通过RMAN进行数据库恢复(step by step)
2012-08-06 19:51
471 查看
1、修改pfile文件
使用在生产端生成的pfile文件进行修改。
PROD.__db_cache_size=1459617792
PROD.__java_pool_size=16777216
PROD.__large_pool_size=16777216
PROD.__shared_pool_size=314572800
PROD.__streams_pool_size=33554432
*._allow_level_without_connect_by=true
*._log_io_size=524288
*.audit_file_dest='/oratest/10g/PROD/admin/adump'
*.background_dump_dest='/oratest/10g/PROD/admin/bdump'
*.compatible='10.2.0.3.0'
*.control_files='/oratest/10g/PROD/control01.ctl','/oratest/10g/PROD/control02.ctl','/oratest/10g/PROD/control03.ctl'
*.core_dump_dest='/oratest/10g/PROD/admin/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='PROD'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=PRODXDB)'
*.job_queue_processes=10
*.local_listener=''
*.lock_sga=TRUE
*.log_archive_dest_1='location=/oratest/10g/PROD/archive/'
*.log_buffer=1024000
*.open_cursors=800
*.pga_aggregate_target=524288000
*.processes=800
*.recyclebin='OFF'
*.remote_login_passwordfile='EXCLUSIVE'
*.sessions=885
*.sga_max_size=1073741824
*.sga_target=1073741824
*.shared_pool_reserved_size=62914560
*.shared_pool_size=314572800
*.undo_management='AUTO'
*.undo_retention=1800
*.undo_tablespace='UNDOTBS2'
*.user_dump_dest='/oratest/10g/PROD/admin/udump'
2、启动数据库实例,即NOMOUNT阶段
SQL> startup nomount pfile='/oratest/10g/PROD/PROD_pfile.ora';
ORACLE instance started.
Total System Global Area 1073741824 bytes
Fixed Size 2078368 bytes
Variable Size 327158112 bytes
Database Buffers 738197504 bytes
Redo Buffers 6307840 bytes
3、恢复控制文件
RMAN> restore controlfile from '/oratest/rmanbak/PROD-c-1503380933-20120728-00.ctl';
Starting restore at 28-JUL-12
using channel ORA_DISK_1
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:26
output filename=/oratest/10g/PROD/control01.ctl
output filename=/oratest/10g/PROD/control02.ctl
output filename=/oratest/10g/PROD/control03.ctl
Finished restore at 28-JUL-12
4、加载数据库,即启动到MOUNT阶段
RMAN> alter database mount;
database mounted
5、重命名redo log文件
由于恢复的数据库和原生产数据库的目录有所变动,所以需要对redo log重命名。
alter database rename file '/oradata/10g/PROD/redo01.log' to '/oratest/10g/PROD/redo01_a.log';
alter database rename file '/oradata/10g/PROD/redo02.log' to '/oratest/10g/PROD/redo02_a.log';
alter database rename file '/oradata/10g/PROD/redo03.log' to '/oratest/10g/PROD/redo03_a.log';
alter database rename file '/oradata/10g/PROD/redo04.log' to '/oratest/10g/PROD/redo04_a.log';
alter database rename file '/oradata/10g/PROD/redo05.log' to '/oratest/10g/PROD/redo05_a.log';
alter database rename file '/oradata/10g/PROD/redo6.log' to '/oratest/10g/PROD/redo06_a.log';
6、CATALOG数据库的备份片(backuppiece)
RMAN > catalog backuppiece '/oratest/rmanbak/PROD-j6nh68e9_1_1.db';
7、RESTORE数据库
由于恢复的数据文件路径与原生产端不一致,因此在RESTORE前,需要SET NEWNAME。
RMAN> run {
set newname for datafile 1 to '/oratest/10g/PROD/system01.dbf';
set newname for datafile 3 to '/oratest/10g/PROD/sysaux01.dbf';
set newname for datafile 4 to '/oratest/10g/PROD/users01.dbf';
set newname for datafile 5 to '/oratest/10g/PROD/IFSAPP_ARCHIVE_DATA.DBF';
set newname for datafile 6 to '/oratest/10g/PROD/IFSAPP_ARCHIVE_INDEX.DBF';
set newname for datafile 7 to '/oratest/10g/PROD/IFSAPP_DATA.DBF';
set newname for datafile 8 to '/oratest/10g/PROD/IFSAPP_INDEX.DBF';
set newname for datafile 9 to '/oratest/10g/PROD/IFSAPP_REPORT_DATA.DBF';
set newname for datafile 10 to '/oratest/10g/PROD/IFSAPP_REPORT_INDEX.DBF';
set newname for datafile 11 to '/oratest/10g/PROD/INDX.DBF';
set newname for datafile 12 to '/oratest/10g/PROD/PERFSTAT.DBF';
set newname for datafile 13 to '/oratest/10g/PROD/RBS.DBF';
set newname for datafile 14 to '/oratest/10g/PROD/TOOLS.DBF';
set newname for datafile 15 to '/oratest/10g/PROD/undotbs02.dbf';
restore datafile 1,3,4,5,6,7,8,9,10,11,12,13,14,15;
switch datafile all;
}
8、CATALOG ARCHIVELOG
SQL> catalog backuppiece '/oratest/rmanbak/PROD-j5nh67ta_1_1.arc';
9、RECOVER数据库
RMAN> recover database;
10、以resetlog方式打开数据库
SQL> alter database open resetlogs;
使用在生产端生成的pfile文件进行修改。
PROD.__db_cache_size=1459617792
PROD.__java_pool_size=16777216
PROD.__large_pool_size=16777216
PROD.__shared_pool_size=314572800
PROD.__streams_pool_size=33554432
*._allow_level_without_connect_by=true
*._log_io_size=524288
*.audit_file_dest='/oratest/10g/PROD/admin/adump'
*.background_dump_dest='/oratest/10g/PROD/admin/bdump'
*.compatible='10.2.0.3.0'
*.control_files='/oratest/10g/PROD/control01.ctl','/oratest/10g/PROD/control02.ctl','/oratest/10g/PROD/control03.ctl'
*.core_dump_dest='/oratest/10g/PROD/admin/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='PROD'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=PRODXDB)'
*.job_queue_processes=10
*.local_listener=''
*.lock_sga=TRUE
*.log_archive_dest_1='location=/oratest/10g/PROD/archive/'
*.log_buffer=1024000
*.open_cursors=800
*.pga_aggregate_target=524288000
*.processes=800
*.recyclebin='OFF'
*.remote_login_passwordfile='EXCLUSIVE'
*.sessions=885
*.sga_max_size=1073741824
*.sga_target=1073741824
*.shared_pool_reserved_size=62914560
*.shared_pool_size=314572800
*.undo_management='AUTO'
*.undo_retention=1800
*.undo_tablespace='UNDOTBS2'
*.user_dump_dest='/oratest/10g/PROD/admin/udump'
2、启动数据库实例,即NOMOUNT阶段
SQL> startup nomount pfile='/oratest/10g/PROD/PROD_pfile.ora';
ORACLE instance started.
Total System Global Area 1073741824 bytes
Fixed Size 2078368 bytes
Variable Size 327158112 bytes
Database Buffers 738197504 bytes
Redo Buffers 6307840 bytes
3、恢复控制文件
RMAN> restore controlfile from '/oratest/rmanbak/PROD-c-1503380933-20120728-00.ctl';
Starting restore at 28-JUL-12
using channel ORA_DISK_1
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:26
output filename=/oratest/10g/PROD/control01.ctl
output filename=/oratest/10g/PROD/control02.ctl
output filename=/oratest/10g/PROD/control03.ctl
Finished restore at 28-JUL-12
4、加载数据库,即启动到MOUNT阶段
RMAN> alter database mount;
database mounted
5、重命名redo log文件
由于恢复的数据库和原生产数据库的目录有所变动,所以需要对redo log重命名。
alter database rename file '/oradata/10g/PROD/redo01.log' to '/oratest/10g/PROD/redo01_a.log';
alter database rename file '/oradata/10g/PROD/redo02.log' to '/oratest/10g/PROD/redo02_a.log';
alter database rename file '/oradata/10g/PROD/redo03.log' to '/oratest/10g/PROD/redo03_a.log';
alter database rename file '/oradata/10g/PROD/redo04.log' to '/oratest/10g/PROD/redo04_a.log';
alter database rename file '/oradata/10g/PROD/redo05.log' to '/oratest/10g/PROD/redo05_a.log';
alter database rename file '/oradata/10g/PROD/redo6.log' to '/oratest/10g/PROD/redo06_a.log';
6、CATALOG数据库的备份片(backuppiece)
RMAN > catalog backuppiece '/oratest/rmanbak/PROD-j6nh68e9_1_1.db';
7、RESTORE数据库
由于恢复的数据文件路径与原生产端不一致,因此在RESTORE前,需要SET NEWNAME。
RMAN> run {
set newname for datafile 1 to '/oratest/10g/PROD/system01.dbf';
set newname for datafile 3 to '/oratest/10g/PROD/sysaux01.dbf';
set newname for datafile 4 to '/oratest/10g/PROD/users01.dbf';
set newname for datafile 5 to '/oratest/10g/PROD/IFSAPP_ARCHIVE_DATA.DBF';
set newname for datafile 6 to '/oratest/10g/PROD/IFSAPP_ARCHIVE_INDEX.DBF';
set newname for datafile 7 to '/oratest/10g/PROD/IFSAPP_DATA.DBF';
set newname for datafile 8 to '/oratest/10g/PROD/IFSAPP_INDEX.DBF';
set newname for datafile 9 to '/oratest/10g/PROD/IFSAPP_REPORT_DATA.DBF';
set newname for datafile 10 to '/oratest/10g/PROD/IFSAPP_REPORT_INDEX.DBF';
set newname for datafile 11 to '/oratest/10g/PROD/INDX.DBF';
set newname for datafile 12 to '/oratest/10g/PROD/PERFSTAT.DBF';
set newname for datafile 13 to '/oratest/10g/PROD/RBS.DBF';
set newname for datafile 14 to '/oratest/10g/PROD/TOOLS.DBF';
set newname for datafile 15 to '/oratest/10g/PROD/undotbs02.dbf';
restore datafile 1,3,4,5,6,7,8,9,10,11,12,13,14,15;
switch datafile all;
}
8、CATALOG ARCHIVELOG
SQL> catalog backuppiece '/oratest/rmanbak/PROD-j5nh67ta_1_1.arc';
9、RECOVER数据库
RMAN> recover database;
10、以resetlog方式打开数据库
SQL> alter database open resetlogs;
相关文章推荐
- 通过Step by step sample了解Windows Workflow Foundation
- 通过dbv和rman blockrecover对Oracle数据库坏块进行修复笔记
- Oracle 11g Active Data Guard step by step: How to create a Physical Standby Database using RMAN
- Caffe使用step by step:使用自己数据对已经训练好的模型进行finetuning
- SQL Server BI Step by Step 2--- 使用SSIS进行简单的数据导入导出
- grails通过findBy或findBy查找的结果集进行排序
- #377 – 通过将ToolTip定义为资源对其进行重用(Reuse Tooltips by Defining Them as Resources)
- Step by Step Guide on Creating Physical Standby Using RMAN DUPLICATE...FROM ACTIVE DATABASE (Doc ID
- 直播通过rman将oracle 12c整库全备后进行异机同目录恢复遇到的小坑
- Step By Step Guide To Create Physical Standby Database Using RMAN Backup and Restore (Doc ID 469493.
- 【神经网络与深度学习】Caffe使用step by step:使用自己数据对已经训练好的模型进行finetuning
- Step byStep Guide on Creating Physical Standby Using RMAN DUPLICATE
- Caffe使用step by step:使用自己数据对已经训练好的模型进行finetuning
- Step By Step Guide To Create Physical Standby Database Using RMAN Backup and Restore
- STEP BY STEP RMAN DUPLICATE Database From RAC ASM To RAC ASM (Doc ID 1913937.1)
- Nodejs https reqest by proxy(node通过代理进行https请求)
- SQL Server BI Step by Step SSIS 5 --- 通过Email发送查询结果
- [EXCEL][STEP BY STEP]使用超级连接进行数据查询
- SQL Server BI Step by Step --- 使用SSIS进行简单的数据导入导出
- document.getElementsByClassName:简单的原生通过className查找元素,可指定多个样式名称进行查找