Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003
    Location
    kualalumpur
    Posts
    89

    Unanswered: database cloning

    Hello Oracle DBAs,
    Iam working on Solaris 5.8 and oracle 9i Rel.2.
    Our production database has to be shifted to another disk partition with different DATABASE name.
    Say..currently the database is running on /u03 ..(db_name 'prod') now it has to be moved to /u07 with different name with db_name 'prod_new'.
    Iam trying to do Database cloning using the following procedure.
    1)Login to prod db.
    2)Backup controlfile to trace(Alter database backup controlfile to trace)
    3)Shutdown prod database
    4)copying database files from /u03 to /u07
    5)Login prod_new
    6)Modify init.ora parameters with appropriate values.
    control_files ,db_name,
    background_dump_dest,core_dump_dest,user_dump_dest , log_archive_dest
    7)Modify the backup controlfile and save as prod_new_create_controlfile.sql
    8)Execute the script file.
    ..here the control file is getting created but for next step in control file(script file) Iam getting the following error:

    Control file created.

    BEGIN :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('DEFAULT DEVICE TYPE TO','DISK'); END;

    *
    ERROR at line 1:
    ORA-01649: operation not allowed with a backup controlfile
    ORA-06512: at "SYS.X$DBMS_BACKUP_RESTORE", line 3445
    ORA-06512: at line 1

    Iam using the HOT BACKUP USING RMAN.

    Please help me in this regard.
    thanking you.
    sridhar

  2. #2
    Join Date
    Sep 2003
    Location
    Virginia, USA
    Posts
    246
    If you are shutting down the database before copying files, then why are you using RMAN to make a hot backup copy? This would be much easier if not renaming the database, which I don't think you need to do since you can use a service name and global database name that are unique. But, anyways ...

    -- for your old database.
    alter system enable restricted session;
    alter system switch logfile; -- repeat a few times.
    alter database backup controlfile to trace;
    shutdown immediate;
    copy all datafiles and temfiles to new location. do not copy controlfiles, on-line redo logs, or arclogs.
    startup;

    -- for the new database.
    edit the trace file created by the backup controlfile to trace command. If it has two sections, delete the section that pertains to noresetlogs. Make sure all of the file locations are correct.
    startup nomount
    run the trace file's commands to create new control files, recover database, open resetlogs, and recreate tempfiles (since those are never recovered.)
    MarkRem
    Author, Oracle Database 10g: From Nuts to Soup
    http://www.remidata.com/book_nuts2soup.htm

  3. #3
    Join Date
    Jul 2003
    Posts
    2,296
    Quote Originally Posted by sridharreddy_d
    Iam trying to do Database cloning using the following procedure.
    7)Modify the backup controlfile and save as prod_new_create_controlfile.sql
    8)Execute the script file.
    ..here the control file is getting created but for next step in control file(script file)
    you need to edit your controlfile script (prod_new_create_controlfile.sql)

    a. delete all the beginning lines until you get to the line:
    "STARTUP NOMOUNT"
    b. at line 2 change:
    CREATE CONTROLFILE REUSE DATABASE "PROD" NORESETLOGS NOARCHIVELOG
    to:
    create controlfile SET database "prod_new" RESETLOGS noarchivelog

    c. delete the last 7 lines (all lines) beginning with:
    # Recovery is required ...
    d. replace all references to the SOURCE sid with the new destination sid
    (vi editor command line to replace strings in a file)
    %s/prod/prodnew/g
    e. verify directory PATHS for the redo and datafiles are the correct directories
    f. then:
    PHP Code:
    sqlplus "/as sysdba"
    @prod_new_create_controlfile.sql
            
            alter database open resetlogs
    ;
            
    shutdown;  
            
    startup;
        
            
    alter database rename global_name to prodnew
    - The_Duck
    you can lead someone to something but they will never learn anything ...

Posting Permissions

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