📜 ⬆️ ⬇️

Installing Oracle 10g on CentOS 6.2 x64

The other day I had to install this type of product on this axis that was not officially supported by Oracle. CentOS for me is quite unexplored Linux, so how to install google. Found a few instructions, unfortunately none of them was the very guide, stupidly following which one could carry out this action. All demanded improvement, search for missing libraries, etc. As a result, he wrote a kind of HOWTO with all the amendments. Maybe someone will be interested.

P.S. Tru fans ask strictly do not judge, I know that installing this database on unsupported operating systems is fraught, etc. ... But since I have practical experience in operating this DBMS in several "uncertified" operating systems and experience resolving a very small number of collisions during the operation - to I still consider the requirement for OS “certification” to be greatly exaggerated.


')
We connect by root, we work in its environment:

su - 


Install the necessary packages (everything is in the standard repository, a bit mixed up):

 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 


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 parameters for compatibility. We correct /etc/sysctl.conf, we 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 use the config:

 sysctl -p 


Adjust the limits on the number of file processes for the oracle user (since he will be the owner of the DBMS processes). We are correcting /etc/security/limits.conf, we are introducing and modifying the following lines:

 oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 


Edit /etc/pam.d/login, add / change:

 session required /lib64/security/pam_limits.so session required pam_limits.so 


We also create a 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 rights to execute:

 chmod +x /etc/profile.d/custom.sh 


Temporarily change the description of the OS version to oracle when installing did not swear. You can of course use the ignoreSysPrereqs key when installing, for an amateur.

 cp /etc/redhat-release /etc/redhat-release.6 echo redhat-4 > /etc/redhat-release 


In order for other OS users, owners of processes that may need access to the database, to have no difficulties with this, add the following lines to the common 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 all, we don’t need root access yet, connect with the oracle user.

Installing to / opt / oracle / database

 cd /opt/oracle cpio -idmv < database_linux_x86_64.cpio cd database ./runInstaller 


Install.
During the installation, an error may occur: ins_emdb (error invoking target 'collector' ...), ignore it and click “Continue”.
In the installation process, follow the instructions of the installer, you need to run two scripts from under the root, execute them.

Hooray? Not yet.

We recall that we changed the description of the OS release, we returned the old description back (we perform from the root):

 mv /etc/redhat-release.6 /etc/redhat-release 


Enter the oracle, try to create the database via dbca, when creating, we get the 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 $ ORACLE_HOME / bin / oralce file with the following contents:

 #!/bin/bash export DISABLE_HUGETLBFS=1 exec $ORACLE_HOME/bin/oracle.bin $@ 


give the file permissions to execute:

 chmod +x oracle 


Now everything works for us. It remains only to arrange the oracle and the listener as demons, so that they start when the system boots.

For the listener, create a script (/etc/init.d/listener) with the following content:

 #!/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 


We correct the rights, add to autorun

 chmod 700 listener chkconfig listener on 


For subd, create a script (/etc/init.d/oracle) with the following content:

 #!/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 


We correct the rights, add to autorun

  chmod 700 oracle chkconfig oracle on 


For automatic start of necessary instances we correct / etc / oratab, we change

 navdb:/opt/oracle/database:N 


on

 navdb:/opt/oracle/database:Y 


Actually everything :)

Source: https://habr.com/ru/post/144403/


All Articles