Oracle *names
GLOBAL_DBNAME 、DB_UNIQUE_NAME、DB_NAME、SERVICE_NAME、SERVICE_NAMES之間相互關系
當前環境:
- ORACLE_SID=ygzhou
[oracle@ygzhou518]$ env |grep ORA
ORACLE_SID=ygzhou
ORACLE_BASE=/u01/app/oracle
ORACLE_HOSTNAME=ygzhou518
ORACLE_TERM=xterm
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 - INSTANCE_NAME=ygzhou
SQL> select instance_name from v$instance;
INSTANCE_NAME
--------------------------
ygzhou - DB_NAME=ygzhou
SQL> select name from v$database;
NAME
--------------------------
YGZHOU - DB_UNIQUE_NAME=ygzhou
SQL> show parameter db_unique_name;
NAME TYPE VALUE
------------------------------------ ----------- ----------
db_unique_name string ygzhou - SERVICE_NAMES=ygzhou
SQL> show parameter service_names;
NAME TYPE VALUE
------------------------------------ ----------- ----------
service_names string ygzhou
[grid@ygzhou518 admin]$ strings listener.ora
# listener.ora Network Configuration File: /u01/app/grid/product/11.2.0/grid/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = ygzhou518)(PORT = 2013))
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = ygzhoudg)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = ygzhou)
)
ADR_BASE_LISTENER = /u01/app/grid
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent
[oracle@ygzhou518 admin]$ strings tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
YGZHOU =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ygzhou518)(PORT = 2013))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ygzhou)
))
YGZHOUDG =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ygzhou518)(PORT = 2013))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ygzhoudg)
))
1、GLOBAL_DBNAME、SERVICE_NAME and SERVICE_NAMES
[oracle@standbyDB admin]$ sqlplus system/system@ygzhou
SQL*Plus: Release 11.2.0.1.0 Production on Wed Dec 14 02:31:32 2011
Copyright (c) 1982, 2009, Oracle. All rights reserved.
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
[oracle@standbyDB admin]$ sqlplus system/system@ygzhoudg
SQL*Plus: Release 11.2.0.1.0 Production on Wed Dec 14 02:31:49 2011
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
結論:GLOBAL_DBNAME、SERVICE_NAME 與SERVICE_NAMES沒有直接關系、只要保證listener.ora與tnsname.ora中的global_dbname=service_name;
2、DB_UNIQUE_NAME、DB_NAME AND SERVICE_NAMES
[grid@ygzhou518 admin]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 14-DEC-2011 02:37:38
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 14-DEC-2011 02:14:05
Uptime 0 days 0 hr. 23 min. 33 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/grid/product/11.2.0/grid/network/admin/listener.ora
Listener Log File /u01/app/grid/diag/tnslsnr/standbyDB/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ygzhou518)(PORT=2013)))
Services Summary...
Service "ygzhoudg" has 1 instance(s).
Instance "ygzhou", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
SQL> alter system set db_unique_name=target scope=spfile;
[grid@ygzhou518 admin]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 14-DEC-2011 02:37:38
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 14-DEC-2011 02:14:05
Uptime 0 days 0 hr. 23 min. 33 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/grid/product/11.2.0/grid/network/admin/listener.ora
Listener Log File /u01/app/grid/diag/tnslsnr/standbyDB/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ygzhou518)(PORT=2013)))
Services Summary...
Service "ygzhoudg" has 1 instance(s).
Instance "ygzhou", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
SQL> show parameter db_unique_name;
NAME TYPE VALUE
------------------------------------ ----------- ----------------
db_unique_name string TARGET
SQL>
SQL> show parameter service_name;
NAME TYPE VALUE
------------------------------------ ----------- ----------------
service_names string TARGET
SQL>
結論:service_names=db_unique_name
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24867586/viewspace-713273/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle database的names(名字們)OracleDatabase
- 關於db_name,oracle_sid,service_names,global_names等的總結說明Oracle
- 【Oracle】service_name和service_names的關係Oracle
- 7-Overview-namesView
- DNS: More than just namesDNS
- NAMES.DIRECTORY_PATH配置不當導致無法連線oracleOracle
- 【故障-ORACLE】‘ALTER SYSTEM SET service_names='' SCOPE=MEMORY SID=’解釋Oracle
- Finding SAP table names and descriptions
- The English names of various berries All In One
- Oracle修改instance_name、db_name、db_unique_name、service_namesOracle
- Oracle(b_name,db_unique_name, servie_names,db_domain修改方法)OracleAI
- Oracle修改(db_name,db_unique_name, servie_names,db_domain)方法OracleAI
- MySQL為什麼要set namesMySql
- Talk about the naming of spring bean namesSpringBean
- SSL - SSLHandshakeException: No subject alternative names presentException
- sqlzoo練習答案--SELECT names/zhSQL
- mysql lower-case-table-names引數MySql
- mysql 大小寫敏感 lower_case_table_namesMySql
- MySQL8.0的坑之lower_case_table_namesMySql
- SID、ORACLE_SID、INSTANCE_NAME、DB_NAME、SERVER_NAMES、GLOBAL_DBNAME等區別OracleServer
- “tar: Removing leading `/’ from member names”的錯誤REM
- SQLNET.ORA中的NAMES.DIRECTORY_PATH設定SQL
- JSnaughty: Recovering Clear, Natural Identifiers from Obfuscated JS NamesJSIDE
- 開啟或關閉時自動設定service_names
- SSL - SSLHandshakeException: No subject alternative names matching IP address foundException
- IllegalArgumentException: Invalid character found in method name. HTTP method names must be tokensExceptionHTTP
- JDK安全證書一個錯誤訊息 No subject alternative names presentJDK
- PostgreSQL DBA(108) - pgAdmin(Don't do this:Don't use upper names)SQL
- “getfacl: Removing leading '/' from absolute path names”解決辦法REM
- Nginx報錯: "Too many open files accept" 和 "could not build the server_names_hash"NginxUIServer
- ServiceStack.Text反序列化lowercase_underscore_names格式的JSONJSON
- disable-the-loopback-check-for-specific-host-names-on-all-sharepoint-web-and-application-servers/OOPWebAPPServer
- 【java細節】Java程式碼忽略https證照:No subject alternative names presentJavaHTTP
- MySQL大小寫敏感問題lower_case_table_names & lower_case_file_systemMySql
- pytest報錯Hint: make sure your test modules/packages have valid Python names.PackagePython
- ora-02085的解決:Database Link與GLOBAL_NAMES引數Database
- 網友問題--service_names與tnsnames.ora中的service_name關係
- Different AG groups have the exactly same group_id value if the group names are same and the ‘CLUSTER_TYPE = EXTERNAL/NONE’None