Oracle Windows异机恢复
2022/1/16 19:04:02
本文主要是介绍Oracle Windows异机恢复,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
环境:windows2008r2 Oracle11gr2
先手动创建新实例
********************************手动创建pfile db_name='ORCL' processes = 150 audit_file_dest='D:\app\xyz\admin\orcl\adump' audit_trail ='db' db_block_size=8192 db_domain='' db_recovery_file_dest='D:\app\xyz\flash_recovery_area' db_recovery_file_dest_size=2G diagnostic_dest='D:\app\xyz' dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)' open_cursors=300 remote_login_passwordfile='EXCLUSIVE' undo_tablespace='UNDOTBS1' * You may want to ensure that control files are created on separate physical * devices control_files = 'D:\app\xyz\oradata\orcl\control01.ctl','D:\app\xyz\flash_recovery_area\orcl\control02.ctl' compatible ='11.2.0' memory_target=0 sga_max_size=3439329280 sga_target=3439329280 pga_aggregate_target=104857600 *************************************手动创建新实例,cmd下使用oradim命令 oradim -NEW -SID xyz -SYSPWD password -STARTMODE MANUAL -PFILE D:\app *****************************pfile放在D:\app\Administrator\product\11.2.0\dbhome_1\database,(这个目录根据你的实际情况去改)启动实例 C:\sqlplus /nolog SQL>connect sys/mynewdb as sysdba; SQL>startup nomount;
参考链接:https://blog.csdn.net/weixin_33696822/article/details/92958518
实例启动后使用rman进行恢复
select 'set newname for datafile '||file_id||' to '||chr(39)||'d:\app\xyz\oradata\'||substr(file_name,(instr(file_name,'/',-1)+1))||chr(39)||';' from dba_data_files where tablespace_name in ('SYSTEM','SYSAUX','UNDOTBS1','USERS','EXAMPLE'); *******************************使用rman恢复 rman target / set dbid=1621815288; restore controlfile from 'd:\bak\C-1621815288-20220116-02'; alter database mount; catalog start with 'd:\bak'; **************************************************恢复数据文件 run { allocate channel ch0 type disk; set newname for datafile 4 to 'd:\app\xyz\oradata\USERS01.DBF'; set newname for datafile 3 to 'd:\app\xyz\oradata\UNDOTBS01.DBF'; set newname for datafile 2 to 'd:\app\xyz\oradata\SYSAUX01.DBF'; set newname for datafile 1 to 'd:\app\xyz\oradata\SYSTEM01.DBF'; set newname for datafile 5 to 'd:\app\xyz\oradata\EXAMPLE01.DBF'; set until scn 1145279; restore database; switch datafile all; switch tempfile all; release channel ch0; } **************恢复过程中如果报ORA-19693: 已包括备份片段 D:\******的错误 先使用crosscheck backup一下,检查可以重命名一下备份文件,delete expired backup删除过期文件。 如果不行再尝试重命名一下备份文件目录 *****************************************恢复到指定的scn recover database until scn 1145279; ********************* alter database open resetlogs;
这篇关于Oracle Windows异机恢复的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-06-06Package Easy(基于 NSIS 的打包exe安装包工具)使用方法-icode9专业技术文章分享
- 2024-06-06基于 casdoor 的 ELK 开源登录认证解决方案: elk-auth-casdoor-icode9专业技术文章分享
- 2024-05-29Elasticsearch慢查询日志配置
- 2024-05-29揭秘华为如此多成功项目的产品关键——Charter模板
- 2024-05-29海外IDC业务拓展的7大挑战
- 2024-05-29InLine Chat功能优化对标Github Copilot,CodeGeeX带来更高效、更直观的编程体验!
- 2024-05-29CodeGeeX 智能编程助手 6 项功能升级,在Visual Studio插件市场霸榜2周!
- 2024-05-29AutoMQ 生态集成 Apache Doris
- 2024-05-292024年IDC行业的深度挖掘:机遇、挑战与未来展望
- 2024-05-29五款扩展组件齐发 —— Volcano、Keda、Crane-scheduler 等,邀你体验