How To Migrate ORACLE Database From Filesystem To ASM
1,Using RMAN backup the whole database as copy;
RMAN> backup as copy database;
2,Change the OMF settings;
SQL> alter system set db_create_file_dest='+DA';
SQL> alter system set db_create_online_log_dest_1='+DA';
3,Add the logfile member to exists logfile group
SQL> alter database add logfile member '+DA' to group 1;
SQL> alter database add logfile member '+DA' to group 2;
SQL> alter database add logfile member '+DA' to group 3;
4.Manauly switch logfile three times and drop logfile member which status is inactive.
SQL> alter system switch logfile;
SQL> alter system switch logfile;
SQL> alter system switch logfile;
SQL> alter database drop logfile member '/u01/11.2/dg3/redo02.log';
SQL> alter database drop logfile member '/u01/11.2/dg3/redo01.log';
SQL> alter database drop logfile member '/u01/11.2/dg3/redo03.log';
5,Migrate temp file to ASM
SQL> alter tablespace temp add tempfile '+DA';
SQL>alter database tempfile '/u01/11.2/dg3/temp01.dbf' drop;
6,Change the control file settings;
SQL> alter system set control_files='+DA','+DA' scope=spfile;
7,Start database to nomount;
SQL> startup nomount;
8,In RMAN ,restore Controlfile from the controlfile which on filesystem;
RMAN> restore controlfile from '/u01/11.2/dg3/control01.ctl';
9,Change database state to mount,then restore database;
RMAN> run
{
set newname for datafile 1 to '+DA';
set newname for datafile 2 to '+DA';
set newname for datafile 3 to '+DA';
set newname for datafile 4 to '+DA';
restore database;
switch datafile all;
}
10,Switch database to copy,recover database, then open database.
RMAN> recover database;
RMAN> alter database open;
11,Confirm that all the datafiles have been migrated to ASM.
SQL> select name from v$datafile_header;
SQL> select name from v$tempfile;
SQL> select group#,member from v$logfile;
中式英文,莫笑话偶,欢迎指正.
阅读(2583) | 评论(0) | 转发(0) |