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>
在进行数据库恢复的过程中,很多时候我们需要知道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>
参照
http://www.eygle.com/archives/2006/02/oracle_howto_get_oracle_dbid.html