Linux+php+apache+oracle environment setup Oracle database under CentOS

  • 2020-05-09 19:50:00
  • OfStack

It is recommended to install Oracle using the OTK script, which will greatly improve the success factor of installing Oracle.


Description
oraToolKit is the Swiss Army Knife for Oracle. Standards and well designed tools help DBA's mastering Oracle 10g / 11g throughout the whole lifecycle. OTK runs on Linux, zLinux, Solaris, AIX, HP-UX and other UNIX based systems.
 from  <http://sourceforge.net/projects/oratoolkit/?source=navbar> 

1, install the Oracle constraint
1. Memory requirements

Minimum memory 1G, 2G or 2G above is recommended

2. Size setting of swap

Between 1GB and 2GB physical memory, set the size of swap to 1.5 times physical memory

Between 2GB and 16GB physical memory, set the size of swap to be the same as physical memory

If 16GB is above physical memory, set the size of swap to 16GB

3. Shared memory /dev/shm requirements

At least larger than MEMORY_MAX_TARGET and MEMORY_TARGET in each oracle instance.

4. /tmp space size requirements

At least 1GB space

5. Hard disk size requirements

The space for oracle software files and data files should be at least 10GB

6. Operating system

CentOS 6.5 64bit
- Basic Server

2. Installation steps
1. Files required to install Oracle:

linux.x64_11gR2_database_1of2.zip
linux.x64_11gR2_database_2of2.zip
oratoolkit-1.0.2.1.5-1.noarch.rpm
Download the three files and place them in /media/oracle.

2. Install OTK

root user login

Move the oratoolkit-1.0.2.1.5-1.noarch.rpm installation package to the yum local data sources folder /Media/Packages

Execute the installation command under Packages

# yum -y install oratoolkit*

3. Change the Oracle user password

OTK has already helped us set up oracle users. Now we need to set up the oracle user password
# passwd oracle

4. Check the environment dependency tool swReqCheck

OTK provides an intelligent check of environment dependencies to see if the Linux system does not meet any requirements, such as the lack of an installation package.


# /opt/oracle/otk/current/bin/installManager swReqCheck osSetup11gR2.cfg

..

..

..

20140419_010832: Info: Action swReqCheck of installManager ended with 44 WARNINGS

My system installed CentOS 6.5 64bit-Basic Server. The new system lacked many installation packages and found 44 WARNINGS.

There are 43 missing installation packages and 1 negligible WARNING:

# 20140419_011022: Warning: Oracle software runs on CentOS however this combination is NOT supported by Oracle

Install must-install packages: fix the problem with an Shell script. OTK provides a list of must-install packages.


# Assemble the command first  

REQ_FILE_DIR="/opt/oracle/otk/current/conf/installManager/requirement"

REQ_FILE_PATH="$REQ_FILE_DIR/ora11gR2-redhat-5-x86_64.pkg.lst"

YUM_COMMAND=$(echo "yum -y install")

YUM_COMMAND+=$(egrep -v "#" $REQ_FILE_PATH | grep 32-bit | awk '{ print " "$1".i[356]86" }') 

YUM_COMMAND+=$(egrep -v "#" $REQ_FILE_PATH | grep 64-bit | awk '{ print " "$1".x86_64" }')

# with echo See what the final assembly order looks like  

echo $YUM_COMMAND

# Execute the command  

$YUM_COMMAND

# Perform the environment check again  

/opt/oracle/otk/current/bin/installManager swReqCheck osSetup11gR2.cfg

Check the results again:

# 20130521_170131: Info: Action swReqCheck of installManager with ONE WARNING

That leaves one negligible warning. Indicates that the environment is ready for an Oracle installation.

5. Compile and install rlwrap (enhanced SQLPLUS functionality)


rlwrap is a wrapper that uses the GNU readline library to allow the editing of keyboard input for any other command. Input history is kept between invocations, separately for each command; history completion and search work as in bash and completion word lists can be specified on the command line.
 from  <http://utopia.knoware.nl/~hlub/uck/rlwrap/> 

OTK integrates the rlwrap tools

rlwrap enhances SQLPLUS's command execution history and auto-completion

Compile and install rlwrap


# cd /opt/oracle/otk/current/tools/rlwrap/
# ./configure
# make
# make install
# rlwrap -v

rlwrap 0.30

6. Install osSetup using the OTK tool installManager


On the one hand it does what is required from Oracle documentation and on the other hand it setups also the environment for OTK. The next bullet list shows a summary.
 from  <https://www.oratoolkit.ch/tutorials/gettingStartedV.php> 
