Installation and configuration of coexistence of Oracle10G and Oracle11G in Linux

Source: Internet
Author: User
Tags stop script

InLinuxCan be implemented in the systemOracle10GAndOracle11Does the database of G dual version coexist? The answer is yes. In this article, we will introduce the installation and configuration of the coexistence of Oracle10G and Oracle11G databases in Linux. Next we will introduce it.

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

Run the following command as the root user:

 
 
  1. groupadd oinstall  
  2.  
  3. groupadd dba  
  4.  
  5. groupadd oper 

2. Create an oracle user

Run the following command as the root user:

 
 
  1. useradd oracle -g oinstall -G dba,oper  
  2.  
  3. passwd oracle 

3. Modify the oracle configuration file

Oracle user execution

Add the following row to. bash_profile

 
 
  1. Export EDITOR = vi # Set sqlplus's default EDITOR to vi
  2.  
  3. Alias sqlplus = 'rlwrap sqlplus '# A small tool that allows sqlplus to use direction keys like in windows
  4.  
  5. Export NLS_LANG = "SIMPLIFIED CHINESE_CHINA.UTF8 ″
  6.  
  7. Export ORACLE_SID = TEST10G
  8.  
  9. Export ORACLE_BASE =/opt/oracle/db/10g
  10.  
  11. Export ORACLE_HOME = $ ORACLE_BASE/product/10.2.0/db_1
  12.  
  13. Export LD_LIBRARY_PATH = $ ORACLE_HOME/lib:/usr/local/lib:
  14.  
  15. Export PATH = $ ORACLE_HOME/bin:/usr/ccs/bin:/etc:/bin:/usr/openwin/bin:/usr/local/bin: /usr/X11R6/bin:
  16.  
  17. Umask 022

4. Modify Kernel Parameters

Run the root user and add the following line to/etc/sysctl. conf.

 
 
  1. kernel.shmmax = 2147483648 
  2.  
  3. kernel.shmmni = 4096 
  4.  
  5. kernel.shmall = 2097152 
  6.  
  7. kernel.sem = 250 32000 100 128  
  8.  
  9. fs.file-max = 65536 
  10.  
  11. net.ipv4.ip_local_port_range = 1024 65000  
  12.  
  13. net.core.rmem_default = 1048576 
  14.  
  15. net.core.rmem_max = 1048576 
  16.  
  17. net.core.wmem_default = 262144 
  18.  
  19. net.core.wmem_max = 262144 

5. Modify resource limits

Run the root user and add the following line to/etc/security/limits. conf.

 
 
  1. oracle soft nofile 65536  
  2.  
  3. oracle hard nofile 65536  
  4.  
  5. oracle soft nproc 16384  
  6.  
  7. oracle hard nproc 16384 

4. Create related directories

Run the following command as the root user:

 
 
  1. mkdir /opt/oracle  
  2.  
  3. chown oracle:oinstall /opt/oracle 

5. Format and mount the New Hard Disk

Run the following command as the root user:

 
 
  1. [root@gtlions ~]# fdisk -l  
  2.  
  3. [root@gtlions ~]# fdisk /dev/sdb 

Input n p 1 w

 
 
  1. [root@gtlions ~]# mkfs -t ext4 -c /dev/sdb1  
  2.  
  3. [root@gtlions ~]# mkdir /media/newdriver  
  4.  
  5. [root@gtlions ~]# mount /dev/sdb1 /media/newdriver/  
  6.  
  7. [root@gtlions ~]# mkdir /media/newdriver/ora  
  8.  
  9. [root@gtlions ~]# 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

 
 
  1. Cp/etc/redhat-release/etc/redhat-release.bak
  2.  
  3. Change vi/etc/redhat-release
  4.  
  5. # Red Hat Enterprise Linux Server release 6.0 (Santiago)
  6.  
  7. Red Hat 4

8. garbled Problem

Run the command by the oracle user before./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 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

 
 
  1. [root@gtlions ~]# tar zxvf rlwrap-0.37.tar.gz  
  2.  
  3. [root@gtlions ~]# cd rlwrap-0.37  
  4.  
  5. [root@gtlions rlwrap-0.37]# ./configure  
  6.  
  7. [root@gtlions rlwrap-0.37]# make  
  8.  
  9. [root@gtlions 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: Change ORACLE_HOME_LISTNER =/ade/vikrkuma_new/oracle in line 79 to ORACLE_HOME_LISTNER = $ ORACLE_HOME.

Otherwise, an error is returned:

 
 
  1. [oracle@gtlions bin]$ ./dbstart  
  2.  
  3. 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.

 
 
  1. ORACLE_HOME_LISTNER=$ORACLE_HOME  
  2.  
  3. if [ ! $ORACLE_HOME_LISTNER ] ; then  
  4.  
  5. echo “ORACLE_HOME_LISTNER is not SET, unable to auto-stop Oracle Net Listener”  
  6.  
  7. echo “Usage: $0 ORACLE_HOME”  
  8.  
  9. else  
  10.  
  11. LOG=$ORACLE_HOME_LISTNER/listener.log  
  12.  
  13. # Set the ORACLE_HOME for the Oracle Net Listener, it gets reset to  
  14.  
  15. # a different ORACLE_HOME for each entry in the oratab.  
  16.  
  17. export ORACLE_HOME=$ORACLE_HOME_LISTNER  
  18.  
  19. # Stop Oracle Net Listener  
  20.  
  21. if [ -f $ORACLE_HOME_LISTNER/bin/tnslsnr ] ; then  
  22.  
  23. echo “$0: Stoping Oracle Net Listener” >> $LOG 2>&1  
  24.  
  25. $ORACLE_HOME_LISTNER/bin/lsnrctl stop >> $LOG 2>&1 &  
  26.  
  27. else  
  28.  
  29. echo “Failed to auto-stop Oracle Net Listener using $ORACLE_HOME_LISTNER/bin/tnslsnr”  
  30.  
  31. fi  
  32.  
  33. 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 one 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:

 
 
  1. export NLS_LANG=”SIMPLIFIED CHINESE_CHINA.UTF8″  
  2.  
  3. export ORACLE_SID=TEST11G 
  4.  
  5. export ORACLE_BASE=/opt/oracle/db/11g/base  
  6.  
  7. export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1  
  8.  
  9. export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib:  
  10.  
  11. export PATH=$ORACLE_HOME/bin:/usr/bin:/usr/ccs/bin:/etc:/bin:/usr/openwin/bin:/usr/local/bin:/usr/X11R6/bin:  
  12.  
  13. umask 022 

2. The version is restored to its original state.

Change vi/etc/redhat-release to 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 installation and configuration process for the coexistence of Oracle10G and Oracle11G databases on Linux systems is described here, and we hope to bring you some benefits.

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.