Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

Oracle 10g VE

1,046 bytes added, 19:50, 11 October 2011
m
Reverted edits by 109.227.76.113 (talk) to last revision by Kir
This is just a listing of steps taken to create a fully functionaly functionalOracle VEcontainer.
'''== Create the VE container on the Hardware Node (HN)'''[[host system]] ==
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 problems during installation. Once the installation isdone and the system left running for some time, these limits can should be adjusted.
vzctl set 1001 {{Note|setting the UBC limits to "unlimited" value like below can only be done on a trusted single--kmemsize 2147483647:2147483647 --savevzctl set 1001 --lockedpages 2147483647:2147483647 --savevzctl set 1001 --privvmpages 2147483647:2147483647 --savevzctl set 1001 --shmpages 2147483647:2147483647 --savevzctl set 1001 --dummy 2147483647:2147483647 --savevzctl set 1001 --numproc 2147483647:2147483647 --savevzctl set 1001 --physpages 2147483647:2147483647 --savevzctl set 1001 --vmguarpages 2147483647:2147483647 --savevzctl set 1001 --oomguarpages 2147483647:2147483647 --savevzctl set 1001 --numtcpsock 2147483647:2147483647 --savevzctl set 1001 --numflock 2147483647:2147483647 --savevzctl set 1001 --numpty 2147483647:2147483647 --savevzctl set 1001 --numsiginfo 2147483647:2147483647 --savevzctl set 1001 --tcpsndbuf 2147483647:2147483647 --savevzctl set 1001 --tcprcvbuf 2147483647:2147483647 --savevzctl set 1001 --othersockbuf 2147483647:2147483647 --savevzctl set 1001 --dgramrcvbuf 2147483647:2147483647 --savevzctl set 1001 --numothersock 2147483647:2147483647 --savevzctl set 1001 --dcachesize 2147483647:2147483647 --savevzctl set 1001 --numfile 2147483647:2147483647 --savevzctl set 1001 --numiptent 2147483647:2147483647 --savecontainer machine, and can create problems. For more info about UBC, see [[Resource shortage]] and [[UBC]].}}
'''Start the VE'''{{Inconsistent UBC warning}}
vzctl start set 1001--kmemsize unlimited --save vzctl set 1001 --lockedpages unlimited --save vzctl set 1001 --privvmpages unlimited --save vzctl set 1001 --shmpages unlimited --save vzctl set 1001 --numproc unlimited --save vzctl set 1001 --numtcpsock unlimited --save vzctl set 1001 --numflock unlimited --save vzctl set 1001 --numpty unlimited --save vzctl set 1001 --numsiginfo unlimited --save vzctl set 1001 --tcpsndbuf unlimited --save vzctl set 1001 --tcprcvbuf unlimited --save vzctl set 1001 --othersockbuf unlimited --save vzctl set 1001 --dgramrcvbuf unlimited --save vzctl set 1001 --numothersock unlimited --save vzctl set 1001 --dcachesize unlimited --save vzctl set 1001 --numfile unlimited --save vzctl set 1001 --numiptent unlimited --save
Or you can set these limits in your <code>/etc/vz/conf/1001.conf</code> file:
'''Update /etc/resolv.conf on the VE'''{{Inconsistent UBC warning}}<pre># Primary parametersAVNUMPROC="unlimited"NUMPROC="unlimited"NUMTCPSOCK="unlimited"NUMOTHERSOCK="unlimited"VMGUARPAGES="unlimited"
search example.com# Secondary parametersnameserver <ip address of your name server>KMEMSIZE="unlimited"TCPSNDBUF="unlimited"TCPRCVBUF="unlimited"OTHERSOCKBUF="unlimited"DGRAMRCVBUF="unlimited"OOMGUARPAGES="unlimited"
# Auxiliary parameters
LOCKEDPAGES="unlimited"
SHMPAGES="unlimited"
PRIVVMPAGES="unlimited"
NUMFILE="unlimited"
NUMFLOCK="unlimited"
NUMPTY="unlimited"
NUMSIGINFO="unlimited"
DCACHESIZE="unlimited"
'''Install Required Packages'''PHYSPAGES="unlimited"NUMIPTENT="unlimited"</pre>
vzyum 1001 install binutils compat-db gcc gcc-c++ glibc glibc-common libstdc++ libstdc++-devel gnome-libs make pdksh sysstat libaio xscreensaver openmotif21== Start the container ==vzyum vzctl start 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== Update <code>/etc/resolv.conf</code> on the container ==
Put the following into your container's /etc/resolv.conf:
'''Add Oracle User/Group''' search example.com nameserver <ip address of your name server>
vzctl exec 1001 /usr/sbin/groupadd oinstallvzctl exec 1001 /usr/sbin/groupadd dbavzctl exec 1001 /usr/sbin/useradd -m -g oinstall -G dba oraclevzctl exec 1001 id oracle== Install Required Packages ==
'''Set Password for the Oracle user''' 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
vzctl exec 1001 passwd oracle== Check the following rpms are installed on the container ==
'''Create Directories for Oracle Home/Data and the download directory''' vzctl exec 1001 rpm -q binutils gcc gcc-c++ glibc gnome-libs \ libstdc++ libstdc++-devel make pdksh sysstat xscreensaver libaio
vzctl exec 1001 mkdir == Add Oracle User/home/oracle/10gR2_dbvzctl exec 1001 mkdir -p /u01/app/oracle/product/10.2.0/db_1vzctl exec 1001 mkdir /u01/app/oracle/oradatavzctl exec 1001 chown -R oracle:oinstall /u01/app/oracle /home/oracle/10gR2_dbvzctl exec 1001 chmod -R 775 /u01/app/oracle /home/oracle/10gR2_dbvzctl exec 1001 ln -s /usr/lib/libstdc++.so.6.0.3 /usr/lib/libstdc++.so.5Group ==
'''Put these values in vzctl exec 1001 /etcusr/sysctl.conf on the HN'''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
kernel.shmall = 2097152kernel.shmmax = 536870912kernel.shmmni Set Password for the Oracle user = 4096kernel.sem = 250 32000 100 128fs.file-max = 65536net.ipv4.ip_local_port_range = 1024 65000net.core.rmem_default=262144net.core.wmem_default=262144net.core.rmem_max=262144net.core.wmem_max=262144
'''Execute on the HN''' vzctl exec 1001 passwd oracle
== Create Directories for Oracle Home/sbin/sysctl -pData 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 ==
At this point the VE is ready for Oracle installationPut these values in /etc/sysctl.We take a backup of the VE at this point in case we need to rebuild conf on the system or do a clean Oracle installHN:
'''Shutdown the VE and take a backup''' 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
vzctl stop 1001Then execute on the HN the following command:cd /u01sbin/backupstar czpvf ve-1001sysctl -preOracle.tar.gz /vz/private/1001/ /etc/vz/conf/1001.confp
'''Start VE again'''
vzctl start 1001At this point the container is ready for Oracle installation.We take a backup of the container at this point in case we need to rebuild thesystem or do a clean Oracle install.
'''Copy == Shutdown the downloaded Oracle zip file to the VE container and change its ownership to oracle on the VE'''take a backup ==
cp vzctl stop 1001 cd /u01/software/10201_database_linux32backups tar czpvf ve-1001-preOracle.tar.zip gz /vz/private/1001/home/oracleetc/10gR2_dbvz/conf/vzctl exec 1001 chown oracle:oinstall /home/oracle/10gR2_db/10201_database_linux32.zipconf
'''Now login as oracle on == Start the ve-1001'''container again ==
cd /home/oracle/10gR2_dbunzip 10201_database_linux32.zipcd database/export ORACLE_BASE=/u01/app/oracleexport ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1export DISPLAY=192.168.0.149:0 vzctl start 1001
Make sure u can run xterm== Put oracle distro into the container ==
Copy the downloaded Oracle zip file to the container and change itsownership to "oracle" on the container.  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 container on the HN [[hardware node]].'''
This backup will allow you to restore the VE container 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 VEthe container   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 == Oracle Help == * [http://www.orafaq.com/forum Ask questions on the Oracle Forum]* [http://www.orawiki.com/ Oracle Wiki] [[Category:HOWTO]]