資料庫中的域名(1)
本文簡要介紹了資料庫中的域名db_domain以及sqlnet.ora中的預設域名.
本文可以任意轉載,轉載時請務必以超連結形式標明文章原始出處和作者資訊及本宣告
http://blog.itpub.net/post/11/6330
1. 資料庫域名
1) 全域性資料庫名(GLOBAL DATABASE NAME)
全域性資料庫名是在分散式資料庫系統中用於標識資料庫的唯一名稱,預設為DB_NAME.DB_DOMAIN。該預設值在資料庫建立的時候被標記,如果資料庫建立後手工修改了DB_NAME或者DB_DOMAIN,全域性資料庫名稱仍然保持為資料庫建立時候的DB_NAME.DB_DOMAIN。
SQL> show parameter db_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_name string test
SQL> show parameter db_domain
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_domain string
SQL> select *from global_name;
GLOBAL_NAME
--------------------------------------------------------------------------------
TEST.US.ORACLE.COM
SQL> alter system set db_domain='test.com' scope=spfile;
系統已更改。
SQL> shutdown abort
ORACLE 例程已經關閉。
SQL>
SQL> startup
ORACLE 例程已經啟動。
Total System Global Area 114061244 bytes
Fixed Size 282556 bytes
Variable Size 79691776 bytes
Database Buffers 33554432 bytes
Redo Buffers 532480 bytes
資料庫裝載完畢。
資料庫已經開啟。
SQL>
SQL> show parameter db_domain
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_domain string test.com
SQL> select *from global_name;
GLOBAL_NAME
-------------------------------------------------------------------------------
TEST.US.ORACLE.COM
SQL>
2) 修改域名
可以透過修改全域性資料庫名來修改域名。
如果alter database rename global_name to 中的name沒有指定域名,則預設為先前global_name中包含的域名.
SQL> select *from global_name;
GLOBAL_NAME
--------------------------------------------------------------------------------
TEST.US.ORACLE.COM
SQL> alter database rename global_name to test1;
資料庫已更改。
SQL> select *from global_name;
GLOBAL_NAME
--------------------------------------------------------------------------------
TEST1.US.ORACLE.COM
SQL>
US.ORACLE.COM即為域名.不妨透過建立資料庫連結來測試一下:
QL> column db_link format a20
SQL> column username format a20
SQL> column host format a10
SQL> column owner format a20
test@SB-HYK> select owner,db_link,username,host from dba_db_links;
未選定行
test@SB-HYK>
test@SB-HYK> create database link test connect to test identified by test using
'test';
資料庫連結已建立。
-- 預設為US.ORACLE.COM
test@SB-HYK> select owner,db_link,username,host from dba_db_links;
OWNER DB_LINK USERNAME HOST
-------------------- -------------------- -------------------- ----------
TEST TEST.US.ORACLE.COM TEST test
test@SB-HYK> alter database rename global_name to oracle.test.com;
資料庫已更改。
test@SB-HYK> create database link test connect to test identified by test using
'test';
資料庫連結已建立。
-- 透過改變全域性資料庫名改變域名為TEST.COM
test@SB-HYK> select owner,db_link,username,host from dba_db_links;
OWNER DB_LINK USERNAME HOST
-------------------- -------------------- -------------------- ----------
TEST TEST.TEST.COM TEST test
TEST TEST.US.ORACLE.COM TEST test
test@SB-HYK>
test@SB-HYK> show parameter db_domain
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_domain string test.com
SQL> alter database rename global_name to oracle.com.cn;
資料庫已更改。
SQL> create database link test connect to test identified by test using
'test';
資料庫連結已建立。
-- 透過改變全域性資料庫名改變域名為COM.CN
test@SB-HYK> select owner,db_link,username,host from dba_db_links;
OWNER DB_LINK USERNAME HOST
-------------------- -------------------- -------------------- ----------
TEST TEST.COM.CN TEST test
TEST TEST.TEST.COM TEST test
TEST TEST.US.ORACLE.COM TEST test
TO BE CONTINUED ......
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/6906/viewspace-21647/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 生產資料庫、開發資料庫、測試資料庫中的資料的區分資料庫
- NodeJs中資料庫的使用NodeJS資料庫
- 2.9.6 資料庫中的示例資料庫
- MYSQL中的DDL(用來操縱資料庫物件的語言)1MySql資料庫物件
- 1.資料庫起步--------Mysql資料庫MySql
- 網站域名無法連線資料庫怎麼回事網站資料庫
- zblog域名後無法訪問 zblog資料庫地址修改資料庫
- mongodb資料庫中插入資料MongoDB資料庫
- SQL資料庫中Truncate的用法SQL資料庫
- Oracle資料庫中遇到的坑Oracle資料庫
- 資料庫中AS的使用意義資料庫
- SAP中的資料庫表索引資料庫索引
- 中興資料庫的決心資料庫
- 【SqlServer】 理解資料庫中的資料頁結構SQLServer資料庫
- 萬里GreatDB資料庫的學習之路--GreatDB分散式資料庫的安裝部署(1)資料庫分散式
- SQLSERVER學習1——資料庫概念SQLServer資料庫
- #資料庫3-1_SQL概述資料庫SQL
- CQL #1:SQLChain 資料庫建立流程SQLAI資料庫
- 1. 備份MySQL資料庫MySql資料庫
- 資料庫8530_實驗(1)資料庫
- redis(1)NoSQL資料庫簡介RedisSQL資料庫
- Linux安裝MariaDB資料庫-1Linux資料庫
- 1. PostgreSQL 資料庫安裝SQL資料庫
- Redis(1)- Redis資料庫的安裝和配置Redis資料庫
- 將資料庫中資料匯入至solr索引庫資料庫Solr索引
- PostgreSQL DBA(1) - 資料庫引數設定#1SQL資料庫
- 資料庫學習與複習筆記--資料庫概念和不同類資料庫CRUD操作(1)資料庫筆記
- 資料庫應用系統中的資料庫完整性(上)KP資料庫
- GeoServer釋出PostGIS資料庫中的柵格資料Server資料庫
- 資料庫安全審計在資料安全中的功能資料庫
- 12、Oracle中的其它資料庫物件Oracle資料庫物件
- “熱搜”中的分散式資料庫分散式資料庫
- ChatGPT “眼”中的開源資料庫ChatGPT資料庫
- PHP中的資料庫連線方法PHP資料庫
- ORACLE資料庫的中的db-linkOracle資料庫
- 將MYSQL資料顯示在QT的tablewidget中/將QT中的資料儲存到MYSQL資料庫中MySqlQT資料庫
- MongoDB資料庫中查詢資料(下)MongoDB資料庫
- 域名解析導致資料庫連線緩慢(hosts :files dns)資料庫DNS
- 資料庫學習筆記1(資料管理歷史)資料庫筆記