Clonează un Oracle_Home pas cu pas

In acest tutorial vom învață cum sa clonam un Oracle Home din un server in altul. Această sarcină este efectuată în scopul de a clona o de baze de date sau a muta o bază de date. Puteți face acest lucru doar pentru a nu face o nouă instalare sau dacă doriți fișierele binare Oracle sa fie la fel ca și în sursa de baza de date.

  

Vom lucra cu un host Inițial și o gazdă Target care va primi Oracle Home.

  

Vom presupune, de asemenea, că aveți deja oracle instalat pe hostul Initial,    dacă nu aveți Oracle install, atunci va trebui să instalați toate RPM necesare pentru o instalare Oracle.

  • 1-Pe hostul Initial - Găsiți locația Oracle Home
  • HOST:>/home/oracle> . oraenv
    ORACLE_SID = [PER01] ? PER01
    The Oracle base for ORACLE_HOME=/l01/oracle/app/product/10.2.0/dbhome_1 is /l01/oracle/app
    
    HOST:/home/oracle> echo $ORACLE_HOME
    /l01/oracle/app/product/10.2.0/db_1
    
    #Începeți procesul de copiere:
    
    HOST:/l01/oracle/app/product/10.2.0> scp -r dbhome_1/ TARGET:/u02/per01/app/10.2.0
    TARGET's password:
    
    portlist.ini                                                                                                        100%   33     0.0KB/s   00:00
    envVars.properties.bak                                                                                              100% 1100     1.1KB/s   00:00
    changePerm.sh                                                                                                       100%   11KB  11.5KB/s   00:00
    install.excl
     
  • 2- Asigurați-vă că utilizatorul Oracle are toate drepturile pe la noile fișiere binare copiate:
  •  TARGET# chown -R oraper01:oinstall db_1/
    
     
  • 3- Creați o intrare în fișierul "/etc/oratab", indicând noul Oracle Home
  •   

    Asigurați-vă că știți calea către noul Oracle Home și puneți-l în fișierele oratab; în meu cazul

     #Backup file is  /u01/app/oragrd/product/11.2.0/grid/srvm/admin/oratab.bak.xxxx line added by Agent
    #
    
    
    
    # This file is used by ORACLE utilities.  It is created by root.sh
    # and updated by either Database Configuration Assistant while creating
    # a database or ASM Configuration Assistant while creating ASM instance.
    
    # A colon, ':', is used as the field terminator.  A new line terminates
    # the entry.  Lines beginning with a pound sign, '#', are comments.
    #
    # Entries are of the form:
    #   $ORACLE_SID:$ORACLE_HOME:<n|Y>:
    #
    # The first and second fields are the system identifier and home
    # directory of the database respectively.  The third filed indicates
    # to the dbstart utility that the database should , "Y", or should not,
    # "N", be brought up at system boot time.
    #
    # Multiple entries with the same $ORACLE_SID are not allowed.
    #
    #
    +ASM:/u01/app/oragrd/product/11.2.0/grid:N
    PRD:/u01/app/oraprd/product/11.2.0/db1:N
    #Add this line
    PER01:/u02/per01/app/10.2.0/db1:N
    
     
  • 4- Acum conectat la instanta Target fixează variabile și verificați utilitarul sqlplus:
  •  TARGET$ . oraenv
    ORACLE_SID = [PER01] ? PER01
    The /u02/per01/app/10.2.0/db1/bin/orabase binary does not exist
    You can set ORACLE_BASE manually if it is required.
    
    TARGET$ echo $ORACLE_HOME
    /u02/per01/app/10.2.0/db1
    TARGET$ echo $ORACLE_SID
    PER01
    TARGET$ sqlplus / as sysdba
    SQL*Plus: Release 10.2.0.5.0 - Production on Tue Dec 17 15:16:48 2013
    Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.
    
    Connected to an idle instance.
    
    SQL>
    
     

    Ok, puteți vedea că binarele recent copiate in ORACLE_HOME și ORACLE_SID reflectă intrarea noastră fișierul oratab.

  • 5- "Clonează", noul ORACLE_HOME.
  •  

    În cazul în care binarele Oracle Home vor fi legate și organizate cu libs Linux.

     

    Ca opțiune va trebui să declare ORACLE_HOME = "locul către noul Oracle_home" ORACLE_HOME_NAME = "un nume unic al noul ORACLE_HOME "   ORACLE_BASE = "locul către noul Oracle_Base"

    TARGET# cd /u02/per01/app/10.2.0/db1/oui/bin/
    TARGET# ll
    total 296
    -rwxr-xr-x 1 oraper01 oinstall    168 Dec 17 15:39 addLangs.sh
    -rw-r--r-- 1 oraper01 oinstall    189 Dec 17 14:27 addLangs.sh.ouibak
    -rwxr-xr-x 1 oraper01 oinstall     88 Dec 17 15:39 addNode.sh
    -rw-r--r-- 1 oraper01 oinstall    102 Dec 17 14:27 addNode.sh.ouibak
    -rwxr-xr-x 1 oraper01 oinstall    276 Dec 17 15:39 attachHome.sh
    -rw-r--r-- 1 oraper01 oinstall    297 Dec 17 14:27 attachHome.sh.ouibak
    -rwxr-xr-x 1 oraper01 oinstall    183 Dec 17 15:39 detachHome.sh
    -rw-r--r-- 1 oraper01 oinstall    204 Dec 17 14:27 detachHome.sh.ouibak
    -rwxr-xr-x 1 oraper01 oinstall  51104 Dec 17 14:27 lsnodes
    -rwxr-xr-x 1 oraper01 oinstall    335 Dec 17 14:27 ouica.bat
    -rwxr-xr-x 1 oraper01 oinstall    453 Dec 17 15:39 ouica.sh
    -rw-r--r-- 1 oraper01 oinstall    551 Dec 17 14:27 ouica.sh.ouibak
    drwxr-x--- 2 oraper01 oinstall   4096 Dec 17 14:27 resource
    -rwxr-xr-x 1 oraper01 oinstall   1109 Dec 17 15:39 runConfig.sh
    -rw-r--r-- 1 oraper01 oinstall   1249 Dec 17 14:27 runConfig.sh.ouibak
    -rwxr-xr-x 1 oraper01 oinstall 175027 Dec 17 14:27 runInstaller
    -rwxr-xr-x 1 oraper01 oinstall     65 Dec 17 15:39 runInstaller.sh
    -rw-r--r-- 1 oraper01 oinstall     79 Dec 17 14:27 runInstaller.sh.ouibak
    
    
    TARGET$ ./runInstaller -silent -clone 
                            ORACLE_HOME="/u02/per01/app/10.2.0/db1" 
                            ORACLE_HOME_NAME="10per01" 
                            ORACLE_BASE="/u02/per01/app"
    Starting Oracle Universal Installer...
    
    No pre-requisite checks found in oraparam.ini, no system pre-requisite checks will be executed.
    Preparing to launch Oracle Universal Installer from /tmp/OraInstall2013-12-17_03-38-47PM. Please wait ...
    Oracle Universal Installer, Version 10.2.0.5.0 Production
    Copyright (C) 1999, 2010, Oracle. All rights reserved.
    
    You can find a log of this install session at:
     /u01/app/oraInventory/logs/cloneActions2013-12-17_03-38-47PM.log
    ...................................................................... 100% Done.
    Installation in progress (Tuesday, December 17, 2013 3:39:02 PM BRST)
    ...................................................................... 75% Done.
    Install successful
    Linking in progress (Tuesday, December 17, 2013 3:39:10 PM BRST)
    Link successful
    Setup in progress (Tuesday, December 17, 2013 3:39:35 PM BRST)
    Setup successful
    End of install phases.(Tuesday, December 17, 2013 3:39:37 PM BRST)
    WARNING:
    The following configuration scripts need to be executed as the "root" user.
    #!/bin/sh
    #Root script to run
    /u02/per01/app/10.2.0/db1/root.sh
    To execute the configuration scripts:
        1. Open a terminal window
        2. Log in as "root"
        3. Run the scripts
    The cloning of 10per01 was successful.
    Please check '/u01/app/oraInventory/logs/cloneActions2013-12-17_03-38-47PM.log' for more details.
    ^C
    TARGET$ exit
    logout
    TARGET# /u02/per01/app/10.2.0/db1/root.sh
    Running Oracle 10g root.sh script...
    
    The following environment variables are set as:
        ORACLE_OWNER= oraper01
        ORACLE_HOME=  /u02/per01/app/10.2.0/db1
    
    Enter the full pathname of the local bin directory: [/usr/local/bin]:
    The file "dbhome" already exists in /usr/local/bin.  Overwrite it? (y/n)
    [n]: n
    The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
    [n]: n
    The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
    [n]:
    
    Entries will be added to the /etc/oratab file as needed by
    Database Configuration Assistant when a database is created
    Finished running generic part of root.sh script.
    Now product-specific root actions will be performed.
    
     

    Și cam atât binarele de baze de date sunt gata să pornească o instanță de baze de date Oracle.