Difference between revisions of "Oracle 10g VE"

From OpenVZ Virtuozzo Containers Wiki
Jump to: navigation, search
 
Line 1: Line 1:
This is just a listing of steps taken to create a fully functionaly Oracle VE.
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 
+
<html>
'''Create the VE on the Hardware Node (HN)'''
+
<head>
 
+
  <meta content="text/html; charset=ISO-8859-1"
vzctl create 1001 --ostemplate centos-4-i386-default
+
http-equiv="content-type">
vzctl set 1001 --userpasswd root:password --save
+
  <title></title>
vzctl set 1001 --hostname ve-oracle.example.com --save
+
</head>
vzctl set 1001 --ipadd 192.168.0.62 --save
+
<body>
 
+
This is just a listing of steps taken to create a fully functionaly
'''Reset resource limits'''
+
Oracle VE.<br>
 
+
<br>
I decided to have max limits to avoid porblems during installation. Once the installation is
+
<span style="font-weight: bold;">Create the VE on the
done and the system left running for some time, these limits can be adjusted.
+
Hardware Node (HN)</span><br>
 
+
<br>
vzctl set 1001 --kmemsize 2147483647:2147483647 --save
+
vzctl create 1001 --ostemplate centos-4-i386-default<br>
vzctl set 1001 --lockedpages 2147483647:2147483647 --save
+
vzctl set 1001 --userpasswd root:password --save<br>
vzctl set 1001 --privvmpages 2147483647:2147483647 --save
+
vzctl set 1001 --hostname ve-oracle.example.com --save<br>
vzctl set 1001 --shmpages 2147483647:2147483647 --save
+
vzctl set 1001 --ipadd 192.168.0.62 --save<br>
vzctl set 1001 --dummy 2147483647:2147483647 --save
+
<br>
vzctl set 1001 --numproc 2147483647:2147483647 --save
+
<span style="font-weight: bold;">Reset resource limits</span><br>
vzctl set 1001 --physpages 2147483647:2147483647 --save
+
<br>
vzctl set 1001 --vmguarpages 2147483647:2147483647 --save
+
I decided to have max limits to avoid porblems during installation.
vzctl set 1001 --oomguarpages 2147483647:2147483647 --save
+
Once the installation is<br>
vzctl set 1001 --numtcpsock 2147483647:2147483647 --save
+
done and the system left running for some time, these limits can be
vzctl set 1001 --numflock 2147483647:2147483647 --save
+
adjusted.<br>
vzctl set 1001 --numpty 2147483647:2147483647 --save
+
<br>
vzctl set 1001 --numsiginfo 2147483647:2147483647 --save
+
vzctl set 1001 --kmemsize 2147483647:2147483647 --save<br>
vzctl set 1001 --tcpsndbuf 2147483647:2147483647 --save
+
vzctl set 1001 --lockedpages 2147483647:2147483647 --save<br>
vzctl set 1001 --tcprcvbuf 2147483647:2147483647 --save
+
vzctl set 1001 --privvmpages 2147483647:2147483647 --save<br>
vzctl set 1001 --othersockbuf 2147483647:2147483647 --save
+
vzctl set 1001 --shmpages 2147483647:2147483647 --save<br>
vzctl set 1001 --dgramrcvbuf 2147483647:2147483647 --save
+
vzctl set 1001 --dummy 2147483647:2147483647 --save<br>
vzctl set 1001 --numothersock 2147483647:2147483647 --save
+
vzctl set 1001 --numproc 2147483647:2147483647 --save<br>
vzctl set 1001 --dcachesize 2147483647:2147483647 --save
+
vzctl set 1001 --physpages 2147483647:2147483647 --save<br>
vzctl set 1001 --numfile 2147483647:2147483647 --save
+
vzctl set 1001 --vmguarpages 2147483647:2147483647 --save<br>
vzctl set 1001 --numiptent 2147483647:2147483647 --save
+
vzctl set 1001 --oomguarpages 2147483647:2147483647 --save<br>
 
+
vzctl set 1001 --numtcpsock 2147483647:2147483647 --save<br>
'''Start the VE'''
+
vzctl set 1001 --numflock 2147483647:2147483647 --save<br>
 
+
vzctl set 1001 --numpty 2147483647:2147483647 --save<br>
vzctl start 1001
+
vzctl set 1001 --numsiginfo 2147483647:2147483647 --save<br>
 
+
vzctl set 1001 --tcpsndbuf 2147483647:2147483647 --save<br>
 
