Sunday, September 12, 2010

Installing Oracle 10g Release2

Installing Oracle 10g Release2

1.1     Prerequisites

Refer to the following table and ensure that the mentioned components have their minimum or recommended value on the Server. If the values are not at their minimum version, the Oracle Database 10g Release installation might fail. Please refer to the URL http://www.oracle.com/technology/pub/articles/smiley_10gdb_install.html#groups & http://www.oracle.com/pls/db102/homepage for installation guides and release notes.
The Meta link Note No. has also been mentioned in the ‘Remarks’ column in the following table as additional supporting documents.
Component Minimum/Recommended Version Installed on Server Remarks
RAM 1024 MB 4096 MB grep MemTotal /proc/meminfo
Swap Info Twice the amount of RAM 8192 MB grep SwapTotal /proc/meminfo
Space in /tmp location 400 MB 5120 MB df –k
Operating System RHEL4 (Advanced Server and Enterprise Server) RHEL 4 Update 2
Kernel Version 2.6.9-22.ELsmp 2.6.9-42.0.3.EL uname –r
O/S Package binutils-2.15.92.0.2-15.0.0.0.2 binutils-2.15.92.0.2.21 (x86_64) Metalink Note 339510.1
O/S Package compat-db-4.1.25-9.i386.rpm compat-db-4.1.25-9.x86_64.rpm compat-db-4.1.25.9 (i386), compat-db-4.1.25.9 (x86_64) Metalink Note 169706.1
O/S Package control-center-2.8.0-12.x86_64.rpm Control-center-2.8.0.12 (x86_64) Metalink Note 169706.1
O/S Package gcc-3.4.3-22.1.x86_64.rpm gcc-3.4.6.3 (x86_64) Metalink Note 169706.1
O/S Package gcc-c++-3.4.3-22.1.x86_64.rpm gcc-c++-3.4.6.3 (x86_64) Metalink Note 169706.1
O/S Package Glibc-2.3.4-2.9.i686.rpm glibc-2.3.4-2.9.x86_64.rpm glibc-2.3.4.2 (x86_64) glibc-2.3.4.2 (i686) Metalink Note 169706.1
O/S Package Glibc-common-2.3.4-2.9.x86_64.rpm glibc-common-2.3.4.2 (x86_64) Metalink Note 169706.1
O/S Package Gnome-libs-1.4.1.2.90-44.1.x86_64 gnome-libs-1.4.1.2.90.44.1 (x86_64) Metalink Note 169706.1
O/S Package libstdc++-3.4.3-22.1.x86_64 Libstdc++-3.4.6.3 (x86_64), libstdc++-3.4.6.3 (i386) Metalink Note 169706.1
O/S Package libstdc++-devel-3.4.3-22.1.x86_64 Libstdc++-devel-3.4.6.3 (x86_64), libstdc++-devel-3.4.6.3 (i386) Metalink Note 169706.1
O/S Package make-3.80-5.x86_64.rpm make-3.80.5 (x86_64) Metalink Note 169706.1
O/S Package Pdksh-5.2.14-30.x86_64.rpm pdksh-5.2.14.30 (x86_64) Metalink Note 169706.1
O/S Package sysstat-5.0.5-1.x86_64.rpm Sysstat-5.0.5.1 (x86_64) Metalink Note 169706.1
O/S Package Xscreensaver-4.18-5.rhel4.2.x86_64.rpm xscreensaver-4.18.5.rhel4.2 (x86_64) Metalink Note 169706.1
O/S Package libaio-0.3.103-3.i386.rpm libaio-0.3.103-3.x86_64.rpm libaio-0.3.105.2 (x86_64) libaio-devel-0.3.105.2 (x86_64)
libaio-0.3.105.2 (i386)
Metalink Note 169706.1
O/S Package compat-libstdc++-33-3.2.3-47.3.x86_64.rpm compat-libstdc++-33-3.2.3-47.3.i386.rpm compat-libstdc++-33-3.2.3.47.3 (x86_64) compat-libgcc-296-2.96.132.7.2 (i386)
compat-libstdc++-296-2.96.132.7.2 (i386)
compat-libstdc++-33-3.2.3.47.3 (i386)
Metalink Note 169706.1
O/S Package glibc-kernheaders-2.4-9.1.87.x86_64.rpm glibc-kernheaders-2.4.9.1.87 (x86_64) Metalink Note 169706.1
O/S Package glibc-headers-2.3.4-2.9.x86_64.rpm glibc-headers-2.3.4.2 (x86_64) Metalink Note 169706.1
O/S Package Libgcc-3.4.3-22.1.i386.rpm libgcc-3.4.6.3 (i386) Metalink Note 169706.1
O/S Package glibc-devel-2.3.4-2.9.x86_64.rpm, glibc-devel-2.3.4-2.9.i386.rpm glibc-devel-2.3.4.2 (i386) glibc-devel-2.3.4.2 (x86_64) Metalink Note 169706.1
O/S Package xorg-x11-deprecated-libs-6.8.2-1.EL.13.6.i386.rpm xorg-x11-deprecated-libs-6.8.2.1.EL.13.37.2 (i386) Metalink Note 169706.1
Linux Groups oinstall
dba
oinstall
dba
/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
Oracle Software Owner oracle oracle /usr/sbin/useradd -m -g oinstall -G dba oracle
ORACLE_BASE Directory /app/oracle /app/oracle Create Manually. Following OFA guidelines
ORACLE_HOME Directory /app/oracle/product/10.2.0/db_1 /app/oracle/product/10.2.0/db_1 Create Manually. Following OFA guidelines
Oracle Inventory location /app/oracle/oraInventory /app/oracle/oraInventory Following OFA guidelines
Oracle Database File Locatioin /u01/oradata /u01/oradata Create Manually. Following OFA guidelines
Linux Kernel Parameter
kernel.shmall = 2097152
kernel.shmmax =  2069207040
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.wmem_default=262144
net.core.rmem_max=262144
net.core.wmem_max=262144
Change using the following command (through root user) cat >> /etc/sysctl.conf <<EOF
kernel.shmall = 2097152
kernel.shmmax =  2069207040
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.wmem_default=262144
net.core.rmem_max=262144
net.core.wmem_max=262144
EOF
/sbin/sysctl –p
Verify using /sbin/sysctl -a | grep <value>
e.g.
/sbin/sysctl -a | grep shm
Shell Limits
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
Change using the following command (through root user)

