文件系统异机恢复到ASM中

文件系统异机恢复到ASM中
源端:
操作系统:Red Hat Enterprise Linux Server release 5.5 (Tikanga)
数据库:11.2.0.3
使用文件系统
目标:
操作系统:Enterprise Linux Enterprise Linux Server release 5.8 (Carthage)
数据库:11.2.0.3
使用ASM


源端:
把源端的全备、增量、控制文件和spfiile、归档日志等文件上传到目标机对应的目录中。
目标:
restore spfile from '/orabak/c-1050479108-20090122-1f';
vi spfile
mkdir -p  /u01/app/..
restore controlfile from '/orabak/c-1050479108-20090204-1c';
startup force
alter database backup controlfile to trace as '/home/oracle/conctl.txt';
orapwd file=$ORACLE_HOME/dbs/orapwb2b entries=10 force=y password=oracle
list backup; 
catalog start with '/orabak/';  
catalog start with '/orabak/INCR1_xxxx_20121223_131_802742712'; 


  select name from v$datafile  
  union all  
  select name from v$tempfile  
  union all  
  select member from v$logfile  
  union all  
  select name from v$controlfile  


restore database until scn xxxxxx preview;

restore database until time 'yyyymmdd hh24:mi:ss' preview;


run  
{  
set newname for datafile 1 to '+DATA';  
set newname for datafile 2 to '+DATA'; 
set newname for datafile 3 to '+DATA'; 
set newname for datafile 4 to '+DATA';
set newname for datafile 5 to '+DATA';  
set newname for datafile 6 to '+DATA'; 
set newname for tempfile 10 to '+DATA'; 
restore database;  
switch datafile all;  
switch tempfile all;  
}  


alter database register physical logfile '/arch/thread_1_seq_322.290.796091183';


recover dtabase;


SQL> alter database rename file '/onlinelog/group_1.257.826495121' to '+DATA'; 
  
Database altered.  
  
SQL> alter database rename file '/onlinelog/group_1.261.826495119' to '+DATA'; 
  
Database altered.  
  
SQL> alter database rename file '/onlinelog/group_2.258.826495125' to '+DATA'; 
  
Database altered.  
  
select group#,member from v$logfile order by 1 




--scn 
select file#,to_char(checkpoint_change#,'999999999999999') "SCN",    to_char(last_change#,'999999999999999')"STOP_SCN" from v$datafile;
select file#,to_char(checkpoint_change#,'999999999999999') "SCN" from v$datafile_header;
  
select min(to_char(checkpoint_change#,'999999999999999')) "MIN_SCN",
max(to_char(checkpoint_change#,'999999999999999')) "MAX_SCN"
from v$datafile;


select min(to_char(checkpoint_change#,'999999999999999')) "MIN_SCN",
max(to_char(checkpoint_change#,'999999999999999')) "MAX_SCN"
from v$datafile_header;


 
alter database open resetlogs;  
drop tablespace undotbs2 including contents and datafiles;  

你可能感兴趣的:(文件系统异机恢复到ASM中)