Directory
First, hardware requirements
Second, the software
Third, System installation note
Iv. System Readiness prior to Oracle installation
V. Install Oracle and set up the settings
Six, upgrade Oracle to Patchset 10.2.0.4
Vii. using Rlwrap to invoke the Sqlplus history command
First, hardware requirements
1. Memory & Swap
Minimum:1 GB of RAM
Recommended:2 GB of RAM or more
Check memory condition# grep memtotal/proc/meminfo# grep swaptotal/proc/meminfo
2. HDD
Since the CentOS installation is almost 4~5g, plus Oracle and so on, please prepare at least 10G of hard disk space.
Check disk condition# df-h
Second, the software
System Platform: CentOS 6.3 (x86_64)
Centos-6.3-x86_64-bin-dvd1.iso
Oracle Version: Oracle 10g R2
10201_database_linux_x86_64.cpio
Patch:p6810189_10204
P6810189_10204_linux-x86-64.zip
Third, System installation note
Installation of the system must be installed in desktop mode, or you cannot install Oracle, also do not open Selinux,oracle official does not recommend the use of Selinux,centos firewall also temporarily shut down, reduce the trouble of installation. In order to prevent garbled in the Oracle installation process, it is recommended to use English as the system language for Oracle installation.
The system commands described in this article, without special markings, are "#" for root Privileges and "$" for Oracle permissions.
Iv. System Readiness prior to Oracle installation
First, please log in as the root account for some pre-set jobs.
1. turn off the firewall and disable SELinux
# Setup
# Vi/etc/selinux/config
Modify the selinux=disabled, and then restart.
If you do not want to restart the system, use the command Setenforce 0
2. Install dependent packages
installation packages required by Oracle's official documentation:
To see if an Oracle-related package is installed:
Install the required packages in Yum mode:
# yum-y Install binutils compat-libstdc++-33 compat-libstdc++-33.i686 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc.i686 glibc-common glibc-devel glibc-devel.i686 glibc-headers ksh libaio libaio.i686 libaio-devel libaio-devel.i686 libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel make Sysstat
Finally need to install LIBXP This library, this must be installed, otherwise install Oracle will appear Java Exception.
# yum Install Libxp
3. Create Oracle Users and Groups
Only the single-host environment is discussed here, regardless of the configuration of the RAC environment.
Execute the following instructions to add the users and groups required for Oracle installation.
(1) Create Group Oinstall
# Groupadd Oinstall
(2) Create a group DBA
# Groupadd DBA
(3) Add user Oracle and add it to Oinstall and DBA Group
# useradd-m-G oinstall-g dba Oracle
(4) test if Oracle account is established
# ID Oracle
(5) Create a new Oracle password
# passwd Oracle
4. Add Oracle users to the sudo group
# vi/etc/sudoers
Found it
Root all= (All) all
This line, and add it at the bottom.
Oracle All= (All) all
Enter wq! (because this is a read-only document so you need to add!) and press ENTER
5, configure the system kernel parameters
# vi/etc/sysctl.conf
Modify and add the following:
Kernel.shmall = 4294967296//Indicates the total amount of shared memory (in pages) that the system can use at one time. The default value is 2097152 and usually does not need to be modified
Kernel.shmmax = 68719476736//Defines the maximum size, in bytes, of a shared memory segment. The default is 32M, which is too low for Oracle, usually set to 2G
Kernel.shmmni = 4096//is used to set the maximum number of shared memory segments in the system range. The default value for this parameter is 4096. Usually do not need to change
Kernel.sem = 250 32000 100 128//indicates the amount of semaphore set
Net.ipv4.ip_local_port_range = 1024 65000
NET.CORE.RMEM_DEFAULT=4194304//default Receive window size
Maximum size of the net.core.rmem_max=4194304//Receive Window
NET.CORE.WMEM_DEFAULT=262144//Default Send window Size
net.core.wmem_max=262144//maximum size of the sending window
There will be some duplicates of the current parameters, which are modified to provide on the file.
When you're done editing, save and then execute:
# sysctl-p
Enable the changes that you just made.
6. Edit/etc/security/limits.conf
# vi/etc/security/limits.conf
Add the following four lines
Oracle Soft Nproc 2047
Oracle Hard Nproc 16384
Oracle Soft Nofile 1024
Oracle Hard Nofile 65536
7. Edit/etc/pam.d/login
# Vi/etc/pam.d/login
Add the following two lines
Session required/lib64/security/pam_limits.so
Session Required Pam_limits.so
8, modify the/etc/profile
# Vi/etc/profile
Add the following code to the profile file.
if [$USER = "Oracle"]; Then if [$SHELL = "/bin/ksh"], then ulimit-p 16384 ulimit-n 65536 else ulimit-u 16384-n 65536
9. Modify Linux distribution Information
Because CentOS 6 was not released when the Oracle 10g was released, Oracle 10g did not confirm support for CentOS 6 and needed to modify the file to support CentOS 6 for Oracle 10g. We need to manually modify the Linux release notes so that Oracle 10g supports CentOS 6. Edit/etc/redhat-release File # Vi/etc/redhat-release To change the contents of CentOS release 6.3 (Final) to Redhat 4
10. Create an Oracle installation folder and a data storage folder
#mkdir/opt/oracle
#mkdir/opt/oracle/102
#chown-R oracle:dba/opt/oracle
11. Configure the Linux hostCheck the/etc/hosts file for localhost records (point to 127.0.0.1), if not, there will be some problems in configuring the Oracle monitoring later, so that the monitoring can not be started, this record can be manually added here.
The first phase is complete, then, after completing these settings, please log out of the root account and log in to the system again with the Oracle account.
12. Configuring Oracle User Environment variables
$ cd/home/oracle
$ VI. bash_profile
Modify and add the following content
Oracle_base=/opt/oracle//The Oracle installation folder created above
Oracle_home= $ORACLE _base/102
Oracle_sid=orcl
Ld_library_path= $ORACLE _home/lib
Path= $PATH: $ORACLE _home/bin: $HOME/bin
Export oracle_base oracle_home oracle_sid ld_library_path PATH
After saving, use the following command to make the settings effective:
$ source/home/oracle/.bash_profile
V. Install Oracle and set up the settings
1. Unzip the installation file
Put the downloaded 10201_database_linux_x86_64.cpio to the folder where Oracle will be installed/opt/oracle
Go back to terminal mode and go to the Oracle folder:
$ cd/opt/oracle
Decompression 10201_database_linux_x86_64.cpio
$ CPIO-IDMV < 10201_database_linux_x86_64.cpio
You will then see a series of decompression actions.
Unzip the folder that you see the database in the same folder, go to the database folder:
$ CD Database
Prepare to perform database installation, if your CentOS is a Chinese environment, the installation will appear in Chinese garbled, please follow the following instructions
$ Export Lang=en_us
Then execute
$./runinstaller
If you are unable to see the installation interface, run the following command using the root account before running Setup: # Export display=:0.0
# Xhost +
$./runinstaller
Error encountered: Exception in .../lib/i386/libawt.so:libxp.so.6:cannot open shared object file:no such file or directory
Solve:
# yum-y Install libxp.i686
Analysis: reading the wrong message "/lib/i386/libawt.so:libxp.so.6:cannot Open Shared object file:no such file or directory ",LIBXP needs to install the I386 package, not the X64 package. It is considered that 64-bit Linux requires the installation of a 64-bit LIBXP package, which causes this problem.
Execute again
$./runinstaller
Error encountered: Exception in .../lib/i386/libawt.so:libxt.so.6:cannot open shared object file:no such file or directory
Solve:
# yum-y Install libxt.i686
Execute again
$./runinstaller
Error encountered: Exception in .../lib/i386/libawt.so:libxtst.so.6:cannot open shared object file:no such file or directory
Solve:
# yum-y Install libxtst.i686
Execute again
$./runinstaller
Start the Setup program.
Since the relevant predecessor job has been done before, in this step you only need to select the UNIX DBA group as the DBA and the database password shared by the system and other accounts. Then select Next.
Similarly, select the group as a DBA group and press Next
In this step, click Checking Network Configuration requirements as user verified, and then press Next
The Install Summary screen appears at the end, and the installation is started as soon as the Install button is pressed.
Installation process ...
There will be an error message when the installation progress is approximately 65%:
Error in invoking target ' collector ' of makefile '/opt/oracle/102/sysman/lib/ins_emdb.mk '.
At the same time the installation log file in the orainventory/logs/directory will have the following similar error message:
This is a bug in the Oracle installer that can be ignored to continue installation and has no effect on the system.
An error message appears when you assistants the configuration:
Oui-25031:some of the configuration assistants failed.
Parse: Host Name Mapping error
FIX: Modify the/etc/hosts file to increase the IP address and hostname mapping as follows:
You will then encounter an error message:
Ora-27125:unable to create shared memory segment
Solve:
1. Determine which user groups are used to install Oracle
# ID Oracle
You can see that the Oracle Group DBA ID is 501.
2. Modifying kernel parameters
echo "501" >/proc/sys/vm/hugetlb_shm_group
You can do it.
Install to the Database Setup Assistant, you can choose Password management for password modification, if you do not need to modify, just press the OK button.
The following setup scripts appear before the installation is complete:
Open a new terminal, Su to root.
The two-paragraph script that is required to execute is executed sequentially.
/opt/oracle/orainventory/orainstroot.sh
/opt/oracle/102/root.sh
The execution screen is as follows.
When you are done, go back to the installation window and press OK to complete all Oracle installations. The following screen appears when the installation is complete.
At this point, you can use the above URL as a test, the login number can be SYS or system
Http://CentOS-Oracle:5560/isqlplus
Http://CentOS-Oracle:5560/isqlplus/dba
Http://CentOS-Oracle:1158/em
All of the above images have been successfully installed on behalf of Oracle.
Six, upgrade Oracle to Patchset 10.2.0.4
1. Upgrading software
A. closing an instance that needs to be upgraded
Stopping an instance
Sql> SHUTDOWN IMMEDIATE
Stop all background processes associated with this instance
$ emctl Stop Dbconsole
$ isqlplusctl Stop
$ lsnrctl Stop
B. backing up an Oracle database
C. run the upgrade package upgrade software
Unzip the patch pack P6810189_10204_linux-x86-64.zip, enter the extracted directory, and execute the installation command.
Click "Next"
Specify Oracle Home directory details, click "Next"
Click "Next"
Click "Next"
Click "Install" to proceed with the installation.
Upgrade process ...
Need to execute script/opt/oracle/102/root.sh
Open a new window and execute the script under the root account.
When you are done, go back to the installation window and press "OK" to complete all Oracle installations. The following screen appears when the installation is complete.
Click "Exit" to exit the Oracle upgrade.
If the database has not been created before, then the upgrade to 10.2.0.4 is over. You can then go to create a new database.
If you have previously created a database, follow these steps to upgrade the database to version 10.2.0.4.
2. Upgrade the database
A. updating the data dictionary
$ sqlplus/as sysdba;
Sql> STARTUP UPGRADE
Sql> SPOOL Patch.log
Sql> @?/rdbms/admin/catupgrd.sql
The upgrade process is long, please wait patiently.
Upgrade complete, the total time 38分钟26秒.
Sql> SPOOL OFF
B. shutting down and restarting the database
Sql> SHUTDOWN IMMEDIATE
Sql> STARTUP
C. compile invalid PL/SQL package
Sql> @?/rdbms/admin/utlrp.sql
Compilation succeeded.
D. Check if the upgrade was successful, and if all components have a status of valid, the upgrade is successful.
Sql> SELECT comp_name, VERSION, STATUS from SYS. Dba_registry;
E. check for upgrade errors
Sql> select * from Utl_recomp_errors;
F. modifying system compatibility Parameters
Sql> alter system set compatible= ' 10.2.0.4.0 ' scope=spfile;
Sql> SHUTDOWN
Sql> STARTUP
Upgrade complete.
Vii. using Rlwrap to invoke the Sqlplus history command
Run Sql*plus in Linux, can not call the history command, after the typo can not press BACKSPACE or del key to delete, although the Ctrl+backspace key combination to achieve the deletion function, but seriously affect the efficiency of use. Use of third-party software rlwrap can achieve the above functions.
Rlwrap provides a readline package (the input to bash commands is handled by ReadLine this library. That is, the up and down Arrows view history commands, Ctrl+r reverse lookup match history input, and Ctrl+w, CTRL + A etc are provided by ReadLine), which means rlwrap provides an input environment, The various functions of readline can be used in this input environment. If a program accepts input at the command line, you can use Rlwrap directly to get an effect like typing under bash.
7.1 Installing Rlwrap
The Rlwrap encapsulates the readline, so you need to install the ReadLine library before installing Rlwrap. Can be installed by Yum, or you can download the source package for installation. Official website: http://utopia.knoware.nl/~hlub/uck/rlwrap/
I. Yum Mode installation
There is no rlwrap this package in the default Yum repository of the CentOS system and needs to be installed through a third party yum source.
A. Installing a third-party yum Source
# RPM-IVH http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# RPM--IMPORT/ETC/PKI/RPM-GPG/RPM-GPG-KEY-EPEL-6//import KEY
The default is to create a Epel.repo and Epel-testing.repo two profiles under/etc/yum.repos.d/.
B. Installing Rlwrap and ReadLine
# yum Install rlwrap ReadLine readline-devel
II. Source Package Installation
Other Linux distributions if the source does not have rlwrap and readline (such as the SUSE Enterprise Edition default does not have these two packages), to download the two source packages separately compiled installation.
A. Installing the ReadLine
# wget ftp://ftp.gnu.org/gnu/readline/readline-6.2.tar.gz# tar zxvf readline-6.2.tar.gz# cd readline-6.2/#./configure # make# make Install
B. Installing Rlwrap
# wget http://utopia.knoware.nl/~hlub/rlwrap/rlwrap-0.37.tar.gz# tar zxvf rlwrap-0.37.tar.gz# cd rlwrap-0.37/#./ configure# make# make Install
7.2 Setting the system alias for Sqlplus
# Vim/home/oracle/.bash_profile
Add at Tail:
Alias sqlplus= ' Rlwrap sqlplus ' Alias rman= ' Rlwrap Rman '
Exiting the Oracle user and logging back in is OK. Now the Linux sqlplus is used like a cmd.
Installing Oracle 10g R2 under CentOS 6.3 (X86_32)
Http://www.cnblogs.com/mchina/archive/2012/11/06/2737472.html
Linux Oracle Services Start & Stop scripts and boot from boot
Http://www.cnblogs.com/mchina/archive/2012/11/27/2782993.html