August 20, 2009

Oracle on Ubuntu

Installation Steps

1. Add the desired repository.

varsha@varsha-laptop:~$ gksudo gedit /etc/apt/sources.list

Enter the user password when prompted. Go to the last line and enter

deb http://oss.oracle.com/debian unstable main non-free


Save and close the file.

2. Open the terminal and type:

varsha@varsha-laptop:~$ wget http://oss.oracle.com/el4/RPM-GPG-KEY-oracle -O- | sudo apt-key add -


3. Then update using,

varsha@varsha-laptop:~$ sudo apt-get update

4. After updating, install the package.

varsha@varsha-laptop:~$ sudo apt-get install oracle-xe

This may take along time.

5. Next step is to configure the Oracle database.

varsha@varsha-laptop:~$ sudo /etc/init.d/oracle-xe configure

6. When prompted, enter the port for the database application. The default port is 8080. I opted for 3128 (as per the proxy settings of my college).

7. Enter the port for the database listener, which by default is set to 1521. I chose not to change this.

8. The username for logging in is 'system' or 'sys'. Enter a password for this.

9. Enter y or n depending on whether you want the database to run at system startup.

Installation completed!

Starting the Database

There are two ways of doing this.

1.Type in the terminal,

varsha@varsha-laptop:~$ sudo /etc/init.d/oracle-xe start

2. Click Start Database from Applications-> Other.

Stopping the Database

There are two ways for this.

1. Type in the terminal

varsha@varsha-laptop:~$ sudo /etc/init.d/oracle-xe stop

2. Click Stop Database from Applications-> Other.

Logging In

There are two ways for doing this as well.

1. For working in the SQL Plus environment, select Run SQL Command Line from Applications-> Other. Type:

connect username/password

2. Open your browser, and type in the address bar:

http://127.0.0.1:3128/apex

Note: Use the port that you specified during configuration, or use the default port if you had opted not to change it.

Then log in using your username 'system' and the password that you created while configuring the database.

Running SQL commands

Select SQL-> SQL Commands-> Enter Command.

Other Features Of Oracle

For using other features, browse about to find out.



Note:

1. Make sure you add your username to the 'dba' user-group.
Go to System-> Administration-> Users and Groups. Click Unlock, and provide your user password. Click Manage Groups. Select 'dba'. Click Properties, and check your name under Group Members. Click OK.

2. In my case, I have to switch to user 'oracle', to start the database, and then log in back as a normal user in order to use the database. In case you are not able to connect to server when logged in as a normal user, try doing this. It might help. A second option will be to make 'dba' your main group. Go to System-> Administration-> Users and Groups. Unlock by providing the user password. Select your username, click Properties and under the tab Advanced, select 'dba' from the menu against Main group. Save your changes.




2 comments:

  1. Disappointed to see you using proprietary software. :(

    ReplyDelete
  2. @viggy: I had to do it for certification. I had done a course in the sem break in a Red Hat certified training partner. We had used oracle there. :(

    ReplyDelete