Archive

Posts Tagged ‘oracle database’

oracle database installation

June 30th, 2013 Comments off

yum -y install libaio-devel sysstat pdksh.x86_64 compat-libstdc++* unixODBC unixODBC-devel
./jdk-6u38-linux-x64-rpm.bin
cat /proc/sys/net/ipv4/ip_local_port_range #Tcp/ip ephemeral port range(starting point bigger than 9000)
cd database/rpm/
rpm -e cvuqdisk
groupadd oinstall;groupadd dba;groupadd oper #for oracle grid: groupadd asmdba;groupadd asmadmin;groupadd asmoper
usermod -g oinstall oracle #oinstall, Oracle Inventory group; grid, Oracle Restart owner user;oracle, database software owner;Groups => OSDBA(dba), OSASM(asmadmin), OSOPER(oper); Privileges => SYSDBA, SYSASM, SYSOPER
useradd oracle -g oinstall
usermod -a -G dba,oper oracle
useradd grid -g oinstall
usermod -a -G asmadmin,asmdba,dba,oper grid
[root@test-centos database]# id oracle
uid=501(oracle) gid=503(oinstall) groups=503(oinstall),502(dba),504(oper)

[root@test-centos database]# id grid
uid=502(grid) gid=503(oinstall) groups=503(oinstall),502(dba),505(asmdba),506(asmadmin)

CVUQDISK_GRP=oinstall; export CVUQDISK_GRP
rpm -ivh cvuqdisk-1.0.7-1.rpm #Cluster Verification Utility, shared disk etc

#check resource limits(for each software installation users: oracle, grid)
ulimit -Sn #nofile, file descriptor setting(soft) >1024
ulimit -Sn #nofile, file descriptor setting(hard) >65536
ulimit -Su #nproc, processes available(soft) >2047
ulimit -Hu #nproc, processes available(hard) >16384
ulimit -Ss #stack, stack setting(soft) >10240KB
ulimit -Hs #stack, stack setting(hard) >32768KB

#/etc/security/limits.conf, then logout/login again
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240

grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
grid soft stack 10240

#kernel parameters
http://docs.oracle.com/cd/E11882_01/install.112/e24321/pre_install.htm#autoId50
/sbin/sysctl -a | grep sem #semmsl, semmns, semopm, and semmni, /proc/sys/kernel/sem: the value of the semaphore parameters
/sbin/sysctl -a | grep shm #shmall, shmmax, and shmmni, /proc/sys/kernel/shm{all, max, mni}: shared memory segment sizes
/sbin/sysctl -a | grep file-max #file-max, /proc/sys/fs/file-max: maximum number of file handles
/sbin/sysctl -a | grep ip_local_port_range, /proc/sys/net/ipv4/ip_local_port_range
rmem_{default, max}, wmem_{default, max} #/sbin/sysctl -a | grep rmem_, /proc/sys/net/core/rmem_default
/sbin/sysctl -a | grep aio-max-nr #/proc/sys/fs/aio-max-nr

#/etc/sysctl.conf, sysctl -p
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576

net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
#mkdir -p /u01/app/grid
mkdir -p /u01/app/oracle
mkdir -p /u01/app/oraInventory
chown -R oracle:oinstall /u01/app/oracle
chown -R grid:oinstall /u01/app/grid
chown -R grid:oinstall /u01/app/oraInventory/
#chmod -R 775 /u01/app/grid
chmod -R 775 /u01/app/oracle
chmod -R 777 /u01/app/oraInventory/
export ORACLE_BASE=/u01/app/oracle/

#edit /etc/udev/rules.d/99-oracle.rules if using a new partition for oracle.After this,/sbin/partprobe devicename to loadupdated block device partition tables(restart udev). grid asm need at least two disks to form a new disk group
KERNEL=="sdb1", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sdc1", OWNER="grid", GROUP="asmadmin", MODE="0660"

KERNEL=="sdb2", OWNER="oracle", GROUP="dba", MODE="0660"
KERNEL=="sdc2", OWNER="oracle", GROUP="dba", MODE="0660"

PS: More about writing udev rules here http://www.reactivated.net/writing_udev_rules.html

/sbin/partprobe /dev/sdb
/sbin/partprobe /dev/sdc

#install vncviewer
yum grouplist
yum groupinstall "X Window System" -y
yum groupinstall "GNOME Desktop Environment" -y
yum groupinstall "Graphical Internet" -y
yum groupinstall "Graphics" -y
yum install vnc-server
echo "DESKTOP="GNOME"" > /etc/sysconfig/desktop
sed -i.bak '/VNCSERVERS=/d' /etc/sysconfig/vncservers
echo "VNCSERVERS=\"1:root 2:oracle 3:sysdba\"" >> /etc/sysconfig/vncservers

mkdir -p /root/.vnc
wget --no-proxy http://test/iso/HostConfiguration/vnc/passwd -P /root/.vnc/
wget --no-proxy http://test/iso/HostConfiguration/vnc/xstartup -P /root/.vnc/
chmod 755 ~/.vnc ; chmod 600 ~/.vnc/passwd ; chmod 755 ~/.vnc/xstartup
[root@test-centos .vnc]# cat xstartup
#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
gnome-terminal &
gnome-session &

PS: you can download passwd and xstartup here vnc-config-passwd (wel*1). Or you can set password through use vncpasswd ~/.vnc/passwd

