Oracle names and things

Source: Internet
Author: User


Oracle's names are confusing for beginners. Me too. The relationship between database name-Global name-service name-Instance name-alias is constantly cut, and the logic is still messy. I understand it. It's a bit of a taste in my mind. SQL> show parameter name www.2cto.com NAME TYPE VALUE contains mongodb_name string orcldb_unique_name string orclglobal_names boolean FALSEinstance_name string orclservice_names string orcl.oracle.com by default, these names are the same. Let's take a look at these names. Note that global_names is not the global database name. Www.2cto.com NO.1 Service_name: defines one or more service names for the database connected to the instance. Different users can be distinguished by defining multiple service names. For example, a sales user can define a sales service name on the customer service end to access the connection, and a news user can connect through the news service name, users do not have to worry about which database is. They only need to know the service name. The default format of this parameter is **. db_domain. Therefore, service_name and sid can be replaced with each other in the TNSNAMES. ORA file configuration at the Customer Service end during monitoring configuration. However, we recommend using service_name instead of sid in oracle. After configuring tnsname on the client, remember to test tnsping service_name. If tnsping is enabled, conn user/pwd @ service_name. No. 2 db_name: indicates the ID card number of the database. Is the minimum parameter for starting to nomount. After the database is installed or created, the parameter DB_NAME is written to the parameter file. When creating a database, you should consider the database name, and after the database is created, the database name should not be modified, even if you want to modify it will be very troublesome. Because the database name is also written into the control file and the control file is stored in binary format, you cannot modify the control file content. Assume that you have modified the database name in the parameter file, that is, the value of DB_NAME. But at Oracle startup, because DB_NAME In the parameter file is inconsistent with the database name in the control file, causing database startup failure, a ORA-01103 error is returned.
No. 3 instance_name: the Instance name can be changed at will. The following is a test: When the Instance name is orcl: [oracle @ localhost ~] $ Sqlplus/nologSQL * Plus: Release 10.2.0.1.0-Production on Mon Jul 16 14:49:47 2012 Copyright (c) 1982,200 5, Oracle. all rights reserved. SQL> conn/as sysdbaConnected to an idle instance. SQL> startup nomountORACLE instance started. www.2cto.com Total System Global Area 419430400 bytesFixed Size 1219760 bytesVariable Size 125829968 bytesDatabase Buffers 289406976 bytesRedo Buffers 2973696 bytesSQ L> create pfile from spfile; File created. SQL>! Ls $ ORACLE_HOME/dbshc_orcl.dat init. ora lkORCL spfileorcl. orainitdw. ora initorcl. ora orapworcl www.2cto.com SQL>! Ps-ef | grep ora_oracle 1695 1 0? 00:00:00 ora_pmon_orcloracle 1697 1 0? 00:00:00 ora_psp0_orcloracle 1699 1 0? 00:00:00 ora_mman_orcloracle 1701 1 0? 00:00:00 ora_dbw0_orcloracle 1703 1 0? 00:00:00 ora_lgwr_orcloracle 1705 1 0? 00:00:00 ora_ckpt_orcloracle 1707 1 0? 00:00:00 ora_smon_orcloracle 1709 1 0? 00:00:00 ora_reco_orcloracle 1711 1 0? 00:00:00 ora_cjq0_orcloracle 1713 1 0? 00:00:00 ora_mmon_orcloracle 1715 1 0? 00:00:00 ora_mmnl_orcloracle 1717 1 0? 00:00:00 ora_d000_orcloracle 1719 1 0? 00:00:00 ora_s000_orcloracle 1739 1687 0 00:00:00 pts/2/bin/bash-c ps-ef | grep ora _ when the Instance name is think: [oracle @ localhost ~] $ Export ORACLE_SID = think [oracle @ localhost ~] $ Sqlplus/nologSQL * Plus: Release 10.2.0.1.0-Production on Mon Jul 16 15:00:16 2012 Copyright (c) 1982,200 5, Oracle. all rights reserved. SQL> conn/as sysdbaConnected to an idle instance. SQL> startup nomount pfile = '/u01/app/oracle/product/10.2.0/db_1/dbs/initorcl. ora '; ORACLE instance started. total System Global Area 419430400 bytesFixed Size 1219760 bytesVariable Size 121635664 bytesDatabase B Uffers 293601280 bytesRedo Buffers 2973696 bytesSQL> select instance_name from v $ instance; INSTANCE_NAME ---------------------------------------------- think www.2cto.com SQL>! Ps-ef | grep ora_oracle 1937 1 0? 00:00:00 ora_pmon_thinkoracle 1939 1 0? 00:00:00 ora_psp0_thinkoracle 1941 1 0? 00:00:00 ora_mman_thinkoracle 1943 1 0? 00:00:00 ora_dbw0_thinkoracle 1945 1 0? 00:00:00 ora_lgwr_thinkoracle 1947 1 0? 00:00:00 ora_ckpt_thinkoracle 1949 1 0? 00:00:00 ora_smon_thinkoracle 1951 1 0? 00:00:00 ora_reco_thinkoracle 1953 1 0? 00:00:00 ora_cjq0_thinkoracle 1955 1 0? 00:00:00 ora_mmon_thinkoracle 1957 1 0? 00:00:00 ora_mmnl_thinkoracle 1959 1 0? 00:00:00 ora_d000_thinkoracle 1961 1 0? 00:00:00 ora_s000_thinkoracle 2055 1911 0 00:00:00 pts/3 00:00:00/bin/bash-c ps-ef | grep ora_oracle 2057 2055 0 pts/3 grep ora _ No. 4 global_name: if it is a distributed database, db_name will have a duplicate name. Global_name is an extension of db_name. Management is the same as service_name. That is, add a db. domain. In db link, you must consider global_name. www.2cto.com SQL> show parameter global_names NAME TYPE VALUE ------------- ------------------------------ global_names boolean FALSE the GLOBAL_NAMES parameter is not used to control GLOBAL_NAME, but to restrict the use of DBLINK. the role of the GLOBAL_NAMES parameter is simply: When the GLOBAL_NAMES parameter is set to TRUE, the name of the DBLINK must be consistent with the GLOBAL_NAME of the connected database. SQL> select * from global_name; The GLOBAL_NAME------------------------------------------------------------------------------------------------------------------------------------------------------ORCL.ORACLE.COM www.2cto.com global database name can be obtained from the view global_name. No. 5 db_unique_name is the database alias, with a small name. Modify it in initorcl. ora. When configuring DG, you need to care about it. Author: linwaterbin

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.