+
vzctl set 1001 --tcprcvbuf 2147483647:2147483647 --save<br>
'''Update /etc/resolv.conf on the VE'''
+
vzctl set 1001 --othersockbuf 2147483647:2147483647 --save<br>
 
+
vzctl set 1001 --dgramrcvbuf 2147483647:2147483647 --save<br>
search example.com
+
vzctl set 1001 --numothersock 2147483647:2147483647 --save<br>
nameserver <ip address of your name server>
+
vzctl set 1001 --dcachesize 2147483647:2147483647 --save<br>
 
+
vzctl set 1001 --numfile 2147483647:2147483647 --save<br>
 
+
vzctl set 1001 --numiptent 2147483647:2147483647 --save<br>
'''Install Required Packages'''
+
<br>
 
+
'''Start the VE'''<br>
vzyum 1001 install binutils compat-db gcc gcc-c++ glibc glibc-common libstdc++ libstdc++-devel gnome-libs make pdksh sysstat libaio xscreensaver openmotif21
+
<br>
vzyum 1001 install xorg-x11-xfs usbutils urw-fonts shared-mime-info perl-libwww-perl perl-XML-Parser perl-URI perl-HTML-Tagset perl-HTML-Parser patch
+
vzctl start 1001<br>
vzyum 1001 install lvm2 intltool libIDL libart_lgpl libbonobo xterm libcap libcroco libgnomecanvas libexif libgnomecups libgnomeprint22 libsoup libwnck libxklavier
+
<br>
           
+
<br>
       
+
'''Update /etc/resolv.conf on the VE'''<br>
'''Check the following rpms are installed on the VE'''
+
<br>
 
+
search example.com<br>
vzctl exec 1001 rpm -q binutils gcc gcc-c++ glibc gnome-libs libstdc++ libstdc++-devel make pdksh sysstat xscreensaver libaio
+
nameserver &lt;ip address of your name server&gt;<br>
 
+
<br>
 
+
<br>
'''Add Oracle User/Group'''
+
'''Install Required Packages'''<br>
 
+
<br>
vzctl exec 1001 /usr/sbin/groupadd oinstall
+
vzyum 1001 install binutils compat-db gcc gcc-c++ glibc glibc-common
vzctl exec 1001 /usr/sbin/groupadd dba
+
libstdc++ libstdc++-devel gnome-libs make pdksh sysstat libaio
vzctl exec 1001 /usr/sbin/useradd -m -g oinstall -G dba oracle
+
xscreensaver openmotif21<br>
vzctl exec 1001 id oracle
+
vzyum 1001 install xorg-x11-xfs usbutils urw-fonts shared-mime-info
 
+
perl-libwww-perl perl-XML-Parser perl-URI perl-HTML-Tagset
'''Set Password for the Oracle user'''
+
perl-HTML-Parser patch <br>
 
+
vzyum 1001 install lvm2 intltool libIDL libart_lgpl libbonobo xterm
vzctl exec 1001 passwd oracle
+
libcap libcroco libgnomecanvas libexif libgnomecups libgnomeprint22
 
+
libsoup libwnck libxklavier<br>
'''Create Directories for Oracle Home/Data and the download directory'''
+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
+
&nbsp;<br>
vzctl exec 1001 mkdir /home/oracle/10gR2_db
+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<br>
vzctl exec 1001 mkdir -p /u01/app/oracle/product/10.2.0/db_1
+
'''Check the following rpms are installed on the VE'''<br>
vzctl exec 1001 mkdir /u01/app/oracle/oradata
+
<br>
vzctl exec 1001 chown -R oracle:oinstall /u01/app/oracle /home/oracle/10gR2_db
+
vzctl exec 1001 rpm -q binutils gcc gcc-c++ glibc gnome-libs libstdc++
vzctl exec 1001 chmod -R 775 /u01/app/oracle /home/oracle/10gR2_db
+
libstdc++-devel make pdksh sysstat xscreensaver libaio<br>
vzctl exec 1001 ln -s /usr/lib/libstdc++.so.6.0.3 /usr/lib/libstdc++.so.5
+
<br>
 
+
<br>
'''Put these values in /etc/sysctl.conf on the HN'''
+
'''Add Oracle User/Group'''<br>
 
