相应文件dbca.rsp中GDBNAME=ora11g,SID=orcl
1.为什么自动生成的tnsname.ora文件中service_name=ora11g?
2.为什么远程通过PLSQL连接配置的服务名要用GDBNAME :ora11g,而不是用SID:orcl

解决方案 »

  1.   

    默认生成的tnsname.ora配置
    ORA11G =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = ora11g)
        )
      )
      

  2.   

    ##############################################################################
    ##                                                                          ##
    ##                            DBCA response file                            ##
    ##                            ------------------                            ##
    ## Copyright   1998, 2007, Oracle Corporation. All Rights Reserved.         ##
    ##                                                                          ##
    ## Specify values for the variables listed below to customize Oracle        ##
    ## Database Configuration installation.                                     ##
    ##                                                                          ##
    ## Each variable is associated with a comment. The comment identifies the   ##
    ## variable type.                                                           ##
    ##                                                                          ##
    ## Please specify the values in the following format :                      ##
    ##          Type       :  Example                                           ##
    ##          String     :  "<value>"                                         ##
    ##          Boolean    :  True or False                                     ##
    ##          Number     :  <numeric value>                                   ##
    ##          StringList :  {"<value1>","<value2>"}                           ##
    ##                                                                          ##
    ## Examples :                                                               ##
    ##     1. dbca -progress_only -responseFile <response file>                 ##
    ##        Display a progress bar depicting progress of database creation    ##
    ##        process.                                                          ##
    ##                                                                          ##
    ##     2. dbca -silent -responseFile <response file>                        ##
    ##        Creates database silently. No user interface is displayed.        ##
    ##                                                                          ##
    ##     3. dbca -silent -createDatabase -cloneTemplate                       ##
    ##  -responseFile <response file>                      ##
    ##        Creates database silently with clone template. The template in    ##
    ##   responsefile is a clone template.              ##
    ##                                                                          ##
    ##     4. dbca -silent -deleteDatabase -responseFile <response file>        ##
    ##        Deletes database silently.                                        ##
    ###############################################################################-----------------------------------------------------------------------------
    # GENERAL section is required for all types of database creations.
    #-----------------------------------------------------------------------------
    [GENERAL]#-----------------------------------------------------------------------------
    # Name          : RESPONSEFILE_VERSION
    # Datatype      : String
    # Description   : Version of the database to create
    # Valid values  : "11.1.0"
    # Default value : None
    # Mandatory     : Yes
    #-----------------------------------------------------------------------------
    RESPONSEFILE_VERSION = "11.2.0"#-----------------------------------------------------------------------------
    # Name          : OPERATION_TYPE
    # Datatype      : String
    # Description   : Type of operation
    # Valid values  : "createDatabase" \ "createTemplateFromDB" \ "createCloneTemplate" \ "deleteDatabase" \ "configureDatabase" \ "addInstance" (RAC-only) \ "deleteInstance" (RAC-only)
    # Default value : None
    # Mandatory     : Yes
    #-----------------------------------------------------------------------------
    OPERATION_TYPE = "createDatabase"#-----------------------*** End of GENERAL section ***------------------------#-----------------------------------------------------------------------------
    # CREATEDATABASE section is used when OPERATION_TYPE is defined as "createDatabase". 
    #-----------------------------------------------------------------------------
    [CREATEDATABASE]#-----------------------------------------------------------------------------
    # Name          : GDBNAME
    # Datatype      : String
    # Description   : Global database name of the database
    # Valid values  : <db_name>.<db_domain> - when database domain isn't NULL
    #                 <db_name>             - when database domain is NULL
    # Default value : None
    # Mandatory     : Yes
    #-----------------------------------------------------------------------------
    GDBNAME = "ora11g"#-----------------------------------------------------------------------------
    # Name          : POLICYMANAGED
    # Datatype      : Boolean
    # Description   : Set to true if Database is policy managed and 
    #   set to false if  Database is admin managed
    # Valid values  : TRUE\FALSE
    # Default value : FALSE
    # Mandatory     : No
    #-----------------------------------------------------------------------------
    #POLICYMANAGED = "false"#-----------------------------------------------------------------------------
    # Name          : CREATESERVERPOOL
    # Datatype      : Boolean
    # Description   : Set to true if new server pool need to be created for database 
    #   if this option is specified then the newly created database 
    #   will use this newly created serverpool. 
    #   Multiple serverpoolname can not be specified for database
    # Valid values  : TRUE\FALSE
    # Default value : FALSE
    # Mandatory     : No
    #-----------------------------------------------------------------------------
    #CREATESERVERPOOL = "false"#-----------------------------------------------------------------------------
    # Name          : FORCE
    # Datatype      : Boolean
    # Description   : Set to true if new server pool need to be created by force 
    #   if this option is specified then the newly created serverpool
    #   will be assigned server even if no free servers are available.
    #   This may affect already running database.
    #   This flag can be specified for Admin managed as well as policy managed db.
    # Valid values  : TRUE\FALSE
    # Default value : FALSE
    # Mandatory     : No
    #-----------------------------------------------------------------------------
    #FORCE = "false"#-----------------------------------------------------------------------------
    # Name          : SERVERPOOLNAME
    # Datatype      : String
    # Description   : Only one serverpool name need to be specified 
    #    if Create Server Pool option is specified. 
    #    Comma-separated list of Serverpool names if db need to use
    #    multiple Server pool
    # Valid values  : ServerPool name
    # Default value : None
    # Mandatory     : No [required in case of RAC service centric database]
    #-----------------------------------------------------------------------------
    #SERVERPOOLNAME = #-----------------------------------------------------------------------------
    # Name          : CARDINALITY
    # Datatype      : Number
    # Description   : Specify Cardinality for create server pool operation
    # Valid values  : any positive Integer value
    # Default value : Number of qualified nodes on cluster
    # Mandatory     : No [Required when a new serverpool need to be created]
    #-----------------------------------------------------------------------------
    #CARDINALITY = #-----------------------------------------------------------------------------
    # Name          : SID
    # Datatype      : String
    # Description   : System identifier (SID) of the database
    # Valid values  : Check Oracle11g Administrator's Guide
    # Default value : <db_name> specified in GDBNAME
    # Mandatory     : No
    #-----------------------------------------------------------------------------
    SID = "orcl"