Professional Documents
Culture Documents
Install Oracle 11G Release 2 RAC (11.2) On Oracle Linux: Public Private Vip Rac1 Rac2
Install Oracle 11G Release 2 RAC (11.2) On Oracle Linux: Public Private Vip Rac1 Rac2
2) on
Oracle Linux
Article presents quick installation of Oracle Enterprise RAC 11.2.0.3 on Oracle Enterprise Linux 5 using Oracle
Virtual Box.
Architecture
Software used:
rac1.dbaora.com
rac2.dbaora.com
Public private vip
rac1 192.168.0.50 192.168.1.60 192.168.0.70
NOTE – to get connection to internet from virtual box be sure you are not using the same subnet as your wifi card
make sense
Shared storage visible on each node:
NOTE: eth2 is NAT interface so nothing has to be change. This card is used to communicate with Internet.
Shared storage
1. To add shared storage virtual machine rac1.dbaora.com must be down. Once it’s down go to “Settings” select
“Storage” then click on icon with plus on disk.
2. Click on “Create new disk” button.
5. Enter storage name “Shared” and set size to 20G then click “Create” button.
6. Once created you should see new disk attached to our virtual machine. Click “OK” button.
8. From
main menu you need to select File->Virtual Media Manager to change “Shared” disk attribute. Select “Shared.vdi”
and click “Modify” button.
9. Select “Sharable” and click “OK” button. It will prepare this storage to be shareable between RAC instances.
Please start virtual machine to create partitions on shared storage.
Host configuration
--list devices
ls /dev/sd*
fdisk /dev/sdb
There is nothing wrong with that, but this is larger than 1024,
Command action
e extended
Command action
e extended
Syncing disks.
fdisk -l /dev/sdb
Disk /dev/sdb: 21.4 GB, 21474836480 bytes
Add groups
--required groups
kernel.shmmni = 4096
kernel.shmmax = 4398046511104
kernel.shmall = 1073741824
fs.aio-max-nr = 1048576
fs.file-max = 6815744
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
/sbin/sysctl -p
Add following line for user oracle to set shell limits in file /etc/security/limits.conf
The “/etc/hosts” file must contain a fully qualified name for the server.
#public
192.168.0.50 rac1.dbaora.com rac1
#private
#virtual
#scan
compat-libstdc++-33 \
elfutils-libelf \
elfutils-libelf-devel \
gcc \
gcc-c++ \
glibc \
glibc-common \
glibc-devel \
glibc-headers \
ksh \
libaio \
libaio-devel \
libgcc \
libstdc++ \
libstdc++-devel \
make \
sysstat \
unixODBC \
unixODBC-devel
SELINUX=disabled
Disable Firewall
Firewall can be disabled in graphical mode or manually.
Run firewall graphical manager “System”->”Administration”->”Security Level and Firewall” and click “Disable”
button and “Apply” button. As you can notice you can change SELinux on second tab as well.
Option 2 – manual mode
mv /etc/ntp.conf /etc/ntp.conf.orig
rm /var/run/ntpd.pid
If you want to keep NTP, add the “-x” option in the “/etc/sysconfig/ntpd” file.
Directories
Create ORACLE_BASE
mkdir -p /ora01/app/oracle
mkdir -p /ora01/app/oracle/product/11.2.0/db_1
mkdir -p /ora01/app/grid/product/11.2.0/grid
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
PATH=$PATH:$HOME/bin
export PATH
. /home/oracle/.bash_profile_database
envo
create new profile for user oracle /home/oracle/.bash_profile_grid. This profile will be used for grid software.
# Oracle Settings
export TMP=/tmp
export ORACLE_HOSTNAME=rac1.dbaora.com
export ORACLE_UNQNAME=+ASM
export ORACLE_BASE=/ora01/app/oracle
export ORACLE_HOME=/ora01/app/grid/product/11.2.0/grid
export ORACLE_SID=+ASM1
PATH=/usr/sbin:$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;
create new profile for user oracle /home/oracle/.bash_profile_database. This profile will be used for database
software.
# Oracle Settings
export TMP=/tmp
export ORACLE_HOSTNAME=rac1.dbaora.com
export ORACLE_UNQNAME=ORA11G
export ORACLE_BASE=/ora01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=ORA11G1
PATH=/usr/sbin:$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;
umask 022
So next time you do su to oracle user you should have environment prepared for database software
ORACLE_UNQNAME=ORA11G
ORACLE_SID=ORA11G1
ORACLE_BASE=/ora01/app/oracle
ORACLE_HOSTNAME=rac1.dbaora.com
ORACLE_HOME=/ora01/app/oracle/product/11.2.0/db_1
ORACLE_SID=+ASM1
ORACLE_BASE=/ora01/app/oracle
ORACLE_HOSTNAME=rac1.dbaora.com
ORACLE_HOME=/ora01/app/grid/product/11.2.0/grid
ORACLE_UNQNAME=ORA11G
ORACLE_SID=ORA11G1
ORACLE_BASE=/ora01/app/oracle
ORACLE_HOSTNAME=rac1.dbaora.com
ORACLE_HOME=/ora01/app/oracle/product/11.2.0/db_1
ORACLE_UNQNAME=ORA11G
ORACLE_SID=ORA11G1
ORACLE_BASE=/ora01/app/oracle
ORACLE_HOSTNAME=rac1.dbaora.com
ORACLE_HOME=/ora01/app/oracle/product/11.2.0/db_1
As oracle user unzip database and grid software. It should create 2 directories:
p10404530_112030_Linux-x86-64_1of7.zip
p10404530_112030_Linux-x86-64_2of7.zip
--grid software
p10404530_112030_Linux-x86-64_3of7.zip
[oracle@rac1]ls
database grid
Configure ASMlib
This will configure the on-boot properties of the Oracle ASM library
loaded on boot and what permissions it will have. The current values
DISK1
DISK2
Cloning machine
New machine rac2.dbaora.com is cloned from machine rac1.dbaora.com using “linked clone” method. It allows to
speed up process of cloning. it’s especially useful for development environments.
Full clone: In this mode all depending disk images are copied to the new VM folder. The clone can fully
operate without the source VM.
Linked clone: In this mode new differencing disk images are created where the parent disk images are the
source disk images. If you selected the current state of the source VM as clone point, a new snapshot will be
created implicitly.
1. Before we create “linked clone” we need to remove shared storage. On Storage tab select Shared.vdi then click
“Remove Attachment”.
2. Now you should see oel5_112_rac1 without Shared storage.
3. In menu of VirtualBox select “Machine”-“Clone” option. Enter name for new machine oel5_112_rac2 and click
“Next” button.
8. Once it’s done shared disk should be visible by machine oel5_112_rac1. Click “OK” button to save your
configuration.
9. You need to repeat the same steps 6,7 to attach shared disk to machine oel5_112_rac2. Don’t be surprised that
both machines are using the same disk “oel5_112_arc1.vdi”. New machine oel5_112_rac2 is linked clone.
Network settings for second machine
Start second linked and use “Network Manager” System->Administration->Networkto apply new static ip address
for eth0 and eth1 and activate both cards. Please remember to save configuration from network manager by selection
from menu File->Save.
rac2.dbaora.com
Verify network between nodes
It’s good time to run verify network on each node: rac1.dbaora.com and rac2.dbaora.com
hostname
ping rac1 -c 1
ping rac2 -c 1
ping rac1-priv -c 1
ping rac2-priv -c 1
test on rac1.dbaora.com
[root@rac1 ~]# hostname
rac1.dbaora.com
test on rac2.dbaora.com
rac2.dbaora.com
xhost +
su - oracle
ORACLE_UNQNAME=+ASM
ORACLE_SID=+ASM1
ORACLE_BASE=/ora01/app/oracle
ORACLE_HOSTNAME=rac1.dbaora.com
ORACLE_HOME=/ora01/app/grid/product/11.2.0/grid
--run installation
./runInstall
12. You should see available devices. Select first one and click “next” button
13. Accept default directory for “Inventory Directory” and click “Next” button
14. Checks are executed to show any errors that need to be fixed before installation can proceed. Ignore “Device
Checks for ASM” by check “Ignore All” checkbox and click “Next” button
15. Confirm you ignore checks click “Yes” button
16. It’s the last moment to go back and make modifications. Click “Install” to proceed with installation
17. It will take some time to install software so be patient
18. When prompted run configuration scripts on each node. Once it’s done click “OK” button
19. Installation should continue …
20. You should receive information about errors related to SCAN setup, assuming you are not using DNS. Just
ignore it.
As user oracle start ASMCA. Remeber to start xhost + as user root to enable run graphical tools from other users like
oracle.
ASMCA – ASM configuration assistant is part of grid software so proper environment must be set
su - oracle
ORACLE_UNQNAME=+ASM
ORACLE_SID=+ASM1
ORACLE_BASE=/ora01/app/oracle
ORACLE_HOSTNAME=rac1.dbaora.com
ORACLE_HOME=/ora01/app/grid/product/11.2.0/grid
4. Now you should see we have 2 ASM groups “BACKUP” and “DATA”. Click “Exit” button.
Now you can verify in sqlplus you have 2 ASM groups.
Connected to:
NAME
------------------------------
DATA
BACKUP
su - oracle
ORACLE_UNQNAME=ORA11G
ORACLE_SID=ORA11G1
ORACLE_BASE=/ora01/app/oracle
ORACLE_HOSTNAME=rac1.dbaora.com
ORACLE_HOME=/ora01/app/oracle/product/11.2.0/db_1
--run installation
./runInstall
1. Uncheck checkbox “I wish to receive security updates via My Oracle Support” and click “Next” button.
2. Ignore this message and click “Yes”.
memory settings
database character sets
turn on extra new security features
install extra schemas
Click “Next” button to continue.
14. Just click “Next” button.
15. Select “Oracle Automatic Storage Management” and enter password for user ASMSNMP. The user is used by
OEM similar to DBSNMP. Click “Next” button.
16. Accept default settings “Do not enable automated backups” or specify details for your automated backup then
click “Next” button.
17. Select “DATA” diskgroup to install our new database and click “Next” button.
18. Specify passwords for users: SYS, SYSTEM, SYSMAN, DBSNMP. You can specify the same password for all
of them like in example below. Click “Next” button to continue.
19. Accept default OS groups and click “Next” button.
20. Prerequisites checks are executed to verify cluster settings.
21. Ignore error related to SCAN by check checkbox “Ignore All” and click “Next” button.
22. Click “Yes” button.
23. It’s the last moment to make changes before starting installation. Click “Install” button to continue.
24. Just wait installation in progress …
25. When software installation is completed DBCA is started to create database.
26. Summary window for our new database. Just click “OK” button. it’s worth to change passwords for our
important users like SYS, SYSTEM etc “Password Management”.
27. As last step run root.sh script on both nodes. when it’s completed click “OK” button.
28. Installation of database software and new database ORA11G is completed. Click “Close” button.
ORACLE_UNQNAME=+ASM
ORACLE_SID=+ASM1
ORACLE_BASE=/ora01/app/oracle
ORACLE_HOSTNAME=rac1.dbaora.com
ORACLE_HOME=/ora01/app/grid/product/11.2.0/grid
Spfile: +DATA/ORA11G/spfileORA11G.ora
Domain: dbaora.com
Services:
Type: RAC
Tomasz