Difference between revisions of "Oracle 10g VE"

From OpenVZ Virtuozzo Containers Wiki
Jump to: navigation, search
(fixed formatting big time (halfway done))
Line 1: Line 1:
 
This is just a listing of steps taken to create a fully functional
 
This is just a listing of steps taken to create a fully functional
Oracle VE.<br>
+
Oracle VE.
<br>
+
 
<span style="font-weight: bold;">Create the VE on the
+
== Create the VE on the Hardware Node ==
Hardware Node (HN)</span><br>
+
 
<br>
+
vzctl create 1001 --ostemplate centos-4-i386-default
vzctl create 1001 --ostemplate centos-4-i386-default<br>
+
vzctl set 1001 --userpasswd root:password --save
vzctl set 1001 --userpasswd root:password --save<br>
+
vzctl set 1001 --hostname ve-oracle.example.com --save
vzctl set 1001 --hostname ve-oracle.example.com --save<br>
+
vzctl set 1001 --ipadd 192.168.0.62 --save
vzctl set 1001 --ipadd 192.168.0.62 --save<br>
+
 
<br>
+
== Reset resource limits ==
<span style="font-weight: bold;">Reset resource limits</span><br>
+
 
<br>
+
I decided to have max limits to avoid problems during installation.
I decided to have max limits to avoid porblems during installation.
+
Once the installation is
Once the installation is<br>
 
 
done and the system left running for some time, these limits can be
 
done and the system left running for some time, these limits can be
adjusted.<br>
+
adjusted.
<br>
+
 
vzctl set 1001 --kmemsize 2147483647:2147483647 --save<br>
+
{{Note|setting the UBC limits to "unlimited" value like below can only be done on a trusted single-VE machine, and can create problems. For more info about UBC, see [[Resource shortage]] and [[UBC]].}}
vzctl set 1001 --lockedpages 2147483647:2147483647 --save<br>
+
 
vzctl set 1001 --privvmpages 2147483647:2147483647 --save<br>
+
vzctl set 1001 --kmemsize 2147483647:2147483647 --save
vzctl set 1001 --shmpages 2147483647:2147483647 --save<br>
+
vzctl set 1001 --lockedpages 2147483647:2147483647 --save
vzctl set 1001 --dummy 2147483647:2147483647 --save<br>
+
vzctl set 1001 --privvmpages 2147483647:2147483647 --save
vzctl set 1001 --numproc 2147483647:2147483647 --save<br>
+
vzctl set 1001 --shmpages 2147483647:2147483647 --save
vzctl set 1001 --physpages 2147483647:2147483647 --save<br>
+
vzctl set 1001 --numproc 2147483647:2147483647 --save
vzctl set 1001 --vmguarpages 2147483647:2147483647 --save<br>
+
vzctl set 1001 --numtcpsock 2147483647:2147483647 --save
vzctl set 1001 --oomguarpages 2147483647:2147483647 --save<br>
+
vzctl set 1001 --numflock 2147483647:2147483647 --save
vzctl set 1001 --numtcpsock 2147483647:2147483647 --save<br>
+
vzctl set 1001 --numpty 2147483647:2147483647 --save
vzctl set 1001 --numflock 2147483647:2147483647 --save<br>
+
vzctl set 1001 --numsiginfo 2147483647:2147483647 --save
vzctl set 1001 --numpty 2147483647:2147483647 --save<br>
+
vzctl set 1001 --tcpsndbuf 2147483647:2147483647 --save
vzctl set 1001 --numsiginfo 2147483647:2147483647 --save<br>
+
vzctl set 1001 --tcprcvbuf 2147483647:2147483647 --save
vzctl set 1001 --tcpsndbuf 2147483647:2147483647 --save<br>
+
vzctl set 1001 --othersockbuf 2147483647:2147483647 --save
vzctl set 1001 --tcprcvbuf 2147483647:2147483647 --save<br>
+
vzctl set 1001 --dgramrcvbuf 2147483647:2147483647 --save
vzctl set 1001 --othersockbuf 2147483647:2147483647 --save<br>
+
vzctl set 1001 --numothersock 2147483647:2147483647 --save
vzctl set 1001 --dgramrcvbuf 2147483647:2147483647 --save<br>
+
vzctl set 1001 --dcachesize 2147483647:2147483647 --save
vzctl set 1001 --numothersock 2147483647:2147483647 --save<br>
+
vzctl set 1001 --numfile 2147483647:2147483647 --save
vzctl set 1001 --dcachesize 2147483647:2147483647 --save<br>
+
vzctl set 1001 --numiptent 2147483647:2147483647 --save
vzctl set 1001 --numfile 2147483647:2147483647 --save<br>
+
 