cat >> /etc/security/limits.conf <<EOF
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
EOF

cat >> /etc/pam.d/login <<EOF
session required /lib/security/pam_limits.so
EOF

cat >> /etc/profile <<EOF
if [ \$USER = "oracle" ]; then
 if [ \$SHELL = "/bin/ksh" ]; then
 ulimit -p 16384
 ulimit -n 65536
 ulimit -s 32768
 else
 ulimit -u 16384 -n 65536 -s 32768
 fi
 umask 022
fi
EOF

cat >> /etc/csh.login <<EOF
if ( \$USER == "oracle" ) then
 limit maxproc 16384
 limit descriptors 65536
 umask 022
endif
EOF
To check the existing value logon as user oracle and issue the command ‘ulimit –a’
The following command be used to check the version of the O/S package installed
rpm -qa –queryformat “%{NAME}-%{VERSION}.%{RELEASE} (%{ARCH})\n” | grep <package_name>
e.g
rpm -qa –queryformat “%{NAME}-%{VERSION}.%{RELEASE} (%{ARCH})\n” | grep libaio
1) For Checking RPM’s for RED HAT AS 4 (x86):
rpm -q binutils compat-db control-center gcc gcc-c++ glibc glibc-common gnome-libs \
        libstdc++ libstdc++-devel make pdksh sysstat xscreensaver libaio
