reset database的用處

myownstars發表於2012-12-28

某資料庫使用open resetlogs開啟後,rman命令總是失敗並報告如下資訊

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03009: failure of resync command on default channel at 12/28/2012 03:43:21

RMAN-20003: target database incarnation not found in recovery catalog

這是由於catalog沒有載入最新的incarnation資訊所致

一般說來,當資料庫resetlogs開啟後,需要在rman命令列中呼叫命令reset database以通知其新的incarnation已經產生了;

另外,如果資料庫想恢復到resetlogs之前的某個狀態,也需要先呼叫此命令;

Syntax Element

Description

TO INCARNATION primary_key

Changes the current incarnation to an older incarnation. Specify the primary key of the DBINC record for the database incarnation. Run INCARNATION OF DATABASE to obtain possible key values. After you issue RESET DATABASE TO INCARNATION, then you can run RMAN commands such as RESTORE and RECOVER.

 

採用nocatalog登陸檢視rman 中資料庫incarnation資訊

db@localhost> $ORACLE_HOME/bin/rman target /

 

Recovery Manager: Release 9.2.0.8.0 - 64bit Production

 

Copyright (c) 1995, 2002, Oracle Corporation.  All rights reserved.

 

connected to target database: DB (DBID=579131802)

 

RMAN> list incarnation of database db;

 

using target database controlfile instead of recovery catalog

 

List of Database Incarnations

DB Key  Inc Key DB Name  DB ID            CUR Reset SCN  Reset Time

------- ------- -------- ---------------- --- ---------- ----------

1       1       DB      579131802        NO  1          12-FEB-05

2       2       DB      579131802        NO  8809796368498 09-JUL-11

3       3       DB      579131802        YES 9049127486070 23-DEC-12

 

RMAN> reset database;

 

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of reset command at 12/28/2012 04:03:34

RMAN-06002: command not allowed when not connected to a recovery catalog

 

採用catalog登陸

RMAN> connect catalog rman_sys/*****@rman;

 

connected to recovery catalog database

 

RMAN> list incarnation of database db;

 

 

List of Database Incarnations

DB Key  Inc Key DB Name  DB ID            CUR Reset SCN  Reset Time

------- ------- -------- ---------------- --- ---------- ----------

423298  423299  DB      579131802        NO  1          12-FEB-05

423298  52409251 DB      579131802        YES 8809796368498 09-JUL-11

--當前incarnation不是最新的,呼叫reset database註冊最新的incarnation

RMAN>  reset database;

 

new incarnation of database registered in recovery catalog

starting full resync of recovery catalog

full resync complete

 

RMAN> resync catalog;

 

starting full resync of recovery catalog

full resync complete

 

更多資訊檢視

http://space.itpub.net/15480802/viewspace-697309

http://space.itpub.net/15480802/viewspace-718437

 

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

相關文章