Installation and configuration of coexistence of Oracle 10g and Oracle 11g databases in Linnux

Source: Internet
Author: User
Tags stop script

After a whim, I suddenly wanted to install Oracle10g and Oracle11g under OEL6. The two versions coexist to facilitate learning and experiment. This installation process is not difficult, if you have installed 10g and 11g respectively, I believe the specific operation is very easy. The most important thing is how to make the two versions coexist and work properly.
The entire installation process has been tested on the virtual machine. The installation process is quite slow.

Environment
Wmware workstaion 7
OS OracleLinux-R6 32Bit 1g memory 30g hard drive 1 + 20G hard drive 2 (for storing installation software)
DATABASE
10201_database_linux32
Linux_11gR2

The reason why I chose OEL as the operating system is mainly for compatibility considerations. After all, this is Oracle's own stuff. The compatibility of my company's products must be better than that of other companies.
PS: But what makes me very depressing is that when I start the database installation program, why the same environment variable configuration can display Chinese normally when I use Red Hat Enterprise, however, OEL is a classic block, but the operating system is 5. x or 6.x, but the database is 10. x or 11.x.

The following is a simple record and summary of the installation process.
1. First install oracle10g
1. Create a group required for oracle Installation
Root User execution
Groupadd oinstall
Groupadd dba
Groupadd rule
2. Create an oracle user
Root User execution
Useradd oracle-g oinstall-G dba, role
Passwd oracle
3. Modify the oracle configuration file
Oracle user execution
Add the following row to. bash_profile
Export EDITOR = vi # Set sqlplus's default EDITOR to vi
Alias sqlplus = 'rlwrap sqlplus '# A small tool that allows sqlplus to use direction keys like in windows
Export NLS_LANG = "SIMPLIFIED CHINESE_CHINA.UTF8 ″
Export ORACLE_SID = TEST10G
Export ORACLE_BASE =/opt/oracle/db/10g
Export ORACLE_HOME = $ ORACLE_BASE/product/10.2.0/db_1
Export LD_LIBRARY_PATH = $ ORACLE_HOME/lib:/usr/local/lib:
Export PATH = $ ORACLE_HOME/bin:/usr/ccs/bin:/etc:/bin:/usr/openwin/bin:/usr/local/bin: /usr/X11R6/bin:
Umask 022
4. Modify Kernel Parameters
Root User execution
Add the following row to/etc/sysctl. conf
Kernel. shmmax = 2147483648
Kernel. shmmni = 4096
Kernel. shmall = 2097152
Kernel. sem = 250 32000 100 128
Fs. file-max = 65536
Net. ipv4.ip _ local_port_range = 1024 65000
Net. core. rmem_default = 1048576
Net. core. rmem_max = 1048576
Net. core. wmem_default = 262144
Net. core. wmem_max = 262144
5. Modify resource limits
Root User execution
Add the following row to/etc/security/limits. conf
Oracle soft nofile 65536
Oracle hard nofile 65536
Oracle soft nproc 16384
Hard nproc 16384
4. Create related directories
Root User execution
Mkdir/opt/oracle
Chown oracle: oinstall/opt/oracle
5. Format and mount the New Hard Disk
Root User execution
Root@www.bkjia.com ~ # Fdisk-l
Root@www.bkjia.com ~ # Fdisk/dev/sdb
Input n p 1 w
Root@www.bkjia.com ~ # Mkfs-t ext4-c/dev/sdb1
Root@www.bkjia.com ~ # Mkdir/media/newdriver
Root@www.bkjia.com ~ # Mount/dev/sdb1/media/newdriver/
Root@www.bkjia.com ~ # Mkdir/media/newdriver/ora
Root@www.bkjia.com ~ # Chown oracle: oinstall/media/newdriver/ora
6. Upload and decompress the software.
Oracle user execution
Unzip-q 10201_database_linux32.zip
7. Version Spoofing
Root User execution
Cp/etc/RedHat-release/etc/redhat-release.bak
Change vi/etc/redhat-release
# Red Hat Enterprise Linux Server release 6.0 (Santiago)
Red Hat 4
8. garbled Problem
Oracle user execution
Before executing./runInstaller
Export LANG = en_US
9. errors encountered during installation
9.1. libXp package missing
Root User execution
Exception in thread "main" java. lang. unsatisfiedLinkError:/tmp/OraInstall2011-07-30_01-41-36AM/jre/1.4.2/lib/i386/libawt. so: libXp. so.6: cannot open shared object file: No such file or directory
Solution: If the libXp package is missing, find and install it on the Linux installation CD. The installation details of www.bkjia.com are not described in detail.
Since I have never installed a database of 10 Gb in Linux6, I am afraid that there will be many problems at the beginning. Fortunately, everything went well. I believe there will be no problems in the next 11G version.
10. Install rlwrap
Root User execution
Root@www.bkjia.com ~ # Tar zxvf rlwrap-0.37.tar.gz
Root@www.bkjia.com ~ # Cd rlwrap-0.37
Root@www.bkjia.com rlwrap-0.37 #./configure
Root@www.bkjia.com rlwrap-0.37 # make
[Root@www.bkjia.com rlwrap-0.37] # make install
11. Use the Startup Script
You need to make some changes before using the startup script, mainly to configure the ORACLE_HOME_LISTNER variable.
Vi $ ORACLE_HOME/bin/dbstart
Put 79 rows
ORACLE_HOME_LISTNER =/ade/vikrkuma_new/oracle
Modify
ORACLE_HOME_LISTNER = $ ORACLE_HOME
Otherwise, an error is returned:
[Oracle @ gtlions bin] $./dbstart
Failed to auto-start Oracle Net Listene using/ade/vikrkuma_new/oracle/bin/tnslsnr
12. Use the close script
Because the 10G version does not enable the function of disabling listening with the script configuration disabled, the script writes
# Oracle Net Listener is NOT shutdown using this script.
Therefore, we need to add a listener stop script. We can use the 11g closing script to copy the relevant part.
ORACLE_HOME_LISTNER = $ ORACLE_HOME
If [! $ ORACLE_HOME_LISTNER]; then
Echo "ORACLE_HOME_LISTNER is not SET, unable to auto-stop Oracle Net Listener"
Echo "Usage: $0 ORACLE_HOME"
Else
LOG = $ ORACLE_HOME_LISTNER/listener. log

