You are on page 1of 7

Install Oracle 11 on Linux

TUESDAY, 13. NOVEMBER 2007, 08:52:34 LINUX

Ci t Oracle 11gR1 trn h iu hnh Enterprise Linux 5 (Step-by-step)

Create Groups and User Account


Ci Oracle cn nh sau: 1. To 2 Groups: c tn l oinstall v dba 2. To 1 User account tn l: oracle (note: ng ra t l T To g cng c, nhng conventional, thy thin h ci Oracle hay t l vy.) Login as root, run: ? # groupadd oinstall # groupadd dba # useradd -m -g oinstall -G dba oracle To password cho user: oracle # passwd oracle Changing password for user oracle. New UNIX password: Retype new UNIX password: passwd: all authentication tokens updated successfully. note: UNIX password i phi c s, ch, du c bit! Mt UNIX pasword th d nh l: P@ssw0rd Kim tra li, run: # id oracle

Create directories, group, user oracle


1. To 1 th mc /u01/app 2. Trao quyn owner cho user oracle 3. Trao quyn read, write mi th trong /u01/app cho tt c! Run commands: # mkdir -p /u01/app # chown -R oracle:oinstall /u01/app # chmod -R 775 /u01/app (note: Ti sap phi c tn my ci ng dn ln nhn nh th? ng ra th cng chng bt but. Nhng m Oracle recomment th y. C c Document v oracle name convention) Set Enviroment for user oracle M file /home/oracle/.bash_profile thm vo: #environment for oracle ORACLE_BASE=/u01/app/oracle

ORACLE_HOME=$ORACLE_BASE/product/11.1.0/db_1 ORACLE_SID=EDU11 PATH=$PATH:$ORACLE_HOME/bin LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH LD_LIBRARY_PATH CLASSPATH (note: Khi ci oracle l log vo bng user oracle.)

Kim tra, upgrade RPMs:


Bc ny hi rt ri t. Oracle1 i hi cc RPM phi c ti thiu cc Version sau: make-3.81 binutils-2.17.50.0.6 gcc-4.1.1 libaio-0.3.106 libaio-devel-0.3.106 libstdc++-4.1.1 elfutils-libelf-devel-0.125 sysstat-7.0.0 compat-libstdc++-33-3.2.3 libgcc-4.1.1 libstdc++-devel-4.1.1 unixODBC-2.2.11 unixODBC-devel-2.2.11 Run command sau xem mnh ang c RPM Version no? # rpm -q make binutils gcc libaio libaio-devel libstdc++ elfutils-libelf-devel sysstat compat-libstdc++ libgcc libstdc++-devel unixODBC-2.2.11 unixODBC-devel (..g trong 1 line) Kt qu: make-3.81-1.1 binutils-2.17.50.0.6-2.el5 gcc-4.1.1-52.el5 libaio-0.3.106-3.2 package libaio-devel is not installed libstdc++-4.1.1-52.el5 elfutils-libelf-devel-0.125-3.el5 sysstat-7.0.0-3.el5 package compat-libstdc++ is not installed libgcc-4.1.1-52.el5 libstdc++-devel-4.1.1-52.el5 package unixODBC is not installed package unixODBC-devel is not installed So snh cc RPMs. Nu thiu ci no th phi ci mi vo. Version c th phi upgrade ln!

Cc RPM c th tm thy trong CD ci Linux, hay search trn google Ti copy cc RPMs vo ci th mc shares ca VMWare, chy cc command sau: # rpm -ivh libaio-devel-0.3.106-3.2.i386.rpm # rpm -ivh unixODBC-2.2.11-7.1.i386.rpm # rpm -ivh unixODBC-devel-2.2.11-7.1.i386.rpm # rpm -ivh compat-libstdc++-33-3.2.3-61.i386.rpm note: to install/ci mi: rpm -ivh package-file-name.rpm to update/nng cp: rpm -Uvh package-file-name xem info package c trong my: rpm -qi package-name xem info package file: rpm -qpi package-file-name

Config Linux Kernel Parameters


Dng vi hay gedit(ci ny ging notepad!) thm cc lines sau vo file /etc/sysctl.conf #This lines is for Oracle Installation kernel.shmall = 2097152 kernel.shmmax = 536870912 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 fs.file-max = 6553600 net.ipv4.ip_local_port_range = 1024 65000 net.core.rmem_default = 4194304 net.core.wmem_default = 262144 net.core.rmem_max = 4194304 net.core.wmem_max = 262144 Check li, run: # sysctl -p

Setting Shell Limits for user oracle


