rman 使用nbu异机恢复
新建pfile
*.audit_file_dest='/u01/app/oracle/admin/feichedb/adump'
*.audit_trail='db'
*.cluster_database=true
*.compatible='11.2.0.4.0'
*.control_files='+DATA/feichedb/controlfile/current.470.1004697565' #控制文件位置
*.db_block_size=8192
*.db_create_file_dest='+DATA'
*.db_domain=''
*.db_name='feichedb'
*.diagnostic_dest='/u01/app/oracle'
feichedb1.instance_number=1
feichedb2.instance_number=2
*.log_archive_dest_1='location=+DATA/' #设置新的归档日志存储位置。
*.open_cursors=300
*.pga_aggregate_target=2147483648
*.processes=2800
*.remote_login_passwordfile='exclusive'
*.sec_case_sensitive_logon=FALSE
*.sessions=3085
*.sga_target=6442450944
feichedb2.thread=2
feichedb1.thread=1
feichedb1.undo_tablespace='UNDOTBS1'
feichedb2.undo_tablespace='UNDOTBS2'
恢复控制文件
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
33752 Full 16.00M SBT_TAPE 00:00:25 2020-09-09 20:36:40
BP Key: 33752 Status: AVAILABLE Compressed: NO Tag: TAG20200909T203615
Handle: cntrl_33980_1_1050698175 Media: 8270L3
Control File Included: Ckp SCN: 10056308463453 Ckp time: 2020-09-09 20:36:15
run{
allocate channel c1 type 'sbt_tape';
send 'NB_ORA_CLIENT=feichedb1';
RESTORE CONTROLFILE FROM 'cntrl_33980_1_1050698175';
}
恢复数据文件
run {
allocate channel c1 type 'sbt_tape';
allocate channel c2 type 'sbt_tape';
allocate channel c3 type 'sbt_tape';
allocate channel c4 type 'sbt_tape';
allocate channel c5 type 'sbt_tape';
allocate channel c6 type 'sbt_tape';
send 'NB_ORA_CLIENT=feichedb1';
set newname for database to '+bidata/test/datafile_%U'; 新的数据文件存储位置,和原来数据文件位置不同。
restore database;
switch datafile all;
}
恢复归档文件
run{
allocate channel c6 type 'sbt_tape';
send 'NB_ORA_CLIENT=feichedb1';
set until time "to_date('2020-09-09 08:30:00','yyyy-mm-dd hh24:mi:ss')";
recover database;
}
修改redo logfile,tempfile 文件位置
set pagesize 999
set linesize 999
select member from v$logfile ;
select 'alter database rename file '||''''||member||''''||' to '||chr(39)||replace(member,'+DATA/feichedb/onlinelog','+bidata/test/')||''';'
from v$logfile ;
select name from v$tempfile;
select 'alter database rename file '||''''||name||''''||' to '||chr(39)||replace(name,'+DATA/feichedb/tempfile/','+bidata/t02/')||''';'
from v$tempfile ;
select 'alter database rename file '||''''||name||''''||' to '||chr(39)||replace
(name,'/u01/app/oracle/oradata/ora11g//','/u03/app/oracle/oradata/ora11g/')||''';'
from v$datafile ;
数据库打开
alter database open resetlogs;
- 点赞
- 收藏
- 关注作者
评论(0)