mkdir -p ~oracle/.vnc
wget --no-proxy http://test/iso/HostConfiguration/vnc/passwd -P ~oracle/.vnc/
wget --no-proxy http://test/iso/HostConfiguration/vnc/xstartup -P ~oracle/.vnc/
chown oracle:oinstall -R ~oracle/.vnc ; chmod 755 ~oracle/.vnc ; chmod 600 ~oracle/.vnc/passwd ; chmod 755 ~oracle/.vnc/xstartup
chkconfig --level 345 vncserver on
chkconfig --list | grep vncserver
service vncserver start

PS: You can change vncserver's resolution through editing /usr/bin/vncserver, change the default "$geometry = "1024x768";" to any one you like, for example "$geometry = "1600x900";". You can also control each user's vnc resolution setting through adding line like "VNCSERVERARGS[1]="-geometry 1600x900"" in /etc/sysconfig/vncservers

#oracle env variables http://docs.oracle.com/cd/E11882_01/install.112/e24321/pre_install.htm#autoId68
[root@test-centos ~]# su - oracle

-bash-3.2$ cat .bash_profile
export ORACLE_HOME="/u01/app/oracle/product/11.2.0/dbhome_6"
export ORACLE_SID="orcl6"

##begin installation
##first install oracle grid infrastructure & ASM http://docs.oracle.com/cd/E11882_01/install.112/e24321/oraclerestart.htm#BABCHCBG
##log file under /u01/app/oraInventory/logs/installActions*
chmod -R 777 database*
su - grid
cd /backup/downloads/database-grid/grid
./runInstaller
Specify ASM Password #Use same passwords
Privileged OS Groups #OSDBA -> dba; OSOPER -> oper; OSASM -> asmadmin
oracle base #/u01/app/grid
Software Location #/u01/app/grid/product/11.2.0/grid
Inventory Directory #/u01/app/oraInventory
Save response file #/home/grid/grid.rsp
#Oracle Grid Infrastructure home => /u01/app/grid/product/11.2.0/grid/

/u01/app/grid/product/11.2.0/grid/bin/crsctl check has #verify that the Oracle High Availability Service is installed properly
ps aux|grep -i Ohasd #Ohasd is a daemon installed with Oracle Grid Infrastructure that starts software services, such as Oracle ASM
#test the Oracle ASM installation
#ASM instance sid<system identifier> => cat /etc/oratab(also used to control whether to boot with OS)
export ORACLE_SID=+ASM
export ORACLE_HOME=/u01/app/grid/product/11.2.0/grid
$ORACLE_HOME/bin/asmcmd lsdg
#If the Oracle ASM instance is not running, you can start the instance with the following
#$ORACLE_HOME/bin/asmcmd startup
#or through sqlplus to startup asm instance
$ORACLE_HOME/bin/sqlplus /nolog
SQL> CONNECT SYS as SYSASM
Enter password: SYS_password
SQL> SELECT NAME,TYPE,TOTAL_MB,FREE_MB FROM V$ASM_DISKGROUP;
SQL> STARTUP

##log under /u01/app/oraInventory/logs/installActions*
##/u01/app/oracle/cfgtoollogs/dbca/orcl6/
export ORACLE_SID=+ASM
export ORACLE_HOME=/u01/app/grid/product/11.2.0/grid
$ORACLE_HOME/bin/sqlplus /nolog
SQL> CONNECT SYS as SYSASM
SQL> SELECT NAME,TYPE,TOTAL_MB,FREE_MB FROM V$ASM_DISKGROUP;
#Enhanced security controls such as database auditing options, and password policy and expiration settings
#Database Security Options
#To enable the security configuration, after db installation:
dbca -silent -configureDatabase -sourceDB SID -disableSecurityConfiguration NONE -enableSecurityConfiguration true
#To disable the security configuration, after db installation:
dbca -silent -configureDatabase -sourceDB SID -disableSecurityConfiguration [ALL|PASSWORD_PROFILE] -enableSecurityConfiguration false
su - oracle
cd /backup/downloads/database
./runInstaller
oracle base => /u01/app/oracle
oracle home directory => /u01/app/oracle/product/11.2.0/dbhome_6
global database name => orcl6.andy
Oracle service identifier => orcl6
Character sets => AL32UTF8
Security => choose "Assert all new security settings"
choose "create database with sample schemas"
Do not enable automated backups

Server Parameter File name +DATA/orcl6/spfileorcl6.ora
Enterprise Manager Database Control URL: https://10.172.12.177:1158/em

#recompiles all PL/SQL modules that might be in an invalid state(including packages, procedures, and types)
su - oracle
$ORACLE_HOME/bin/sqlplus / as sysdba
SQL> @?/rdbms/admin/utlrp.sql

#Generating the Client Static Library
su - oracle
$ORACLE_HOME/bin/genclntst

#create a fast recovery area disk group(large enough to hold all of your data files and control files, the online redo logs, and the archived redo log files: Multiple databases can use the same fast recovery area)
vncviewer
GRID_HOME/bin/asmca

#Configuring Oracle Net Services(listener.ora/tnsnames.ora)
su - oracle
/u01/app/grid/product/11.2.0/grid/bin/tnsping orcl6

#install windows oracle 11g client

PS:

1.More about oracle rac installation on linux here http://www.oracleonlinux.cn/?s=%E4%B8%80%E6%AD%A5%E4%B8%80%E6%AD%A5%E5%9C%A8Linux%E4%B8%8A%E5%AE%89%E8%A3%85 (it's 32bits, change for example /lib/security/pam_limits.so to /lib64/security/pam_limits.so)

2.PDF files of above link oracle_on_linux.zip