中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

如何更改數據庫DBID

發布時間:2021-11-10 14:06:19 來源:億速云 閱讀:217 作者:小新 欄目:關系型數據庫

小編給大家分享一下如何更改數據庫DBID,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!

更改數據庫DBID

當克隆一個數據庫到另外一臺機器上,具有相同的數據庫名稱或者如果一個新的數據庫名稱是通過重建的控制文件,
那么需要改變DBBID,特別是如果是新的數據庫在相同的rman catalog是注冊。
尤其是如果使用rman catalog,rman catalog中只允許注冊一個DBID,相同DBID不能注冊在同一catalog當中,下面演示改變DBID:
1、關閉數據庫,啟動到mount狀態
SYS@jzh>shu immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@jzh>startup mount
ORACLE instance started.
Total System Global Area  626327552 bytes
Fixed Size                  2230952 bytes
Variable Size             444597592 bytes
Database Buffers          176160768 bytes
Redo Buffers                3338240 bytes
Database mounted.
2、確認sys用戶可以連接
[oracle@jzh6 ~]$ sqlplus sys/oracle@jzh as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Sun Sep 13 08:43:52 2015
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
3、更改DBID
[oracle@jzh6 ~]$ cd $ORACLE_HOME/bin
[oracle@jzh6 bin]$ ./nid target=sys/oracle@jzh
DBNEWID: Release 11.2.0.3.0 - Production on Sun Sep 13 08:45:08 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
Connected to database JZH (DBID=233255254)----當前數據庫DBID
Connected to server version 11.2.0
Control Files in database:
    /u01/app/oracle/oradata/jzh/control01.ctl
    /u01/app/oracle/fast_recovery_area/jzh/control02.ctl
Change database ID of database JZH? (Y/[N]) => y----是否更改DBID,輸入Y
Proceeding with operation
Changing database ID from 233255254 to 249044244 -----DBID從233255254更改為249044244 
    Control File /u01/app/oracle/oradata/jzh/control01.ctl - modified
    Control File /u01/app/oracle/fast_recovery_area/jzh/control02.ctl - modified
    Datafile /u01/app/oracle/oradata/jzh/system01.db - dbid changed
    Datafile /u01/app/oracle/oradata/jzh/sysaux01.db - dbid changed
    Datafile /u01/app/oracle/oradata/jzh/undotbs01.db - dbid changed
    Datafile /u01/app/oracle/oradata/jzh/users01.db - dbid changed
    Datafile /u01/app/oracle/oradata/jzh/test01.db - dbid changed
    Datafile /u01/app/oracle/oradata/jzh/temp01.db - dbid changed
    Control File /u01/app/oracle/oradata/jzh/control01.ctl - dbid changed
    Control File /u01/app/oracle/fast_recovery_area/jzh/control02.ctl - dbid changed
    Instance shut down
Database ID for database JZH changed to 249044244.
All previous backups and archived redo logs for this database are unusable.---以前的數據庫與歸檔備份現在不可用
Database is not aware of previous backups and archived logs in Recovery Area.
Database has been shutdown, open database with RESETLOGS option.----數據庫被shutdown,以resetlogs打開。
Succesfully changed database ID.
DBNEWID - Completed succesfully.
4、打開數據庫
SYS@jzh>startup mount
ORACLE instance started.
Total System Global Area  626327552 bytes
Fixed Size                  2230952 bytes
Variable Size             444597592 bytes
Database Buffers          176160768 bytes
Redo Buffers                3338240 bytes
Database mounted.
SYS@jzh>alter database open resetlogs;
Database altered.
5、檢查新的DBID
[oracle@jzh6 ~]$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Sun Sep 13 08:50:45 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database: JZH (DBID=249044244)----新的DBID
由于更改DBID會導致以前的備份失效,因此在更改DBID時還需要慎重考慮。

以上是“如何更改數據庫DBID”這篇文章的所有內容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內容對大家有所幫助,如果還想學習更多知識,歡迎關注億速云行業資訊頻道!

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

平山县| 武陟县| 会昌县| 边坝县| 红桥区| 沙湾县| 利川市| 武宣县| 无锡市| 汽车| 宁阳县| 武安市| 定边县| 恩平市| 崇礼县| 沁阳市| 奇台县| 梨树县| 遂溪县| 巴青县| 宽城| 汪清县| 河南省| 双峰县| 营山县| 宁夏| 克拉玛依市| 徐州市| 荣成市| 晋江市| 齐河县| 冀州市| 乌拉特后旗| 乌审旗| 台中县| 文昌市| 德安县| 泊头市| 来凤县| 东乡族自治县| 张家川|