首页 数据库 mysql教程 Oracle中的global

Oracle中的global

Jun 07, 2016 pm 03:13 PM
global oracle 进入

欢迎进入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.

Oracle中的global

本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

Video Face Swap

Video Face Swap

使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

热门话题

Java教程
1660
14
CakePHP 教程
1416
52
Laravel 教程
1311
25
PHP教程
1261
29
C# 教程
1234
24
oracle打不开怎么办 oracle打不开怎么办 Apr 11, 2025 pm 10:06 PM

Oracle 打不开的解决办法包括:1. 启动数据库服务;2. 启动监听器;3. 检查端口冲突;4. 正确设置环境变量;5. 确保防火墙或防病毒软件未阻止连接;6. 检查服务器是否已关闭;7. 使用 RMAN 恢复损坏的文件;8. 检查 TNS 服务名称是否正确;9. 检查网络连接;10. 重新安装 Oracle 软件。

oracle游标关闭怎么解决 oracle游标关闭怎么解决 Apr 11, 2025 pm 10:18 PM

解决 Oracle 游标关闭问题的方法包括:使用 CLOSE 语句显式关闭游标。在 FOR UPDATE 子句中声明游标,使其在作用域结束后自动关闭。在 USING 子句中声明游标,使其在关联的 PL/SQL 变量关闭时自动关闭。使用异常处理确保在任何异常情况下关闭游标。使用连接池自动关闭游标。禁用自动提交,延迟游标关闭。

oracle怎么循环创建游标 oracle怎么循环创建游标 Apr 12, 2025 am 06:18 AM

Oracle 中,FOR LOOP 循环可动态创建游标, 步骤为:1. 定义游标类型;2. 创建循环;3. 动态创建游标;4. 执行游标;5. 关闭游标。示例:可循环创建游标,显示前 10 名员工姓名和工资。

oracle日志写满怎么办 oracle日志写满怎么办 Apr 12, 2025 am 06:09 AM

Oracle 日志文件写满时,可采用以下解决方案:1)清理旧日志文件;2)增加日志文件大小;3)增加日志文件组;4)设置自动日志管理;5)重新初始化数据库。在实施任何解决方案前,建议备份数据库以防数据丢失。

HDFS配置CentOS需要哪些步骤 HDFS配置CentOS需要哪些步骤 Apr 14, 2025 pm 06:42 PM

在CentOS系统上搭建Hadoop分布式文件系统(HDFS)需要多个步骤,本文提供一个简要的配置指南。一、前期准备安装JDK:在所有节点上安装JavaDevelopmentKit(JDK),版本需与Hadoop兼容。可从Oracle官网下载安装包。环境变量配置:编辑/etc/profile文件,设置Java和Hadoop的环境变量,使系统能够找到JDK和Hadoop的安装路径。二、安全配置:SSH免密登录生成SSH密钥:在每个节点上使用ssh-keygen命令

甲骨文在商业世界中的作用 甲骨文在商业世界中的作用 Apr 23, 2025 am 12:01 AM

Oracle不仅是数据库公司,还是云计算和ERP系统的领导者。1.Oracle提供从数据库到云服务和ERP系统的全面解决方案。2.OracleCloud挑战AWS和Azure,提供IaaS、PaaS和SaaS服务。3.Oracle的ERP系统如E-BusinessSuite和FusionApplications帮助企业优化运营。

oracle数据库怎么停止 oracle数据库怎么停止 Apr 12, 2025 am 06:12 AM

要停止 Oracle 数据库,请执行以下步骤:1. 连接到数据库;2. 优雅关机数据库(shutdown immediate);3. 完全关机数据库(shutdown abort)。

oracle动态sql怎么创建 oracle动态sql怎么创建 Apr 12, 2025 am 06:06 AM

可以通过使用 Oracle 的动态 SQL 来根据运行时输入创建和执行 SQL 语句。步骤包括:准备一个空字符串变量来存储动态生成的 SQL 语句。使用 EXECUTE IMMEDIATE 或 PREPARE 语句编译和执行动态 SQL 语句。使用 bind 变量传递用户输入或其他动态值给动态 SQL。使用 EXECUTE IMMEDIATE 或 EXECUTE 执行动态 SQL 语句。

See all articles