Oracle names and things

Source: Internet
Author: User

For beginners, many Oracle names are confusing. 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

Name type value
---------------------------------------------------------------------

Db_name string orcl
Db_unique_name string orcl
Global_names Boolean false
Instance_name string orcl
Service_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.

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 you can use tnsping, you can use Conn.
User/pwd @ SERVICE_NAME.

No. 2
Db_name: ID 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, consider the database name,
The database name cannot be modified after the database is created. It may be difficult to modify the database name. 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
. 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. Let's test it below:
When the Instance name is orcl:
[Oracle @ localhost ~] $ Sqlplus/nolog
SQL * 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 sysdba
Connected to an idle instance.
SQL> startup nomount
Oracle instance started.

Total system global area 419430400 bytes
Fixed size 1219760 bytes
Variable Size 125829968 bytes
Database buffers 289406976 bytes
Redo buffers 2973696 bytes
SQL> Create pfile from spfile;
File Created.

SQL>! Ls $ ORACLE_HOME/dbs
Hc_orcl.dat init. ora lkorcl spfileorcl. ora
Initdw. ora initorcl. ora orapworcl

SQL>! PS-Ef | grep ora _
Oracle 1695 1 0? 00:00:00 ora_pmon_orcl
Oracle 1697 1 0? 00:00:00 ora_psp0_orcl
Oracle 1699 1 0? 00:00:00 ora_mman_orcl
Oracle 1701 1 0? 00:00:00 ora_dbw0_orcl
Oracle 1703 1 0? 00:00:00 ora_lgwr_orcl
Oracle 1705 1 0? 00:00:00 ora_ckpt_orcl
Oracle 1707 1 0? 00:00:00 ora_smon_orcl
Oracle 1709 1 0? 00:00:00 ora_reco_orcl
Oracle 1711 1 0? 00:00:00 ora_cjq0_orcl
Oracle 1713 1 0? 00:00:00 ora_mmon_orcl
Oracle 1715 1 0? 00:00:00 ora_mmnl_orcl
Oracle 1717 1 0? 00:00:00 ora_d000_orcl
Oracle 1719 1 0? 00:00:00 ora_s000_orcl
Oracle 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/nolog
SQL * 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 sysdba
Connected 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 bytes
Fixed size 1219760 bytes
Variable Size 121635664 bytes
Database buffers 293601280 bytes
Redo buffers 2973696 bytes
SQL> select instance_name from V $ instance;

Instance_name
------------------------------------------------
Think
SQL>! PS-Ef | grep ora _
Oracle 1937 1 0? 00:00:00 ora_pmon_think
Oracle 1939 1 0? 00:00:00 ora_psp0_think
Oracle 1941 1 0? 00:00:00 ora_mman_think
Oracle 1943 1 0? 00:00:00 ora_dbw0_think
Oracle 1945 1 0? 00:00:00 ora_lgwr_think
Oracle 1947 1 0? 00:00:00 ora_ckpt_think
Oracle 1949 1 0? 00:00:00 ora_smon_think
Oracle 1951 1 0? 00:00:00 ora_reco_think
Oracle 1953 1 0? 00:00:00 ora_cjq0_think
Oracle 1955 1 0? 00:00:00 ora_mmon_think
Oracle 1957 1 0? 00:00:00 ora_mmnl_think
Oracle 1959 1 0? 00:00:00 ora_d000_think
Oracle 1961 1 0? 00:00:00 ora_s000_think
Oracle 2055 1911 0 00:00:00 pts/3/bin/bash-c ps-Ef | grep ora _
Oracle 2057 2055 0 00:00:00 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. By default, the service is provided as a network service name. But most of them are not needed.
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;

Global_name
Certificate ------------------------------------------------------------------------------------------------------------------------------------------------------
Orcl. Oracle. com

The global database name can be obtained from the global_name view.

No. 5
Db_unique_name
Is the database alias, small name. Modify it in initorcl. ora. When configuring DG, you need to care about it.

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.