vzctl set 1001 --numiptent 2147483647:2147483647 --save<br>
+
== Start the VE ==
<br>
+
vzctl start 1001
'''Start the VE'''<br>
+
 
<br>
+
== Update /etc/resolv.conf on the VE
vzctl start 1001<br>
+
 
<br>
+
Put the following into your VE's /etc/resolv.conf:
<br>
+
 
'''Update /etc/resolv.conf on the VE'''<br>
+
search example.com
<br>
+
nameserver <ip address of your name server>
search example.com<br>
+
 
nameserver &lt;ip address of your name server&gt;<br>
+
== Install Required Packages ==
<br>
+
 
<br>
+
vzyum 1001 install binutils compat-db gcc gcc-c++ glibc \
'''Install Required Packages'''<br>
+
  glibc-common libstdc++ libstdc++-devel gnome-libs make \
<br>
+
  pdksh sysstat libaio xscreensaver openmotif21 xorg-x11-xfs \
vzyum 1001 install binutils compat-db gcc gcc-c++ glibc glibc-common
+
  usbutils urw-fonts shared-mime-info perl-libwww-perl \
libstdc++ libstdc++-devel gnome-libs make pdksh sysstat libaio
+
  perl-XML-Parser perl-URI perl-HTML-Tagset perl-HTML-Parser \
xscreensaver openmotif21<br>
+
  patch lvm2 intltool libIDL libart_lgpl libbonobo xterm \
vzyum 1001 install xorg-x11-xfs usbutils urw-fonts shared-mime-info
+
  libcap libcroco libgnomecanvas libexif libgnomecups \
perl-libwww-perl perl-XML-Parser perl-URI perl-HTML-Tagset
+
  libgnomeprint22 libsoup libwnck libxklavier
perl-HTML-Parser patch <br>
+
 
vzyum 1001 install lvm2 intltool libIDL libart_lgpl libbonobo xterm
+
== Check the following rpms are installed on the VE ==
libcap libcroco libgnomecanvas libexif libgnomecups libgnomeprint22
+
 
libsoup libwnck libxklavier<br>
+
vzctl exec 1001 rpm -q binutils gcc gcc-c++ glibc gnome-libs \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
  libstdc++ libstdc++-devel make pdksh sysstat xscreensaver libaio
&nbsp;<br>
+
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<br>
+
== Add Oracle User/Group ==
'''Check the following rpms are installed on the VE'''<br>
+
 
<br>
+
vzctl exec 1001 /usr/sbin/groupadd oinstall
vzctl exec 1001 rpm -q binutils gcc gcc-c++ glibc gnome-libs libstdc++
+
vzctl exec 1001 /usr/sbin/groupadd dba
libstdc++-devel make pdksh sysstat xscreensaver libaio<br>
+
vzctl exec 1001 /usr/sbin/useradd -m -g oinstall -G dba oracle
<br>
+
vzctl exec 1001 id oracle
<br>
+
 
'''Add Oracle User/Group'''<br>
+
== Set Password for the Oracle user ==
<br>
+
 
vzctl exec 1001 /usr/sbin/groupadd oinstall<br>
+
vzctl exec 1001 passwd oracle
vzctl exec 1001 /usr/sbin/groupadd dba<br>
+
 
vzctl exec 1001 /usr/sbin/useradd -m -g oinstall -G dba oracle<br>
+
== Create Directories for Oracle Home/Data and the download directory ==
vzctl exec 1001 id oracle<br>
+
 
