背景
環境信息
恢復數據庫(目標端操作)
cat initiyuanduanku.ora
*.control_files=+RESTORE/mubiaoku/control01.ctl,+RESTORE/mubiaoku/control02.ctl, +RESTORE/mubiaoku/control03.ctl
*.db_block_size=8192
*.db_create_file_dest=+restore
*.db_file_name_convert=+DATADG01,+RESTORE,+DATADG02,+RESTORE,+DATADG05,+RESTORE
*.db_name=yuanduan
*.diagnostic_dest=/opt/oracle/diag
*.log_archive_dest_1=location=+RESTORE
*.log_archive_max_processes=5
*.open_cursors=1000
*.sga_max_size=75G
*.shared_pool_size=19G
*.shared_pool_reserved_size=1020054732
*.sga_target=0
*.db_files=2000
sqlplus / as sysdba
startup nomount pfile=’/home/oracle/initiyuanduanku.ora’;
#!/bin/bash
rman target / log=/home/oracle/mubiaoku/rman_control_mubiaoku.log <run{
allocate channel ch00 type sbt_tape;
SEND ‘NB_ORA_SERV=XXX-XXX-BACKUP02-test,NB_ORA_CLIENT=test-dcn’;
restore controlfile from ‘/cntrl_74261_1_test’;
release channel ch00;
}
EOF
Recovery Manager: Release 11.2.0.4.0 - Production on Tue Sep 19 19:40:23 2020
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: mubiaoku (not mounted)
RMAN> 2> 3> 4> 5> 6>
using target database control file instead of recovery catalog
allocated channel: ch00
channel ch00: SID=3 device type=SBT_TAPE
channel ch00: Veritas NetBackup for Oracle - Release 7.7.2 (2016011116)
sent command to channel: ch00
Starting restore at 19-Sep-20
channel ch00: restoring control file
channel ch00: restore complete, elapsed time: 00:00:15
output file name=+RESTORE/mubiaoku/control01.ctl
output file name=+RESTORE/mubiaoku/control02.ctl
output file name=+RESTORE/mubiaoku/control03.ctl
Finished restore at 19-Sep-20
released channel: ch00
RMAN>
Recovery Manager complete.
sqlplus / as sysdba
alter database mount;
調整目標庫在線日志文件位置
alter database rename file +REDODG01/yuanduanku/redo03_1.log to +RESTORE/mubiaoku/redo/redo03_1.log
alter database rename file +REDODG01/yuanduanku/redo02_1.log to +RESTORE/mubiaoku/redo/redo02_1.log
alter database rename file +REDODG01/yuanduanku/redo01_1.log to +RESTORE/mubiaoku/redo/redo01_1.log
alter database rename file +REDODG01/yuanduanku/redo01_3.log to +RESTORE/mubiaoku/redo/redo01_3.log
alter database rename file +REDODG01/yuanduanku/redo02_3.log to +RESTORE/mubiaoku/redo/redo02_3.log
alter database rename file +REDODG01/yuanduanku/redo03_3.log to +RESTORE/mubiaoku/redo/redo03_3.log
alter database rename file +REDODG01/yuanduanku/redo01_2.log to +RESTORE/mubiaoku/redo/redo01_2.log
alter database rename file +REDODG01/yuanduanku/redo02_2.log to +RESTORE/mubiaoku/redo/redo02_2.log
alter database rename file +REDODG01/yuanduanku/redo03_2.log to +RESTORE/mubiaoku/redo/redo03_2.log
alter database rename file +REDODG01/yuanduanku/stbredo01_1.log to +RESTORE/mubiaoku/redo/stbredo01_1.log
alter database rename file +REDODG01/yuanduanku/stbredo02_1.log to +RESTORE/mubiaoku/redo/stbredo02_1.log
alter database rename file +REDODG01/yuanduanku/stbredo03_1.log to +RESTORE/mubiaoku/redo/stbredo03_1.log
alter database rename file +REDODG01/yuanduanku/stbredo04_1.log to +RESTORE/mubiaoku/redo/stbredo04_1.log
alter database rename file +REDODG01/yuanduanku/stbredo05_1.log to +RESTORE/mubiaoku/redo/stbredo05_1.log
......
alter database rename file +REDODG01/yuanduanku/stbredo05_3.log to +RESTORE/mubiaoku/redo/stbredo05_3.log
alter database rename file +REDODG01/yuanduanku/stbredo06_3.log to +RESTORE/mubiaoku/redo/stbredo06_3.log
alter database rename file +REDODG01/yuanduanku/stbredo07_3.log to +RESTORE/mubiaoku/redo/stbredo07_3.log
alter database rename file +REDODG01/yuanduanku/stbredo08_3.log to +RESTORE/mubiaoku/redo/stbredo08_3.log
alter database rename file +REDODG01/yuanduanku/stbredo09_3.log to +RESTORE/mubiaoku/redo/stbredo09_3.log
alter database rename file +REDODG01/yuanduanku/stbredo10_3.log to +RESTORE/mubiaoku/redo/stbredo10_3.log
alter database rename file +DATADG01/yuanduanku/temp01.dbf to +RESTORE/mubiaoku/tempfile/temp01.dbf
alter database rename file +DATADG01/tbs_forum_tmp01.dbf to +RESTORE/mubiaoku/tempfile/tbs_forum_tmp01.dbf
alter database rename file +DATADG01/tbs_sns_tmp01.dbf to +RESTORE/mubiaoku/tempfile/tbs_sns_tmp01.dbf
alter database rename file +DATADG01/tbs_henews_tmp.dbf to +RESTORE/mubiaoku/tempfile/tbs_henews_tmp.dbf
alter database rename file +DATADG01/consume/consume_temp03 to +RESTORE/mubiaoku/tempfile/consume_temp03
alter database rename file +DATADG01/consume/consume_temp04 to +RESTORE/mubiaoku/tempfile/consume_temp04
alter database rename file +DATADG01/tbs_forum_tmp02.dbf to +RESTORE/mubiaoku/tempfile/tbs_forum_tmp02.dbf
調整數據文件位置
在恢復腳本中調整。
恢復腳本:
rman target / log=/home/oracle/mubiaoku/rman_database_mubiaoku.log < run {
set newname for datafile 1 to +RESTORE/mubiaoku/datafile/system01.dbf;
set newname for datafile 2 to +RESTORE/mubiaoku/datafile/sysaux01.dbf;
set newname for datafile 3 to +RESTORE/mubiaoku/datafile/undotbs01.dbf;
set newname for datafile 4 to +RESTORE/mubiaoku/datafile/users01.dbf;
set newname for datafile 5 to +RESTORE/mubiaoku/datafile/undotbs02.dbf;
set newname for datafile 6 to +RESTORE/mubiaoku/datafile/undotbs03.dbf;
set newname for datafile 7 to +RESTORE/mubiaoku/datafile/tbs_henews_dat01.dbf;
set newname for datafile 8 to +RESTORE/mubiaoku/datafile/tbs_henews_dat02.dbf;
set newname for datafile 9 to +RESTORE/mubiaoku/datafile/tbs_henews_dat03.dbf;
......
set newname for datafile 202 to +RESTORE/mubiaoku/datafile/tbs_henews_dat45.dbf;
configure channel device type disk rate 51200k;
allocate channel ch00 typesbt_tape parms=ENV=(NB_ORA_CLIENT=yuanduanku-dcn);
set until time "to_date(2020/09/19 18:40:00,yyyy/mm/dd hh24:mi:ss)";
restore database;
switch datafile all;
recover database;
release channel ch00;
}
EOF
5. open resetlogs 打開數據庫報錯
報錯信息:
SQL> alter database open resetlogs;
alter database open resetlogs
*
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00704: bootstrap process failure
ORA-39700: database must be opened with UPGRADE option
Process ID: 30486
Session ID: 358 Serial number: 3
SQL> ho oerr ora 39700
39700, 00000, "database must be opened with UPGRADE option"
// *Cause: A normal database open was attempted, but the database has not
// been upgraded to the current server version.
// *Action: Use the UPGRADE option when opening the database to run
// catupgrd.sql (for database upgrade), or to run catalog.sql
// and catproc.sql (after initial database creation).
sql>startup upgrade
sql>@$ORACLE_HOME/rdbms/admin/catupgrd.sql
sql>@$ORACLE_HOME/rdbms/admin/utlrp.sql
操作注意事項
文章版權歸作者所有,未經允許請勿轉載,若此文章存在違規行為,您可以聯系管理員刪除。
轉載請注明本文地址:http://specialneedsforspecialkids.com/yun/129722.html
摘要:在企業這場數字化轉型的馬拉松賽跑中,聰明的正在尋求新的技術方案以保護企業的數據和業務安全,而英方不管在技術方案還是在實踐案例方面,都以全新的奔跑姿態與們在同一條跑道的同一水平上。企業數字化轉型就像一場馬拉松賽跑,在漫長的賽道上,哪怕最頂級的選手,也有可能會被后來者趕超。因為在數字化進程中,除了業務方向跑對之外,企業的信息安全是會影響企業戰略大局的關鍵。這絕非危言聳聽,而是有事實依據。美國德克...
閱讀 1347·2023-01-11 13:20
閱讀 1685·2023-01-11 13:20
閱讀 1133·2023-01-11 13:20
閱讀 1860·2023-01-11 13:20
閱讀 4101·2023-01-11 13:20
閱讀 2705·2023-01-11 13:20
閱讀 1386·2023-01-11 13:20
閱讀 3599·2023-01-11 13:20