Database name (DB_NAME), database instance name (Instance_name, ORACLE_SID), the domain name database, the global database name, database service name

Database name (DB_NAME), database instance name (Instance_name, ORACLE_SID), the domain name database, the global database name, database service name
    only database name (db_name) and database instance name (instance_name) in ORACLE7,8 database.
    In ORACLE8i, 9i in the emergence of new parameters, namely the database domain name (db_domain), service name (service_name), and the operating system environment variables (ORACLE_SID).
First, what is the database name (db_name)?
    Database name is used to distinguish internal identification data is then stored in a binary parameter database control file, install or create the data will not be modified.
    After installation is complete database, the parameters are written to the database pfile parameter file in the following format:
            [code:. 1: 1aaf156970]
            .........
            db_name = "ORCL" # (not modify)
            db_domain = dbcenter. toys.com
            instance_name = ORCL
            SERVICE_NAMES = orcl.dbcenter.toys.com
            the control_file = (...............
            .........
            [/ code:. 1: 1aaf156970]
    In ORACLE8i each database running in both a database name (db_name), if a server program creates two databases, there are two database name.
    Which it belongs to the control parameter data associated with the control of the pfile different databases.
    The name of the current database query
    method: the SELECT name from v $ Database;
            SQL> name from the SELECT v $ Database;
            NAME
            ---------
            ORCL
    Method Two: Show the Parameter db
            SQL> --db_name database name, db_domain database domain name
            SQL> Show the Parameter db
            NAME the TYPE of VALUE
            ------------------------------------ ----- ------------------------------ ------
            db_16k_cache_size Big Integer 0
            db_2k_cache_size Big Integer 0
            db_32k_cache_size                    big integer 0
            db_4k_cache_size                     big integer 0
            db_8k_cache_size                     big integer 0
            db_block_buffers                     integer     0
            db_block_checking                    string      FALSE
            db_block_checksum                    string      TRUE
            db_block_size                        integer     8192
            db_cache_advice                      string      ON
            db_cache_size                        big integer 0
            db_create_file_dest                  string
            db_create_online_log_dest_1          string
            db_create_online_log_dest_2          string
            db_create_online_log_dest_3          string
            db_create_online_log_dest_4          string
            db_create_online_log_dest_5          string
            db_domain                            string
            db_file_multiblock_read_count        integer     16
            db_file_name_convert                 string
            db_files                             integer     200
            db_flashback_retention_target        integer     1440
            db_keep_cache_size                   big integer 0
            db_name                              string      orcl
            db_recovery_file_dest                string      c:/oracle/product/10.2.0/flash_recovery_area
            db_recovery_file_dest_size           big integer 2G
            db_recycle_cache_size                big integer 0
            db_unique_name                       string      orcl
            db_writer_processes                  integer     1
            dbwr_io_slaves                       integer     0
            rdbms_server_dn                      string
            standby_archive_dest                 string      %ORACLE_HOME%/RDBMS
            standby_file_management              string      MANUAL
           
            SQL> select value from v$parameter where name='db_name';
            VALUE
            -------------------------------------------------- ------
            orcl
    method three: View the parameter file.
Second, what is the database instance name (instance_name, ORACLE_SID)
    is sometimes used instance name (instance_name) parameters for the description of the database instance name, sometimes used ORACLE_SID parameter. These are two examples of the database, as shown below differences:
            [code:. 1: 1aaf156970]
            (the ORACLE_SID)
            the OS <----------------> the ORACLE database <----- --- (instance_name (instance name))
            [/ code:. 1: 1aaf156970]
    the figure shows the relationship between the instance name instance_name, ORACLE_SID database and operating systems,
    instance_name ORACLE database parameter is a parameter, this parameter in the parameter file can be the query, when using the external connection.
    After e.g., to a database server, and a connection, it is necessary to know the instance_name, only know the name of the database is of no use, as the database name, or installation data to create the database,
    instance name can be modified. After installation is complete database, the name of the instance is written to the database pfile parameter file in the following format:
            [code:. 1: 1aaf156970]
            db_name = "orcl" # (not modify)
            db_domain = dbcenter.toys.com
            instance_name ORCL = # (can be modified, may be the same or different db_name)
            SERVICE_NAMES = orcl.dbcenter.toys.com
            the control_file = (.... ...........
            .........
            [/ code: 1: 1aaf156970]
    query the current database instance name
    method one: the SELECT instance_name from v $ instance;
            SQL> the SELECT instance_name from v $ instance;
            INSTANCE_NAME
            ----------------
            ORCL
    method two: Parameter instance Show
            the SQL> Show Parameter instance;
            NAME the TYPE of VALUE
            ------------------------------------ ----------- ---------
            active_instance_count                integer
            cluster_database_instances           integer     1
            instance_groups                      string
            instance_name                        string      orcl
            instance_number                      integer     0
            instance_type                        string      RDBMS
            open_links_per_instance              integer     4
            parallel_instance_group              string
            parallel_server_instances            integer     1
            SQL> select value from v$parameter where name='instance_name';
            Of VALUE
            ------------------------------------------------- -------------
            orcl
    method three: query in the parameter file.
    The ORACLE_SID parameter is the operating system environment variables, and for operating system interaction. That is, in order to get the operating system instance name, you must use ORACLE_SID. This parameter ORACLE_BASE, ORACLE_HOME, etc. the same usage.
    After database installation, ORACLE_SID is used to define the name of the database parameter file. Such as:
            $ ORACLE_BASE / ADMIN / DB_NAME / pfile / the init $ ORACLE_SID.ora.
    The method defined:
            [code:. 1: 1aaf156970]
            Export the ORACLE_SID = ORCL
            [/ code:. 1: 1aaf156970]
    If multiple databases created in the same server, the same time there must be a plurality of database instances, then the process can repeat as defined above, to select a different instance.
    Can also use
            [code:. 1: 1aaf156970]
            [Oracle @ Datacent] $ the oraenv.
            [/ Code:. 1: 1aaf156970]
    To switch to a different start ORACLE_SID different instances (instance) through the operating system
    ORACLE_SID connected to the network
    ORACLE_SID oracle server is further configured to identify the network connection. When configuring the oracle host connection string, it is necessary to specify ORACLE_SID.
    Of course, after the 8i version of the network components requires the use of a service name SERVICE_NAMES. This concept is explained next.
   
Third, the relationship between the database name and instance name.
    The relationship between the database name and the instance name is generally one to one relationship, there is a name there is a database instance name,
    if you create two databases on a single server, there are two database name, database instance name two, with determining a two identification database, the user is connected, and examples.
    However, 8i, 9i parallel server architecture (i.e. oracle real application cluster), the database instance between many relationship, (corresponding to a plurality of database instances, a user only one time instance linked, when a certain examples of failure, other examples of automated services to ensure the safe operation of the database.)

Fourth, what is the database domain name?
    In the distributed database system work, between different versions of the database server, regardless of the operating system is running unix or windows, can be remote replication through a database link between the server and
    database domain name primarily for the oracle in a distributed environment replication. An example:
        distributed database system of the National Traffic transportation administration, including:
        Fujian node: fj.jtyz
        Xiamen, Fujian node: xm.fj.jtyz
        Jiangxi: jx.jtyz
        Jiangxi Shangrao: sr.jx.jtyz
    This is the domain name database.
    Database domain names exist in the parameter file, his argument is db_domain.
    Query the database domain
    method: the SELECT value from v $ the Parameter the WHERE name = 'db_domain';
            SQL> the SELECT value from v $ the Parameter the WHERE name = 'db_domain';
            of VALUE
            -------------------------------------------------- ---------
           

    method two: Show the Parameter Domain
            SQL> Show the Parameter Domain
            NAME the TYPE of VALUE
            --------------------------- --------- ----------- ------------------
            db_domain String
    method three: query in the parameter file.
Fifth, the global database name
    Global database name = name + database domain database, such as the aforementioned global database name is Fujian node: oradb.fj.jtyz
Six, what is the database service name?
    From oracle9i version, we introduced a new parameter, the database service name. Parameter name is SERVICE_NAMES.
    If you have a domain name database, the database service name is the global database name; otherwise, the database server name and database name the same.
    Query the database service name
    Method One: the SELECT value from v $ the Parameter the WHERE name = 'SERVICE_NAMES';
            SQL> value from the SELECT v $ the Parameter the WHERE name = 'SERVICE_NAMES';
            of VALUE
            -------------- ------------------------------------------------
            orcl
    method two: Show the Parameter service_name
            SQL> Show the Parameter service_name;
            NAME the TYPE of VALUE
            ------------------------------------ ----------- ---------
            service_names string orcl
    Method three: Query in the parameter file.
    Database services connected to the network
    oracle network components oracle8i from the beginning of the database and the client host connection string using the database service name. Before using a ORACLE_SID, namely database instance name

Published 18 original articles · won praise 16 · views 390 000 +

Guess you like

Origin blog.csdn.net/f_zongjian/article/details/5835425