rac到单机rman 恢复

举报
snowofsummer 发表于 2021/09/16 19:53:40 2021/09/16
【摘要】 1.修改pfile文件源pfile文件信息:zmsft2.__db_cache_size=56103010304zmsft1.__db_cache_size=48318382080zmsft2.__java_pool_size=134217728zmsft1.__java_pool_size=939524096zmsft2.__large_pool_size=671088640zmsft1....

1.修改pfile文件

源pfile文件信息:

zmsft2.__db_cache_size=56103010304
zmsft1.__db_cache_size=48318382080
zmsft2.__java_pool_size=134217728
zmsft1.__java_pool_size=939524096
zmsft2.__large_pool_size=671088640
zmsft1.__large_pool_size=671088640
zmsft1.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
zmsft2.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
zmsft2.__pga_aggregate_target=16106127360
zmsft1.__pga_aggregate_target=16106127360
zmsft2.__sga_target=64424509440
zmsft1.__sga_target=64424509440
zmsft2.__shared_io_pool_size=0
zmsft1.__shared_io_pool_size=0
zmsft2.__shared_pool_size=7113539584
zmsft1.__shared_pool_size=14092861440
zmsft2.__streams_pool_size=0
zmsft1.__streams_pool_size=0
*._deferred_log_dest_is_valid='FALSE'
*.audit_file_dest='/u01/app/oracle/admin/zmsft/adump'
*.audit_trail='NONE'
*.cluster_database=true
*.compatible='11.2.0.4.0'
*.control_files='+NEWDATA/newzmsft/controlfile/control.ctl'
*.db_block_size=8192
*.db_create_file_dest='+NEWDATA'
*.db_domain=''
*.db_files=2000
*.db_name='zmsft'
*.db_recovery_file_dest_size=322122547200
*.deferred_segment_creation=FALSE
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=zmsftXDB)'
*.fal_client='ZMRES'
zmsft1.instance_number=1
zmsft2.instance_number=2
zmsft1.local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.0.63)(PORT=1521))))'
*.log_archive_config='dg_config=(zmsft,zmdg,zmsftdg)'
*.log_archive_dest_1='location=+newdata valid_for=(all_logfiles,all_roles) db_unique_name=zmsft'
*.log_archive_dest_2='service=zmtar arch async valid_for=(online_logfiles,primary_role) db_unique_name=zmdg'
*.log_archive_dest_3='service=zmsftdg arch async valid_for=(online_logfiles,primary_role) db_unique_name=zmsftdg'
*.log_archive_dest_state_2='enable'
*.log_archive_dest_state_3='ENABLE'
*.log_archive_format='%t_%s_%r.dbf'
*.log_archive_max_processes=20
*.open_cursors=4000
*.open_links=50
*.open_links_per_instance=50
*.optimizer_mode='ALL_ROWS'
*.pga_aggregate_target=16106127360
*.processes=1200
*.remote_listener='scan:1521'
*.remote_login_passwordfile='exclusive'
*.sessions=890
*.sga_max_size=64424509440
*.sga_target=64424509440
zmsft2.thread=2
zmsft1.thread=1
*.undo_retention=3600
zmsft1.undo_tablespace='UNDOTBS1'
zmsft2.undo_tablespace='UNDOTBS2'

修改之后的pfile文件:

#注意建立相关日志文件位置:

#*.audit_file_dest='/u01/app/oracle/admin/zmsft/adump'

#*.log_archive_dest_1='location=/testora/arc'

#*.diagnostic_dest='/u01/app/oracle'

#*.control_files='/testora/control.ctl'

