Nethence Documentation Lab Webmail Your IP BBDock  


Those documents are obsolete, please use the Nethence Documentation instead.

HomeUnixWindowsOracleObsoleteHardwareDIYMechanicsScriptsConfigsPrivate

Installing Oracle 11gR2 on RHEL5 64-bit
 
Hardware requirements
Make sure you've got:
- at least 1GB of RAM (note that 1GB in a VMware guest, for testing, won't be enought, a few bytes are missing)
- at least 1,5GB of swap (2048MB will be just fine for 1GB of RAM)
Between 1 GB and 2 GB: 1.5 times the size of the RAM
Between 2 GB and 16 GB: Equal to the size of the RAM
More than 16 GB: 16 GB
Ref. 11gR2 Installation Guide for Linux -> Checking the Hardware Requirements -> Memory Requirements
- a few gigabytes of storage for the system (/ mount point) -- 16GB here
- a few more gigabytes of sotrage for the database binaries and files (/u01 mount point) -- 100GB here
 
System post-installation
Eventually disable SELinux and firewalling,
rpm -q system-config-securitylevel-tui
system-config-securitylevel-tui
==> Security Level: Disabled
==> SELinux: Disabled
 
Make sure your hostname resolves locally (check /etc/hosts).
 
Make sure you've enabled NTP: install the 'ntp' package and edit /etc/ntp.conf to change the server line(s) and enable the daemon,
rpm -q ntp
cd /etc/
grep ^server ntp.conf
service ntpd status
chkconfig --list | grep ntp
 
Software requirements
Make sure you've installed the @base package group and those additional packages,
rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH} ' \
binutils \
compat-libstdc++-33.x86_64 \
compat-libstdc++-33.i386 \
elfutils-libelf \
elfutils-libelf-devel \
gcc \
gcc-c++ \
glibc.x86_64 \
glibc.i686 \
glibc-common \
glibc-devel.x86_64 \
glibc-devel.i386 \
glibc-headers \
ksh \
libaio.x86_64 \
libaio.i386 \
libaio-devel.x86_64 \
libaio-devel.i386 \
libgcc.x86_64 \
libgcc.i386 \
libstdc++.x86_64 \
libstdc++.i386 \
libstdc++-devel \
make \
sysstat | grep ^package
Note the i686 architecture for the glibc package, unlike the other 32-bit binaries (i386).
 
Also install the 'xorg-x11-xauth' and 'xorg-x11-apps' packages (the latter to run "xclock" later on, to check that X11 forwarding is working),
rpm -q xorg-x11-xauth xorg-x11-apps
 
