Thursday 3 November 2016

Installing Oracle Database on Linux



In this blog, I would be talking about doing an install of the Oracle database on Linux environment. This is the first step in the configuration of a master repository of Oracle Data Integrator and it is a lot more fun since you work on the command line and frankly, I don’t miss the GUI a lot.
Now, the below snapshot shows the Oracle 11g database rpm on a USB stick. 
I copied the rpm zip file onto my downloads folder and unzip it into OracleDB folder as shown in the below snapshot. 
Now, to run the install I run the rpm command with the -i flag as shown in the below snapshot. 
However, the install fails since the user cannot get a transaction lock on one of the files as shown in the above snapshot. This is because the user odi_user does not have superuser privileges because of which the install fails.
I switch the user to root as shown in the below snapshot. 
I run the install once again under the root credentials as shown in the next snapshot and it starts up normally. 
The next snapshot shows that the install has gone through successfully.
Observe that in the above snapshot, it says that I need to run the oracle-xe configure script to configure the database. This is because in Linux, the install is a two-step process. One is the install and the second step is a configuration. I now navigate to /etc/init.d folder to run the configuration.
This is shown in the next snapshot.

 The next snapshots shows the configuration options for my database. This is similar to Oracle database installs.



The following snapshot shows that the Oracle database configuration has gone through successfully.   
Now, by default, the database gets installed at the path as shown in the below snapshot. 
In order to access the sqlplus and connect to the database, you would need to do some more setup. First of all, the database is setup using a new user which is called as oracle. So you need to switch to this user as shown in the below snapshot.
Next step is you need to setup some environmental parameters. These are the parameters that you need to set up.
  • ORACLE_HOME
  • ORACLE_SID
  • ORACLE_BASE
This is shown in the below snapshot.


Finally, the last variable that you need to setup is the PATH, which is shown in the below snapshot. 
Once this is done, type is sqlplus on the command line and you would be redirected to the sqlplus prompt as shown in the below snapshot.
After entering the user name and password you are connected as shown in the below snapshot. 
I next run a sample query against the database to see that I am connected. This is shown above.
Note that I have connected the first time using the SYSTEM user ID. In the next blog, I will setup a new user who should be able to access the database.

No comments:

Post a Comment