Sanjiv Karn's OCP Training Manual Installing Oracle Database 10g Preparing Linux System For Installing Oracle 10g
Sanjiv Karn's OCP Training Manual Installing Oracle Database 10g Preparing Linux System For Installing Oracle 10g
10g 1. Login as root and change the release version # vi /etc/redhat-release redhat-4 2. Check disk space and memory requirements # df -h ( Minimum /tmp > 400MB, /u01 > 2.5G free space) # free -m ( Minimum RAM > 1024MB, Swap > 2048MB )
3. Check software requirements and if required packages are not installed, install them # rpm -qa make gcc glibc compat* openmotif* setarch libaio libXp sysstat . Insert RedHat Installation DVD into the DVD-ROM # mkdir -p /stage/Disk1 # df -h # cp -r /media/RH<TAB>/* /stage/Disk1 # cd /stage/Disk1/Server # rpm -ivh createrepo<TAB> # createrepo /stage/Disk1/Server # cd /etc/yum.repos.d # vi packages.repo [server] name=server's packages baseurl=file:///stage/Disk1/Server enabled=1 gpgcheck=0 # yum -y install make gcc glibc compat* openmotif* setarch libaio libXp sysstat 4. Create required OS Group & Users # groupadd oinstall # groupadd dba # groupadd oper # useradd -g oinstall -G dba,oper oracle # passwd oracle
Sanjiv Karn's OCP Training Manual 5. Create Required Directories # mkdir -p /u01/app/oracle/ # chown -R oracle:oinstall /u01/app/oracle # chmod -R 775 /u01/app/oracle # ls -ld /u01/app/oracle 6.Create Temopary Directories # mkdir /tmp/temp # chown oracle:oinstall /tmp/temp # chmod -R 770 /tmp/temp # ls -ld /tmp/temp 7. Configure Kernel Parameters # vi /etc/sysctl.conf #shared memory parameters kernel.shmall = 2097152 kernel.shmmax = 2147483648 kernel.shmmni = 4096 #semaphore parameters (semmsl semmns semopm semmni) kernel.sem = 250 32000 100 128 #max no. of file handles fs.file-max = 65536 # Range of IP port net.ipv4.ip_local_port_range = 1024 65000 #others net.core.rmem_default = 262144 net.core.rmem_max = 262144 net.core.wmem_default = 262144 net.core.wmem_max = 262144 # sysctl -p 8. Specify limits on the max number of process and the number of open files # vi /etc/security/limits.conf oracle soft nproc oracle hard nproc oracle soft nofile oracle hard nofile 2047 16384 1024 65536
pam_limits.so
9.Configure the shell limits for the oracle user # vi /etc/profile if [ $USER = "oracle" ]; then if [ $SHELL = "/bin/bash" ]; then ulimit -u 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi fi 10.Configuring the oracle user's Environment # vi /home/oracle/.bash_profile ORACLE_BASE=/u01/app/oracle ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1 JAVA_HOME=/usr/lib/jvm/java PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:$JAVA_HOME/bin LD_LIBRARY_PATH=$ORACLE_HOME/lib ORACLE_SID=orcl TEMP=/tmp/temp TMPDIR=/tmp/temp umask 022 export PATH ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH TEMP TMPDIR unset USERNAME 11. Log out of root and login as oracle user from GUI Installing Oracle 10g 1. Mount the Oracle CD-ROM and start installation $ mkdir oracle-10g-software $ cp -r /media/Oracle<TAB>/database/* oracle-10g-software $ cd /tmp/temp $ /home/oracle/oracle-10g-software/runInstaller 2. Select Installation Method Home Directory Location: /u01/app/oracle/product/10.2.0/db_1 Installation Type: Enterprise Edition Prepared By: Sanjiv R. Karn ( OCP, RHCE Trainer , [email protected], 9741115889)
Sanjiv Karn's OCP Training Manual UNIX DBA Group: oinstall Create Starter Database: Select Global Database Name: orcl Database Password: oracle Confirm Password: oracle 3. Specify Inventory Directory and Credentials Enter the full path of the inventory directory: /u01/app/oracle/oraInventory Specify Operating System Group Name: oinstall 4. Product-Specific Prerequisite Check: Next 5. Summary: Install
6. Password Management: Unlock the HR user and set the HR user's password to HR 7. Execute Configuration Scripts $ su root #/u01/app/oracle/oraInventory/orainstRoot.sh #/u01/app/oracle/product/10.2.0/db_1/root.sh 8.End of Installation: Exit Connecting to The Database ( After the Completion of the Oracle 10g Installation) 1. Connecting the Database using text-based tool (i.e. SQL*Plus) e.g. $ sqlplus username/password $ sqlplus / as sysdba To Connect as SYS $ sqlplus hr/hr_pass 2. Connecting the Database using iSQL*Plus $ firefox Start web-browser http://192.168.0.1:5560/isqlplus 3. Connecting the Database using Enterprise Manager(EM) $ firefox http://192.168.0.1:1158/em Note: If you have forgotten the port number of iSQL*Plus and Enterprise Manager, then to view $ cat $ORACLE_HOME/install/portlist.init Prepared By: Sanjiv R. Karn ( OCP, RHCE Trainer , [email protected], 9741115889)
Sanjiv Karn's OCP Training Manual Connecting to The Database After Restart of the System Start Necessary Services 1. Start Oracle Database $ sqlplus / as sysdba SQL> startup SQL> quit 2. Start Listenerr $ lsnrctl start 1. Start iSQL*Plus service $ isqlplusctl start 4. Start Enterprise Manager Service $ emctl start dbconssole Connect To The Database 1. View the port numbers of iSQLP*Lus and EM $ echo $ORACLE_HOME $ cat $ORACLE_HOME/install/portlist.ini 1. Connect using SQLPlus ( Text-based Tool) $ sqlplus username/password@database_name e.g. $ sqlplus sys/oracle@orcl $ sqlplus hr/hr@orcl 1. Connect using iSQLP*lus $ firefox http://192.168.0.1:5560/isqlplus Username: hr Password: hr Connect Identifier: orcl
1. Connect Using Enterprise Manager $ firefox http://192.168.0.1:1158/em Username: sys Password: oracle Connect As: sysdba