Preparing the system for the RDBMS
Install the Oracle RDBMS pre-installation RPM from Oracle's public Yum Server (http://public-yum.oracle.com/),
cd /etc/yum.repos.d/
wget http://public-yum.oracle.com/public-yum-el5.repo
yum install oracle-validated
tail /var/log/oracle-validated/results/orakernel.log
grep ^oracle /etc/passwd
grep ^oinstall /etc/group
grep ^dba /etc/group
you can restore the RHEL kernel by default,
vi /boot/grub/grub.conf ==> e.g. default=1
don't forget to setup a password for the oracle user,
passwd oracle
create a folder for the application binaries to be deployed (assuming some quite large mount point /u01/ already exists),
cd /u01/
mkdir -p app/
chown oracle:oinstall app/
install the missing i386 unixODBC package (donno why oracle-validate doesn't install both, i386 and x86_64),
yum install unixODBC
and reboot the machine IF you choose to use the kernel provided by Oracle,
#shutdown -r now
 
Installing the RDBMS
Enable the ftp daemon and upload the installation archives to the host with the 'oracle' user account (it's faster with FTP than with SFTP/SSH). Now connect to the host as 'oracle' user with X11 forwarding enabled, extract the archives and run the Oracle Universal Installer,
unzip V17530-01_1of2.zip
unzip V17530-01_2of2.zip
rm -f V17530-01_1of2.zip
rm -f V17530-01_2of2.zip
cd database/
./runInstaller
 
Deploy the RDBMS binaries as usual (Software Only, Standard Edition, ORACLE_HOME=.../ora112 instead of dbhome_1, OSDBA and OSOPER=dba, save response file). Don't panic when it stucks at 84% when linking the binaires, this takes a while. And finish up with the root scripts,
cd /u01/app/oraInventory/
./orainstRoot.sh
cd ../oracle/product/11.2.0/ora112/
./root.sh
 
As oracle user, fix some env variables for the oracle user,
cd ~/
echo syn off >> .vimrc
vi .bash_profile
add/change,
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/ora112
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
apply and configure the listener,
source .bash_profile
netca
...
 
As root, make some init script to start the listener and the needed databases (/etc/oratab),
cd /etc/init.d/
vi dbora
like,
#!/bin/sh
# chkconfig: 345 99 10
# description: Oracle auto start-stop script.

case "$1" in
'start')
su - oracle -c "lsnrctl start"
su - oracle -c "dbstart /u01/app/oracle/product/11.2.0/ora112"
touch /var/lock/subsys/dbora
;;
'stop')
su - oracle -c "dbshut /u01/app/oracle/product/11.2.0/ora112"
su - oracle -c "lsnrctl stop"
rm -f /var/lock/subsys/dbora
;;
esac
and enable it,
chmod 750 dbora
chkconfig --add dbora
chkconfig --list | grep dbora
check it is working (eventhough you haven't configured any database yet),
service dbora stop
service dbora start
 
Creating a database
Create a database as user 'oracle',
unset ORACLE_SID
dbca
Step 2: Custom Database
Step 3: (same GDN and SID is fine)
Step 4: without Enterprise Manager
Step 5: same password for SYS and SYSTEM
Step 6: Use database file locations from template
Step 7: by default without archiving (no RMAN for now)
Step 8: without Enterprise Manager Repository
Step 9: size of the SGA depending on needs of your applciation, no less than 500MB (see the troubleshooting chapter)
Step 9 Character Sets: Use Unicode (AL32UTF8)
Step 11: with Database Creation Scripts
and eventually enable it at boot time (dbora init script has already been installed),
cd /etc/
vi oratab
change N to Y,
dbname:/u01/app/oracle/product/11.2.0/ora112:Y
 
Eventually configure GNU Screen as oracle user,
cd $ORACLE_BASE/
find . | grep alert_ | grep .log$ | grep -v DBUA0
cd ~/
cat >> .screenrc <<EOF9
screen -t "dbname alert" 0 tail -F /u01/app/oracle/diag/rdbms/dbname/dbname/trace/alert_dbname.log
EOF9
 
Configuring a database
Connect to your empty (custom) database,
. oraenv
sqlplus / as sysdba
Note. On much older Oracle RDBMS versions once had to,
#sqlplus /nolog
#connect / as sysdba
 
Prepare a tablespace and user/schema, e.g.,
create tablespace tsname 
datafile '/u01/app/oracle/oradata/dbname/tsname.dbf' size 100M
autoextend on;

create temporary tablespace tsnametmp
tempfile '/u01/app/oracle/oradata/dbname/tsnametmp.dbf' size 10M
autoextend on;

create user dbuser identified by PASSWORD 
default tablespace tsname
temporary tablespace tsnametmp;

grant connect, resource to dbuser;
--grant exp_full_database to dbuser;
--grant imp_full_database to dbuser;
--grant dba to dbuser;
Note. there's also "extent management local"
Note. there's also "extent management uniform"
Note. there's also "quota unlimited on tsname"
 
Check you can connect locally and through TNS,
sqlplus dbuser/PASSWORD 
sqlplus dbuser/PASSWORD@dbname 
 
Troubleshooting
If you get an ora-00604 ora-04031 ora-06512 during the database creation, at the "Adding Oracle JVM" step, you should increase the size of the shared memory (large_pool_size into init.ora). Simply abord and retry the database creation with a larger SGA (you don't have to proceed through the whole dbca wizard again, just go back and change the SGA value).
 
References
Automating Database Startup and Shutdown on Linux
 

Last update: May 15, 2013