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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 關於ORACLE_SID和DB_NAME的理解Oracle
- db_name和db_unique_name的區別
- 更改資料庫SID名和db_name名資料庫
- ORACLE_SID,INSTANCE_NAME和DB_NAMEOracle
- DB_NAME、DB_UNIQUE_NAME、SERVICE_NAME和INSTANCE_NAME等的區別
- instance_name、db_name、ORACLE_SID、db_name等的區別Oracle
- 修改oracle例項名(sid)和資料庫名(db_name)Oracle資料庫
- oracle sid,instance_name,db_name,oracle_sid之間的關係Oracle
- The database owner SID recorded in the master database differs from the database owner SID recorded in database 'DB_NAME'DatabaseAST
- Oracle修改instance_name、db_name、db_unique_name、service_namesOracle
- Oracle修改(db_name,db_unique_name, servie_names,db_domain)方法OracleAI
- oracle 10g中的幾個概念(sid/db_name/....)Oracle 10g
- SID、ORACLE_SID、INSTANCE_NAME、DB_NAME、SERVER_NAMES、GLOBAL_DBNAME等區別OracleServer
- Oracle中DB_NAME,SID,DB_DOMAIN,SERVICE_NAME等之間的區別OracleAI
- CUUG 筆記ORACLE db_name instance_name gobal_name service_name db_unique_name分析筆記OracleGo
- 驗證service_names、db_name、db_unique_name在註冊動態監聽服務名時的作用
- How to Rename Database/Change DB_NAME or ORACLE_SID/Instance Name-15390.1DatabaseOracle
- [轉]ORACLE中的DB_NAME,SERVICE_NAME,INSTANCE_NAME,ORACLE_SID,GLOBAL_DBNAMEOracle
- 關於db_name,oracle_sid,service_names,global_names等的總結說明Oracle
- ORACL中的DB_NAME,SERVICE_NAME,INSTANCE_NAME,ORACLE_SID,GLOBAL_DBNAME介紹Oracle
- ORACLE中的DB_NAME,SERVICE_NAME,INSTANCE_NAME,ORACLE_SID,GLOBAL_DBNAME介紹Oracle
- 關於db_name,instance_name等近似概念的理解????
- 關於資料庫名(db_name)、例項名(instance_name)、ORACLE_SID資料庫Oracle
- (轉)關於資料庫名(db_name)、例項名(instance_name)、ORACLE_SID資料庫Oracle
- 轉貼:關於資料庫名(db_name)、例項名(instance_name)、ORACLE_SID資料庫Oracle
- 獲取本session的sid和serial#Session
- oracle_sid與netmgr listener的sidOracle
- oracle 11g 更改sid和dbnameOracle
- v$session檢視中的sid和serial#研究Session
- Rename db_name for OracleOracle
- oracle sidOracle
- 利用nid工具修改db_name和instance_name
- 修改資料庫db_name的方法資料庫
- DB_NAME Initialization Parameter (87)
- V$SESSION的SID&SERIAL#Session
- Oracle SID和Service_Name有什麼區別?Oracle
- oracle 10gR2 dataguard db_unique_name parameterOracle 10g
- 【轉】怎樣修改Oracle的SIDOracle