Migrating from File system to ASM using backup as copy.
1. Run the following command to create the initial copy of the database into ASM:
Run {
Allocate channel t1 device type disk format ‘+DATA01’;
Allocate channel t2 device type disk format ‘+DATA01’;
Backup incremental level 1 for recover of copy database;
}
Since there is no previous copy of the database, this will create the initial backup.
2. Run this command as necessary to keep the copy current:
Run {
Allocate channel t1 device type disk format ‘+DATA01’;
Allocate channel t2 device type disk format ‘+DATA01’;
Backup incremental level 1 for recover of copy database;
Recover copy of database;
Backup as copy current controlfile format ‘/home/oracle/control01.ctl’;
}
3. When ready to switch, run these commands:
SQL> alter system set control_files=’+DATA01/ctl1.f’ scope=spfile;
SQL>alter system set db_recovery_file_dest=’+DATA01’ scope=spfile;
SQL>alter system set db_create_file_dest=’+DATA01 scope=spfile;
4. Now switch to rman.
RMAN> shutdown immediate; -- start of downtime
RMAN>startup nomount;
RMAN>restore controlfile from ‘/home/oracle/control01.ctl’;
RMAN>alter database mount;
RMAN>switch database to copy;
RMAN>recover database;
RMAN> Run {
set newname for tempfile 1 to ‘+DATA01’;
set newname for tempfile 2 to ‘+DATA01’;
switch tempfile all;
}
RMAN>alter database open; --downtime is complete at this point:
5. Move redo logs to ASM.
6. Migrate spfile to ASM.
7. Create additional copy of controlfile and add to spfile.
No comments:
Post a Comment