<br>
+
vzctl exec 1001 mkdir /home/oracle/10gR2_db
'''Set Password for the Oracle user'''<br>
+
vzctl exec 1001 mkdir -p /u01/app/oracle/product/10.2.0/db_1
<br>
+
vzctl exec 1001 mkdir /u01/app/oracle/oradata
vzctl exec 1001 passwd oracle<br>
+
vzctl exec 1001 chown -R oracle:oinstall /u01/app/oracle /home/oracle/10gR2_db
<br>
+
vzctl exec 1001 chmod -R 775 /u01/app/oracle /home/oracle/10gR2_db
'''Create Directories for Oracle Home/Data and the download directory'''<br>
+
vzctl exec 1001 ln -s /usr/lib/libstdc++.so.6.0.3 /usr/lib/libstdc++.so.5
<br>
+
 
vzctl exec 1001 mkdir /home/oracle/10gR2_db<br>
+
== Put these values in /etc/sysctl.conf on the HN ==
vzctl exec 1001 mkdir -p /u01/app/oracle/product/10.2.0/db_1<br>
+
 
vzctl exec 1001 mkdir /u01/app/oracle/oradata<br>
+
Put these values in /etc/sysctl.conf on the HN:
vzctl exec 1001 chown -R oracle:oinstall /u01/app/oracle
+
 
/home/oracle/10gR2_db<br>
+
kernel.shmall = 2097152
vzctl exec 1001 chmod -R 775 /u01/app/oracle /home/oracle/10gR2_db<br>
+
kernel.shmmax = 536870912
vzctl exec 1001 ln -s /usr/lib/libstdc++.so.6.0.3
+
kernel.shmmni = 4096
/usr/lib/libstdc++.so.5<br>
+
kernel.sem = 250 32000 100 128
<br>
+
fs.file-max = 65536
'''Put these values in /etc/sysctl.conf on the HN'''<br>
+
net.ipv4.ip_local_port_range = 1024 65000
<br>
+
net.core.rmem_default=262144
kernel.shmall = 2097152<br>
+
net.core.wmem_default=262144
kernel.shmmax = 536870912<br>
+
net.core.rmem_max=262144
kernel.shmmni = 4096<br>
+
net.core.wmem_max=262144
kernel.sem = 250 32000 100 128<br>
+
 
fs.file-max = 65536<br>
+
Then execute on the HN the following command:
net.ipv4.ip_local_port_range = 1024 65000<br>
+
net.core.rmem_default=262144<br>
+
/sbin/sysctl -p
net.core.wmem_default=262144<br>
+
 
net.core.rmem_max=262144<br>
+
 
net.core.wmem_max=262144<br>
+
 
<br>
+
At this point the VE is ready for Oracle installation.
'''Execute on the HN'''<br>
 
<br>
 
/sbin/sysctl -p<br>
 
<br>
 
<br>
 
<br>
 
At this point the VE is ready for Oracle installation.<br>
 
 
We take a backup of the VE at this point in case we need to rebuild the
 
We take a backup of the VE at this point in case we need to rebuild the
system or do a clean Oracle install<br>
+
system or do a clean Oracle install.
<br>
+
 
'''Shutdown the VE and take a backup'''<br>
+
== Shutdown the VE and take a backup ==
<br>
+
 
vzctl stop 1001<br>
+
vzctl stop 1001
cd /u01/backups<br>
+
cd /u01/backups
tar czpvf ve-1001-preOracle.tar.gz /vz/private/1001/
+
tar czpvf ve-1001-preOracle.tar.gz /vz/private/1001/ /etc/vz/conf/1001.conf
/etc/vz/conf/1001.conf<br>
+
 
<br>
+
== Start VE again ==
'''Start VE again'''<br>
+
 
<br>
+
vzctl start 1001
vzctl start 1001<br>
+
 
<br>
+
== Put oracle distro into VE ==
'''Copy the downloaded Oracle zip file to the VE and change its
+
 
ownership to oracle on the VE'''<br>
+
Copy the downloaded Oracle zip file to the VE and change its
<br>
+
ownership to "oracle" on the VE.
cp /u01/software/10201_database_linux32.zip
+
 
