您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息
免费发信息
三六零分类信息网 > 张家界分类信息网,免费分类信息发布

Oracle中的global

2024/3/13 13:39:39发布8次查看
欢迎进入oracle社区论坛,与200万技术人员互动交流 >>进入 1. you connect to sales.us.example.com and query the global_name data dictionary view to determine the current database global name: connect system@sales.us.example.com select * from g
欢迎进入oracle社区论坛,与200万技术人员互动交流 >>进入
    1. you connect to sales.us.example.com and query the global_name data dictionary view to determine the current database global name:
    connect system@sales.us.example.com
    select * from global_name;
    global_name
    ----------------------------------------------------------------------------
    sales.us.example.com
    2. you query the v$parameter view to determine the current setting for the db_domain initialization parameter:
    select name, value from v$parameter where name = 'db_domain';
    name value
    --------- -----------
    db_domain us.example.com
    3. you then create a database link to a database called hq, using only a partially-specified global name:
    create database link hq using 'sales';
    the database expands the global database name for this link by appending the domain part of the global database name of the local database to the name of the database specified in the link.
    4. you query user_db_links to determine which domain name the database uses to resolve the partially specified global database name:
    select db_link from user_db_links;
    db_link
    ------------------
    hq.us.example.com
    this result indicates that the domain part of the global database name of the local database is us.example.com. the database uses this domain in resolving partial database link names when the database link is created.
    5. because you have received word that the sales database will move to japan, you rename the sales database to sales.jp.example.com:
    alter database rename global_name to sales.jp.example.com;
    select * from global_name;
    global_name
    ----------------------------------------------------------------------------
    sales.jp.example.com
    6. you query v$parameter again and discover that the value of db_domain is not changed, although you renamed the domain part of the global database name:
    select name, value from v$parameter
    where name = 'db_domain';
    name value
    --------- -----------
    db_domain us.example.com
    this result indicates that the value of the db_domain initialization parameter is independent of the alter database rename global_name statement. the alter database statement determines the domain of the global database name, not the db_domain initialization parameter (although it is good practice to alter db_domain to reflect the new domain name)。
    7. you create another database link to database supply, and then query user_db_links to see how the database resolves the domain part of the global database name of supply:
    create database link supply using 'supply';
    select db_link from user_db_links;
    db_link
    ------------------
    hq.us.example.com
    supply.jp.example.com
    this result indicates that the database resolves the partially specified link name by using the domain jp.example.com. this domain is used when the link is created because it is the domain part of the global database name of the local database. the database does not use the db_domain initialization parameter setting when resolving the partial link name.
    8. you then receive word that your previous information was faulty: sales will be in the asia.jp.example.com domain, not the jp.example.com domain. consequently, you rename the global database name as follows:
    alter database rename global_name to sales.asia.jp.example.com;
    select * from global_name;
    global_name
    ----------------------------------------------------------------------------
    sales.asia.jp.example.com
    you query v$parameter to again check the setting for the parameter db_domain:
    select name, value from v$parameter
    where name = 'db_domain';
    name value
    ---------- -----------
    db_domain us.example.com
    the result indicates that the domain setting in the parameter file is the same as it was before you issued either of the alter database rename statements.
    9. finally, you create a link to the warehouse database and again query user_db_links to determine how the database resolves the partially-specified global name:
    create database link warehouse using 'warehouse';
    select db_link from user_db_links;
    db_link
    ------------------
    hq.us.example.com
    supply.jp.example.com
    warehouse.asia.jp.example.com
    again, you see that the database uses the domain part of the global database name of the local database to expand the partial link name during link creation.
    由此说明, alter database rename global_name to xx并不影响db_domain参数, 而创建db link时使用的是global_name而不是db_domain.
张家界分类信息网,免费分类信息发布

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录