Installing Oracle 10g on CentOS 6.2 x64
P.S. Tru fans of Oracle, please do not judge strictly, I know that installing this database on unsupported operating systems is fraught with fraud, etc. ... But since I have practical experience in operating this DBMS in several "non-certified" operating systems and experience in resolving a very small number of conflicts during operation - up to I still consider the requirement for OS "certified" to be greatly exaggerated.
We are connected by root, we work in its environment:
su -
Install the necessary packages (everything is in the standard repository, a little interspersed):
yum install libXp gcc make setarch libaio glibc-devel glibc.i686 libXp.so.6 libXt.so.6 libXtst.so.6 compat-libstdc++-33.x86_64 binutils elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel glibc-headers gcc gcc-c++ libaio-devel libaio libgcc libstdc++ make sysstat unixODBC unixODBC-devel unzip glibc-devel.i686 libgcc.i686 binutils compat-db libstdc++ gdbm make ksh libaio-devel libXtst xorg-x11-utils openmotif openmotif.i686 libaio.i686 libaio-devel.i686 compat-glibc.x86_64
We create users and groups:
groupadd oinstall
groupadd dba
useradd -d /opt/oracle -g oinstall -G dba -s /bin/bash -m oracle
passwd oracle
useradd nobody
Configure system settings for compatibility. Edit /etc/sysctl.conf, add-modify the following lines:
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
and apply the config:
sysctl -p
We will adjust the limits on the number of file processes for the oracle user (since he will be the owner of the DBMS processes). Edit /etc/security/limits.conf, make-change the following lines:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
Edit /etc/pam.d/login, make / change:
session required /lib64/security/pam_limits.so
session required pam_limits.so
We also create the profile file (vi /etc/profile.d/custom.sh), add the text to it:
#!/bin/bash
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
Add execution rights:
chmod +x /etc/profile.d/custom.sh
Temporarily change the OS version description so that the installation does not swear. You can of course use the ignoreSysPrereqs key during installation, not for everybody.
cp /etc/redhat-release /etc/redhat-release.6
echo redhat-4 > /etc/redhat-release
To ensure that other users of the OS, process owners who may need access to the database, have no difficulties with this, we add the following lines to the general profile (/ etc / profile), at the end:
ORACLE_BASE=/opt/oracle
ORACLE_HOME=/opt/oracle/database
ORACLE_SID=navdb
export ORACLE_BASE ORACLE_HOME ORACLE_SID
PATH=$ORACLE_HOME/bin:$ORACLE_HOME/lib:$ORACLE_HOME/lib32:$PATH:.
export PATH
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME/lib32:/lib:/usr/lib
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export LD_LIBRARY_PATH CLASSPATH
export NLS_LANG=AMERICAN_AMERICA.UTF8
That's it, we don’t need root access yet, we are connected by the oracle user.
Installing in / opt / oracle / database
cd /opt/oracle
cpio -idmv < database_linux_x86_64.cpio
cd database
./runInstaller
Install.
During the installation process, an error may occur: ins_emdb (error invoking target 'collector' ...), ignore it and click “Continue”.
In the installation process, we follow the instructions of the installer, you need to execute two scripts from under the root, we execute them.
Hurrah? Not yet.
We recall that we changed the description of the OS release, return the old description back (we execute it from the root):
mv /etc/redhat-release.6 /etc/redhat-release
We enter oracle, try to create a database through dbca, when creating, we get an error:
ORA-27125: unable to create shared memory segment
We treat this annoying misunderstanding. We carry out
cd $ORACLE_HOME/bin
mv oracle oracle.bin
create the file $ ORACLE_HOME / bin / oralce with the following contents:
#!/bin/bash
export DISABLE_HUGETLBFS=1
exec $ORACLE_HOME/bin/oracle.bin $@
give the file the right to execute:
chmod +x oracle
Now everything works for us. It remains only to design the oracle and the listener as daemons so that they start when the system boots.
For the listener, create a script (/etc/init.d/listener) with the following contents:
#!/bin/bash
#
# chkconfig: 345 51 49
# description: startup and shutdown the Oracle 10g listener
#
echo "Oracle 10g listener start/stop/restart/status"
ORA_OWNER=oracle
ORACLE_BASE=/opt/oracle
ORACLE_HOME=/opt/oracle/database
ORACLE_SID=navdb
export ORACLE_BASE ORACLE_HOME ORACLE_SID
PATH=$ORACLE_HOME/bin:$PATH:.
export PATH
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME/lib32:/lib:/usr/lib
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export LD_LIBRARY_PATH CLASSPATH
alias sqlplus='rlwrap sqlplus'
export NLS_LANG=AMERICAN_AMERICA.UTF8
case $1 in
start)
echo -n "Starting oracle listener: "
su - $ORA_OWNER -c "$ORACLE_HOME/bin/lsnrctl start"
echo
;;
stop)
echo -n "Shutting down oracle listener: "
su - $ORA_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop"
echo
;;
status)
echo -n "Status of oracle listener: "
su - $ORA_OWNER -c "$ORACLE_HOME/bin/lsnrctl status"
echo
;;
restart)
echo -n "Restarting oracle listener:"
$0 stop
$0 start
echo
;;
*)
echo "Usage: listener [ start | stop | restart | status ]"
exit 1
esac
exit 0
Adjust the rights, add to autorun
chmod 700 listener
chkconfig listener on
For sub, create a script (/etc/init.d/oracle) with the following contents:
#!/bin/bash
#
# chkconfig: 345 51 49
# description: startup and shutdown the Oracle 10g instance
#
# Run-level Startup script for the Oracle Instance, Listener, and Web Interface
echo "Oracle 10g database start/stop/restart"
ORA_OWNER=oracle
ORACLE_BASE=/opt/oracle
ORACLE_HOME=/opt/oracle/database
ORACLE_SID=navdb
export ORACLE_BASE ORACLE_HOME ORACLE_SID
PATH=$ORACLE_HOME/bin:$PATH:.
export PATH
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME/lib32:/lib:/usr/lib
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export LD_LIBRARY_PATH CLASSPATH
export NLS_LANG=AMERICAN_AMERICA.UTF8
# if the executables do not exist -- display error
if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
then
echo "Oracle startup: cannot start"
exit 1
fi
# depending on parameter -- startup, shutdown, restart
# of the instance and listener or usage display
case "$1" in
start)
# Oracle listener and instance startup
echo -n "Starting Oracle: "
su $ORA_OWNER -c "$ORACLE_HOME/bin/lsnrctl start"
su $ORA_OWNER -c $ORACLE_HOME/bin/dbstart
touch /var/lock/oracle
# su $ORA_OWNER -c "$ORACLE_HOME/bin/emctl start dbconsole"
echo "OK"
;;
stop)
# Oracle listener and instance shutdown
echo -n "Shutdown Oracle: "
su $ORA_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop"
su $ORA_OWNER -c $ORACLE_HOME/bin/dbshut
rm -f /var/lock/oracle
# su $ORA_OWNER -c "$ORACLE_HOME/bin/emctl stop dbconsole"
echo "OK"
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: `basename $0` start|stop|restart"
exit 1
esac
exit 0
Adjust the rights, add to autorun
chmod 700 oracle
chkconfig oracle on
To automatically start the necessary instances, edit / etc / oratab, change
navdb:/opt/oracle/database:N
on the
navdb:/opt/oracle/database:Y
Actually everything :)