/vz/private/1001/home/oracle/10gR2_db/<br>
+
cp /u01/software/10201_database_linux32.zip /vz/private/1001/home/oracle/10gR2_db/
vzctl exec 1001 chown oracle:oinstall
+
vzctl exec 1001 chown oracle:oinstall /home/oracle/10gR2_db/10201_database_linux32.zip
/home/oracle/10gR2_db/10201_database_linux32.zip<br>
+
 
<br>
+
== Start installation ==
'''Now login as oracle on the ve-1001'''<br>
+
 
<br>
+
Now login as oracle on the ve-1001, and run the following commands:
cd /home/oracle/10gR2_db<br>
+
 
unzip 10201_database_linux32.zip<br>
+
cd /home/oracle/10gR2_db
cd database/<br>
+
unzip 10201_database_linux32.zip
export ORACLE_BASE=/u01/app/oracle<br>
+
cd database/
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1<br>
+
export ORACLE_BASE=/u01/app/oracle
export DISPLAY=192.168.0.149:0<br>
+
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
<br>
+
export DISPLAY=192.168.0.149:0
Make sure u can run xterm<br>
+
 
<br>
+
Make sure you can run xterm, then:
./runInstaller<br>
+
 
<br>
+
./runInstaller
 +
 
 
'''When prompted to run scripts as root. Login as root and execute'''<br>
 
'''When prompted to run scripts as root. Login as root and execute'''<br>
 
<br>
 
<br>
Line 199: Line 192:
 
tar czpvf ve-1001-postOracleDatabase.tar.gz /vz/private/1001/
 
tar czpvf ve-1001-postOracleDatabase.tar.gz /vz/private/1001/
 
/etc/vz/conf/1001.conf<br>
 
/etc/vz/conf/1001.conf<br>
<br>
+
 
--[[User:Smaliz|Smaliz]] 19:09, 10 January 2007 (EST)
 
 
[[Category:HOWTO]]
 
[[Category:HOWTO]]

Revision as of 15:20, 14 January 2007

This is just a listing of steps taken to create a fully functional Oracle VE.

Create the VE on the Hardware Node

vzctl create 1001 --ostemplate centos-4-i386-default
vzctl set 1001 --userpasswd root:password --save
vzctl set 1001 --hostname ve-oracle.example.com --save
vzctl set 1001 --ipadd 192.168.0.62 --save

Reset resource limits

I decided to have max limits to avoid problems during installation. Once the installation is done and the system left running for some time, these limits can be adjusted.

Yellowpin.svg Note: setting the UBC limits to "unlimited" value like below can only be done on a trusted single-VE machine, and can create problems. For more info about UBC, see Resource shortage and UBC.
vzctl set 1001 --kmemsize 2147483647:2147483647 --save
vzctl set 1001 --lockedpages 2147483647:2147483647 --save
vzctl set 1001 --privvmpages 2147483647:2147483647 --save
vzctl set 1001 --shmpages 2147483647:2147483647 --save
vzctl set 1001 --numproc 2147483647:2147483647 --save
vzctl set 1001 --numtcpsock 2147483647:2147483647 --save
vzctl set 1001 --numflock 2147483647:2147483647 --save
vzctl set 1001 --numpty 2147483647:2147483647 --save
vzctl set 1001 --numsiginfo 2147483647:2147483647 --save
vzctl set 1001 --tcpsndbuf 2147483647:2147483647 --save
vzctl set 1001 --tcprcvbuf 2147483647:2147483647 --save
vzctl set 1001 --othersockbuf 2147483647:2147483647 --save
vzctl set 1001 --dgramrcvbuf 2147483647:2147483647 --save
vzctl set 1001 --numothersock 2147483647:2147483647 --save
vzctl set 1001 --dcachesize 2147483647:2147483647 --save
vzctl set 1001 --numfile 2147483647:2147483647 --save
vzctl set 1001 --numiptent 2147483647:2147483647 --save

Start the VE

vzctl start 1001

== Update /etc/resolv.conf on the VE

Put the following into your VE's /etc/resolv.conf:

search example.com
nameserver <ip address of your name server>

Install Required Packages

