特殊情况下如何找出数据库的DBID

作者: Maclean Liu , post on September 15th, 2009 , English Version
【本站文章除注明转载外,均为本站原创编译】
转载请注明:文章转载自: Oracle Clinic – Maclean Liu的个人技术博客 [http://www.oracledatabase12g.com/]
本文标题: 特殊情况下如何找出数据库的DBID
本文永久地址: http://www.oracledatabase12g.com/archives/%e7%89%b9%e6%ae%8a%e6%83%85%e5%86%b5%e4%b8%8b%e5%a6%82%e4%bd%95%e6%89%be%e5%87%ba%e6%95%b0%e6%8d%ae%e5%ba%93%e7%9a%84dbid.html

以下文字摘自metalink:

Fact(s)
~~~~~~~~
You need to determine the dbid of your database for use with RMAN but you are
not sure how this can be done, especially in an unusual circumstance such as the
loss of all of your database files.

Symptom(s)
~~~~~~~~~~
You may be in a situation where your database is down due to the loss of all
database files, you need the dbid to begin your recovery, you are not using a
recovery catalog, and you did not previously note the dbid of your database.
You need to know how at this point you can determine the dbid for your database.
Or, you may simple want to know the best method to determine the dbid of your
database.

Fix
~~~~
There are several methods you can use to determine the dbid of your database.
This can be done both when the database is open / functioning normally and when
all the database files are lost causing your database to be unavailable for
queries that would allow you to display the dbid of your database via a query.

1)  If your database is open you may issue the following query:

SQL>  SELECT dbid FROM v$database;

DBID
———-
1411146558
——————————————————————————–

2)  If you are using a recovery catalog then connect to the recovery catalog via
RMAN and issue the “list incarnation” command. You must first nomount the target
database.  For example:

D:\> rman target <user>/<pwd>@mydb rcvcat <user>/<pwd>@rcat

Recovery Manager: Release 8.1.7.4.1 – Production

RMAN-06193: connected to target database (not started)
RMAN-06008: connected to recovery catalog database

RMAN> startup nomount

RMAN-06196: Oracle instance started

Total System Global Area      94980124 bytes

Fixed Size                       75804 bytes
Variable Size                 57585664 bytes
Database Buffers              37240832 bytes
Redo Buffers                     77824 bytes

RMAN> list incarnation;

RMAN-03022: compiling command: list

List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            CUR Reset SCN  Reset Time
——- ——- ——– —————- — ———- ———-
1       2       ORCL817  1411146558       YES 282854     03-DEC-02
——————————————————————————–

3)  If you have a saved copy of the screen details from a previous RMAN session
you may refer to this output for the dbid.  For example:

D:\> rman target <user>/<pwd>@mydb rcvcat <user>/<pwd>@rcat

Recovery Manager: Release 8.1.7.4.1 – Production

RMAN-06005: connected to target database: ORCL817 (DBID=1411146558)
RMAN-06008: connected to recovery catalog database
——————————————————————————–

4)  If you are using RMAN with version 9i you have the ability to configure the
automatic backup of your control files.  If you have this feature on locate one
of your control file autobackups.  The name of this file will tell you the dbid
of your database. For example:

D:\ORACLE\ORA92\DATABASE> dir
Volume in drive D has no label.
Volume Serial Number is 3E3B-12FD

Directory of D:\ORACLE\ORA92\DATABASE

11/20/2002  02:06p      <DIR>          .
11/20/2002  02:06p      <DIR>          ..
01/23/2003  11:12a           2,064,384 C-2282329623-20030123-00

In this case 2282329623 is the dbid for this database.
——————————————————————————–

5)  If the four steps above are not available because you have lost all the files
for your database, you are not using a recovery catalog, you are not using
autobackup of your controlfile, etc., but you have an old control file available,
mount the database with the old control file then query v$database as in step 1
to obtain the dbid of your database.

© 2009, www.oracledatabase12g.com. 版权所有.文章允许转载,但必须以链接方式注明源地址,否则追究法律责任.

相关文章 | Related posts:

  1. 使用Oracle RMAN脚本
  2. Oracle恢复目录的管理使用简要
  3. Oracle中RMAN恢复目录性能问题研究

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>