Setup Oracle DBMS for Lab Practice
It is very important for students to practice SQL to learn RDBMS concepts. It is not enough to read the theories given in books and listen to lectures. Learn by doing helps understand the topic quickly. To practice DBMS labs on you personal computer, one must install a DBMS software such as SQL, MySQL, DB 2 and Oracle. Oracle is very popular and standard software with all the relational DBMS features. It is very good for practicing DBMS labs. Other systems are equally good and there are may Standard products, so one must choose according to their own choice. All of them can run fundamental SQL commands.
To setup Oracle for lab practice you need to following :
1. Download the latest Oracle software :
You can get the latest Oracle software from their web site. The size of the software is large if you download the full version. Since we are only downloading for practice download the Oracle Express edition which is a compact version of the Oracle.
There are three types of download available, they are as follows
Windows version for 64 bit systems.
Window version for 32 bit systems.
Oracle Database Express Edition 11g Release 2
Oracle Database Software Downloads
For purpose of this article, I have downloaded Oracle 10g Express edition which is no longer from their website and in rest of the article we will configure it so that you run SQL queries on it.
2. Install the Oracle software on you personal computer.
Once downloaded run to install the software on you personal computer. You may have a different version of setup , but when you click on it then you should see the installation wizard.
After the installation you may see that startup menu have new icons.
Startup menu have new Oracle programs
Click the start database, to start the database and work on it. It you want to stop the database just click on the stop database. By default the database get started automatically.
Now Click 'Go To Database Home Page', this will open a web interface for Oracle database. You need to Log In to the database using user name and password.
Password: < this is password that you entered during Installation >
SQL option on the Home page is to run DDL and DML commands and Administration page is maintain database and users. There are many privileged users by default. Here is list of default users for the Database. Also you can create new users for the database with different access levels.
3. Configure the SQL Command Line
The command line utility is very useful for running SQL commands and Queries. You need to configure the SQL command line interface, there is not need to configure Environment path to run SQL command line in Windows.
The SQL command line is row command mode and that's why we will use a utility called SQLPlus to run the SQL queries using command line interface.
For more information you can visit : Configuring SQL *Plus
The SQL *Plus is already part of your installation, but there is also a downloadable package for SQL *plus which you can download according to your need.
Instant Client Downloads for Microsoft Windows (x64)
The information to use the Client is available in Sqlplus_user guide.
4. Configuring SQL plus IDE
The command line interface of SQL *plus is not interactive. To make it interactive we have to download another utility called the sqlplusw.exe. It is available in most of the Oracle database softwares. The sqlplusw is located in \oracle\product\10.2.0\server\BIN folder.
Right click on the Sqlplus software and make a shortcut to desktop. You can then change the ICON and screen options for SQL Plus.
5. Test Logon using sqlplusw
Now that we are ready to run SQL Plus. Click on the shortcut created earlier and run it. You should be able to see the logon window.
Enter the credentials for system and password specified during the installation. I have not specified any Host String for the database. So I have not entered any during logon process.
The system account have DBA rights. If you are not able to logon make sure that you have TNSNAMES.ORA file in following location.
oracle\product\10.2.0\server\NETWORK\ADMIN
After you have logon to the SQLPLUS , you should see the screen shown below.
Once you have completed the installation then go ahead and run DDL command and create a table to test it.
for example, run following command to Create a table.
CREATE TABLE ( ROLLNO NUMBER(3), NAME VARCHAR2(15), MARKS (IN %) NUMBER(2), GRADE VARCHAR2(1));
You may experience problem with the installation sometimes or sometimes there may be issues with logon. Make sure that use an account that have full access to the database. The 'system' account has full privilege to the database.