Thread: database cloning
10-20-04, 10:32 #1Registered User
- Join Date
- Nov 2003
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
6)Modify init.ora parameters with appropriate values.
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.
10-20-04, 12:25 #2Registered User
- Join Date
- Sep 2003
- Virginia, USA
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;
copy all datafiles and temfiles to new location. do not copy controlfiles, on-line redo logs, or arclogs.
-- 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.
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
10-20-04, 13:28 #3Registered User
Originally Posted by sridharreddy_d
- Join Date
- Jul 2003
a. delete all the beginning lines until you get to the line:
b. at line 2 change:
CREATE CONTROLFILE REUSE DATABASE "PROD" NORESETLOGS NOARCHIVELOG
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)
e. verify directory PATHS for the redo and datafiles are the correct directories
f. then:PHP Code:
sqlplus "/as sysdba"
alter database open resetlogs;
alter database rename global_name to prodnew;
you can lead someone to something but they will never learn anything ...