Oracle Database Cloning

Source: Internet
Author: User
Tags aliases mkdir fully qualified domain name sqlplus

Oracle on linux multiple servers can be installed with a single copy of multiple clones, simple and fast. ******************************************************* 1. Check if the following packages are installed **************************************************************yum -y install   gcc gcc-c++ make binutils compat-libstdc++-33 compat-libcap1  elfutils-libelf elfutils-libelf-devel glibc  glibc-devel glibc-common   libaio libaio-devel libgcc libstdc++ libstdc++-devel  sysstat    expat ksh unixodbc unixodbc-devel  --Configuration System # grep memtotal /proc/ meminfomemtotal:      4946772 kb# grep swaptotal /proc/ meminfoswaptotal:    12289716 kb# df -hfilesystem             size  used avail use% mounted on /dev/sda2              17g  2.8g   14g  18%  //dev/sda1            1012M    40M  921M   5% /bootnone                   891M     0   891m   0% /dev/shm/dev/hdc               192m  192m     0 100% /media/cdrom******* 2. Parameter Modification ************************************************* 1. Set the required IP2, modify the host file in the/etc/hosts file to add a fully qualified domain name, such as: VI&NBSP;/ETC/HOSTS192.168.50.180&NBSP;&NBSP;VP01   vp01.vpay.com192.168.50.190  vp02  vp02.vpay.com3.  See the results of the changes Hostnamecat  /etc/hosts | grep  ' Eval hostname ' 4, set core parameter 1, add the following line to the/etc/sysctl.conf file: #vi  /etc/sysctl.conffs.suid_dumpable =  1fs.aio-max-nr = 1048576fs.file-max = 6815744kernel.shmmni = 4096#  semaphores: semmsl, semmns, semopm, semmnikernel.sem = 250 32000 100  128net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default=4194304net.core.rmem_ max=4194304net.core.wmem_default=262144net.core.wmem_max=1048586 5, run the following command to change the core parameters: #/sbin/sysctl -p 6, in/etc/ Add the following line to the security/limits.conf file:# vi /etc/security/limits.conforacle            soft    nproc   2047oracle            hard    nproc    16384oracle           soft     nofile  1024oracle           hard    nofile   65536oracle           hard    stack    102407, add the following line to the/etc/pam.d/login file:# vi +13 /etc/pam.d/loginsession     required     pam_limits.so*********************************************** 3. Create the following groups and users **************************************************************groupadd  oinstallgroupadd dbagroupadd operuseradd -g oinstall -g dba,oper -d / home/oracle -m oraclepasswd oracle123********************************************************** 4. Set the environment variables for Oracle users ************************************************************** with Oracle login at:/home/oracle/. At the end of the Bash_profile file, notice that ORACLE_SID is replaced with its own instance name: # vi /home/oracle/.bash_profile can also   #su  -  Oracle#vi .bash_profile IncreaseThe following contents: # oracle settingstmp=/tmp;export tmptmpdir= $TMP; export tmpdiroracle_base=/u01/app/ Oracle;export oracle_baseoracle_home= $ORACLE _base/product/11.2.0/dbhome_1;export oracle_homeoracle_ Sid=jinri;export oracle_sidoracle_term=xterm;export oracle_termpath=/usr/sbin: $PATH;export  Pathpath= $ORACLE _home/bin: $PATH; export pathld_library_path= $ORACLE _home/lib:/lib:/usr/lib;export ld_ Library_pathclasspath= $ORACLE _home/jre: $ORACLE _home/jlib: $ORACLE _home/rdbms/jlib;export classpath#ld_ assume_kernel=2.4.1;export ld_assume_kernel#set languagenls_lang= "SIMPLIFIED CHINESE" _CHINA. al32utf8export  nls_langeditor=viexport editorif [  $USER  =  "Oracle"  ];  thenif [  $SHELL  =  "/bin/ksh"  ]; thenulimit -p 16384ulimit - N 65536elseulimit -u 16384 -n 65536fifialias  oratrace= "cat     $ORACLE _base/diag/rdbms/$ORACLE _sid/$ORACLE _sid/trace/alert_jinri.log "alias  oradata=" cd  $ORACLE _base/oradata/$ORACLE _ SID "alias  oranetwork=" cd  $ORACLE _home/network/admin "alias topc= ' ps -e -o  Pcpu,pid,user,tty,args | sort -n -k 1 -r | head ' alias topm= ' PS  -e -o pmem,pid,user,tty,args | sort -n -k 1 -r | head ' ----Create the necessary data directory #mkdir /u01/backup/  && chown -r    oracle.oinstall  /u01/backup/# mkdir /data/ctl# chown -r    Oracle.oinstall /data/ctl/**************************************************************5. Replica Clone Installation database ****** --1.VP01 gracefully shuts down the database [[email protected] 20760982]$  sqlplus / as sysdbaSQL*Plus: Release 11.2.0.4.0 Production on  Monday  9 Month &NBSP;28&NBSP;18:27:13&NBsp;2015copyright  (c)  1982, 2013, oracle.  all rights reserved. Connect to:  Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 -  64bit productionwith the partitioning, olap, data mining and real The  application testing optionssql> shutdown immediate database is closed. The database has been uninstalled. The oracle  routine has been closed. Sql> exit[[email protected] 20760982]$ lsnrctl stoplsnrctl for linux:  version 11.2.0.4.0 - production on 28-9 Month  -2015 18:27:39copyright   (c)  1991, 2013, oracle.  all rights reserved. Connecting to   (DESCRIPTION= (Address= (PROTOCOL=IPC) (key=extproc1521))) The command executes successfully---2.VP01 package $cd /u01/$tar  czvf oracle.tar.gz /u01/---3.vp01 pass the Oracle installation copy package to VP02SCP  -r -p -p 16335 /u01/oracle.tar.gz  [email protected]:/u01/backup/---4.vp02 decompression Modify Permissions #chown -r   oracle.oinstall /u01/backup/oracle.tar.gz#cd  /u01/backup/# tar zxvf oracle.tar.gz -c /u01/--moving a directory to the previous layer # cd /u01/u01/ &NBSP;&AMP;&AMP;&NBSP;MV&NBSP;APP/&NBSP;&NBSP, .... / && ls /u01/u01/ &&  ls /u01/app/  #rm  -rf / U01/U01---Control file has a copy in a different directory #cp /u01/app/oracle/oradata/jinri/control01.ctl  /data/ctl/control03.ctl #chown  -r   oracle.oinstall  /u01/app/#chown  -R    oracle.oinstall /data/ctl/--relink$cd$relink allwriting relink log to: /u01/app/ Oracle/product/11.2.0/dbhome_1/install/relink.log----5. Modify the Listening parsing file $ cat   /u01/app/oracle/ Product/11.2.0/dbhome_1/network/admin/listener.ora # listener.ora network configuration  file: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora# genErated by oracle configuration tools. Sid_list_listener = (sid_list =     (sid_desc =   (GLOBAL_DBNAME  = jinri)    (Sid_name = jinri)   )  )    listener  =   (description_list =     (description =         (address =  (protocol = tcp) (host = 10.174.157.163) (PORT =  1521))     )  adr_base_listener = /u01/app/oracle[[email   )  protected] ~]$  #将vp01修改为vp02对应IP $ cat   /u01/app/oracle/product/11.2.0/ dbhome_1/network/admin/tnsnames.ora # tnsnames.ora network configuration file: / u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora# generated by oracle  Configuration tools. jinri =   (description =     (address =  (protocol = tcp) (HOST&NBSP;=&NBSP;VP02) (port = 1521))      (connect_data =       (server = dedicated)        (Service_name = jinri)     )   )---- -6. Additional ORACLE home directory cd  $ORACLE _home/oui/bin$  $ORACLE _home/oui/bin/runinstaller –silent - Attachhome -invprtloc /u01/app/orainventory/orainst.loc  oracle_home_name= "OraDb11g_home1"  oracle_home= "/u01/app/oracle/product/11.2.0/dbhome_1" Starting oracle universal installer ... checking swap space: must be greater than 500 mb.    actual 4999 mb    passedthe inventory pointer is located  at /etc/orainst.locthe inventory is located at /u01/app/orainventoryplease  execute the ‘ /u01/app/orainventory/orainstroot.sh '  script at the end of the session. ' Attachhome '  was successful.#/u01/app/orainventory/orainstroot.sh--Pre-registration $ cat /u01/app/ Orainventory/contentsxml/inventory.xml <?xml version= "1.0"  standalone= "yes"  ?><!- - copyright  (c)  1999, 2013, oracle and/or its affiliates. all rights reserved. --><!-- do not modify the contents of  this file by hand. --><INVENTORY><VERSION_INFO>   < Saved_with>11.2.0.4.0</saved_with>   <minimum_ver>2.1.0.6.0</minimum_ver> </VERSION_INFO><HOME_LIST></HOME_LIST><COMPOSITEHOME_LIST></COMPOSITEHOME_LIST> </inventory>--Pre-registration $ cat /u01/app/orainventory/contentsxml/inventory.xml <?xml  Version= "1.0"  standalone= "yes" &nBSP;? ><!-- Copyright  (c)  1999, 2013, oracle and/or its affiliates. all rights reserved. --><!-- do not modify the contents of  this file by hand. --><INVENTORY><VERSION_INFO>   < Saved_with>11.2.0.4.0</saved_with>   <minimum_ver>2.1.0.6.0</minimum_ver> </version_info>


This article is from the "half-displaced 田ぶ" blog, please make sure to keep this source http://zhangzhankuan.blog.51cto.com/12619683/1908392

Oracle Database Cloning

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.