Chinaunix首页 | 论坛 | 博客
  • 博客访问: 234947
  • 博文数量: 15
  • 博客积分: 1490
  • 博客等级: 上尉
  • 技术积分: 460
  • 用 户 组: 普通用户
  • 注册时间: 2006-11-18 15:28
文章分类

全部博文(15)

文章存档

2011年(3)

2009年(2)

2008年(10)

我的朋友

分类:

2008-10-28 22:15:11

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>
 
阅读(805) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~