系统崩溃后,数据库只剩下数据文件,比如SYSTEM01.DBF,请问如何从这些文件中获取到原来的dbid,以便用于恢复数据库?谢谢

解决方案 »

  1.   

    Oracle如何获得数据库的DBID 
    在进行数据库恢复的过程中,很多时候我们需要知道Oracle数据库的DBID,通常有以下几种方法可以获得数据库的DBID.法1:
    在命令行下
    C:\Documents and Settings\zhhs>rman target /
    恢复管理器: 版本9.2.0.7.0 - Production
    Copyright (c) 1995, 2002, Oracle Corporation.  All rights reserved.
    连接到目标数据库: ORCL (DBID=1150171135)
    RMAN> show all;
    正在使用目标数据库控制文件替代恢复目录
    RMAN 配置参数为:
    CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
    CONFIGURE BACKUP OPTIMIZATION OFF; # default
    CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
    CONFIGURE CONTROLFILE AUTOBACKUP ON;
    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
    CONFIGURE DEVICE TYPE DISK PARALLELISM 1; # default
    CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
    CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
    CONFIGURE MAXSETSIZE TO UNLIMITED; # default
    CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'E:\ORACLE\ORA92\DATABASE\SNCFORCL.ORA';
    # default
    RMAN>
    RMAN> list incarnation;数据库 Incarnations 列表
    DB 关键字  Inc 关键字 DB 名  DB ID            CUR 重置 SCN   重置时间
    ------- ------- -------- ---------------- --- ---------- ----------
    1       1       ORCL     1150171135       YES 1          12-5月 -07
    RMAN>
    法2:
    C:\Documents and Settings\zhhs>sqlplus "/ as sysdba"
    SQL*Plus: Release 9.2.0.7.0 - Production on 星期二 10月 28 22:19:24 2008
    Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.连接到:
    Oracle9i Enterprise Edition Release 9.2.0.7.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.7.0 - Production
    SQL> select dbid from v$database;
          DBID
    ----------
    1150171135
    SQL>
      

  2.   

    貌似eygle的网站上有相关的资料
    参照
    http://www.eygle.com/archives/2006/02/oracle_howto_get_oracle_dbid.html
      

  3.   

    http://www.itpub.net/viewthread.php?tid=1019508&extra=&page=1无实践