日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

修改 oracle dbid,更改数据库DBID

發(fā)布時間:2025/3/20 数据库 17 豆豆
生活随笔 收集整理的這篇文章主要介紹了 修改 oracle dbid,更改数据库DBID 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

當(dāng)克隆一個數(shù)據(jù)庫到另外一臺機器上,具有相同的數(shù)據(jù)庫名稱或者如果一個新的數(shù)據(jù)庫名稱是通過重建的控制文件,

那么需要改變DBBID,特別是如果是新的數(shù)據(jù)庫在相同的rman catalog是注冊。

尤其是如果使用rman catalog,rman catalog中只允許注冊一個DBID,相同DBID不能注冊在同一catalog當(dāng)中,下面演示改變DBID:

1、關(guān)閉數(shù)據(jù)庫,啟動到mount狀態(tài)

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、確認(rèn)sys用戶可以連接

[oracle@jzh5 ~]$ 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@jzh5 ~]$ cd $ORACLE_HOME/bin

[oracle@jzh5 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)----當(dāng)前數(shù)據(jù)庫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.---以前的數(shù)據(jù)庫與歸檔備份現(xiàn)在不可用

Database is not aware of previous backups and archived logs in Recovery Area.

Database has been shutdown, open database with RESETLOGS option.----數(shù)據(jù)庫被shutdown,以resetlogs打開。

Succesfully changed database ID.

DBNEWID - Completed succesfully.

4、打開數(shù)據(jù)庫

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@jzh5 ~]$ 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會導(dǎo)致以前的備份失效,因此在更改DBID時還需要慎重考慮。

總結(jié)

以上是生活随笔為你收集整理的修改 oracle dbid,更改数据库DBID的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。