# /opt/oracle/otk/current/bin/installManager osSetup osSetup11gR2.cfg

7. Move the Oracle installation file to the resource directory

OTK read oracle installation file by default directory is/var opt/oracle/repository;

The OTK swInst instance installation command reads this directory:


# cd /media/oracle

# chown oracle:oinstall *

# mv linux.x64_11gR2_database_1of2.zip linux.x64_11gR2_database_2of2.zip /var/opt/oracle/repository/

8. Log in Oracle user and modify the configuration file


# su - oracle

------------------------------------------------------

oraToolKit environment variables

------------------------------------------------------

Installation directory : /opt/oracle/otk

Release : 1.0.2.1.5

$RUN directory : /opt/oracle/otk/1.0/bin

$LOG_BASE directory : /var/opt/oracle/otk/1.0/log

------------------------------------------------------

# vi .profile.custom.interactive

Modify the SITE value in the file.

9. Install the Oracle database

OTK installed the database with swInst. The working principle of swInst is as follows:


The main purpose of swInst action is to execute OUI in silent mode in order to install the software. However, before it can be executed it is required to unzip the file containing the software. OTK starts here and takes care also about the extraction before launching runInstaller script.
 from  <https://www.oratoolkit.ch/tutorials/gettingStartedVII.php> 

Install the database using 1 Shell script:


#bash

# /opt/oracle/otk/1.0/conf/installManager  Profile path 

cd $INSTALL_CONF

#  copy Oracle11gR2 The configuration file ,Step1,2,3

cp sample/swInstEeSrv11gR2-Step[123]-linux-x86_64.cfg .

# swInst  Guide the installation 

installManager swInst swInstEeSrv11gR2-Step1-linux-x86_64.cfg

installManager swInst swInstEeSrv11gR2-Step2-linux-x86_64.cfg

installManager swInst swInstEeSrv11gR2-Step3-linux-x86_64.cfg

Wait a moment, then output the following message: indicating that the installation was successful.
----------------------------------------------------------------------------------------------------


# /opt/oracle/otk/current/bin/installManager swReqCheck osSetup11gR2.cfg

..

..

..

20140419_010832: Info: Action swReqCheck of installManager ended with 44 WARNINGS

0

Complete the rest of the configuration, execute the root.sh command, and manually execute the rest of the scripts at the end of the installation:


# /opt/oracle/otk/current/bin/installManager swReqCheck osSetup11gR2.cfg

..

..

..

20140419_010832: Info: Action swReqCheck of installManager ended with 44 WARNINGS

1

10. Create a database instance

OTK USES dbSetup to create instances


# /opt/oracle/otk/current/bin/installManager swReqCheck osSetup11gR2.cfg

..

..

..

20140419_010832: Info: Action swReqCheck of installManager ended with 44 WARNINGS

2

I installed the development mode (dev), we also saw the test mode (test) and the production mode (prod).

To modify the dbSetup-dev.cfg configuration file, you must modify the configuration as follows:

ORACLE_HOME value:

$ORACLE_BASE/sesrv/11.1.0/db1

Is amended as:

$ORACLE_BASE/eesrv/11.2.0/db1

Execute the installation command:

# installManager dbSetup dbSetup-dev.cfg

Next you'll see the following output after installing the database instance for about 10 minutes:


---------------------------------------------------------------------------------------------------- 

20130419_013000: Info: Executing libmiscellaneous.getFooter function 

20130419_013000: Info: Terminating installManager execution 

20130419_013000: Info: Summary log file: /var/opt/oracle/otk/1.0/log-old/installManager/../installManager.log 

20130419_013000: Info: Detailed log file: /var/opt/oracle/otk/1.0/log-old/installManager/dbsetup-20130522_012901.log 

20130419_013000: Info: Action dbSetup of installManager ended successfully 

----------------------------------------------------------------------------------------------------

Congratulations! The database is ready to use.

11. Login SQLPLUS


# /opt/oracle/otk/current/bin/installManager swReqCheck osSetup11gR2.cfg

..

..

..

20140419_010832: Info: Action swReqCheck of installManager ended with 44 WARNINGS

4

See which users are in the database


# /opt/oracle/otk/current/bin/installManager swReqCheck osSetup11gR2.cfg

..

..

..

20140419_010832: Info: Action swReqCheck of installManager ended with 44 WARNINGS

5

SQLPLUS is ready to use.

12. Manage the database using CTL

OTK provides a generic Oracle database management tool that replaces Oracle's APPCTL framework.

$ctl status all // view the current status

# ctl start all // start the database

$ctl stop all // stop database


Related articles: