DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: Clone from one server to other server

  1. #1
    Join Date
    Aug 2008
    Posts
    123

    Clone from one server to other server

    hi,

    I am running 10.2.0.4 database systeem. I need to clone databsae from deve to test server.

    How can i do that.

    I know basic so please tell me steps in details please:

    1) controlfile backup

    2) shut down dev database c

    3) copy datafile from dev to test server

    4) edit controfile backup: (what i need to do here)

    5)create file structure on test server

    6) edit init.ora file

    7) start new database (HOW) on Test?

    thanks: I really need help at step 4 and 7

    thanks

  2. #2
    Join Date
    Jul 2006
    Posts
    195
    These steps are applicable on UNIX you can conver to win-dozeeeee
    Good luck


    STEP 1: On the old system, go into SQL*Plus, sign on as SYSDBA and issue:
    “alter database backup controlfile to trace”.

    This will put the create database syntax in the trace file directory. The trace keyword tells oracle to
    generate a script containing a create controlfile command
    and store it in the trace directory identified in the
    user_dump_dest parameter of the init.ora file.

    It will look something like this:

    STARTUP NOMOUNT
    CREATE CONTROLFILE REUSE DATABASE "OLDLSQ" NORESETLOGS
    NOARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 2
    MAXDATAFILES 240
    MAXINSTANCES 1
    MAXLOGHISTORY 113
    LOGFILE
    GROUP 1 ('/u03/oradata/oldlsq/log1a.dbf',
    '/u03/oradata/olslsq/log1b.dbf') SIZE 30M,
    GROUP 2 ('/u04/oradata/oldlsq/log2a.dbf',
    '/u04/oradata/oldlsq/log2b.dbf') SIZE 30M
    DATAFILE
    '/u01/oradata/oldlsq/system01.dbf',
    '/u01/oradata/oldlsq/mydatabase.dbf'
    ;
    # Recovery is required if any of the datafiles are restored
    # backups, or if the last shutdown was not normal or immediate.
    RECOVER DATABASE
    # Database can now be opened normally.
    ALTER DATABASE OPEN;


    STEP 2: Shutdown the old database

    STEP 3: Copy all data files into the new directories on the new server. You may change the file names if you want, but you must edit the controlfile to reflect the new data files names on the new server.

    rcp /u01/oradata/oldlsq/* newhost:/u01/oradata/newlsq
    rcp /u01/oradata/oldlsq/* newhost:/u01/oradata/newlsq
    rcp /u03/oradata/oldlsq/* newhost:/u03/oradata/newlsq
    rcp /u04/oradata/oldlsq/* newhost:/u04/oradata/newlsq


    STEP 4: Copy and Edit the Control file – Using the output syntax from STEP 1,
    modify the controlfile creation script by changing the following:

    Old:

    CREATE CONTROLFILE REUSE DATABASE "OLDLSQ" NORESETLOGS

    New:

    CREATE CONTROLFILE SET DATABASE "NEWLSQ" RESETLOGS

    STEP 5: Remove the “recover database” and “alter database open” syntax

    # Recovery is required if any of the datafiles are restored
    # backups, or if the last shutdown was not normal or immediate.
    RECOVER DATABASE
    # Database can now be opened normally.
    ALTER DATABASE OPEN;


    STEP 6: Re-names of the data files names that have changed.

    Save as db_create_controlfile.sql.

    Old:

    DATAFILE
    '/u01/oradata/oldlsq/system01.dbf',
    '/u01/oradata/oldlsq/mydatabase.dbf'

    New:

    DATAFILE
    '/u01/oradata/newlsq/system01.dbf',
    '/u01/oradata/newlsq/mydatabase.dbf'

    STEP 7: Create the bdump, udump and cdump directories

    cd $DBA/admin
    mkdir newlsq
    cd newlsq
    mkdir bdump
    mkdir udump
    mkdir cdump
    mkdir pfile


    STEP 8: Copy-over the old init.ora file

    rcp $DBA/admin/olslsq/pfile/*.ora newhost:/u01/oracle/admin/newlsq/pfile

    STEP 9: Start the new database

    @db_create_controlfile.sql

    STEP 10: Place the new database in archivelog mode


    If you are using RMAN you can do this:

    1) From the command prompt create a password file for the AUX database.

    orapwd file=$ORACLE_HOME/dbs/orapwaux password=sys entries=5


    2) Create a parameter file from the spfile for the AUX database. Ensure that the ORACLE_SID
    is set to the DB you want to clone.

    sqlplus / AS sysdba

    create pfile='/oracle/10.2.0.1.0/dbs/initaux.ora' from spfile;

    3) Edit the file /oracle/10.2.0.1.0/dbs/initaux.ora;
    change all occurrences of "pri" to "aux". Next change db_name and instance_name to aux.

    Then add the following two lines to the parameter file:

    db_file_name_convert=('/oracle/data/pri','/oracle/data/aux')
    log_file_name_convert=('/oracle/data/pri','/oracle/data/aux')


    4) create the following directories mkdir udump arch bdump audit cdump

    5) Edit tnsnames.ora and listener.ora files to add the AUX entry

    6. Shutdown and startup the listener.ora. From the command prompt type the follow:

    lsnrctl stop

    lsnrctl start

    7) From RMAN, type the following commands.

    RMAN
    CONNECT AUXILIARY SYS/SYS@GOLD_AUX
    CONNECT TARGET SYS/SYS@GOLD_PRI
    STARTUP CLONE NOMOUNT FORCE;
    DUPLICATE TARGET DATABASE TO AUX;

    8) Remove the following entries from initaux.ora

    db_file_name_convert=('/oracle/data/pri','/oracle/data/aux')
    log_file_name_convert=('/oracle/data/pri','/oracle/data/aux')

    9) Login into "aux" DB and create and spfile

    create spfile from pfile='/oracle/10.2.0.1.0/dbs/initaux.ora';

    10) Register AUX database with catalog for backups

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width