Install Oracle database under the CentOS of linux+php+apache+oracle environment _linux

Source: Internet
Author: User
Tags oracle documentation sqlplus egrep

The recommended use of OTK scripts to install Oracle is a great boost to the success factor of installing Oracle.

Description
Oratoolkit is the Swiss Army knife for Oracle. Standards and 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  
 

First, install the Oracle constraint
1, memory requirements

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

2. Swap Size setting

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

Between 2GB and 16GB physical memory, set swap size equal to physical memory

16GB of physical memory, set the swap size to 16GB

3. Shared Memory/DEV/SHM Requirements

It is at least larger than the Memory_max_target and memory_target in each Oracle instance.

4./TMP Space size requirements

At least 1GB space

5. Hard Disk Size requirements

At least 10GB of storage of Oracle software files and data files

6. Operating system

CentOS 6.5 64bit
-Basic Server

Second, installation steps
1. To install the required files for Oracle:

Linux.x64_11gR2_database_1of2.zip
Linux.x64_11gR2_database_2of2.zip
oratoolkit-1.0.2.1.5-1.noarch.rpm
Download these three files and put them in the/media/oracle directory.

2. Install OTK

Root User Login

Move the ORATOOLKIT-1.0.2.1.5-1.NOARCH.RPM installation package to the Yum Local Data source folder/media/packages

Execute the install command under packages

# yum-y Install oratoolkit*

3. Modify Oracle User Password

OTK has helped us set up Oracle users, we need to set the Oracle user password below
# passwd Oracle

4. Check the Environment dependency tool Swreqcheck

OTK provides an intelligent check environment dependency that examines what is not satisfied with the Linux system, such as the lack of installation packages.

#/opt/oracle/otk/current/bin/installmanager Swreqcheck ossetup11gr2.cfg ...

20140419_010832:info:action Swreqcheck of Installmanager ended with warnings

My system is installed CentOS 6.5 64bit-basic Server, the new system is missing more installation packages, check out 44 warnings.

Of these, 43 missing installation packages, a negligible warning:

# 20140419_011022:warning:oracle software runs on CentOS however this combination be not supported by Oracle

Install the installation package that must be installed: solve the problem with a shell script, OTK provides a list of installation packages that must be installed.

#先拼装命令 

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 ' $ '. i[356]86 '} ' 

yum_command+=$ (egrep-v "#" $REQ _file_path | grep 64-bit | awk ' {print ' "$". X86_6 4 "}"

#用echo看看最终拼装的命令是什么样 

echo $YUM _command

#执行命令 

$YUM _command

#再次执行环境检查 

/opt/oracle/ Otk/current/bin/installmanager Swreqcheck ossetup11gr2.cfg

Check the results again:

# 20130521_170131:info:action Swreqcheck of Installmanager with one WARNING

There is one caveat left to ignore. Indicates that the environment has been satisfied with Oracle installation.

5. Compile and install Rlwrap (Enhanced Sqlplus function)

Rlwrap is a wrapper which uses the GNU ReadLine Library to allow the editing of keyboard of Input history is kept between invocations, separately for each command; History completion and search work as in bash and completion word lists can is specified on the command line.
From  
 

OTK integrates the Rlwrap tool

Rlwrap enhances the Sqlplus execution command history and AutoComplete features

Compile and install Rlwrap

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

Rlwrap 0.30

6. Install Ossetup using the OTK tool Installmanager

On the one hand it does what are required from Oracle documentation and in the other hand it setups also the environment fo R OTK. The next bullet list shows a summary.
From  
 

7. Move the Oracle installation files into the resource directory

OTK the directory where Oracle installation files are read by default 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 on to the 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 Oracle Database

OTK is to install the database with the Swinst, swinst work principle:

The main purpose of Swinst action is into execute OUI in silent mode in order to install the software. However, before it can be executed it are required to unzip the file containing the software. OTK starts here and takes care also about the extraction before the launching script.
From  
 

Install the database with a shell script:

#bash

#/opt/oracle/otk/1.0/conf/installmanager configuration file path

CD $INSTALL _conf

# Copy ORACLE11GR2 profile, step1,2,3

CP sample/swinsteesrv11gr2-step[123]-linux-x86_64.cfg.

# swinst Boot 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, and finally output the following information: Description of the successful installation.
----------------------------------------------------------------------------------------------------

20140419_132032:info:executing libinstallmanager.printinfomsg function

Check in the logs if there are commands to be executed manually.
-usually/opt/oracle/sesrv/11.1.0/db1/cfgtoollogs/configtoolallcommands contains such commands
-usually/opt/ Oracle/sesrv/11.1.0/db1/root.sh with root privileges has the to being executed in case APPCTL the framework is not used.
-usually/opt/oracle/sesrv/11.1.0/db1/install/changeperm.sh needs to is executed when the other OS users requires Oracle Libra Ries
----------------------------------------------------------------------------------------------------
20140419_132032:info:action Swinst of Installmanager ended successfully
--------------------------------------- -------------------------------------------------------------

Complete the remaining configuration, execute the root.sh command, install the final need to manually execute the remaining scripts:

# Su-
#/opt/oracle/eesrv/11.2.0/db1/root.sh #
exit

10. Create a database instance

OTK use Dbsetup to create an instance

# CD $INSTALL _conf
# ls-l dbsetup*.cfg
dbsetup-dev.cfg 
dbsetup-prod.cfg
dbsetup-test.cfg 

I installed the development mode (DEV), we also saw the test mode (testing) and Production mode (PROD);

To modify the Dbsetup-dev.cfg configuration file, the configuration that must be modified is:

Value of Oracle_home:

$ORACLE _BASE/SESRV/11.1.0/DB1

Modified to:

$ORACLE _BASE/EESRV/11.2.0/DB1

To execute the installation command:

# Installmanager Dbsetup dbsetup-dev.cfg

Then you'll see the following output in the Setup database instance, about more than 10 minutes, and finally:

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

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

# su-oracle------------------------------------------------------Oracle database environment Variables----------  --------------------------------------------$ORACLE _home:/opt/oracle/eesrv/11.2.0/db1 $ORACLE _sid:dev $TNS _admin :/opt/oracle/network------------------------------------------------------------------------------------------

------------------Oratoolkit Environment Variables------------------------------------------------------ installation directory:/OPT/ORACLE/OTK release:1.0.2.1.5 $RUN directory:/opt/oracle/otk/1.0/bin $LOG _base Directo  Ry:/var/opt/oracle/otk/1.0/log------------------------------------------------------# sqlplus/as SYSDBA sql*plus: Release 11.2.0.1.0 Production on Sat Apr 11:27:47 2014 Copyright (c) 1982, 2009, Oracle.

All rights reserved. Connected to:oracle Database 11g Enterprise Edition release 11.2.0.1.0-64bit Production with the partitioning, OLAP,
Data Mining and real application testing options
Sql>

 

View which users of the database

Sql>select username from dba_users;

USERNAME

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

SYSTEM

SYS

otk

oracle_ocm

dbsnmp

DIP

Outln

exfsys

perfstat

appqossys

haprobe

rows selected.

Description Sqlplus can be used.

12. Using the CTL to manage the database

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

$ CTL Status All//view current status

# CTL start all/Start database

$ ctl Stop all//stopping database

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.