+
<br>
kernel.shmall = 2097152
+
vzctl exec 1001 /usr/sbin/groupadd oinstall<br>
kernel.shmmax = 536870912
+
vzctl exec 1001 /usr/sbin/groupadd dba<br>
kernel.shmmni = 4096
+
vzctl exec 1001 /usr/sbin/useradd -m -g oinstall -G dba oracle<br>
kernel.sem = 250 32000 100 128
+
vzctl exec 1001 id oracle<br>
fs.file-max = 65536
+
<br>
net.ipv4.ip_local_port_range = 1024 65000
+
'''Set Password for the Oracle user'''<br>
net.core.rmem_default=262144
+
<br>
net.core.wmem_default=262144
+
vzctl exec 1001 passwd oracle<br>
net.core.rmem_max=262144
+
<br>
net.core.wmem_max=262144
+
'''Create Directories for Oracle Home/Data and the download directory'''<br>
 
+
<br>
'''Execute on the HN'''
+
vzctl exec 1001 mkdir /home/oracle/10gR2_db<br>
 
+
vzctl exec 1001 mkdir -p /u01/app/oracle/product/10.2.0/db_1<br>
/sbin/sysctl -p
+
vzctl exec 1001 mkdir /u01/app/oracle/oradata<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<br>
At this point the VE is ready for Oracle installation.
+
vzctl exec 1001 ln -s /usr/lib/libstdc++.so.6.0.3
We take a backup of the VE at this point in case we need to rebuild the system or do a clean Oracle install
+
/usr/lib/libstdc++.so.5<br>
 
+
<br>
'''Shutdown the VE and take a backup'''
+
'''Put these values in /etc/sysctl.conf on the HN'''<br>
 
+
<br>
vzctl stop 1001
+
kernel.shmall = 2097152<br>
cd /u01/backups
+
kernel.shmmax = 536870912<br>
tar czpvf ve-1001-preOracle.tar.gz /vz/private/1001/ /etc/vz/conf/1001.conf
+
kernel.shmmni = 4096<br>
 
+
kernel.sem = 250 32000 100 128<br>
'''Start VE again'''
+
fs.file-max = 65536<br>
 
+
net.ipv4.ip_local_port_range = 1024 65000<br>
vzctl start 1001
+
net.core.rmem_default=262144<br>
 
+
net.core.wmem_default=262144<br>
'''Copy the downloaded Oracle zip file to the VE and change its ownership to oracle on the VE'''
+
net.core.rmem_max=262144<br>
 
+
net.core.wmem_max=262144<br>
cp /u01/software/10201_database_linux32.zip /vz/private/1001/home/oracle/10gR2_db/
+
<br>
vzctl exec 1001 chown oracle:oinstall /home/oracle/10gR2_db/10201_database_linux32.zip
+
'''Execute on the HN'''<br>
 
+
<br>
'''Now login as oracle on the ve-1001'''
+
/sbin/sysctl -p<br>
 
+
<br>
cd /home/oracle/10gR2_db
+
<br>
unzip 10201_database_linux32.zip
+
<br>
cd database/
+
At this point the VE is ready for Oracle installation.<br>
export ORACLE_BASE=/u01/app/oracle
+
We take a backup of the VE at this point in case we need to rebuild the
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
+
system or do a clean Oracle install<br>
export DISPLAY=192.168.0.149:0
+
<br>
 
+
'''Shutdown the VE and take a backup'''<br>
Make sure u can run xterm
+
<br>
 
+
vzctl stop 1001<br>
./runInstaller
+
cd /u01/backups<br>
 
+
tar czpvf ve-1001-preOracle.tar.gz /vz/private/1001/
'''When prompted to run scripts as root. Login as root and execute'''
+
/etc/vz/conf/1001.conf<br>
 
+
<br>
export DISPLAY=192.168.0.149:0
+
'''Start VE again'''<br>
/u01/app/oracle/oraInventory/orainstRoot.sh
+
<br>
/u01/app/oracle/product/10.2.0/db_1/root.sh
+
vzctl start 1001<br>
 
+
<br>
'''Update oracle's profile with the following'''
+
'''Copy the downloaded Oracle zip file to the VE and change its
 
+
ownership to oracle on the VE'''<br>
cd
+
<br>
vi /home/oracle/.bashrc
+
cp /u01/software/10201_database_linux32.zip
export ORACLE_BASE=/u01/app/oracle
+
/vz/private/1001/home/oracle/10gR2_db/<br>
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
+
vzctl exec 1001 chown oracle:oinstall
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
+
/home/oracle/10gR2_db/10201_database_linux32.zip<br>
export PATH=$ORACLE_HOME/bin:$PATH
+
<br>
export ORACLE_SID=orcl
+
'''Now login as oracle on the ve-1001'''<br>
 