vzyum 1001 install binutils compat-db gcc gcc-c++ glibc \
 glibc-common libstdc++ libstdc++-devel gnome-libs make \
 pdksh sysstat libaio xscreensaver openmotif21 xorg-x11-xfs \
 usbutils urw-fonts shared-mime-info perl-libwww-perl \
 perl-XML-Parser perl-URI perl-HTML-Tagset perl-HTML-Parser \
 patch lvm2 intltool libIDL libart_lgpl libbonobo xterm \
 libcap libcroco libgnomecanvas libexif libgnomecups \
 libgnomeprint22 libsoup libwnck libxklavier

Check the following rpms are installed on the VE

vzctl exec 1001 rpm -q binutils gcc gcc-c++ glibc gnome-libs \
 libstdc++ libstdc++-devel make pdksh sysstat xscreensaver libaio

Add Oracle User/Group

vzctl exec 1001 /usr/sbin/groupadd oinstall
vzctl exec 1001 /usr/sbin/groupadd dba
vzctl exec 1001 /usr/sbin/useradd -m -g oinstall -G dba oracle
vzctl exec 1001 id oracle

Set Password for the Oracle user

vzctl exec 1001 passwd oracle

Create Directories for Oracle Home/Data and the download directory

vzctl exec 1001 mkdir /home/oracle/10gR2_db
vzctl exec 1001 mkdir -p /u01/app/oracle/product/10.2.0/db_1
vzctl exec 1001 mkdir /u01/app/oracle/oradata
vzctl exec 1001 chown -R oracle:oinstall /u01/app/oracle /home/oracle/10gR2_db
vzctl exec 1001 chmod -R 775 /u01/app/oracle /home/oracle/10gR2_db
vzctl exec 1001 ln -s /usr/lib/libstdc++.so.6.0.3 /usr/lib/libstdc++.so.5

Put these values in /etc/sysctl.conf on the HN

Put these values in /etc/sysctl.conf on the HN:

kernel.shmall = 2097152
kernel.shmmax = 536870912
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

Then execute on the HN the following command:

/sbin/sysctl -p


At this point the VE is ready for Oracle installation. We take a backup of the VE at this point in case we need to rebuild the system or do a clean Oracle install.

Shutdown the VE and take a backup

vzctl stop 1001
cd /u01/backups
tar czpvf ve-1001-preOracle.tar.gz /vz/private/1001/ /etc/vz/conf/1001.conf

Start VE again

vzctl start 1001

Put oracle distro into VE

Copy the downloaded Oracle zip file to the VE and change its ownership to "oracle" on the VE.

cp /u01/software/10201_database_linux32.zip /vz/private/1001/home/oracle/10gR2_db/
vzctl exec 1001 chown oracle:oinstall /home/oracle/10gR2_db/10201_database_linux32.zip

Start installation

Now login as oracle on the ve-1001, and run the following commands:

cd /home/oracle/10gR2_db
unzip 10201_database_linux32.zip
cd database/
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
export DISPLAY=192.168.0.149:0

Make sure you can run xterm, then:

./runInstaller

When prompted to run scripts as root. Login as root and execute

export DISPLAY=192.168.0.149:0
/u01/app/oracle/oraInventory/orainstRoot.sh
/u01/app/oracle/product/10.2.0/db_1/root.sh

Update oracle's profile with the following

cd
vi /home/oracle/.bashrc
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_SID=orcl


Delete installation files (optional)

cd /home/oracle/10gR2_db
rm -rf database

Time to take another backup of the VE on the HN node.

This backup will allow you to restore the VE to the point where no database has yet been created.

vzctl stop 1001
cd /u01/backups
tar czpvf ve-1001-postOracleSoftware.tar.gz /vz/private/1001/ /etc/vz/conf/1001.conf


Start VE
vzctl start 1001

Login as oracle and create the database

export DISPLAY=192.168.0.149:0
dbca


Create listener

netca

Now take another backup on the HN node

vzctl stop 1001
cd /u01/backups
tar czpvf ve-1001-postOracleDatabase.tar.gz /vz/private/1001/ /etc/vz/conf/1001.conf