RMAN - "丢失控制文件的恢复"
来源:互联网 发布:windows平板刷机 编辑:程序博客网 时间:2024/05/16 17:59
OS:
Oracle Linux Server release 5.7
DB:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 -64bit Production
1.
如何获取数据库的DBID
由于DBID在控制文件和数据文件都存在记录,所以如果能够mount数据库就可以查询v$database视图获得
SQL> select dbid from v$database;
----------
SQL>
2.
在nomount状态时
[root@yoon ~]# cd /u01/archivelog/
[root@yoon archivelog]# ls -lr
total 19872
-rw-r----- 1 oracle oinstall 10158080 Sep 15 12:47 c-675362528-20130915-01
-rw-r----- 1 oracle oinstall 10158080 Sep 11 16:20c-675362528-20130911-01
[root@yoon archivelog]#
这里的675362528就是DBID
3.
连接到RMAN
[oracle@yoon ~]$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Sun Sep 1512:56:09 2013
Copyright (c) 1982, 2011, Oracle and/or itsaffiliates.
connected to target database (not started)
RMAN>
4.
关闭数据库
RMAN> shutdown immediate
database closed
database dismounted
Oracle instance shut down
RMAN>
5.delete controlfile
RMAN> host;
[oracle@yoon ~]$ cd /u01/oracle/oradata/yoon/
[oracle@yoon yoon]$ rm -rf control01.ctl
[oracle@yoon yoon]$
6.由于目标数据库控制文件丢失,在此处必须指定dbid
RMAN> startup nomount
connected to target database (not started)
Oracle instance started
Total System GlobalArea
FixedSize
VariableSize
DatabaseBuffers
RedoBuffers
RMAN>
RMAN> set dbid 675362528
executing command: SET DBID
RMAN> restore controlfile from'/u01/archivelog/c-675362528-20130915-01';
Starting restore at 15-SEP-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/oracle/oradata/yoon/control01.ctl
output filename=/u01/oracle/fast_recovery_area/yoon/control02.ctl
Finished restore at 15-SEP-13
RMAN>
RMAN> sql 'alter database mount';
sql statement: alter database mount
released channel: ORA_DISK_1
RMAN>
RMAN> restore database;
Starting restore at 15-SEP-13
Starting implicit crosscheck backup at 15-SEP-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK
Crosschecked 1 objects
Finished implicit crosscheck backup at 15-SEP-13
Starting implicit crosscheck copy at 15-SEP-13
using channel ORA_DISK_1
Finished implicit crosscheck copy at 15-SEP-13
searching for all files in the recovery area
cataloging files...
no files cataloged
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backupset
channel ORA_DISK_1: restoring datafile 00001 to/u01/oracle/oradata/yoon/system01.dbf
channel ORA_DISK_1: restoring datafile 00002 to/u01/oracle/oradata/yoon/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00003 to/u01/oracle/oradata/yoon/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00004 to/u01/oracle/oradata/yoon/users01.dbf
channel ORA_DISK_1: reading from backup piece/u01/oracle/fast_recovery_area/YOON/backupset/2013_09_15/o1_mf_nnndf_TAG20130915T124630_93bgx6qx_.bkp
channel ORA_DISK_1: piecehandle=/u01/oracle/fast_recovery_area/YOON/backupset/2013_09_15/o1_mf_nnndf_TAG20130915T124630_93bgx6qx_.bkptag=TAG20130915T124630
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:01:05
Finished restore at 15-SEP-13
RMAN>
RMAN> recover database;
Starting recover at 15-SEP-13
using channel ORA_DISK_1
starting media recovery
archived log for thread 1 with sequence 1 is already on disk asfile /u01/oracle/oradata/yoon/redo01.log
archived log file name=/u01/oracle/oradata/yoon/redo01.log thread=1sequence=1
media recovery complete, elapsed time: 00:00:00
Finished recover at 15-SEP-13
RMAN>
RMAN> sql 'alter database openresetlogs';
sql statement: alter database open resetlogs
RMAN>
注意:because of
- RMAN - "丢失控制文件的恢复"
- 将输入的string中的"yes" 改为"no"
- Unix/Linux 脚本中 "set -e" 的作…
- ch10_ex42 序列的"中值记录"…
- ORA-14037: 分区 "P8" 的分区界限…
- 说说程序员 "必备能力"
- "跟对人" 比 "能干" 更重要!
- identifier "tBoolean" is undefie…
- Linux "ls -l"文件列表权限详解
- "No Report Specified"错误的可能…
- yum groupinstall &quot…
- React-Native "RC…
- 实战rman恢复(1)丢失控制文件的恢复
- 实战rman恢复(1)丢失控制文件的恢复
- variable "l" was set but n…
- What is a Perforce "shelved" fil…
- Solution for "Waiting for …
- Xlib: connection to ":0.0" refus…
- HDU - 3359 Kind of a Blur - 高斯-约当消元
- ORA-01207: file is&nbs…
- ORA-00265: instance re…
- IIS_设置64位机器上的(IIS6/IIS7)兼容32位程序
- SQL开发 循序渐进
- RMAN - "丢失控制文件的恢复"
- RMAN - 备份异机恢复
- springMVC3.2+Hibernate4+freemarker入门简单小例子,适合初学者
- ORACLE 单实例完全卸载数据库
- Oracle 11g Windows 迁移至 Linux
- Mac Chrome允许跨域
- 索引大小及占表的空间
- oracle 配置 oem
- java synchronized类锁,对象锁详解(转载)