婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > oracle中如何獲得數(shù)據(jù)庫的DBID信息

oracle中如何獲得數(shù)據(jù)庫的DBID信息

熱門標(biāo)簽:百度地圖標(biāo)注素材 征服眼公司地圖標(biāo)注 征服者火車站地圖標(biāo)注 外呼線路外顯本地號碼 美圖秀秀地圖標(biāo)注 開封智能外呼系統(tǒng)廠家 阿爾巴尼亞地圖標(biāo)注app 人工智能地圖標(biāo)注自己能做嗎 word地圖標(biāo)注方向

1.查詢v$database獲得

由于DBID在控制文件和數(shù)據(jù)文件中都存在記錄,所以如果能夠mount數(shù)據(jù)庫就可以查詢v$database視圖獲得.

復(fù)制代碼 代碼如下:

SQL> alter database mount;
Database altered.
SQL> select dbid from v$database;
      DBID
----------
3152029224

2.在nomount狀態(tài)時

如果數(shù)據(jù)庫配置了自動控制文件備份(Oracle9i),并且名稱是缺省的,那么我們可以從自動備份文件獲得DBID.

復(fù)制代碼 代碼如下:

[oracle@jumper dbs]$ cd $ORACLE_HOME/dbs
[oracle@jumper dbs]$ ll c-*
-rw-r----- 1 oracle dba 3375104 Dec 21 11:13 c-3152029224-20051221-00
-rw-r----- 1 oracle dba 3358720 Jan 21 14:03 c-3152029224-20060121-00
-rw-r----- 1 oracle dba 3358720 Jan 21 14:08 c-3152029224-20060121-01

這里的3152029224就是DBID。在10g中,使用Flash Recovery Area,則沒有這個命名規(guī)則。

3.從自動備份中恢復(fù)

需要或缺DBID進(jìn)行恢復(fù)通常是因?yàn)閬G失了所有的控制文件.在恢復(fù)時會遇到錯誤.

復(fù)制代碼 代碼如下:

[oracle@jumper dbs]$ rman target  /

Recovery Manager: Release 9.2.0.4.0 - Production

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

connected to target database: conner (not mounted)

RMAN> restore controlfile from autobackup;

Starting restore at 05-FEB-06

using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=11 devtype=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 02/05/2006 20:47:25
RMAN-06495: must explicitly specify DBID with SET DBID command

如果存在自動備份,我們通常可以直接恢復(fù)控制文件,mount數(shù)據(jù)庫之后就好辦了:

復(fù)制代碼 代碼如下:

RMAN> restore controlfile from '/opt/oracle/product/9.2.0/dbs/c-3152029224-20051221-00';

Starting restore at 05-FEB-06

using channel ORA_DISK_1
channel ORA_DISK_1: restoring controlfile
channel ORA_DISK_1: restore complete
replicating controlfile
input filename=/opt/oracle/oradata/conner/control01.ctl
output filename=/opt/oracle/oradata/conner/control02.ctl
output filename=/opt/oracle/oradata/conner/control03.ctl
Finished restore at 05-FEB-06

4.直接從幸存的文件中讀取

由于DBID存在于數(shù)據(jù)文件及控制文件中,所以我們可以通過PL/SQL程序直接從文件中讀取:

復(fù)制代碼 代碼如下:

SQL> select eygle.get_dbid('/opt/oracle/oradata/conner','user02.dbf') from dual;

EYGLE.GET_DBID('/OPT/ORACLE/OR
------------------------------
3152029224
SQL> select dbid from v$database;
DBID
----------
3152029224

其實(shí)更簡單的,用BBED就好了。

這種方法僅為測試興趣所致,不被推薦.

標(biāo)簽:酒泉 宜春 葫蘆島 泰安 海北 孝感 淮南 六安

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《oracle中如何獲得數(shù)據(jù)庫的DBID信息》,本文關(guān)鍵詞  oracle,中,如何,獲得,數(shù)據(jù)庫,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《oracle中如何獲得數(shù)據(jù)庫的DBID信息》相關(guān)的同類信息!
  • 本頁收集關(guān)于oracle中如何獲得數(shù)據(jù)庫的DBID信息的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 运城市| 黄山市| 高唐县| 湟中县| 洪洞县| 罗平县| 和林格尔县| 临洮县| 阳江市| 韶关市| 郯城县| 武宣县| 瓮安县| 台北市| 大姚县| 库尔勒市| 宜城市| 东安县| 沽源县| 涿鹿县| 若尔盖县| 上高县| 枣阳市| 洪泽县| 勐海县| 成安县| 徐闻县| 临清市| 黄大仙区| 南城县| 长汀县| 鄢陵县| 长垣县| 太和县| 讷河市| 隆回县| 镇远县| 河曲县| 临邑县| 获嘉县| 平安县|