$ cat initzmsft1.ora
*.audit_file_dest='/u01/app/oracle/admin/zmsft/adump'
*.audit_trail='NONE'
*.compatible='11.2.0.4.0'
*.control_files='/testora/control.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_files=2000
*.db_name='zmsft'
*.db_recovery_file_dest_size=322122547200
*.deferred_segment_creation=FALSE
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=zmsftXDB)'
*.fal_client='ZMRES'
zmsft1.instance_number=1
zmsft2.instance_number=2
*.log_archive_dest_1='location=/testora/arc'
*.log_archive_format='%t_%s_%r.dbf'
*.log_archive_max_processes=20
*.open_cursors=4000
*.open_links=50
*.open_links_per_instance=50
*.optimizer_mode='ALL_ROWS'
*.pga_aggregate_target=16106127360
*.processes=1200
*.sessions=890
*.sga_max_size=64424509440
*.sga_target=64424509440
zmsft2.thread=2
zmsft1.thread=1
*.undo_retention=3600
zmsft1.undo_tablespace='UNDOTBS1'
zmsft2.undo_tablespace='UNDOTBS2'


2,恢复控制文件

run{
allocate channel c1 type 'sbt_tape';
send 'NB_ORA_CLIENT=rac1';
RESTORE CONTROLFILE FROM 'cntrl_132738_1_1024120713';
}


3,恢复数据文件,并改位置

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=rac1';
set newname for database to '/testora/data/datafile_%U';
restore database;
switch datafile all;
}

#和控制文件数据库文件位置不一致,重新切换目录位置。
#catalog start with '/testora/data/';
#switch database to copy;

4,恢复归档文件

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=rac1';
recover database until  sequence 172450 thread 2;
}


5,更文件位置redo,tempfile

alter database rename file '+NEWDATA/zmsft/onlinelog/group_11.319.866774651' to '/testora/data/group_11.319.866774651';
alter database rename file '+NEWDATA/zmsft/onlinelog/group_12.320.866774673' to '/testora/data/group_12.320.866774673';
alter database rename file '+NEWDATA/zmsft/onlinelog/group_13.321.866774673' to '/testora/data/group_13.321.866774673';
alter database rename file '+NEWDATA/zmsft/onlinelog/group_14.322.866774675' to '/testora/data/group_14.322.866774675';
alter database rename file '+NEWDATA/zmsft/onlinelog/group_15.323.866774675' to '/testora/data/group_15.323.866774675';
alter database rename file '+NEWDATA/zmsft/onlinelog/group_16.324.866774677' to '/testora/data/group_16.324.866774677';
alter database rename file '+NEWDATA/zmsft/onlinelog/group_17.325.866774677' to '/testora/data/group_17.325.866774677';
alter database rename file '+NEWDATA/zmsft/onlinelog/group_18.326.866774679' to '/testora/data/group_18.326.866774679';

alter database rename file '+NEWDATA/zmsft/tempfile/tbl_temp_sys.351.866779747' to '/testora/data/tbl_temp_sys.351.866779747';
alter database rename file '+NEWDATA/zmsft/tempfile/tbl_temp_rpt.352.866779831' to '/testora/data/tbl_temp_rpt.352.866779831';
alter database rename file '+NEWDATA/zmsft/tempfile/tbl_temp_rsv.355.866779887' to '/testora/data/tbl_temp_rsv.355.866779887';
alter database rename file '+NEWDATA/zmsft/tempfile/tbl_temp_pics.356.866779945' to '/testora/data/tbl_temp_pics.356.866779945';
alter database rename file '+NEWDATA/zmsft/tempfile/tbl_temp_res.357.866780007' to '/testora/data/tbl_temp_res.357.866780007';
alter database rename file '+NEWDATA/zmsft/tempfile/tbl_temp_ilog.358.866780057' to '/testora/data/tbl_temp_ilog.358.866780057';
alter database rename file '+NEWDATA/zmsft/tempfile/tbl_temp_fxq.359.866780119' to '/testora/data/tbl_temp_fxq.359.866780119';
alter database rename file '+NEWDATA/zmsft/tempfile/tbl_temp_rpt1.dbf' to '/testora/data/tbl_temp_rpt1.dbf';
alter database rename file '+NEWDATA/zmsft/tempfile/tbl_temp_rpt2.dbf' to '/testora/data/tbl_temp_rpt2.dbf';
alter database rename file '+NEWDATA/zmsft/tempfile/temp.350.866779599' to '/testora/data/temp.350.866779599';

6,打开数据库

SQL> alter database open resetlogs;

Database altered.











【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。