+
<br>
 
+
cd /home/oracle/10gR2_db<br>
'''Delete installation files (optional)'''
+
unzip 10201_database_linux32.zip<br>
 
+
cd database/<br>
cd /home/oracle/10gR2_db
+
export ORACLE_BASE=/u01/app/oracle<br>
rm -rf database
+
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1<br>
 
+
export DISPLAY=192.168.0.149:0<br>
'''Time to take another backup of the VE on the HN node.'''  
+
<br>
 
+
Make sure u can run xterm<br>
This backup will allow you to restore the VE to the point where no database has yet been created.
+
<br>
 
+
./runInstaller<br>
vzctl stop 1001
+
<br>
cd /u01/backups
+
'''When prompted to run scripts as root. Login as root and execute'''<br>
tar czpvf ve-1001-postOracleSoftware.tar.gz /vz/private/1001/ /etc/vz/conf/1001.conf
+
<br>
 
+
export DISPLAY=192.168.0.149:0<br>
 
+
/u01/app/oracle/oraInventory/orainstRoot.sh<br>
Start VE
+
/u01/app/oracle/product/10.2.0/db_1/root.sh<br>
vzctl start 1001
+
<br>
 
+
'''Update oracle's profile with the following'''<br>
'''Login as oracle and create the database'''
+
<br>
 
+
cd<br>
export DISPLAY=192.168.0.149:0
+
vi /home/oracle/.bashrc<br>
dbca
+
export ORACLE_BASE=/u01/app/oracle<br>
 
+
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1<br>
 
+
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH<br>
'''Create listener'''
+
export PATH=$ORACLE_HOME/bin:$PATH<br>
 
+
export ORACLE_SID=orcl<br>
netca
+
<br>
 
+
<br>
'''Now take another backup on the HN node'''
+
'''Delete installation files (optional)'''<br>
 
+
<br>
vzctl stop 1001
+
cd /home/oracle/10gR2_db<br>
cd /u01/backups
+
rm -rf database<br>
tar czpvf ve-1001-postOracleDatabase.tar.gz /vz/private/1001/ /etc/vz/conf/1001.conf
+
<br>
 +
'''Time to take another backup of the VE on the HN node.''' <br>
 +
<br>
 +
This backup will allow you to restore the VE to the point where no
 +
database has yet been created.<br>
 +
<br>
 +
vzctl stop 1001<br>
 +
cd /u01/backups<br>
 +
tar czpvf ve-1001-postOracleSoftware.tar.gz /vz/private/1001/
 +
/etc/vz/conf/1001.conf<br>
 +
<br>
 +
<br>
 +
Start VE<br>
 +
vzctl start 1001<br>
 +
<br>
 +
'''Login as oracle and create the database'''<br>
 +
<br>
 +
export DISPLAY=192.168.0.149:0<br>
 +
dbca<br>
 +
<br>
 +
<br>
 +
'''Create listener'''<br>
 +
<br>
 +
netca<br>
 +
<br>
 +
'''Now take another backup on the HN node'''<br>
 +
<br>
 +
vzctl stop 1001<br>
 +
cd /u01/backups<br>
 +
tar czpvf ve-1001-postOracleDatabase.tar.gz /vz/private/1001/
 +
/etc/vz/conf/1001.conf<br>
 +
<br>
 +
</body>
 +
</html>

Revision as of 00:01, 11 January 2007

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head>

 <meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
 <title></title>

</head> <body> This is just a listing of steps taken to create a fully functionaly Oracle VE.

Create the VE on the Hardware Node (HN)

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 porblems during installation. Once the installation is
done and the system left running for some time, these limits can be adjusted.

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 --dummy 2147483647:2147483647 --save
vzctl set 1001 --numproc 2147483647:2147483647 --save
vzctl set 1001 --physpages 2147483647:2147483647 --save
vzctl set 1001 --vmguarpages 2147483647:2147483647 --save
vzctl set 1001 --oomguarpages 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

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
vzyum 1001 install xorg-x11-xfs usbutils urw-fonts shared-mime-info perl-libwww-perl perl-XML-Parser perl-URI perl-HTML-Tagset perl-HTML-Parser patch
vzyum 1001 install 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

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

Execute on the HN

/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

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

Now login as oracle on the ve-1001

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 u can run xterm

./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

</body> </html>