DBNEWIN工具使用一:更改DBID
DBNEWID 工具的使用:
DBNEWID 工具是用於更改資料庫SID和資料庫DBNAME;DBID是ORACLE用來標識這個資料庫的唯一內部ID號,DBNAME用於標識資料庫的唯一名稱;
通常情況下使用者使用者是不容易修改ORACLE的DBID和DBNAME的,但是有特殊情況的時候需要修改,ORACLE為我們提供了DBNEWID這個工具來輔助我們去
更改DBID和DBNAME。
DBNEWID 工具是用於更改資料庫SID和資料庫DBNAME;DBID是ORACLE用來標識這個資料庫的唯一內部ID號,DBNAME用於標識資料庫的唯一名稱;
通常情況下使用者使用者是不容易修改ORACLE的DBID和DBNAME的,但是有特殊情況的時候需要修改,ORACLE為我們提供了DBNEWID這個工具來輔助我們去
更改DBID和DBNAME。
一、更改DBID
DBID是資料庫唯一內部識別符號,一旦更改後,該資料庫的原有日誌檔案和歸檔檔案均不能使用,同時也會修改所有的控制檔案資料檔案頭部的DBID,並
且在啟動的時候必須使用resetlogs選項重新建立資料庫的日誌組。本人建議在生產環境中不到萬不得已最好還是別改,如果一旦要修改DBID,一定要事先停
止當前資料庫的所有業務並用RMAN對資料庫進行一次全備,後再修改,備份過程再次就不論述了,在後期的RMAN文件中將會有詳細的論述。
DBID是資料庫唯一內部識別符號,一旦更改後,該資料庫的原有日誌檔案和歸檔檔案均不能使用,同時也會修改所有的控制檔案資料檔案頭部的DBID,並
且在啟動的時候必須使用resetlogs選項重新建立資料庫的日誌組。本人建議在生產環境中不到萬不得已最好還是別改,如果一旦要修改DBID,一定要事先停
止當前資料庫的所有業務並用RMAN對資料庫進行一次全備,後再修改,備份過程再次就不論述了,在後期的RMAN文件中將會有詳細的論述。
1、檢查資料庫的當前DBID
SQL> select dbid,name from v$database;
DBID NAME
---------- ---------
4284499451 WWL
---------- ---------
4284499451 WWL
2、關閉資料庫,並將資料庫啟動到MOUNT狀態
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1218992 bytes
Variable Size 62916176 bytes
Database Buffers 218103808 bytes
Redo Buffers 2973696 bytes
Database mounted.
SQL> host
Fixed Size 1218992 bytes
Variable Size 62916176 bytes
Database Buffers 218103808 bytes
Redo Buffers 2973696 bytes
Database mounted.
SQL> host
3、透過使用NID命令來修改資料庫的DBID
[oracle@ora10g dbs]$ nid target=sys/oracle
[oracle@ora10g dbs]$ nid target=sys/oracle
DBNEWID: Release 10.2.0.1.0 - Production on Wed Dec 7 00:18:52 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to database WWL (DBID=4284499451)
Connected to server version 10.2.0
Control Files in database:
/oradata/wwl/control01.ctl
/oradata/wwl/control02.ctl
/oradata/wwl/control03.ctl
/oradata/wwl/control01.ctl
/oradata/wwl/control02.ctl
/oradata/wwl/control03.ctl
Change database ID of database WWL? (Y/[N]) => Y
Proceeding with operation
Changing database ID from 4284499451 to 4286252909
Control File /oradata/wwl/control01.ctl - modified
Control File /oradata/wwl/control02.ctl - modified
Control File /oradata/wwl/control03.ctl - modified
Datafile /oradata/wwl/system01.dbf - dbid changed
Datafile /data2/test_local_01.dbf - dbid changed
Datafile /oradata/wwl/sysaux01.dbf - dbid changed
Datafile /oradata/wwl/users01.dbf - dbid changed
Datafile /oradata/wwl/test01_01.dbf - dbid changed
Datafile /data2/test001_01.dbf - dbid changed
Datafile /data2/test001_02.dbf - dbid changed
Datafile /data2/test002_01.dbf - dbid changed
Datafile /data2/bigfile001.dbf - dbid changed
Datafile /data2/undotbs2_01.dbf - dbid changed
Datafile /oradata/wwl/temp01.dbf - dbid changed
Datafile /data2/temp01_01.dbf - dbid changed
Control File /oradata/wwl/control01.ctl - dbid changed
Control File /oradata/wwl/control02.ctl - dbid changed
Control File /oradata/wwl/control03.ctl - dbid changed
Instance shut down
Changing database ID from 4284499451 to 4286252909
Control File /oradata/wwl/control01.ctl - modified
Control File /oradata/wwl/control02.ctl - modified
Control File /oradata/wwl/control03.ctl - modified
Datafile /oradata/wwl/system01.dbf - dbid changed
Datafile /data2/test_local_01.dbf - dbid changed
Datafile /oradata/wwl/sysaux01.dbf - dbid changed
Datafile /oradata/wwl/users01.dbf - dbid changed
Datafile /oradata/wwl/test01_01.dbf - dbid changed
Datafile /data2/test001_01.dbf - dbid changed
Datafile /data2/test001_02.dbf - dbid changed
Datafile /data2/test002_01.dbf - dbid changed
Datafile /data2/bigfile001.dbf - dbid changed
Datafile /data2/undotbs2_01.dbf - dbid changed
Datafile /oradata/wwl/temp01.dbf - dbid changed
Datafile /data2/temp01_01.dbf - dbid changed
Control File /oradata/wwl/control01.ctl - dbid changed
Control File /oradata/wwl/control02.ctl - dbid changed
Control File /oradata/wwl/control03.ctl - dbid changed
Instance shut down
Database ID for database WWL changed to 4286252909.
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.
Succesfully changed database ID.
DBNEWID - Completed succesfully.
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.
Succesfully changed database ID.
DBNEWID - Completed succesfully.
4、成功修改完DBID後登陸到資料庫
[oracle@ora10g dbs]$ sqlplus / as sysdba
[oracle@ora10g dbs]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Dec 7 00:19:41 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
5、首先啟動到mount狀態
SQL> startup mount;
ORACLE instance started.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1218992 bytes
Variable Size 62916176 bytes
Database Buffers 218103808 bytes
Redo Buffers 2973696 bytes
Database mounted.
Fixed Size 1218992 bytes
Variable Size 62916176 bytes
Database Buffers 218103808 bytes
Redo Buffers 2973696 bytes
Database mounted.
6、將資料庫啟動到open resetlogs狀態,這個時候將會清空原有的redo log組中的資訊
SQL> alter database open resetlogs;
SQL> alter database open resetlogs;
Database altered.
7、我們看到DBID已由原來的4284499451改變為4286252909,當然這個改變的值不是我們自己可以控制的。
SQL> select dbid,name from v$database;
SQL> select dbid,name from v$database;
DBID NAME
---------- ---------
4286252909 WWL
---------- ---------
4286252909 WWL
SQL> select * from v$log;
8、檢查redo log 資訊已經清空。
SQL> set line 200
SQL> select * from v$log;
SQL> set line 200
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME
---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ----------
1 1 1 52428800 1 NO CURRENT 670390 07-12?-11
2 1 0 52428800 1 YES UNUSED 0
3 1 0 52428800 1 YES UNUSED 0
---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ----------
1 1 1 52428800 1 NO CURRENT 670390 07-12?-11
2 1 0 52428800 1 YES UNUSED 0
3 1 0 52428800 1 YES UNUSED 0
SQL> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- ---------------------------------------- ---
3 ONLINE /oradata/wwl/redo03.log NO
2 ONLINE /oradata/wwl/redo02.log NO
1 ONLINE /oradata/wwl/redo01.log NO
---------- ------- ------- ---------------------------------------- ---
3 ONLINE /oradata/wwl/redo03.log NO
2 ONLINE /oradata/wwl/redo02.log NO
1 ONLINE /oradata/wwl/redo01.log NO
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME
---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ----------
1 1 4 52428800 1 YES INACTIVE 671378 07-12?-11
2 1 5 52428800 1 NO CURRENT 671389 07-12?-11
3 1 3 52428800 1 YES INACTIVE 671375 07-12?-11
---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ----------
1 1 4 52428800 1 YES INACTIVE 671378 07-12?-11
2 1 5 52428800 1 NO CURRENT 671389 07-12?-11
3 1 3 52428800 1 YES INACTIVE 671375 07-12?-11
SQL>
SQL>
SQL>
SQL>
SQL>
SQL>
SQL>
SQL>
SQL>
SQL>
SQL>
SQL>
SQL>
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/20674423/viewspace-713741/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 更改資料庫DBID資料庫
- DBNEWID工具使用二:更改DBNAME
- 11g DBNEWID工具修改DBID碰到的問題
- 獲取Oracle DBIDOracle
- oracle 之修改DBIDOracle
- Oracle identifiers :DBIDOracleIDE
- oracle 修改dbid和dbnameOracle
- Oracle 設定指定DBIDOracle
- Oracle NID工具修改資料庫DBID和資料庫名稱Oracle資料庫
- win10系統使用自帶畫圖工具更改照片大小的方法Win10
- dbnewid修改dbid和庫名
- Windows下更改並使用NTPWindows
- Oracle rac使用nid和dbms_backup_restore包修改dbid和dbnameOracleREST
- 記一次通過DBNEWID工具修改DBID時的NID-00135: There are 1 active threads錯誤thread
- ETL工具(kettl)使用系列(一)
- 更改oracle使用者資訊(轉)Oracle
- centos7 用工具nmtui更改網路卡設定CentOSUI
- BBED工具的安裝使用(一)
- oradebug工具使用系列一
- RMAN duplicate必須指定DBID的場景
- nid 改變資料庫名,DBID資料庫
- 一、更改ORACLE SID名稱Oracle
- 推薦一個使用 Homestead 時自動更改 hosts 的外掛
- Flutter 之使用 Event Bus 更改主題Flutter
- oracle更改使用者名稱Oracle
- vue中使用element ui時想要更改官方標籤的某些樣式時,一般不要在scoped中更改,要在全域性的style標籤中更改VueUI
- 構建工具之Maven的使用(一)Maven
- 對 LLM 工具使用進行統一
- 通過dbms_backup_restore修改oracle的dbidRESTOracle
- View and Data API Tips : Conversion between DbId and nodeViewAPI
- 更改jar包中的一個classJAR
- 更改使用者host留下的坑
- 更改MYSQL使用者名稱密碼MySql密碼
- LoadRunner效能測試工具---(一)使用流程
- Unity效能分析(一)流程與工具的使用Unity
- HAC叢集更改IP(單節點更改、全部節點更改)
- Win10 Bash更改預設使用者Win10
- MySQL 5.5更改使用者密碼方法MySql密碼