Global_name and db domain in Oracle

Source: Internet
Author: User

Global_name and db domain in Oracle

  1. 1. YouConnect ToSALES.US.EXAMPLE.COMAndQuery the GLOBAL_NAMEDataDictionaryView ToDetermineCurrent DatabaseGlobal name:

  2. CONNECTSYSTEM@Sales.Us.Example.Com
  3. SELECT * FROMGLOBAL_NAME;

  4. GLOBAL_NAME
  5. ----------------------------------------------------------------------------
  6. SALES.US.EXAMPLE.COM

  7. 2. You query the V $ PARAMETERView ToDetermineCurrentSettingForThe DB_DOMAIN initialization parameter:

  8. SELECTNAME, VALUE FROMV $ PARAMETERWHERENAME= 'Db _ domain';

  9. NAMEVALUE
  10. --------------------
  11. Db_domain US.EXAMPLE.COM

  12. 3. YouThen CreateADatabaseLinkToADatabaseCalled hq, Using OnlyA partially-Specified global name:

  13. CREATE DATABASELINK hqUSING 'Sales';

  14. TheDatabaseExpands the globalDatabaseNameForThis linkByAppending the domain partOfThe globalDatabaseNameOfThe localDatabase ToThe nameOfTheDatabaseSpecifiedInThe link.

  15. 4. You query USER_DB_LINKSToDetermine which domain nameDatabaseUsesToResolve the partially specified globalDatabaseName:

  16. SELECTDB_LINKFROMUSER_DB_LINKS;

  17. DB_LINK
  18. ------------------
  19. HQ.US.EXAMPLE.COM

  20. This result indicates that the domain partOfThe globalDatabaseNameOfThe localDatabase IsUs.Example.Com.TheDatabaseUses this domainInResolving partialDatabaseLink names whenDatabaseLinkIsCreated.

  21. 5. Because you have already ed word that the salesDatabaseWill moveToJapan,YouRenameThe salesDatabase ToSales.Jp.Example.Com:

  22. ALTER DATABASE RENAMEGLOBAL_NAMETOSales.Jp.Example.Com;
  23. SELECT * FROMGLOBAL_NAME;

  24. GLOBAL_NAME
  25. ----------------------------------------------------------------------------
  26. SALES.JP.EXAMPLE.COM

  27. 6. You query V $ PARAMETER againAndDiscover thatValue OfDB_DOMAINIs NotChanged,Although you renamed the domain partOfThe globalDatabaseName:

  28. SELECTNAME, VALUE FROMV $ PARAMETER
  29. WHERENAME= 'Db _ domain';

  30. NAMEVALUE
  31. --------------------
  32. Db_domain US.EXAMPLE.COM

  33. This result indicates thatValue OfThe DB_DOMAIN initialization parameterIsIndependentOfTheALTER DATABASE RENAMEGLOBAL_NAME statement.TheALTER DATABASEStatement determines the domainOfThe globalDatabaseName, NotThe DB_DOMAIN initialization parameter(Although itIsGood practiceTo AlterDB_DOMAINToReflect the new domain name).

  34. 7. YouCreateAnotherDatabaseLinkTo DatabaseSupply, And ThenQuery USER_DB_LINKSToSee howDatabaseResolves the domain partOfThe globalDatabaseNameOfSupply:

  35. CREATE DATABASELINK supplyUSING 'Suply';
  36. SELECTDB_LINKFROMUSER_DB_LINKS;

  37. DB_LINK
  38. ------------------
  39. HQ.US.EXAMPLE.COM
  40. SUPPLY.JP.EXAMPLE.COM

  41. This result indicates thatDatabaseResolves the partially specified link nameBy UsingThe domain jp.Example.Com.This domainIsUsed when the linkIsCreated because itIsThe domain partOfThe globalDatabaseNameOfThe localDatabase.TheDatabaseDoesNotUse the DB_DOMAIN initialization parameter setting when resolving the partial link name.

  42. 8. YouThenReceive word that your previous information was faulty:Sales will beInThe ASIA.JP.EXAMPLE.COM domain, NotThe JP.EXAMPLE.COM domain.Consequently,YouRenameThe globalDatabaseNameAsFollows:

  43. ALTER DATABASE RENAMEGLOBAL_NAMETOSales.Asia.Jp.Example.Com;
  44. SELECT * FROMGLOBAL_NAME;

  45. GLOBAL_NAME
  46. ----------------------------------------------------------------------------
  47. SALES.ASIA.JP.EXAMPLE.COM

  48. You query V $ PARAMETERToAgainCheckThe settingForThe parameter DB_DOMAIN:

  49. SELECTNAME, VALUE FROMV $ PARAMETER
  50. WHERENAME= 'Db _ domain';

  51. NAMEVALUE
  52. ---------------------
  53. Db_domain US.EXAMPLE.COM

  54. The result indicates that the domain settingInThe parameterFile IsThe sameAsIt was before you issued eitherOfTheALTER DATABASE RENAMEStatements.

  55. 9. Finally,YouCreateA linkToThe warehouseDatabase AndAgain query USER_DB_LINKSToDetermine howDatabaseResolves the partially-Specified global name:

  56. CREATE DATABASELINK warehouseUSING 'Warehouse';
  57. SELECTDB_LINKFROMUSER_DB_LINKS;

  58. DB_LINK
  59. ------------------
  60. HQ.US.EXAMPLE.COM
  61. SUPPLY.JP.EXAMPLE.COM
  62. WAREHOUSE.ASIA.JP.EXAMPLE.COM

  63. Again,You see thatDatabaseUses the domain partOfThe globalDatabaseNameOfThe localDatabase ToExpand the partial link name during link creation.

Therefore, alter database rename global_name to xx does not affect the db_domain parameter, but uses global_name instead of db_domain when creating the db link.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.