1. 在Windows上创建Oracle实例,服务
C:\Windows\system32>oradim -new -sid prod
实例已创建。
2. 恢复spfile
启动数据库实例至nomount状态
pfile是从原数据库实例拷贝而来
# Oracle init.ora parameter file generated by instance prod on 06/22/2016 10:33:41
__db_cache_size=320M
__java_pool_size=4M
__large_pool_size=8M
__oracle_base='/u01/app/oracle' # ORACLE_BASE set from environment
__pga_aggregate_target=320M
__sga_target=480M
__shared_io_pool_size=0
__shared_pool_size=136M
__streams_pool_size=0
_aggregation_optimization_settings=0
_always_anti_join='CHOOSE'
_always_semi_join='CHOOSE'
_and_pruning_enabled=TRUE
_b_tree_bitmap_plans=TRUE
_bloom_filter_enabled=TRUE
_bloom_folding_enabled=TRUE
_bloom_pruning_enabled=TRUE
_complex_view_merging=TRUE
_compression_compatibility='11.2.0.4.0'
_connect_by_use_union_all='TRUE'
_convert_set_to_join=FALSE
_cost_equality_semi_join=TRUE
_cpu_to_io=0
_dimension_skip_null=TRUE
_eliminate_common_subexpr=TRUE
_enable_type_dep_selectivity=TRUE
_fast_full_scan_enabled=TRUE
_first_k_rows_dynamic_proration=TRUE
_gby_hash_aggregation_enabled=TRUE
_generalized_pruning_enabled=TRUE
_globalindex_pnum_filter_enabled=TRUE
_gs_anti_semi_join_allowed=TRUE
_improved_outerjoin_card=TRUE
_improved_row_length_enabled=TRUE
_index_join_enabled=TRUE
_ksb_restart_policy_times='0'
_ksb_restart_policy_times='60'
_ksb_restart_policy_times='120'
_ksb_restart_policy_times='240' # internal update to set default
_left_nested_loops_random=TRUE
_local_communication_costing_enabled=TRUE
_minimal_stats_aggregation=TRUE
_mmv_query_rewrite_enabled=TRUE
_new_initial_join_orders=TRUE
_new_sort_cost_estimate=TRUE
_nlj_batching_enabled=1
_optim_adjust_for_part_skews=TRUE
_optim_enhance_nnull_detection=TRUE
_optim_new_default_join_sel=TRUE
_optim_peek_user_binds=TRUE
_optimizer_adaptive_cursor_sharing=TRUE
_optimizer_better_inlist_costing='ALL'
_optimizer_cbqt_no_size_restriction=TRUE
_optimizer_coalesce_subqueries=TRUE
_optimizer_complex_pred_selectivity=TRUE
_optimizer_compute_index_stats=TRUE
_optimizer_connect_by_combine_sw=TRUE
_optimizer_connect_by_cost_based=TRUE
_optimizer_connect_by_elim_dups=TRUE
_optimizer_correct_sq_selectivity=TRUE
_optimizer_cost_based_transformation='LINEAR'
_optimizer_cost_hjsmj_multimatch=TRUE
_optimizer_cost_model='CHOOSE'
_optimizer_dim_subq_join_sel=TRUE
_optimizer_distinct_agg_transform=TRUE
_optimizer_distinct_elimination=TRUE
_optimizer_distinct_placement=TRUE
_optimizer_eliminate_filtering_join=TRUE
_optimizer_enable_density_improvements=TRUE
_optimizer_enable_extended_stats=TRUE
_optimizer_enable_table_lookup_by_nl=TRUE
_optimizer_enhanced_filter_push=TRUE
_optimizer_extend_jppd_view_types=TRUE
_optimizer_extended_cursor_sharing='UDO'
_optimizer_extended_cursor_sharing_rel='SIMPLE'
_optimizer_extended_stats_usage_control=192
_optimizer_false_filter_pred_pullup=TRUE
_optimizer_fast_access_pred_analysis=TRUE
_optimizer_fast_pred_transitivity=TRUE
_optimizer_filter_pred_pullup=TRUE
_optimizer_fkr_index_cost_bias=10
_optimizer_full_outer_join_to_outer=TRUE
_optimizer_group_by_placement=TRUE
_optimizer_improve_selectivity=TRUE
_optimizer_interleave_jppd=TRUE
_optimizer_join_elimination_enabled=TRUE
_optimizer_join_factorization=TRUE
_optimizer_join_order_control=3
_optimizer_join_sel_sanity_check=TRUE
_optimizer_max_permutations=2000
_optimizer_mode_force=TRUE
_optimizer_multi_level_push_pred=TRUE
_optimizer_native_full_outer_join='FORCE'
_optimizer_new_join_card_computation=TRUE
_optimizer_null_aware_antijoin=TRUE
_optimizer_or_expansion='DEPTH'
_optimizer_order_by_elimination_enabled=TRUE
_optimizer_outer_join_to_inner=TRUE
_optimizer_outer_to_anti_enabled=TRUE
_optimizer_push_down_distinct=0
_optimizer_push_pred_cost_based=TRUE
_optimizer_rownum_bind_default=10
_optimizer_rownum_pred_based_fkr=TRUE
_optimizer_skip_scan_enabled=TRUE
_optimizer_sortmerge_join_inequality=TRUE
_optimizer_squ_bottomup=TRUE
_optimizer_star_tran_in_with_clause=TRUE
_optimizer_system_stats_usage=TRUE
_optimizer_table_expansion=TRUE
_optimizer_transitivity_retain=TRUE
_optimizer_try_st_before_jppd=TRUE
_optimizer_undo_cost_change='11.2.0.4'
_optimizer_unnest_corr_set_subq=TRUE
_optimizer_unnest_disjunctive_subq=TRUE
_optimizer_use_cbqt_star_transformation=TRUE
_optimizer_use_feedback=TRUE
_or_expand_nvl_predicate=TRUE
_ordered_nested_loop=TRUE
_parallel_broadcast_enabled=TRUE
_partition_view_enabled=TRUE
_pivot_implementation_method='CHOOSE'
_pre_rewrite_push_pred=TRUE
_pred_move_around=TRUE
_push_join_predicate=TRUE
_push_join_union_view=TRUE
_push_join_union_view2=TRUE
_px_minus_intersect=TRUE
_px_partition_scan_enabled=TRUE
_px_pwg_enabled=TRUE
_px_ual_serial_input=TRUE
_query_rewrite_setopgrw_enable=TRUE
_remove_aggr_subquery=TRUE
_replace_virtual_columns=TRUE
_resource_manager_plan=''
_right_outer_hash_enable=TRUE
_selfjoin_mv_duplicates=TRUE
_sql_model_unfold_forloops='RUN_TIME'
_sqltune_category_parsed='DEFAULT' # parsed sqltune_category
_subquery_pruning_enabled=TRUE
_subquery_pruning_mv_enabled=FALSE
_table_scan_cost_plus_one=TRUE
_union_rewrite_for_gs='YES_GSET_MVS'
_unnest_subquery=TRUE
_use_column_stats_for_function=TRUE
audit_file_dest='/u01/app/oracle/admin/prod/adump'
audit_trail='DB'
background_dump_dest='/u01/app/oracle/diag/rdbms/prod/prod/trace' #Deprecate parameter
compatible='11.2.0.4.0'
control_files='/u01/app/oracle/oradata/prod/control01.ctl'
control_files='/u01/app/oracle/fast_recovery_area/prod/control02.ctl'
core_dump_dest='/u01/app/oracle/diag/rdbms/prod/prod/cdump'
db_block_size=8192
db_domain=''
db_name='prod'
db_recovery_file_dest='/u01/app/oracle/fast_recovery_area'
db_recovery_file_dest_size=5182M
diagnostic_dest='/u01/app/oracle'
dispatchers='(PROTOCOL=TCP) (SERVICE=prodXDB)'
log_archive_format='%t_%s_%r.dbf'
log_buffer=6266880 # log buffer update
memory_target=800M
open_cursors=300
optimizer_dynamic_sampling=2
optimizer_mode='ALL_ROWS'
plsql_warnings='DISABLE:ALL' # PL/SQL warnings at init.ora
processes=150
query_rewrite_enabled='TRUE'
remote_login_passwordfile='EXCLUSIVE'
resource_manager_plan=''
result_cache_max_size=2M
skip_unusable_indexes=TRUE
undo_tablespace='UNDOTBS1'
user_dump_dest='/u01/app/oracle/diag/rdbms/prod/prod/trace' #Deprecate parameter
修改pfile中对应的路径, 修改后如下:
# Oracle init.ora parameter file generated by instance prod on 06\22\2016 10:33:41
__db_cache_size=320M
__java_pool_size=4M
__large_pool_size=8M
__oracle_base='E:\app\oracle' # ORACLE_BASE set from environment
__pga_aggregate_target=320M
__sga_target=480M
__shared_io_pool_size=0
__shared_pool_size=136M
__streams_pool_size=0
_aggregation_optimization_settings=0
_always_anti_join='CHOOSE'
_always_semi_join='CHOOSE'
_and_pruning_enabled=TRUE
_b_tree_bitmap_plans=TRUE
_bloom_filter_enabled=TRUE
_bloom_folding_enabled=TRUE
_bloom_pruning_enabled=TRUE
_complex_view_merging=TRUE
_compression_compatibility='11.2.0.4.0'
_connect_by_use_union_all='TRUE'
_convert_set_to_join=FALSE
_cost_equality_semi_join=TRUE
_cpu_to_io=0
_dimension_skip_null=TRUE
_eliminate_common_subexpr=TRUE
_enable_type_dep_selectivity=TRUE
_fast_full_scan_enabled=TRUE
_first_k_rows_dynamic_proration=TRUE
_gby_hash_aggregation_enabled=TRUE
_generalized_pruning_enabled=TRUE
_globalindex_pnum_filter_enabled=TRUE
_gs_anti_semi_join_allowed=TRUE
_improved_outerjoin_card=TRUE
_improved_row_length_enabled=TRUE
_index_join_enabled=TRUE
_ksb_restart_policy_times='0'
_ksb_restart_policy_times='60'
_ksb_restart_policy_times='120'
_ksb_restart_policy_times='240' # internal update to set default
_left_nested_loops_random=TRUE
_local_communication_costing_enabled=TRUE
_minimal_stats_aggregation=TRUE
_mmv_query_rewrite_enabled=TRUE
_new_initial_join_orders=TRUE
_new_sort_cost_estimate=TRUE
_nlj_batching_enabled=1
_optim_adjust_for_part_skews=TRUE
_optim_enhance_nnull_detection=TRUE
_optim_new_default_join_sel=TRUE
_optim_peek_user_binds=TRUE
_optimizer_adaptive_cursor_sharing=TRUE
_optimizer_better_inlist_costing='ALL'
_optimizer_cbqt_no_size_restriction=TRUE
_optimizer_coalesce_subqueries=TRUE
_optimizer_complex_pred_selectivity=TRUE
_optimizer_compute_index_stats=TRUE
_optimizer_connect_by_combine_sw=TRUE
_optimizer_connect_by_cost_based=TRUE
_optimizer_connect_by_elim_dups=TRUE
_optimizer_correct_sq_selectivity=TRUE
_optimizer_cost_based_transformation='LINEAR'
_optimizer_cost_hjsmj_multimatch=TRUE
_optimizer_cost_model='CHOOSE'
_optimizer_dim_subq_join_sel=TRUE
_optimizer_distinct_agg_transform=TRUE
_optimizer_distinct_elimination=TRUE
_optimizer_distinct_placement=TRUE
_optimizer_eliminate_filtering_join=TRUE
_optimizer_enable_density_improvements=TRUE
_optimizer_enable_extended_stats=TRUE
_optimizer_enable_table_lookup_by_nl=TRUE
_optimizer_enhanced_filter_push=TRUE
_optimizer_extend_jppd_view_types=TRUE
_optimizer_extended_cursor_sharing='UDO'
_optimizer_extended_cursor_sharing_rel='SIMPLE'
_optimizer_extended_stats_usage_control=192
_optimizer_false_filter_pred_pullup=TRUE
_optimizer_fast_access_pred_analysis=TRUE
_optimizer_fast_pred_transitivity=TRUE
_optimizer_filter_pred_pullup=TRUE
_optimizer_fkr_index_cost_bias=10
_optimizer_full_outer_join_to_outer=TRUE
_optimizer_group_by_placement=TRUE
_optimizer_improve_selectivity=TRUE
_optimizer_interleave_jppd=TRUE
_optimizer_join_elimination_enabled=TRUE
_optimizer_join_factorization=TRUE
_optimizer_join_order_control=3
_optimizer_join_sel_sanity_check=TRUE
_optimizer_max_permutations=2000
_optimizer_mode_force=TRUE
_optimizer_multi_level_push_pred=TRUE
_optimizer_native_full_outer_join='FORCE'
_optimizer_new_join_card_computation=TRUE
_optimizer_null_aware_antijoin=TRUE
_optimizer_or_expansion='DEPTH'
_optimizer_order_by_elimination_enabled=TRUE
_optimizer_outer_join_to_inner=TRUE
_optimizer_outer_to_anti_enabled=TRUE
_optimizer_push_down_distinct=0
_optimizer_push_pred_cost_based=TRUE
_optimizer_rownum_bind_default=10
_optimizer_rownum_pred_based_fkr=TRUE
_optimizer_skip_scan_enabled=TRUE
_optimizer_sortmerge_join_inequality=TRUE
_optimizer_squ_bottomup=TRUE
_optimizer_star_tran_in_with_clause=TRUE
_optimizer_system_stats_usage=TRUE
_optimizer_table_expansion=TRUE
_optimizer_transitivity_retain=TRUE
_optimizer_try_st_before_jppd=TRUE
_optimizer_undo_cost_change='11.2.0.4'
_optimizer_unnest_corr_set_subq=TRUE
_optimizer_unnest_disjunctive_subq=TRUE
_optimizer_use_cbqt_star_transformation=TRUE
_optimizer_use_feedback=TRUE
_or_expand_nvl_predicate=TRUE
_ordered_nested_loop=TRUE
_parallel_broadcast_enabled=TRUE
_partition_view_enabled=TRUE
_pivot_implementation_method='CHOOSE'
_pre_rewrite_push_pred=TRUE
_pred_move_around=TRUE
_push_join_predicate=TRUE
_push_join_union_view=TRUE
_push_join_union_view2=TRUE
_px_minus_intersect=TRUE
_px_partition_scan_enabled=TRUE
_px_pwg_enabled=TRUE
_px_ual_serial_input=TRUE
_query_rewrite_setopgrw_enable=TRUE
_remove_aggr_subquery=TRUE
_replace_virtual_columns=TRUE
_resource_manager_plan=''
_right_outer_hash_enable=TRUE
_selfjoin_mv_duplicates=TRUE
_sql_model_unfold_forloops='RUN_TIME'
_sqltune_category_parsed='DEFAULT' # parsed sqltune_category
_subquery_pruning_enabled=TRUE
_subquery_pruning_mv_enabled=FALSE
_table_scan_cost_plus_one=TRUE
_union_rewrite_for_gs='YES_GSET_MVS'
_unnest_subquery=TRUE
_use_column_stats_for_function=TRUE
audit_file_dest='E:\app\oracle\admin\prod\adump'
audit_trail='DB'
background_dump_dest='E:\app\oracle\diag\rdbms\prod\prod\trace' #Deprecate parameter
compatible='11.2.0.4.0'
control_files='E:\app\oracle\oradata\prod\control01.ctl'
control_files='E:\app\oracle\fast_recovery_area\prod\control02.ctl'
core_dump_dest='E:\app\oracle\diag\rdbms\prod\prod\cdump'
db_block_size=8192
db_domain=''
db_name='prod'
db_recovery_file_dest='E:\app\oracle\fast_recovery_area'
db_recovery_file_dest_size=5182M
diagnostic_dest='E:\app\oracle'
dispatchers='(PROTOCOL=TCP) (SERVICE=prodXDB)'
log_archive_format='%t_%s_%r.dbf'
log_buffer=6266880 # log buffer update
memory_target=800M
open_cursors=300
optimizer_dynamic_sampling=2
optimizer_mode='ALL_ROWS'
plsql_warnings='DISABLE:ALL' # PL\SQL warnings at init.ora
processes=150
query_rewrite_enabled='TRUE'
remote_login_passwordfile='EXCLUSIVE'
resource_manager_plan=''
result_cache_max_size=2M
skip_unusable_indexes=TRUE
undo_tablespace='UNDOTBS1'
user_dump_dest='E:\app\oracle\diag\rdbms\prod\prod\trace' #Deprecate parameter
C:\Windows\system32>sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on 星期四 6月 23 11:02:14 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
已连接到空闲例程。
SQL> startup nomount
ORA-01078: failure in processing system parameters
LRM-00109: ???????????????? 'E:\APP\ORACLE\PRODUCT\11.2.0\DBHOME_1\DATABASE\INIT
PROD.ORA'
SQL> startup nomount pfile='E:\app\oracle\product\11.2.0\dbhome_1\database\initp
rod.ora'
ORA-32006: BACKGROUND_DUMP_DEST initialization parameter has been deprecated
ORA-32006: USER_DUMP_DEST initialization parameter has been deprecated
ORA-48108: invalid value given for the diagnostic_dest init.ora parameter
ORA-48140: the specified ADR Base directory does not exist [e:\u01\app\oracle]
ORA-48187: specified directory does not exist
OSD-00002: ????????????
O/S-Error: (OS 3) ??????????????????????
SQL> create spfile from pfile;
文件已创建。
SQL> startup nomount
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE 例程已经启动。
Total System Global Area 835104768 bytes
Fixed Size 2285832 bytes
Variable Size 541069048 bytes
Database Buffers 281018368 bytes
Redo Buffers 10731520 bytes
SQL>
3. 恢复控制文件
C:\Windows\system32>rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Thu Jun 23 11:13:04 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: PROD (not mounted)
RMAN> catalog start with 'e:\dmp';
using target database control file instead of recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of catalog command at 06/23/2016 11:13:11
ORA-01507: database not mounted
RMAN> restore controlfile from 'e:\dmp\o1_mf_s_915186191_cpmxnhj4_.bkp';
Starting restore at 23-JUN-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=189 device type=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
output file name=E:\APP\ORACLE\ORADATA\PROD\CONTROL01.CTL
output file name=E:\APP\ORACLE\FAST_RECOVERY_AREA\PROD\CONTROL02.CTL
Finished restore at 23-JUN-16
RMAN>
4. 在参数文件中增加如下内容:
*.DB_FILE_NAME_CONVERT='/u01/app/oracle/oradata/prod','E:\app\oracle\oradata\PROD'
*.LOG_FILE_NAME_CONVERT='/u01/app/oracle/oradata/prod','E:\app\oracle\oradata\PROD'
5. 关闭数据库并启动至nomount
SQL> startup nomount
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE 例程已经启动。
Total System Global Area 835104768 bytes
Fixed Size 2285832 bytes
Variable Size 541069048 bytes
Database Buffers 281018368 bytes
Redo Buffers 10731520 bytes
SQL> shutdown immediate
ORA-01507: ??????
ORACLE 例程已经关闭。
SQL> create spfile from pfile;
文件已创建。
SQL> startup nomount
ORACLE 例程已经启动。
Total System Global Area 835104768 bytes
Fixed Size 2285832 bytes
Variable Size 541069048 bytes
Database Buffers 281018368 bytes
Redo Buffers 10731520 bytes
6. C:\Windows\system32>set ORACLE_SID=prod
C:\Windows\system32>rman target /
恢复管理器: Release 11.2.0.4.0 - Production on 星期四 6月 23 11:23:45 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
已连接到目标数据库: PROD (DBID=326977200, 未打开)
RMAN> catalog start with 'e:\dmp';
启动 implicit crosscheck backup 于 23-6月 -16
使用目标数据库控制文件替代恢复目录
分配的通道: ORA_DISK_1
通道 ORA_DISK_1: SID=189 设备类型=DISK
已交叉检验的 3 对象
完成 implicit crosscheck backup 于 23-6月 -16
启动 implicit crosscheck copy 于 23-6月 -16
使用通道 ORA_DISK_1
完成 implicit crosscheck copy 于 23-6月 -16
搜索恢复区中的所有文件
正在编制文件目录...
目录编制完毕
已列入目录的文件的列表
=======================
文件名: E:\APP\ORACLE\FAST_RECOVERY_AREA\PROD\AUTOBACKUP\2016_06_23\O1_MF_S_9152
72523_CPPKYJ5D_.BKP
搜索与样式 e:\dmp 匹配的所有文件
数据库未知文件的列表
=====================================
文件名: E:\dmp\export.log
文件名: E:\dmp\import.log
文件名: E:\dmp\initprod.ora
文件名: E:\dmp\o1_mf_annnn_TAG20160622T102157_cpmxl5fw_.bkp
文件名: E:\dmp\o1_mf_annnn_TAG20160622T102309_cpmxnfw8_.bkp
文件名: E:\dmp\o1_mf_nnndf_TAG20160622T102204_cpmxldq9_.bkp
文件名: E:\dmp\o1_mf_s_915186191_cpmxnhj4_.bkp
文件名: E:\dmp\prod_ora_4632.trc
文件名: E:\dmp\TTS.DMP
是否确实要将上述文件列入目录 (输入 YES 或 NO)? yes
正在编制文件目录...
目录编制完毕
已列入目录的文件的列表
=======================
文件名: E:\dmp\o1_mf_annnn_TAG20160622T102157_cpmxl5fw_.bkp
文件名: E:\dmp\o1_mf_annnn_TAG20160622T102309_cpmxnfw8_.bkp
文件名: E:\dmp\o1_mf_nnndf_TAG20160622T102204_cpmxldq9_.bkp
文件名: E:\dmp\o1_mf_s_915186191_cpmxnhj4_.bkp
未列入目录的文件的列表
=======================================
文件名: E:\dmp\export.log
RMAN-07517: 原因: 文件标头已损坏
文件名: E:\dmp\import.log
RMAN-07517: 原因: 文件标头已损坏
文件名: E:\dmp\initprod.ora
RMAN-07517: 原因: 文件标头已损坏
文件名: E:\dmp\prod_ora_4632.trc
RMAN-07517: 原因: 文件标头已损坏
文件名: E:\dmp\TTS.DMP
RMAN-07520: 原因: 数据泵转储文件
RMAN>
7. restore database
遇到如下错误:
RMAN> run{
2> set newname for datafile '/u01/app/oracle/oradata/prod/system01.dbf' to 'E:\A
PP\ORACLE\ORADATA\PROD\SYSTEM01.DBF';
3> set newname for datafile '/u01/app/oracle/oradata/prod/sysaux01.dbf' to 'E:\A
PP\ORACLE\ORADATA\PROD\SYSAUX01.DBF';
4> set newname for datafile '/u01/app/oracle/oradata/prod/undotbs01.dbf' to 'E:\
APP\ORACLE\ORADATA\PROD\UNDOTBS01.DBF';
5> set newname for datafile '/u01/app/oracle/oradata/prod/users01.dbf' to 'E:\AP
P\ORACLE\ORADATA\PROD\USERS01.DBF';
6> set newname for datafile '/u01/app/oracle/oradata/prod/example01.dbf' to 'E:\
APP\ORACLE\ORADATA\PROD\EXAMPLE01.DBF';
7> restore database;
8> }
正在执行命令: SET NEWNAME
正在执行命令: SET NEWNAME
正在执行命令: SET NEWNAME
正在执行命令: SET NEWNAME
正在执行命令: SET NEWNAME
启动 restore 于 23-6月 -16
使用通道 ORA_DISK_1
通道 ORA_DISK_1: 正在开始还原数据文件备份集
通道 ORA_DISK_1: 正在指定从备份集还原的数据文件
通道 ORA_DISK_1: 将数据文件 00001 还原到 /u01/app/oracle/oradata/prod/system01.d
bf
通道 ORA_DISK_1: 将数据文件 00002 还原到 /u01/app/oracle/oradata/prod/sysaux01.d
bf
通道 ORA_DISK_1: 将数据文件 00003 还原到 /u01/app/oracle/oradata/prod/undotbs01.
dbf
通道 ORA_DISK_1: 将数据文件 00004 还原到 /u01/app/oracle/oradata/prod/users01.db
f
通道 ORA_DISK_1: 将数据文件 00005 还原到 /u01/app/oracle/oradata/prod/example01.
dbf
通道 ORA_DISK_1: 正在读取备份片段 E:\DMP\O1_MF_NNNDF_TAG20160622T102204_CPMXLDQ9
_.BKP
通道 ORA_DISK_1: ORA-19870: 还原备份片段 E:\DMP\O1_MF_NNNDF_TAG20160622T102204_C
PMXLDQ9_.BKP 时出错
ORA-19504: 无法创建文件"E:\U01\APP\ORACLE\ORADATA\PROD\SYSTEM01.DBF"
ORA-27040: 文件创建错误, 无法创建文件
OSD-04002: 无法打开文件
O/S-Error: (OS 3) 系统找不到指定的路径。
故障转移到上一个备份
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: restore 命令 (在 06/23/2016 11:25:19 上) 失败
RMAN-06026: 有些目标没有找到 - 终止还原
RMAN-06023: 没有找到数据文件5的副本来还原
RMAN-06023: 没有找到数据文件4的副本来还原
RMAN-06023: 没有找到数据文件3的副本来还原
RMAN-06023: 没有找到数据文件2的副本来还原
RMAN-06023: 没有找到数据文件1的副本来还原
RMAN>
根据file#来进行恢复:
run{
set newname for datafile 1 to 'E:\APP\ORACLE\ORADATA\PROD\SYSTEM01.DBF';
set newname for datafile 2 to 'E:\APP\ORACLE\ORADATA\PROD\SYSAUX01.DBF';
set newname for datafile 3 to 'E:\APP\ORACLE\ORADATA\PROD\UNDOTBS01.DBF';
set newname for datafile 4 to 'E:\APP\ORACLE\ORADATA\PROD\USERS01.DBF';
set newname for datafile 5 to 'E:\APP\ORACLE\ORADATA\PROD\EXAMPLE01.DBF';
restore database;
}
正在执行命令: SET NEWNAME
正在执行命令: SET NEWNAME
正在执行命令: SET NEWNAME
正在执行命令: SET NEWNAME
正在执行命令: SET NEWNAME
启动 restore 于 23-6月 -16
使用通道 ORA_DISK_1
通道 ORA_DISK_1: 正在开始还原数据文件备份集
通道 ORA_DISK_1: 正在指定从备份集还原的数据文件
通道 ORA_DISK_1: 将数据文件 00001 还原到 E:\APP\ORACLE\ORADATA\PROD\SYSTEM01.DBF
通道 ORA_DISK_1: 将数据文件 00002 还原到 E:\APP\ORACLE\ORADATA\PROD\SYSAUX01.DBF
通道 ORA_DISK_1: 将数据文件 00003 还原到 E:\APP\ORACLE\ORADATA\PROD\UNDOTBS01.DB
F
通道 ORA_DISK_1: 将数据文件 00004 还原到 E:\APP\ORACLE\ORADATA\PROD\USERS01.DBF
通道 ORA_DISK_1: 将数据文件 00005 还原到 E:\APP\ORACLE\ORADATA\PROD\EXAMPLE01.DB
F
通道 ORA_DISK_1: 正在读取备份片段 E:\DMP\O1_MF_NNNDF_TAG20160622T102204_CPMXLDQ9
_.BKP
通道 ORA_DISK_1: 段句柄 = E:\DMP\O1_MF_NNNDF_TAG20160622T102204_CPMXLDQ9_.BKP 标
记 = TAG20160622T102204
通道 ORA_DISK_1: 已还原备份片段 1
通道 ORA_DISK_1: 还原完成, 用时: 00:01:05
完成 restore 于 23-6月 -16
此时打开数据库时报错:
SQL> alter database open resetlogs;
alter database open resetlogs
*
第 1 行出现错误:
ORA-01157: 无法标识/锁定数据文件 1 - 请参阅 DBWR 跟踪文件
ORA-01110: 数据文件 1: '/u01/app/oracle/oradata/prod/system01.dbf'
因为restore的控制文件记录的数据文件位置还是linux数据库下的数据文件路径:
SQL> select file#,name from v$datafile;
FILE#
----------
NAME
---------------------------------------------------------------------------
1
/u01/app/oracle/oradata/prod/system01.dbf
2
/u01/app/oracle/oradata/prod/sysaux01.dbf
3
/u01/app/oracle/oradata/prod/undotbs01.dbf
FILE#
----------
NAME
---------------------------------------------------------------------------
4
/u01/app/oracle/oradata/prod/users01.dbf
5
/u01/app/oracle/oradata/prod/example01.dbf
此时需要重建控制文件:
CREATE CONTROLFILE reuse DATABASE "PROD" RESETLOGS NOARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 'E:\APP\ORACLE\ORADATA\PROD\REDO01.LOG' SIZE 50M BLOCKSIZE 512,
GROUP 2 'E:\APP\ORACLE\ORADATA\PROD\REDO02.LOG' SIZE 50M BLOCKSIZE 512,
GROUP 3 'E:\APP\ORACLE\ORADATA\PROD\REDO03.LOG' SIZE 50M BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE
'E:\APP\ORACLE\ORADATA\PROD\SYSTEM01.DBF',
'E:\APP\ORACLE\ORADATA\PROD\SYSAUX01.DBF',
'E:\APP\ORACLE\ORADATA\PROD\UNDOTBS01.DBF',
'E:\APP\ORACLE\ORADATA\PROD\USERS01.DBF',
'E:\APP\ORACLE\ORADATA\PROD\EXAMPLE01.DBF'
CHARACTER SET ZHS16GBK
SQL> CREATE CONTROLFILE reuse DATABASE "PROD" RESETLOGS NOARCHIVELOG
2 MAXLOGFILES 16
3 MAXLOGMEMBERS 3
4 MAXDATAFILES 100
5 MAXINSTANCES 8
6 MAXLOGHISTORY 292
7 LOGFILE
8 GROUP 1 'E:\APP\ORACLE\ORADATA\PROD\REDO01.LOG' SIZE 50M BLOCKSIZE 512,
9 GROUP 2 'E:\APP\ORACLE\ORADATA\PROD\REDO02.LOG' SIZE 50M BLOCKSIZE 512,
10 GROUP 3 'E:\APP\ORACLE\ORADATA\PROD\REDO03.LOG' SIZE 50M BLOCKSIZE 512
11 -- STANDBY LOGFILE
12 DATAFILE
13 'E:\APP\ORACLE\ORADATA\PROD\SYSTEM01.DBF',
14 'E:\APP\ORACLE\ORADATA\PROD\SYSAUX01.DBF',
15 'E:\APP\ORACLE\ORADATA\PROD\UNDOTBS01.DBF',
16 'E:\APP\ORACLE\ORADATA\PROD\USERS01.DBF',
17 'E:\APP\ORACLE\ORADATA\PROD\EXAMPLE01.DBF'
18 CHARACTER SET ZHS16GBK
19 /
控制文件已创建。
SQL> alter database open resetlogs;
数据库已更改。
SQL>
至此,数据库已经可以打开。但是这里并没有进行recover database
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/8520577/viewspace-2120812/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/8520577/viewspace-2120812/