If any RPM is not installed, please download not installed RPM from mentioned link.
\\10.210.47.40\InfraSoftwareRepository\Database\Oracle\RHEL-32Bit-RPMS
Then Install rpm with mentioned command
Login as root and issue $ rpm –Uvh rpm_location
All RPMS should be installed; otherwise oracle installation may fail somewhere.
2) Creating oracle user and group oinstall and dba for oracle owner.
Login as root
  • $ su – root
  • $ groupadd oinstall
  • $ groupadd dba
  • $ useradd -m -g oinstall -G dba oracle –c “Oracle Software Owner”
3) After creating oracle user, login as oracle user and populate .bash_profile with mentioned parameters. Paste mentioned parameters in oracle user .bash_profile  and execute it once.
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME
#ORACLE_SID=ORADEMO; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:/sbin:/usr/bin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH:$AGENT_HOME/bin; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
#LD_ASSUME_KERNEL=2.4.1; export LD_ASSUME_KERNEL
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
  • $su – oracle
  • Paste in .bash_profile
  • $. .bash_profile
  • $echo $ORACLE_HOME # just for confirmation

1.2     Installing Oracle 10g Release 2 Software

Before proceeding further, ensure that the Oracle 10g Release 2 software is staged on the server for installation.
1. From any terminal emulation software logon to the server with the id which will own the Oracle software. E.g. “oracle”. Navigate to the directory where the Oracle Database 10g Release 2 software is staged and run command “ ./runInstaller”
2. Select ‘Advanced Installation’ and click ‘Next’.
3. Specify the location for Oracle’s Inventory Directory and the O/S group name. Click ‘Next’
4. Select ‘Enterprise Edition’ as installation type. Click Next.
5. Enter a name for the installation and the full path where you want to install the software for Oracle 10g Release 2. Click ‘Next’
6. Oracle Installer is going to verify whether the pre-requisites required by Oracle 10g Release 2 is in place or not. If you see ‘Failed’ against any of the following Check, ‘Cancel’ the installation, correct the problem and start again. Otherwise click ‘Next’
7. Select ‘Install database software only’ and click Next.
8. Review the summary information and click ‘Install’
9. Oracle will start installing the Oracle 10g Release 2. This step will take a while.
10. Once Installation is done, Installer will prompt you to run the following scripts as ‘root’ user.
/u01/app/oracle/oraInventory/orainstRoot.sh
/u01/app/oracle/product/10.2.0/db_1/root.sh
Open another terminal Window and logon as ‘root’. Navigate to the directory mentioned directory and run orainstRoot.sh.
Navigate to the second directory and run ‘root.sh’
11. Return to the GUI installer window and click ‘OK’. Note down the URLs and click ‘Exit’. This completes the Oracle 10g Release 2 installation.


1.3     Installing Oracle 10g Release 2 Patch 2

1. Download the patch (Patch No. 4547817) from metalink.oracle.com and stage it on the Server. Unzip the patch in the staging location in the server. From any terminal emulation software logon to the server with the id which owns the Oracle 10g Release 2 software. E.g. “oracle”. Navigate to the directory where the Oracle Database 10g Release 2 Patchset 2 software is staged.
2. Click ‘Next’
3. Ensure that correct location is chosen for installing the Oracle 10g Release 2 Patch-set 2. Click ‘Next’
4. Review the Summary and click ‘Install’
5. Installer will install the Oracle 10g Release 2 Patch-set 2
6. Once the installation is done, Installer will prompt you with the following Window.
7. Open another terminal window and logon as ‘root’. Navigate to directory ‘/u01/app/oracle/product/10.2.0/db_1 and run ‘root.sh’.
8. Return to the GUI Installer Window and click ‘OK.’
9. This completes the installation of Oracle 10g Release 2 Patch set 2. Click ‘Exit’.


1.4     Post-Installation Setup

1. From a terminal window logon to database server as the owner of the Oracle software ‘oracle’. Navigate to directory ‘$HOME’ and open the file ‘.bash_profile’ in vi editor
2. Enter the following lines (enclosed within the red rectangle) in the file ‘.bash_profile’
# Setting Oracle environment
ORACLE_SID=codev
export ORACLE_SID
ORAENV_ASK=NO
export ORAENV_ASK
. /usr/local/bin/oraenv
3. Save the file and exit the ‘vi’ editor. Logout from server and login again.  Ensure that the Oracle environment is set now.


