I guess you have already installed linux operating system using vmware.If not have a look at my earlier post which shows the complete Redhat linux operating system installation.
Before installing Oracle, you got to check the prerequisites. And here are the details of the requirements that need to be done prior to the installation of the Oracle software.
Pre-Requisites :
(1) Check the OS bit:
You may be having a very common question in your mind about which version of oracle you need to install. 32 bit or 64 bit ?? It all depends upon your version of os.
A 64-bit operating system can support either a 32-bit database or a 64-bit database. A 32-bit operating system cannot support a 64-bit database. When it comes to large databases the hybrid x86-64 architecture platform is strongly recommended over the 32-bit x86 platform. 64-bit platforms can access more than 4GB of memory without workarounds. With 32-bit platforms there are several issues that require workaround solutions for databases that use lots of memory .So, version identification of the OS is necessary prior to install oracle. If you are not sure whether you are on a 32-bit or 64-bit hardware then the following procedure will hopefully help you.
Check whether OS is 64 bit or 32 bit :
Method 1 :
On linux :
Command :
[root@localhost ~]$ uname -a
Output :
Linux localhost.localdomain 2.6.9-42.0.0.0.1.ELsmp #1 SMP Sun Oct 15 15:13 :57 PDT 2006 x86_64 x86_64 x86_64 GNU/Linux
Explanation :
Output clearly indicates that its x66_64….that means it 64 – bit.
Usually it will be i686 or similar for 32-bit
Method 2 :
On linux , you can also see by getconf LONG_BIT command.
On 64 bit,
[root@localhost ~]$ getconf LONG_BIT
64
On 32 bit,
[root@localhost ~]$ getconf LONG_BIT
32
Here is the screen shot :
2)Verify System Hardware Requirements:
The system must meet the following minimum hardware requirements:
(a) At least 1 GB of physical RAM
(b) The following table describes the relationship between installed RAM and the configured swap space requirement
RAM | Swap Space |
Up to 512 MB | 2 times the size of RAM |
Between 1024 MB and 2048 MB | 1.5 times the size of RAM |
Between 2049 MB and 8192 MB | Equal to the size of RAM |
More than 8192 MB | 0.75 times the size of RAM |
(c) 400 MB of disk space in the /tmp
directory
(d) Between 1.5 GB and 3.5 GB of disk space for the Oracle software, depending on
the installation type
(e) 1.2 GB of disk space for a preconfigured database that uses file system storage(optional)
Now, lets verify the above mentioned hardware requirement with the help of following commands :
To check the size of physical memory, execute:
[root@localhost]$ grep MemTotal /proc/meminfo
To check the size of swap space, execute:
[root@localhost]$ grep SwapTotal /proc/meminfo
If you notice that you doesn’t have enough swap space then you can always increase your swap space.Here is the process :
[root@localhost]$ free -m
total used free shared buffers cached
Mem: 251 242 8 22 11 32
-/+ buffers/cache: 198 52
Swap: 133 133 0
[root@localhost]$ dd if=/dev/zero of=swapfile bs=1024 count=132207
132207+0 records in
132207+0 records out
Note : You can increase the count value depending on the free swap space available in your system.
[root@localhost]$ ls -l
total 132364
drwxr-xr-x 20 usr-3 users 4096 May 22 10:46 usr-3
drwxr-xr-x 2 root root 16384 Feb 21 07:04 lost+found
-rw-r–r– 1 root root 135379968 May 29 11:52 swapfile
Now, assign permission for the swap file :
[root@localhost]$ chmod 600 swapfile
[root@localhost]$ ls -l
total 132364
drwxr-xr-x 20 usr-3 users 4096 May 22 10:46 usr-3
drwxr-xr-x 2 root root 16384 Feb 21 07:04 lost+found
-rw——- 1 root root 135379968 May 29 11:52 swapfile
Next we got to setup the swap area and enable it :
[root@localhost]$ mkswap swapfile
Setting up swapspace version 1, size = 135372800 bytes
[root@localhost]$ swapon swapfile
Now lets check the swap space,
[root@localhost]$ free
total used free shared buffers cached
Mem: 257632 254632 3000 2512 36172 15096
-/+ buffers/cache: 203364 54268
Swap: 268708 136512 132196
If you could notice, the swap space have been increased.
Apart from this, You also can add temporary swap space to your system by creating a temporary swap file instead of using a raw device. Here is the procedure:
[root@localhost]$ su – root
[root@localhost]$ dd if=/dev/zero of=tmpswap bs=1k count=900000
[root@localhost]$ chmod 600 tmpswap
[root@localhost]$ mkswap tmpswap
[root@localhost]$ swapon tmpswap
To disable the temporary swap space execute the following commands:
[root@localhost]$ su – root
[root@localhost]$ swapoff tmpswap
[root@localhost]$ rm tmpswap
Checking /tmp Space :
According to Oracle’s documentation, the Oracle Universal Installer (OUI) requires up to 400 MB of free space in the /tmp directory. But OUI checks if /tmp is only greater than 80 MB.
To check the space in /tmp, run:
$ df /tmp
If you do not have enough space in the /tmp filesystem, you can temporarily create a tmp directory in another filesystem. Here is how you can do this:
Login as root :
$ su – root
General Syntax :
mkdir /<AnotherFilesystem>/tmp
chown root.root /<AnotherFilesystem>/tmp
chmod 1777 /<AnotherFilesystem>/tmp
export TEMP=/<AnotherFilesystem> # used by Oracle
export TMPDIR=/<AnotherFilesystem> # used by Linux programs like the linker “ld”
When you are done with the Oracle installation, shutdown Oracle and remove the temporary /tmp directory:
su – root
rmdir /<AnotherFilesystem>/tmp
unset TEMP
unset TMPDIR
Example :
lets consider the file system as /u01
[root@localhost]$ mkdir /u01/tmp
[root@localhost]$ chown root:root /u01/tmp
[root@localhost]$ chmod 1777 /u01/tmp
[root@localhost]$ export TEMP=/u01
[root@localhost]$ export TMPDIR=/u01
When you are done with the Oracle installation, shutdown Oracle and remove the temporary /tmp directory:
[root@localhost]$ rmdir /u01/tmp
[root@localhost]$ unset TEMP
[root@localhost]$ unset TMPDIR
To determine the amount of free disk space on the system, enter the following command:
[root@localhost]$ df -k
The following table shows the approximate disk space requirements for software files for each installation type:
Installation Type | Requirement for Software Files (GB) |
Enterprise Edition | 1.9 |
Standard Edition | 1.9 |
Custom (maximum) | 2.0 |
Most of the times we install Enterprise Edition which is going to take about 1.9GB.
(3)Configure the Linux Kernel Parameters
Edit the /etc/sysctl.conf and add following lines:
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
Note: You need to reboot the system or execute “sysctl -p” command to apply above settings immediately.
(4)Install the Packages :
Some additional packages are required for succesful instalation of Oracle software.
To check whether required packages are installed on your operating system use following command:
For 32 bit (x86) Linux version:
rpm -q binutils gcc glibc glibc-headers glibc-kernheaders glibc-devel compat-libstdc++ cpp compat-gcc make compat-db
compat-gcc-c++ compat-libstdc++ compat-libstdc++-devel setarch sysstat
pdksh libaio libaio-devel –qf ‘%{name}.%{arch}\n’|sort
Required packages for 32bit (x86) architecture:
binutils.i386
compat-gcc-7.3-2.96.128.i386
compat-gcc-c++-7.3-2.96.128.i386
compat-libstdc++-7.3-2.96.128.i386
compat-libstdc++-devel-7.3-2.96.128.i386
cpp.i386
gcc.i386
gcc-c++.i386
glibc.i386
glibc-common.i386
glibc-devel.i386
glibc-headers.i386
glibc-kernheaders.i386
libstdc++.i386
libstdc++-devel.i386
libaio
libai-devel.i386
pdksh.i386
setarch.i386
sysstat.i386
For 64 bit (x86_64) Linux version:
rpm -q binutils compat-db compat-libstdc++-33 glibc glibc-devel glibc-headers gcc gcc-c++ libstdc++ cpp make libaio ksh
elfutils-libelf sysstat libaio libaio-devel setarch –qf ‘%{name}.%{arch}\n’|sort
Required packages for 64bit (x86_64) architecture:
binutils.x86_64
compat-db.x86_64
compat-libstdc++-33.i386
compat-libstdc++-33.x86_64
cpp.x86_64
elfutils-libelf.i386
elfutils-libelf.x86_64
gcc-c++.x86_64
gcc.x86_64
glibc-devel.i386
glibc-devel.x86_64
glibc-headers.x86_64
glibc.i686
glibc.x86_64
ksh.x86_64
libaio-devel.i386
libaio-devel.x86_64
libaio.i386
libaio.i386
libaio.x86_64
libaio.x86_64
libstdc++.i386
libstdc++.x86_64
make.x86_64
setarch.x86_64
sysstat.x86_64
So from the above list ,make a note about the packages that are needed to be installed. Next Install the required packages using the rpm command :
Procedure to install packages in Linux :
Before installing the packages,First download all the packages from the CD and then follow the below procedure.
1) # cd /var
2) Var # cd ftp
3) ftp # cd pub
4) pub # cd Redhat
5) redhat # RPMS
6) RPMS # rpm –ivh <package-name> .rpm
7) Example : rpm –ivh gcc-3.4.4-2.i386.rpm
5)Create the Oracle Groups and User Account
Log in as a root user and then create two groups
- oinstall
- dba
Create oracle user who owns the oracle software making initial group oinstall and secondary group dba.
[root@localhost]$ /usr/sbin/groupadd oinstall
[root@localhost]$ /usr/sbin/groupadd dba
[root@localhost]$ /usr/sbin/useradd -m -g oinstall -G dba oracle
[root@localhost]$ id oracle
uid=501(oracle) gid=502(oinstall) groups=502(oinstall),503(dba)
Set the password on the oracle user,
[root@localhost]$ passwd oracle
Changing password for user oracle,
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
6)Create Directory for Oracle software
Create directory as root and then change permission 755 and make owner to oracle user.
mkdir /u01/oracle
chown -R oracle:oinstall /u01/oracle
chmod -R 775 /u01/oracle
NOTE : Note on the «oinstall» Group
The oinstall group is often needed for those organizations who have separate groups that maintain the software and the database. It prevents unauthorized access to the database by personnel who maintain the software, and it prevents the database administrators from making changes to the software and the installations inventory directory.
When using oinstall during the install of the software, one must set their default group to the one that will be maintaining the database before creating the database or permission problems will arise.
Oinstall is not needed when the same people will be maintaining the software and the database. In this situation, it will create more work and add an extra layer of complexity to the maintenance of the installation.
Recommendation: if you don’t need the oinstall group for added security, just install using the dba group.
As earlier i was not aware of this fact , i have considered Oinstall as my primary group.But now that we are clear about the groups,its upto yoou to decide about the group.
7)Set Shell Limits for the oracle User
To improve the performance of the software on Linux systems, you must increase the following shell limits for the oracle user:
- how much memory oracle user permit to use,
- how many files it can open,
- how many processes it can run.
This is done by
Login as Oracle,
Edit the /etc/security/limits.conf file and add following lines:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
Edit the /etc/pam.d/login file & Add the following lines to
session required /lib/security/pam_limits.so
session required pam_limits.so
Make the following Settings Permanent
For the Bourne, Bash, or Korn shell, add the following lines to the $HOME/.bash_profile
if [ $USER = “oracle” ]; then
if [ $SHELL = “/bin/ksh” ]; then
ulimit -p 16384
ulimit -n 63536
else
ulimit -u 16384 -n 63536
fi
fi
Now that all prerequisites have been completed,lets start the installation of oracle 10g (release 2) 64-bit on Redhat linux -4 :
Login as Oracle User and perform the steps shown :
STEP 1 : Unzip -> 10201_database_linux_x86_64.zip to any particular folder
STEP 2 :
[oracle@localhost database]$ ./runInstaller
Screen Shot :
STEP 3 :
Here you need to select the type of installation . I have opted for Advanced Installation.
If you want to create new database after software installation,
check “Create Starter Database” checkbox and enter database name and password, then click Next
STEP 4 :
Specify Inventory directory (keep it as default) and click Next
STEP 5 :
Select the installation type.Usually Enterprise Edition is used.
STEP 6 :
Specify name for the installation and full path where you want to install the product
STEP 7 :
Here we see that all Prerequisite Checks are succeeded.
STEP 7 :
Select the create database option
STEP 8 :
I have opted for General Purpose database.
STEP 9 :
Specify the database name of your choice.
I have mentioned the database name as db21
STEP 10 :
STEP 11 :
Select the storage option as File System.we will learn about the ASM storage in the upcoming posts.
STEP 12 :
Select the backup option.
STEP 13 :
You can specify passwords of your choice.
STEP 14 :
Click Install to begin installation
Note :Make a note of all these URL’s so that we can access the applications (like EM ) later on.
STEP 15 :
RUN the 2 scripts :
1) orainstRoot.sh
2) root.sh
as shown in the below screen shots.
STEP 16 :
Set the Environmental variable to start the instance
[oracle@localhost ~]$ . oraenv
ORACLE_SID=[db21] ? db21
[oracle@localhost ~]$ export ORACLE_SID=db21
To start the instance, connect as sysdba
[oracle@localhost ~]$ sqlplus /nolog
SQL> conn sys as sysdba
Enter password:
Now that we are connected to instance, start the database “db21” using the following command.
SQl>startup
STEP 17 :
Connecting to Database with Enterprise Manager
Now, let’s start Oracle Enterprise Manager. In order to use EM, we should firstly start listener. In production environment, you need automate database, listener and EM startup.
Start the listener
[oracle@localhost ~]$ lsnrctl start
Listener started successfully.
STEP 18 :
Now, we can start the Enterprise Manager Database Console in 2 ways:
(a)Using the URL
http://localhost.localdomain:1158/em/
(b) Using Command
[oracle@localhost ~]$ emctl start dbconsole
We can use any of the above choice to start EM Database Console
Enter username sys and its password, then select “SYSDBA” as a role and click Login
Just checkout the license agreement and at the bottom of the page as shown in the next screen shot,you got to accept the terms and proceed further.
And here is your Enterprise Manager 10g Database Console…. With this we can administor our database very easily.
Congratulations!!! Now we are done with installation …..