If you need to install more database servers, it is still very slow and cumbersome to install the database software graphically. Oracle 11g provides a way to clone the installation.
The steps are as follows:
Use the normal method to install Oracle on Server A.
Pack the $oracle_home on the A machine, db_home1.zip.
Prepare the environment of B machine, such as creating user, setting up user, modifying kernel parameters, modifying environment variables and so on.
Copy the ZIP package to Server B and unzip to any directory.
Execute Clone command
Pack A on the machine
[Email protected] oracle]# zip-r db_1.zip/u01/app/oracle/product/11.2.0/db_1/
2. Prepare the B machine environment
[Email protected] inst_env_scripts]#/1preusers.sh [[email protected] inst_env_scripts]#./2predir.sh [Email Protected] inst_env_scripts]#/3prelimits.sh[[email protected] inst_env_scripts]#./4presysctl.sh
The script content is as follows
[[Email protected] inst_env_scripts]# cat 1preusers.sh #!/bin/bash#purpose:create 3 groups named ' Oinstall ', ' dba ', ' Oper ', plus 1 users named ' Oracle '. #Also setting the environment#variable for oracle user. #variable For grid user. #Usage: Log on as the superuser (' root '), And then execute the command:#./1preusers.sh#Author:ding liqing echo "now create 3 groups named ' Oinstall ', ' dba ', ' oper ', ' echo ' plus 1 users named ' Oracle ', Also setting the environment "groupadd -g 1000 oinstall groupadd -g 1300 dba groupadd -g 1301 oper useradd -u 1101 -g oinstall -G dba,oper -d /home/oracle -s /bin/bash -c "Oracle software owner " oracle echo "Oracle" | passwd --stdin oracleecho "Export tmp=/tmp" >> / home/oracle/.bash_profile echo ' export tmpdir= $TMP ' >>/home/oracle/.bash_profile echo "EXPORT ORACLE_SID=ORCL" >> /home/oracle/.bash_profile echo "Export oracle_base=/u01/app/oracle ">> /home/oracle/.bash_profileecho " export oracle_home=$ Oracle_base/product/11.2.0/db_1 ' >> /home/oracle/.bash_profileecho ' export tns_admin=$ Oracle_home/network/admin ' >> /home/oracle/.bash_profileecho ' export path=/usr /sbin: $PATH ' >> /home/oracle/.bash_profileecho ' export path= $ORACLE _home/bin: $PATH ' > > /home/oracle/.bash_profileecho ' export ld_library_path= $ORACLE _home/lib:/lib:/usr/lib ' > > /home/oracle/.bash_profileecho ' export classpath= $ORACLE _home/jre: $ORACLE _home/jlib:$ Oracle_home/rdbms/jlib ' >> /home/oracle/.bash_profileecho "Export editor=vi" >> /home/oracle/.bash_ profileecho "Export lang=en_us" >> /home/oracle/.bash_profileecho "export Nls_lang=american_america. Al32utf8 " >> /home/oracle/.bash_profileecho " export nls_date_format= ' Yyyy/mm/dd hh24:mi:ss ' " >> /home/oracle/.bash_profileecho " umask 022 ">> /home/ oracle/.bash_profile echo "The groups and users has been created" Echo "The environment for oracle also has been set successfully"
[[email protected] inst_env_scripts]# cat 2predir.sh #!/bin/bash#Purpose:Create the necessary directory for oracle users And change the authention to oracle users. #Usage: Log on as the superuser (' root '), and then execute the command:#./2predir.sh#author:ding liqing echo "now create the necessary directory for oracle users And change the authention to oracle users ... "mkdir -p /u01/app/ oraclechown -r oracle:oinstall /u01chmod -r 775 /u01echo "The Necessary directory for oracle users and change the authention to oracle users has been finished "
[[Email protected] inst_env_scripts]# cat 3prelimits.sh #!/bin/bash#purpose:change the /etc/security/limits.conf. #Usage: Log on as the superuser (' root '),and then execute the command:#./3prelimits.sh#author:ding lq echo "Now modify the /etc/security/limits.conf,but backup it named /etc/security/limits.conf.bak before "cp /etc/security/limits.conf /etc/security/limits.conf.bakecho " Oracle soft nproc 2047 " >>/etc/security/limits.confecho " oracle hard nproc 16384 " >>/etc/security/limits.confecho " oracle soft nofile 1024 " >>/etc/ security/limits.confecho "oracle hard nofile 65536" >>/etc/security/ limits.confecho "Modifing the /etc/security/limits.conf has been succeed."
#Usage: Log on as the superuser (' root '), and then execute the command:#. /4presysctl.sh#author:ding liqing echo "Now modify the /etc/sysctl.conf,but with a backup named /etc/sysctl.bak "cp /etc/sysctl.conf /etc/ sysctl.conf.bak echo "fs.aio-max-nr = 1048576" >> /etc/sysctl.confecho "fs.file-max = 6815744" >> /etc/sysctl.confecho "kernel.shmall = 2097152 " >> /etc/sysctl.confecho " kernel.shmmax = 1054472192 " > > /etc/sysctl.confecho "kernel.shmmni = 4096" >> /etc/sysctl.confecho "kernel.sem = 250 32000 100 128" >> /etc/sysctl.confecho " net.ipv4.ip_local_port_range = 9000 65500 " >> /etc/sysctl.confecho " net.core.rmem_default = 262144 " >> /etc/sysctl.confecho "net.core.rmem_max = 4194304" >> /etc/ sysctl.confecho "net.core.wmem_default = 262144" >> /etc/sysctl.confecho " net.core.wmem_max = 1048586 " >> /etc/sysctl.confecho " net.ipv4.tcp_wmem = 262144 262144 262144 " >> /etc/sysctl.confecho " net.ipv4.tcp_rmem = 4194304 4194304 4194304 " >> /etc/sysctl.conf echo " modifing the /etc/sysctl.conf has been succeed. " echo "Now make the changes take effect ..." sysctl -p
3. Copy the ZIP package on the A machine to the B machine
[[Email protected] inst_env_scripts]# scp 192.168.199.163:/home/oracle/db_1.zip /home /oracle/the authenticity of host ' 192.168.199.163 (192.168.199.163) ' can ' t Be established. rsa key fingerprint is cc:d0:c3:de:37:33:a7:cb:91:40:c5:5f:18:07:06:9f. are you sure you want to continue connecting (yes/no)? yesWarning : permanently added ' 192.168.199.163 ' (RSA) to the list of known hosts. [email protected] ' s password: db_1.zip 100% 2366mb 30.0mb/s 01:19
4. Unzip the zip file
[Email protected] oracle]# unzip-d/db_1.zip [[email protected] oracle]# chown-r oracle.oinstall/u01/
5. Execute the Clone command
[Email protected] ~]$ cd/u01/app/oracle/product/11.2.0/db_1/clone/bin/[[email protected] bin]$ $ORACLE _home/perl/ Bin/perl clone.pl oracle_base= "/u01/app/oracle/" oracle_home= "/u01/app/oracle/product/11.2.0/db_1" OSDBA_GROUP=dba Osoper_group=oper-defaulthomename
Execution results are as follows
./runinstaller -clone -waitforcompletion "oracle_base=/u01/app/oracle/" "ORACLE_HOME =/u01/app/oracle/product/11.2.0/db_1 " " ORACLE_INSTALL_OSDBA=DBA " " Oracle_install_osoper=oper " - Defaulthomename -defaulthomename -silent -noconfig -nowait starting oracle universal installer ... checking swap space: must be greater than 500 mb. Actual 1999 mb passedpreparing to launch oracle universal  INSTALLER FROM /TMP/ORAINSTALL2015-08-22_05-13-13AM. PLEASE WAIT&NBSP, ..... oracle universal installer, version 11.2.0.4.0 productioncopyright (C) 1999 , 2013, oracle. all rights reserved. you can find the log of this install session at: /u01/app/ Orainventory/logs/cloneactions2015-08-22_05-13-13am.log ..... ..... ..... ..... .......................... ..... ..... ..... ..... ..... ............... ......... 100% Done.Installation in progress (saturday, august 22, 2015 5:13:31 AM CST) .............................................................................. 78% Done.Install successfullinking in progress (saturday, august 22, 2015 5:13:38 am  CST) link successfulsetup in progress (saturday, august 22, 2015 5:13:41 AM CST) setup successfulend of install phases. (saturday, august 22, 2015 5:14:06 AM CST) Warning:a new inventory has been created in this session. however, it has not yet been registered as the central inventory of this system. to register the new inventory please run the script '/u01/app/ Orainventory/orainstroot.sh ' with root privileges. If you do not Register the inventory, you may not be able to update or patch the products you installed. The following configuration scripts need to be executed as the "Root" user./u01/app/oraInventory/orainstRoot.sh/u01/app/oracle/product/11.2.0/db_1/root.shTo Execute the configuration scripts: 1. open a terminal window 2. log in as "Root" 3. Run the scripts the cloning of orahome1 was successful. please check '/u01/app/orainventory/logs/cloneactions2015-08-22_05-13-13am.log ' for more details.
6. Run the two scripts above using the root user
[Email protected] ~]#/u01/app/orainventory/orainstroot.sh[[email protected] ~]#/u01/app/oracle/product/11.2.0/db_ 1/root.sh
Installation is complete!
This article is from the "Ding Dong" blog, please be sure to keep this source http://lqding.blog.51cto.com/9123978/1686940
11g Clone installation of Oracle learning