1.5     Creating Database

1. From any terminal emulation software (after logging on as the Oracle software owner), set the value of DISPLAY variable and run Database Creation Assistant.
2. Click ‘Next’
3. Select ‘Create a Database’ and click Next.
4. Select ‘General Purpose’ and click Next.
5. Enter the ‘Global Database Name’ & ‘SID’. These are the database name that you have assigned to your database.
6. Select ‘Configure the database with Enterprise Manager’ & ‘Use Database Control for Database Management’. Click ‘Next’
7. Choose ‘Use the Same password for All Accounts’. Enter the password and click ‘Next’
8. Select ‘File System’ and click ‘Next’
9. Enter the location for Database Files and click ‘Next’. Ensure that the specified location at least has about 1.5 GB of free space to create a blank database. The Database name (DBNAME) will be added automatically to the path specified. So don’t specify the Database Name in the path here.
10. Enter the location for ‘Flash Recovery Area’, the size that you want to use for Flash Recovery area and select ‘Enable Archiving’. Click on ‘Edit Archive Mode Parameters’
11. Enter the ‘Archive Log File Format’ and the ‘Archive Log Destination’. Click ‘OK’.
12. Click Next.
13. In ‘Memory’ tab, enter the percentage of the memory that you want to allocate to Oracle SGA & PGA. Click on ‘Show Memory Distribution’ to see how much memory will be allocated after entering the percentage. Click Next
14. In ‘Sizing’ tab, ensure that the block size is set to ‘8192’. Enter the value under ‘processes’. Click Next
15. In ‘Character Sets’ Tab, select ‘Use Unicode’ as the Database Character set. Click Next
16. In ‘Connection Mode’ tab, ensure that ‘Dedicated Server Mode’ is selected. Click Next
17. Review the Database Storage locations. Click Next
18. Ensure that the ‘Controlfile’ location & ‘Datafiles’ location are set correctly. Click Next
19. Change the Redo File size to 100M and ensure that its location is correctly specified. Repeat this for Redo Log Groups 1, 2 & 3 and then click Next
20. Select ‘Create Database’ & ‘Save as a Database Template’. Specify a name for the database template. Save as a database template will help in running the ‘dbca’ without specifiying the paramneters all over again, in case the Database Creation Assistants fails with any error. Click Next
21. Review all the details entered and click ‘OK’ to initiate database creation.
22. Database Creation Assistant will create the database.
23. Note the Database Control URL and click ‘Exit’. This completes the database creation.

1.6     Testing the installation

Once the database is running, the SQL*Plus tool can be used to connect to the database.
Go to the shell prompt
# sqlplus Scott/tiger@hoststring
Application Development program group and run the SQL Plus application. Once SQL Plus is running, you will be prompted for 3 things: Username, password and Host String.
The default account has a username of SCOTT and a default password of TIGER. Then click ENTER. Below mentioned window will pop up.
By default, you can also log in with the SCOTT/TIGER account. That is, there is a demo account already set up in the database with username SCOTT and password TIGER. Many of the examples in the Oracle documentation use the tables included in the SCOTT user’s account. Now sqlplus prompt is ready to execute oracle commands.

1.7     Starting oracle services

Follow the sequence of steps mentioned below to start database services
$ORACLE_HOME/bin/dbstart
$ORACLE_HOME/bin/lsnrctl  start
$ORACLE_HOME/bin/emctl start agent

1.8     Stopping oracle services

Follow the sequence of steps mentioned below to stop database services
$ORACLE_HOME/bin/dbshut
$ORACLE_HOME/bin/lsnrctl  stop
$ORACLE_HOME/bin/emctl stop agent

Appendix

1.    Port Numbers

Port Number Description
1521 Oracle TCP/IP default port number.

2.    URLs

Enterprise Manager Control Home Page
http://<hostname>:/em/
Enterprise Manager Control Home Page (Secure access)
https://<hostname>:/em/
 

No comments:

Post a Comment