dblink命名时需注意的地方和GLOBAL_NAMES的含义

官方文档:

 

Typically, a database link has the same name as the global database name of the remote database that it references. For example, if the global database name of a database is sales.us.oracle.com, then the database link is also called sales.us.oracle.com.

When you set the initialization parameter GLOBAL_NAMES to TRUE, the database ensures that the name of the database link is the same as the global database name of the remote database. For example, if the global database name for hq is hq.acme.com, and GLOBAL_NAMES is TRUE, then the link name must be called hq.acme.com. Note that the database checks the domain part of the global database name as stored in the data dictionary, not the DB_DOMAIN setting in the initialization parameter file (see "Changing the Domain in a Global Database Name").

If you set the initialization parameter GLOBAL_NAMES to FALSE, then you are not required to use global naming. You can then name the database link whatever you want. For example, you can name a database link to hq.acme.com as foo.

Note:

Oracle recommends that you use global naming because many useful features, including Replication, require global naming.

After you have enabled global naming, database links are essentially transparent to users of a distributed database because the name of a database link is the same as the global name of the database to which the link points. For example, the following statement creates a database link in the local database to remote database sales:

CREATE PUBLIC DATABASE LINK sales.division3.acme.com USING 'sales1';

See Also:

Oracle Database Reference for more information about specifying the initialization parameter GLOBAL_NAMES

 

 

GLOBAL_NAMES的含义:

GLOBAL_NAMES

Property

Description

Parameter type

Boolean

Default value

false

Modifiable

ALTER SESSION, ALTER SYSTEM

Range of values

true | false

Basic

No

 

GLOBAL_NAMES specifies whether a database link is required to have the same name as the database to which it connects.

If the value of GLOBAL_NAMES is false, then no check is performed. If you use or plan to use distributed processing, then Oracle recommends that you set this parameter to true to ensure the use of consistent naming conventions for databases and links in a networked environment.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
二、 注释说明  1. 本注释说明主要用于PL/SQL程序及其它SQL文件,其它可作参考;  2. SQLPLUS接受的注释有三种:   ―― 这儿是注释   /* 这儿是注释 */   REM 这儿是注释  3. 开始注释,类似JAVAK中的开始注释,主要列出文件名,编写日期,版权说明,程序功能以及修改记录:   REM   REM $Header: filename, version, created date,auther   REM   REM Copyright   REM   REM FUNCTION   REM function explanation   REM   REM NOTES   REM   REM MODIFIED (yy/mm/dd)   REM who when - for what, recently goes first  4. 块注释,如表注释,PROCEDURE注释等,同JAVA:   /*   * This table is for TrustPass   * mainly store the information   * of TrustPass members   */  5. 单行注释,如列注释:   login_id VARCHAR2(32) NOT NULL, -- 会员标识 三、 缩进 低级别语句在高级别语句后的,一般缩进4个空格:   DECLARE   v_MemberId VARCHAR2(32),   BEGIN   SELECT admin_member_id INTO v_MemberId   FROM company   WHERE id = 10;   DBMS_OUTPUT.PUT_LINE(v_MemberId);   END;     同一语句不同部分的缩进,如果为sub statement,则通常为2个空格,如果与上一句某部分有密切联系的,则缩至与其对齐:   BEGIN   FOR v_TmpRec IN   (SELECT login_id,   gmt_created, -- here indented as column above   satus   FROM member -- sub statement   WHERE site = 'china'   AND country='cn' )   LOOP   NULL;   END LOOP;   END; 四、 断行 • 一行最长不能超过80字符

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值