rman恢復控制檔案測試--log

lovestanford發表於2014-06-20
環境:Oracle 11.2.0.4 64bit  RedHat 6.5 64 bit

[oracle@rhel ~]$ rman target / catalog rman/
Recovery Manager: Release 11.2.0.4.0 - Production on Fri Jun 20 04:58:47 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database: ANDREW (DBID=2602015135)
recovery catalog database Password:
connected to recovery catalog database
RMAN> list backup summary;
List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
3752    B  0  A DISK        20-JUN-14       1       1       NO         WHOLE-DB
3753    B  0  A DISK        20-JUN-14       1       1       NO         WHOLE-DB
3754    B  0  A DISK        20-JUN-14       1       1       NO         WHOLE-DB
3755    B  0  A DISK        20-JUN-14       1       1       NO         WHOLE-DB
3757    B  0  A DISK        20-JUN-14       1       1       NO         WHOLE-DB
3796    B  A  A DISK        20-JUN-14       1       1       NO         ARCH-LOG
3798    B  A  A DISK        20-JUN-14       1       1       NO         ARCH-LOG
3834    B  F  A DISK        20-JUN-14       1       1       NO         CTR-FILE

[oracle@rhel ~]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Fri Jun 20 05:32:39 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database (not started)
RMAN>
RMAN> startup nomount;
Oracle instance started
Total System Global Area     659730432 bytes
Fixed Size                     2256152 bytes
Variable Size                415236840 bytes
Database Buffers             239075328 bytes
Redo Buffers                   3162112 bytes

RMAN> set dbid=2602015135
executing command: SET DBID
RMAN> restore controlfile;
Starting restore at 20-JUN-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=18 device type=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 06/20/2014 05:34:48
RMAN-06563: control file or SPFILE must be restored using FROM AUTOBACKUP

RMAN> restore controlfile from autobackup;
Starting restore at 20-JUN-14
using channel ORA_DISK_1
recovery area destination: /u01/app/oracle/recovey_area
database name (or database unique name) used for search: ANDREW
channel ORA_DISK_1: no AUTOBACKUPS found in the recovery area
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20140620
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20140619
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20140618
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20140617
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20140616
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20140615
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20140614
channel ORA_DISK_1: no AUTOBACKUP in 7 days found
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 06/20/2014 05:35:15
RMAN-06172: no AUTOBACKUP found or specified handle is not a valid copy or piece

RMAN> restore controlfile from '/u01/app/oracle/recovey_area/ANDREW/backupset/2014_06_20/o1_mf_ncnnf_TAG20140620T052841_9t7zpbg7_.bkp'
2> ;
Starting restore at 20-JUN-14
using channel ORA_DISK_1
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/ANDREW/control01.ctl
output file name=/u01/app/oracle/recovey_area/ANDREW/control02.ctl
Finished restore at 20-JUN-14

RMAN> sql 'alter database mount';
sql statement: alter database mount
released channel: ORA_DISK_1
RMAN> restore database;

Starting restore at 20-JUN-14

Starting implicit crosscheck backup at 20-JUN-14

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=18 device type=DISK

allocated channel: ORA_DISK_2

channel ORA_DISK_2: SID=20 device type=DISK

Crosschecked 8 objects

Finished implicit crosscheck backup at 20-JUN-14

Starting implicit crosscheck copy at 20-JUN-14

using channel ORA_DISK_1

using channel ORA_DISK_2
 .........
channel ORA_DISK_1: restore complete, elapsed time: 00:01:10
Finished restore at 20-JUN-14

RMAN> recover database;
Starting recover at 20-JUN-14
using channel ORA_DISK_1
using channel ORA_DISK_2
starting media recovery
.........
media recovery complete, elapsed time: 00:00:02
Finished recover at 20-JUN-14

RMAN> sql 'alter database open';
sql statement: alter database open
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of sql command on default channel at 06/20/2014 05:42:58
RMAN-11003: failure during parse/execution of SQL statement: alter database open
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

[oracle@rhel ~]$ oerr ora 01589

01589, 00000, "must use RESETLOGS or NORESETLOGS option for database open"
// *Cause:  Either incomplete or backup control file recovery has been
//          performed. After these types of recovery you must specify either
//          the RESETLOGS option or the NORESETLOGS option to open your
//          database.
// *Action: Specify the appropriate option.

RMAN> sql 'alter database open NORESETLOGS';
sql statement: alter database open NORESETLOGS
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of sql command on default channel at 06/20/2014 05:43:55
RMAN-11003: failure during parse/execution of SQL statement: alter database open NORESETLOGS
ORA-01588: must use RESETLOGS option for database open

[oracle@rhel]$ oerr ora 01588
01588, 00000, "must use RESETLOGS option for database open"
// *Cause: An earlier attempt to open the database with the RESETLOGS option
//         did not complete, or recovery was done with a control file backup,
//         or a FLASHBACK DATABASE was done.
// *Action: Use the RESETLOGS option when opening the database.

RMAN> sql 'alter database open RESETLOGS';
sql statement: alter database open RESETLOGS
----
SQL*Plus: Release 11.2.0.4.0 Production on Fri Jun 20 05:47:25 2014
Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

SQL> archive log list;

Database log mode           Archive Mode
Automatic archival           Enabled
Archive destination           USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     1
Next log sequence to archive   1
Current log sequence           1

SQL> select DBID,name,CREATED,RESETLOGS_CHANGE#,LOG_MODE,CURRENT_SCN from v$database;
      DBID NAME      CREATED   RESETLOGS_CHANGE# LOG_MODE     CURRENT_SCN
---------- --------- --------- ----------------- ------------ -----------

2602015135 ANDREW    13-MAR-14         1564776       ARCHIVELOG      1570849

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/21754115/viewspace-1190252/,如需轉載,請註明出處,否則將追究法律責任。

相關文章