Oracle, Oracle Database April 27, 2012 0

Installing Oracle Database 11g R2 on Linux

In article Installing Oracle Linux in VMware virtual machine we covered installation of Oracle Linux 5U8 including oracle-validated package.

Now, our system is ready for Oracle database installation, and no additional configuration tasks is required at this moment.

Note: Most of the time we work with OS from remote locations and target servers are located in data centers or somewhere else.

In this tutorial we assume that our server is located in a remote location and we use remote access tools in order to connect to the Linux terminal, transfer installation packages, and run Oracle Universal Installer on our local (client) machine.

Here is the action plan:

1. Downloading Oracle database 11g installation packages from Oracle websites

2. Installing local X-Server Xming to be able to display GUI applets from a remote server on our local desktop, like we were sitting in front of the server.

3. Connecting to Linux server using WinSCP and transferring installation packages.

4. Connecting to Linux server via SSH protocol using PuTTY  and reset password for oracle user (WinSCP and PuTTY how-to can be found here: Enter the Linux ).

5. Configure PyTTY session with port forwarding enabled to be able to display GUI windows via Xming server

6. Unpacking and running Oracle Universal Installer to install Oracle database software

7. Creating new Oracle database instance with Enterprise Manager Database Control

8. Testing our installation connecting to running database instance using the following tools:

  • SqlPlus (general command line tool)
  • Oracle SQLDeveloper – GUI Oracle database client
  • Enterprise Manager Database Control 11g – web based powerful administration and monitoring tool

Let’s get started…

1. Download Oracle Database software installation package from Oracle Technology Network

Let’s download Linux 64bit version Oracle Database 11g Release 2 (11.2.0.1.0) for Linux x86-64 

  • linux.x64_11gR2_database_1of2.zip
  • linux.x64_11gR2_database_2of2.zip

 

2. Installing and running Xming X Server on Windows host

Xming will start minimized in system tray next to the system clock.

3. Connecting to Linux server via WinSCP and transferring installation packages:

Our Linux server has the following access details:

IP Address: 192.168.1.2

Hostname: test-host

Domain: local.com

 

4. Download and run PuTTY

  • This is how we connect to Linux server using putty:

As we remember, oracle user account has been created automatically thanks to oracle-validated package, however with randomly generated password.

Normally we would grand to our local user privileges to switch to oracle account without the password (sudo, su and visudo commands – check here) but for this tutorial we will reset oracle user account password.

  • let’s switch to root account and change oracle account password to be able to use it for database installation.
[neo@test-host ~]$ su - root
Password:
[root@test-host ~]# passwd oracle
Changing password for user oracle.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@test-host ~]# exit
logout
[neo@test-host ~]$

 

5. Configure PyTTY session with port forwarding enabled to be able to display GUI windows via Xming server and test it with xclock command

xclock command starts graphical application xclock on the Linux server and displays it on local windows host thanks to xming server running.

6. Unpacking and running Oracle Universal Installer to install Oracle database software

Once all zip files have been copied to Linux server we are ready to unzip them from /tmp directory to /home/oracle/stage directory – now we can do it as oracle user

connect as oracle user using PuTTY and issue the following commands

[oracle@test-host ~]$ for i in /tmp/linux.x64_11gR2_database_*.zip; do unzip $i -d /home/oracle/stage; done

[oracle@test-host ~]$ ls /home/oracle/stage  
database

Our installation package has been unzipped into /home/oracle/stage/database directory

Before we start with installation we must create directories for Oracle Software

[oracle@test-host database]$ su - root
Password:
[root@test-host ~]# mkdir -p /u01/app/oracle
[root@test-host ~]# chown -R oracle:oinstall /u01
[root@test-host ~]# exit
logout
[oracle@test-host database]$

 

Now let’s run Oracle Universal Installer and install oracle software:

[oracle@test-host ~]$ cd /home/oracle/stage/database/
[oracle@test-host database]$ ./runInstaller

Starting Oracle Universal Installer...
Checking Temp space: must be greater than 120 MB.   Actual 16917 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 3999 MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 1
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2022-04-27_07

 

7. Creating new Oracle database instance with Enterprise Manager Database Control

Before we start with database creation we configure oracle listener executing netca (net service creation assistance) utility:

[oracle@test-host ~]$ cd /u01/app/oracle/product/11.2.0/db_1/bin/
[oracle@test-host bin]$ ./netca  

Oracle Net Services Configuration:

Once we have Oracle software installed and listener configured we can launch DBCA (database creation assistance) to install Oracle Database Instance – TESTDB1

Launching DBCA:

[oracle@test-host ~]$ cd /u01/app/oracle/product/11.2.0/db_1/bin/

[oracle@test-host bin]$ ./dbca

This is it!

Our brand new database is now up and running!

Database connection details:

Database IP: 192.168.1.2

Database name (SID): TESTDB1

Database listener port: 1521

 

8. Testing our installation connecting to running database instance using the following tools:

  • SqlPlus (general command line tool)
  • Oracle SQLDeveloper – GUI Oracle database client
  • Enterprise Manager Database Control 11g – web based powerful administration and monitoring tool

Connecting to a database using sqlplus utility on local database host (on Linux server as oracle user)

connect to Linux server using putty and run the following commands:

[oracle@test-host bin]$ . oraenv
ORACLE_SID = [oracle] ? TESTDB1
The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1 is /u01/app/oracle
[oracle@test-host bin]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Fri Apr 27 20:56:41 2012
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select * from global_name;
GLOBAL_NAME
--------------------------------------------------------------------------------
TESTDB1.LOCAL.COM
SQL> select name from v$database;
NAME
---------
TESTDB1
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@test-host bin]$

 

NOTE: You must install Java JDK for Windows 32/64bit depends on your Windows host architecture

Oracle Enterprise Manager Database Control 11g 

To access OEM Database control update windows hosts file c:\Windows\System32\drivers\etc\hosts with the following entries:

192.168.1.2    test-host.local.com    test-host

Type the following URL in your web browser: https://test-host.local.com:1158/em

That’s all folks!!

Next, we will show the following article Installing Oracle Database 11g R2 on Linux with ASM (Automatic Storage Management) which is more advanced type of installation.

Cheers!!