# Set the ORACLE_HOME for the Oracle Net Listener, it gets reset
# A different ORACLE_HOME for each entry in the oratab.
Export ORACLE_HOME = $ ORACLE_HOME_LISTNER

# Stop Oracle Net Listener
If [-f $ ORACLE_HOME_LISTNER/bin/tnslsnr]; then
Echo "$0: Stoping Oracle Net Listener" >>$ LOG 2> & 1
$ ORACLE_HOME_LISTNER/bin/lsnrctl stop >>$ LOG 2> & 1 &
Else
Echo "Failed to auto-stop Oracle Net Listener using $ ORACLE_HOME_LISTNER/bin/tnslsnr"
Fi
Fi
13. Configure/etc/oratab
Add or modify the following content. Note that the last Y file will be written to this file by default when the installation is complete, but the last bit is N
/Etc/oratab TEST10G:/opt/oracle/db/10g/product/10.2.0/db_1: Y

Ii. Install oracle11g
1. Modify the oracle configuration file
Note: First back up this file, because this file is a configuration file for the 10G version, only the corresponding configuration files of the two versions are saved at the same time, in the future, you can easily switch between them.
After the backup, modify the previous configuration as follows:
Export NLS_LANG = "SIMPLIFIED CHINESE_CHINA.UTF8 ″
Export ORACLE_SID = TEST11G
Export ORACLE_BASE =/opt/oracle/db/11g/base
Export ORACLE_HOME = $ ORACLE_BASE/product/11.2.0/db_1
Export LD_LIBRARY_PATH = $ ORACLE_HOME/lib:/usr/local/lib:
Export PATH = $ ORACLE_HOME/bin:/usr/ccs/bin:/etc:/bin:/usr/openwin/bin:/usr/local/bin: /usr/X11R6/bin:
Umask 022
2. The version is restored to its original state.
Vi/etc/redhat-release
Modify this file
Red Hat Enterprise Linux Server release 6.0 (Santiago)
3. garbled Problem
Export LANG = en_US before executing./runInstaller

Iii. Configuration and use
Finally, how to use and use the two versions of the database separately.
Of course, it is implemented by using different configuration files. The focus is to switch to the corresponding environment variable every time you use different versions of the database.
There are multiple methods, such:
1. Set relevant variables one by one;
2. Back up two versions of the environment variable parameter file. bash_profile, and manually switch after login;
3. Here I use the SecureCRT ssh tool to configure two sessions for oracle and set different scripts to be executed after logon, in this case, we need to set the environment variables for us.

Iv. Final
Specifically, I checked the space occupied by the installation directories of the next two versions. The size of the data files is similar, 10 Gb occupies 1.1 GB, and 11 GB occupies 1.4 GB, however, the installation of software is greatly different. The 11g is almost three times the 10g, the former is 3.7g, and the latter is only 1.3g. Big guy, 11 GB.


-The End-

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.