背景
环境信息
恢复数据库(目标端操作)
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
操作注意事项
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/yun/129722.html
摘要:在企业这场数字化转型的马拉松赛跑中,聪明的正在寻求新的技术方案以保护企业的数据和业务安全,而英方不管在技术方案还是在实践案例方面,都以全新的奔跑姿态与们在同一条跑道的同一水平上。企业数字化转型就像一场马拉松赛跑,在漫长的赛道上,哪怕最顶级的选手,也有可能会被后来者赶超。因为在数字化进程中,除了业务方向跑对之外,企业的信息安全是会影响企业战略大局的关键。这绝非危言耸听,而是有事实依据。美国德克...
阅读 1346·2023-01-11 13:20
阅读 1684·2023-01-11 13:20
阅读 1132·2023-01-11 13:20
阅读 1858·2023-01-11 13:20
阅读 4100·2023-01-11 13:20
阅读 2704·2023-01-11 13:20
阅读 1385·2023-01-11 13:20
阅读 3597·2023-01-11 13:20