todo: 1. Thm vo file /etc/security/limits.conf cc dng sau: (trn ci line # End of file) oracle soft nofile 63566 oracle hard nofile 63536 oracle soft nproc 16384 oracle hard nproc 16384 (note: soft limit = hard limit setting) 2. Verify file /etc/pam.d/system-auth, check xem c 2 lines sau: session required /lib/security/pam_limits.so session required pam_limits.so

3. Disable SELinux edit /etc/selinux/config file, change line SELINUX=disabled

Ci Oracle11
Login vo Linux vi user oracle. Kim tra(echo) li xem coi cc Environment Vars c set, export ko? Run: # cd /mnt/oracle11g/ # ./runInstaller Step 1: Select Installation Method: -Chn Basic Installation -Global Database Name: EDU11 -Database Password -Nhng ci cn li default mc nh -Click Next note: Enterprise cn 3.3GB + DB 1.48GB = 4.8GB Chn Basic Install cho d. Ai rnh th chn Advanced. Ti chn Basic Install. Khe!

Step 2: Specify Inventory directory and crendentials -Click next

Step 3: Product-Specific Prereqisite Checks -Step ny, ai chun b ko tt s b bo li, warning! -Ai b th copy text trong ci textbox ra xem, cancel install, tm ch no c ch "failed"! fix li, ri runInstaller li. -Ti b 1 li l RAM ch c 512MB, nn click Next c!

Step 4: Warning: Product-Specific Prereqisite Checks -Click yes

Step 5: Oracle Configuration Manager Registration -Ngho nh ti th lm g c Customer Identification Number CSI, click next!

Step 6: Summary -click install

Step 7: Install run Oracle beginn the install..wait...

Step 8: Database Configuration Assistant -click ok

Step 9: Execute Configuration scripts Step ny phi chy 2 ci scrips bng user root. -Chut phi m new Terminal -G: $ su - root # /u01/app/oraInventory/orainstRoot.sh # /u01/app/oracle/product/11.1.0/db_1/root.sh Khi b hi: Enter the full pathname of the local direcory, th nhn Enter... # exit <- quay v oracle #exit <- close terminal -tip tc vi Oracle Install dialog box: click OK Step 10: End of Installation click exit and Yes! xong, finish!

T ng Start v Shutdown
Login vo h thng bng user root: 1. chnh sa file /etc/oratab, thay i k t cui cng thnh Y (mc nh l N). EDU11:/u01/app/oracle/product/11.1.0/db_1:Y 2. chnh sa file $ORACLE_HOME/bin/dbstart v thay i gi tr cho ORACLE_HOME_LISTNER (dng 82): ORACLE_HOME_LISTNER=$ORACLE_HOME 3. chnh sa file $ORACLE_HOME/bin/dbshut v thay i gi tr cho ORACLE_HOME_LISTNER (dng 53): ORACLE_HOME_LISTNER=$ORACLE_HOME 4. To file c tn l oracle trong th mc /etc/init.d/ vi ni dung nh sau: #!/bin/bash # # oracle Init file for starting and stopping # Oracle Database. Script is valid for 10g and 11g versions. # # chkconfig: 35 80 30 # description: Oracle Database startup script

# Source function library. . /etc/rc.d/init.d/functions ORACLE_OWNER="oracle" ORACLE_HOME="/u01/app/oracle/product/11.1.0/db_1" case "$1" in start) echo -n $"Starting Oracle DB:" su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart" echo "OK" ;; stop) echo -n $"Stopping Oracle DB:" su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbshut" echo "OK" ;; *) echo $"Usage: $0 {start|stop}" esac Sau : chmod 750 /etc/init.d/oracle chkconfig --add oracle --level 0356 5. To file c tn l oraemctl trong th mc /etc/init.d/ vi ni dung nh sau: #!/bin/bash # # oraemctl Starting and stopping Oracle Enterprise Manager Database Control. # Script is valid for 10g and 11g versions. # # chkconfig: 35 80 30 # description: Enterprise Manager DB Control startup script # Source function library. . /etc/rc.d/init.d/functions ORACLE_OWNER="oracle" ORACLE_HOME="/u01/app/oracle/product/11.1.0/db_1" case "$1" in start) echo -n $"Starting Oracle EM DB Console:" su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl start dbconsole" echo "OK" ;;

stop) echo -n $"Stopping Oracle EM DB Console:" su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl stop dbconsole" echo "OK" ;; *) echo $"Usage: $0 {start|stop}" esac Sau : chmod 750 /etc/init.d/oraemctl chkconfig --add oraemctl --level 0356