原创RMAN恢复崩溃数据库

[oracle@localhost ~]$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Mon Oct 25 02:42:31 2010

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

connected to target database: asc (not mounted)

RMAN> restore database;

Starting restore at 25-OCT-10
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 10/25/2010 02:42:46
ORA-01507: database not mounted

RMAN> restore controlfile from autobackup;

Starting restore at 25-OCT-10
using channel ORA_DISK_1

recovery area destination: /home/oracle/oracle10g/flash_recovery_area
database name (or database unique name) used for search: ASC
channel ORA_DISK_1: autobackup found in the recovery area
channel ORA_DISK_1: autobackup found: /home/oracle/oracle10g/flash_recovery_area/ASC/autobackup/2010_10_25/o1_mf_s_733285333_6dbm262r_.bkp
channel ORA_DISK_1: control file restore from autobackup complete
output filename=/home/oracle/oracle10g/oradata/asc/asc/control01.ctl
output filename=/home/oracle/oracle10g/oradata/asc/asc/control02.ctl
output filename=/home/oracle/oracle10g/oradata/asc/asc/control03.ctl
Finished restore at 25-OCT-10

RMAN>

RMAN>

RMAN> quit


Recovery Manager complete.
[oracle@localhost ~]$
[oracle@localhost ~]$
[oracle@localhost ~]$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Mon Oct 25 02:44:45 2010

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

connected to target database: ASC (DBID=20733190, not open)

RMAN>

RMAN> restore database;

Starting restore at 25-OCT-10
Starting implicit crosscheck backup at 25-OCT-10
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=157 devtype=DISK
Crosschecked 11 objects
Finished implicit crosscheck backup at 25-OCT-10

Starting implicit crosscheck copy at 25-OCT-10
using channel ORA_DISK_1
Crosschecked 1 objects
Finished implicit crosscheck copy at 25-OCT-10

searching for all files in the recovery area
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /home/oracle/oracle10g/flash_recovery_area/ASC/autobackup/2010_10_25/o1_mf_s_733285333_6dbm262r_.bkp

using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /home/oracle/oracle10g/oradata/asc/asc/system01.dbf
channel ORA_DISK_1: reading from backup piece /home/oracle/rmanbackup/asc/101025-ASC311.bak
channel ORA_DISK_1: restored backup piece 1
piece handle=/home/oracle/rmanbackup/asc/101025-ASC311.bak tag=TAG20101025T022134
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00003 to /home/oracle/oracle10g/oradata/asc/asc/sysaux01.dbf
restoring datafile 00004 to /home/oracle/oracle10g/oradata/asc/asc/users01.dbf
channel ORA_DISK_1: reading from backup piece /home/oracle/rmanbackup/asc/101025-ASC321.bak
channel ORA_DISK_1: restored backup piece 1
piece handle=/home/oracle/rmanbackup/asc/101025-ASC321.bak tag=TAG20101025T022134
channel ORA_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00002 to /home/oracle/oracle10g/oradata/asc/asc/undotbs01.dbf
restoring datafile 00005 to /home/oracle/oracle10g/oradata/asc/asc/yanxj01.dbf
channel ORA_DISK_1: reading from backup piece /home/oracle/rmanbackup/asc/101025-ASC331.bak
channel ORA_DISK_1: restored backup piece 1
piece handle=/home/oracle/rmanbackup/asc/101025-ASC331.bak tag=TAG20101025T022134
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
Finished restore at 25-OCT-10

RMAN> recover database;

Starting recover at 25-OCT-10
using channel ORA_DISK_1

starting media recovery

channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=4
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=5
channel ORA_DISK_1: reading from backup piece /home/oracle/rmanbackup/arc/101025-ASC351.arc
channel ORA_DISK_1: restored backup piece 1
piece handle=/home/oracle/rmanbackup/arc/101025-ASC351.arc tag=TAG20101025T022211
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
archive log filename=/home/oracle/archive/arch_1_4_733283281.dbf thread=1 sequence=4
archive log filename=/home/oracle/archive/arch_1_5_733283281.dbf thread=1 sequence=5
unable to find archive log
archive log thread=1 sequence=6
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 10/25/2010 02:46:10
RMAN-06054: media recovery requesting unknown log: thread 1 seq 6 lowscn 486865

RMAN>

RMAN> list archive log all;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "identifier": expecting one of: "all, archivelog, backup, backuppiece, backupset, backed, completed, copy, controlfilecopy, datafilecopy, device, expired, global, incarnation, like, proxy, recoverable, script, tag"
RMAN-01008: the bad identifier was: archive
RMAN-01007: at line 2 column 6 file: standard input

RMAN> list archivelog all;


List of Archived Log Copies
Key     Thrd Seq     S Low Time  Name
------- ---- ------- - --------- ----
21      1    4       A 25-OCT-10 /home/oracle/archive/arch_1_4_733283281.dbf
22      1    5       A 25-OCT-10 /home/oracle/archive/arch_1_5_733283281.dbf

RMAN> list backup of archivelog all;


List of Backup Sets
===================

BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
27      107.50K    DISK        00:00:01     25-OCT-10     
        BP Key: 27   Status: EXPIRED  Compressed: NO  Tag: TAG20101025T015053
        Piece Name: /home/oracle/rmanbackup/arc/101025-ASC281.arc

  List of Archived Logs in backup set 27
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
  1    1       464720     25-OCT-10 465041     25-OCT-10
  1    2       465041     25-OCT-10 465055     25-OCT-10

BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
34      1.13M      DISK        00:00:01     25-OCT-10     
        BP Key: 34   Status: AVAILABLE  Compressed: NO  Tag: TAG20101025T022211
        Piece Name: /home/oracle/rmanbackup/arc/101025-ASC351.arc

  List of Archived Logs in backup set 34
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
  1    3       465055     25-OCT-10 485921     25-OCT-10
  1    4       485921     25-OCT-10 486851     25-OCT-10
  1    5       486851     25-OCT-10 486865     25-OCT-10

RMAN>

RMAN> sql 'alter database open resetlogs';

sql statement: alter database open resetlogs

RMAN> quit


Recovery Manager complete.
[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Oct 25 03:04:29 2010

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL>
SQL> startup
ORACLE instance started.

Total System Global Area  218103808 bytes
Fixed Size                  1218604 bytes
Variable Size              75499476 bytes
Database Buffers          138412032 bytes
Redo Buffers                2973696 bytes
Database mounted.
Database opened.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/15037413/viewspace-676687/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/15037413/viewspace-676687/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值