DB_NAME DB_UNIQUE_NAME 和 SID 的理解
1. DB_NAME 表示資料庫名稱,DB_NAME 會保持在資料檔案頭、控制檔案、REDO檔案裡,所以更改DB_NAME不能僅僅修改spfile ,還需要用nid 來進行更改,並且更改後還需要手工做些工作,使其生效。
DB_NAME 最長 8 個字元。
2. 在 DG下,主庫和物理從庫的 DB_NAME 是一致的,主庫和物理從庫的DB_UNIQUE_NAME 不同,DB_UNIQUE_NAME 用於標識主從庫。
修改 DB_UNIQUE_NAME 需要修改 spfile 並重啟資料庫;
由於 DB_NAME 記錄在資料檔案頭、控制檔案、REDO檔案裡,所以修改 DB_NAME 一般有兩種方式:
(1)備份控制檔案到trace,修改 spfile,重啟資料庫,resetlogs 開啟資料庫
(2)或者透過 nid 命令修改
3. SID:System Identifier
The SID identifies the instance's shared memory on a host, but may not uniquely distinguish this instance
from other instances
doc上把sid解釋為在host上用sid來標示例項的共享記憶體的,可見sid主要是和os打交道的。
sid可以透過如下語句在庫中查詢: select instance_name from v$instance;
(I):如果你只想更改資料庫的id(dbid),那麼你只需要指定target引數就可以了,具體的操作過程,請參考如下:
1. Backup the database
2. SHUTDOWN IMMEDIATE of the database
3. STARTUP MOUNT
4. Open one session and run NID with sysdba privileges
% nid TARGET=SYS/password@test_db
5. Shutdown IMMEDIATE of the database
6. Set the DB_NAME initialization parameter in the initialization parameter
file to the new database name
7. Create a new password file
8. Startup of the database with open resetlogs
(II):如果你想只更改資料庫名(db_name),那麼你需要設定SETNAME引數為Y,同時指定DBNAME引數,具體的操作過程,請參考如下:
1. Backup the database
2. SHUTDOWN IMMEDIATE of the database
3. STARTUP MOUNT
4. Open one session and run NID with sysdba privileges
% nid TARGET=SYS/password@test_db DBNAME=test_db2 SETNAME=Y
- the value of DBNAME is the new dbname of the database
- SETNAME must be set to Y. The default is N and causes the
DBID to be changed also.
5. shutdown IMMEDIATE of the database
6. Set the DB_NAME initialization parameter in the initialization parameter
file to the new database name
7. Create a new password file
8. Startup of the database(without resetlogs)
(III):如果你想同時更改資料庫名(db_name)和資料庫ID(dbid),那麼你要指定DBNAME引數,同時設定SETNAME為N(其值預設也為N),具體操作過程,請參考如下:
1. Backup of the database.
2. Shutdown IMMEDIATE of the database
3. STARTUP MOUNT
4. Open one session and run NID with sysdba privileges
% nid TARGET=SYS/password@test_db DBNAME=test_db2
- the value of DBNAME is the new dbname of the database
5. After DBNEWID successfully changes the DBID,Shutdown IMMEDIATE of the database
6. Set the DB_NAME initialization parameter in the initialization parameter file to the new database name.
7. Create a new password file.
8. Startup of the database with open resetlogs
(IV):如果你只更改了資料庫名,而沒有更改資料庫id,那麼你開啟資料庫就不需要open resetlogs了。
在構建DG的時候,從庫上提示:
ORA-16047: DGID mismatch between destination setting and standby
其實就是主從庫上配置的 db_unique_name, log_archive_config 引數是否匹配導致的。
DB_NAME 最長 8 個字元。
2. 在 DG下,主庫和物理從庫的 DB_NAME 是一致的,主庫和物理從庫的DB_UNIQUE_NAME 不同,DB_UNIQUE_NAME 用於標識主從庫。
修改 DB_UNIQUE_NAME 需要修改 spfile 並重啟資料庫;
由於 DB_NAME 記錄在資料檔案頭、控制檔案、REDO檔案裡,所以修改 DB_NAME 一般有兩種方式:
(1)備份控制檔案到trace,修改 spfile,重啟資料庫,resetlogs 開啟資料庫
(2)或者透過 nid 命令修改
3. SID:System Identifier
The SID identifies the instance's shared memory on a host, but may not uniquely distinguish this instance
from other instances
doc上把sid解釋為在host上用sid來標示例項的共享記憶體的,可見sid主要是和os打交道的。
sid可以透過如下語句在庫中查詢: select instance_name from v$instance;
(I):如果你只想更改資料庫的id(dbid),那麼你只需要指定target引數就可以了,具體的操作過程,請參考如下:
1. Backup the database
2. SHUTDOWN IMMEDIATE of the database
3. STARTUP MOUNT
4. Open one session and run NID with sysdba privileges
% nid TARGET=SYS/password@test_db
5. Shutdown IMMEDIATE of the database
6. Set the DB_NAME initialization parameter in the initialization parameter
file to the new database name
7. Create a new password file
8. Startup of the database with open resetlogs
(II):如果你想只更改資料庫名(db_name),那麼你需要設定SETNAME引數為Y,同時指定DBNAME引數,具體的操作過程,請參考如下:
1. Backup the database
2. SHUTDOWN IMMEDIATE of the database
3. STARTUP MOUNT
4. Open one session and run NID with sysdba privileges
% nid TARGET=SYS/password@test_db DBNAME=test_db2 SETNAME=Y
- the value of DBNAME is the new dbname of the database
- SETNAME must be set to Y. The default is N and causes the
DBID to be changed also.
5. shutdown IMMEDIATE of the database
6. Set the DB_NAME initialization parameter in the initialization parameter
file to the new database name
7. Create a new password file
8. Startup of the database(without resetlogs)
(III):如果你想同時更改資料庫名(db_name)和資料庫ID(dbid),那麼你要指定DBNAME引數,同時設定SETNAME為N(其值預設也為N),具體操作過程,請參考如下:
1. Backup of the database.
2. Shutdown IMMEDIATE of the database
3. STARTUP MOUNT
4. Open one session and run NID with sysdba privileges
% nid TARGET=SYS/password@test_db DBNAME=test_db2
- the value of DBNAME is the new dbname of the database
5. After DBNEWID successfully changes the DBID,Shutdown IMMEDIATE of the database
6. Set the DB_NAME initialization parameter in the initialization parameter file to the new database name.
7. Create a new password file.
8. Startup of the database with open resetlogs
(IV):如果你只更改了資料庫名,而沒有更改資料庫id,那麼你開啟資料庫就不需要open resetlogs了。
在構建DG的時候,從庫上提示:
ORA-16047: DGID mismatch between destination setting and standby
其實就是主從庫上配置的 db_unique_name, log_archive_config 引數是否匹配導致的。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29135257/viewspace-1989004/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- The database owner SID recorded in the master database differs from the database owner SID recorded in database 'DB_NAME'DatabaseAST
- 叢集修改OCR中記錄的db_unique_name以及db_name
- Oracle修改instance_name、db_name、db_unique_name、service_namesOracle
- 獲取本session的sid和serial#Session
- 2.6.2.1 初始化引數DB_NAME
- ERROR: failed to establish dependency between database db_name and diskgroupErrorAIDatabase
- Oracle - 資料庫名、例項名、服務名、ORACLE_SID 的說明和區別Oracle資料庫
- NSProxy的理解和使用
- Exception和Error的理解ExceptionError
- DPC和ISR的理解
- promise的理解和使用Promise
- Future和CompletableFuture的理解
- @bean和@component的理解Bean
- SPU和SKU的理解
- SID“2017年顯示周”盛大來襲!
- 【故障處理】ORA-65500: could not modify DB_UNIQUE_NAME, resource exists
- redis api的使用和理解RedisAPI
- 對AIDL和Binder的理解AI
- 對session和cookie的理解SessionCookie
- Flink Time和Watermark的理解
- python 程式的使用和理解Python
- SID是什麼?用於什麼場景
- CREATE CONTROLFILE修改DB_NAME一定不能使用REUSE
- Promise && async/await的理解和用法PromiseAI
- 關於rpc的整理和理解RPC
- 狀態模式的理解和示例模式
- Java NIO的理解和應用Java
- SpringBoot之ApplicationContextInitializer的理解和使用Spring BootAPPContext
- pid,sid相互查詢,根據PID查詢sqlSQL
- oracle 透過pid 找到sid 再找出執行sqlOracleSQL
- 2.4.2 Step 1: 指定例項識別符號 (SID)符號
- 以Sid Meier切入,談談遊戲中的趣味選擇設計遊戲
- 19c環境bbed安裝及db_name檢視
- 深入理解和運用Pandas的GroupBy機制——理解篇
- javascript中的prototype和__proto__的理解JavaScript
- 對javascript中的call()和apply()的理解JavaScriptAPP
- [20190306]靜態監聽配置sid大小寫問題.txt
- dataguard 搭建 oracle_sid相同 2節點 primary+standbyOracle
- dataguard 搭建 oracle_sid不同 2節點 primary+standbyOracle