Sunteți pe pagina 1din 14

ORA-12514: TNS:listener does not currently now of service Filed under: TNS Ed Stevens @ 7:02 pm In previous posts I have

explored various reasons why a client process might not be able to connect to an Oracle database. In Help! I can t connect to my database presented an overview of the process used by sqlnet to convert a connection req uest to a networ connection descriptor and deliver that request to a listener c apable of servicing the request. I followed that with two posts going into more depth on the types of problems that can prevent the request from reaching the ho st server. Now I would li e to loo at the next possible problem in the sequence , in particular ORA-12514: TNS:listener does not currently now of service reques ted in connect descriptor . For this demonstration I will generate the error then go through the standard an alysis and solution. After that, I will explore some of the interesting factors that flow from this. The Error The vast majority of the time, this error results from an incorrectly specified connect descriptor in the tnsnames.ora file. Let s loo at a very typical example then diagnose and fix it. After that we will dig in to how the listener comes to now of a service name. 01 02 03 04 05 06 07 08 connect 09 10 11 12 Fig. 1 Of course the very first thing anyone should do when confronted with an Oracle e rror is to chec the official description. There are many sources on the web, bu t I li e to start with oerr utility on the server .. 01 [oracle@vmlnx01 admin]$ oerr ora 12514 02 12514, 00000, "TNS:listener does not currently now of service requested in connect descriptor" 03 // *Cause: The listener received a request to establish a connection to a 04 // database or other service. The connect descriptor received by the lis tener 05 // specified a service name for a service (usually a database service) 06 // that either has not yet dynamically registered with the listener or h as 07 // not been statically configured for the listener. This may be a tempo rary 08 // condition such as after the listener has started, but before the data base 09 // instance has registered with the listener. 10 // *Action: 11 // - Wait a moment and try to connect a second time. C:\>sqlplus scott/tiger@vlnxora1 SQL*Plus: Release 10.2.0.4.0 - Production on Tue Mar 15 18:47:26 2011 Copyright (c) 1982, 2007, Oracle. All Rights Reserved.

descriptor Enter user-name: C:\>

ERROR: ORA-12514: TNS:listener does not currently

now of service requested in

// lsnrctl services // - Chec that the SERVICE_NAME parameter in the connect descriptor of // net service name used specifies a service nown by the listener. // - If an easy connect naming connect identifier was used, chec that // the service name specified is a service nown by the listener. // - Chec for an event in the listener.log file.

Fig. 2 The error is pretty self-explanatory: listener does not currently now of service requested in connect descriptor . So how do we now exactly what service was reque sted in connect descriptor ?

01 02 03 04 05 06 07 08 09 10 11 12 Fig. 3

C:\>type C:\oracle\product\10.2.0\client_1\NETWORK\ADMIN\tnsnames.ora vlnxora1 = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = vmlnx01)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = fubar) ) ) C:\>

In Fig. 3, line 8 we see that we should be requesting SERVICE_NAME = fubar. In o ur discussion of ORA-12154 I described how we might not be using the tnsnames.or a we thought we were. At this point we now what SERVICE_NAME we should be using . We can use tnsping to confirm this. 01 C:\>tnsping vlnxora1 02 03 TNS Ping Utility for 32-bit Windows: Version 10.2.0.4.0 - Production on 15-MAR-2 04 011 19:02:39 05 06 Copyright (c) 1997, 2007, Oracle. All rights reserved. 07 08 Used parameter files: 09 C:\oracle\product\10.2.0\client_1\networ \admin\sqlnet.ora 10 11 Used TNSNAMES adapter to resolve the alias 12 Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCO L = TCP) 13 (HOST = vmlnx01)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = fubar))) 14 OK (0 msec) 15 16 C:\> Fig. 4 Fig. 4, line 13 shows that we are requesting a connection to service fubar . Don t be

First, do a sanity chec

by loo ing at the tnsnames.ora file.

12 ing: 13 14 the 15 16 17 18

// - Chec which services are currently nown by the listener by execut

fooled by the good return code. As we saw in tnsping what it is, what it isn t , tns ping only goes as far as confirming there is a listener at the specified ip addr ess and port. It says nothing about any services the listener nows about. The p resence of SERVCICE_NAME in the feedbac is simply the result of showing the ent ire connect descriptor. Now that we now what service name was actually requested, we need to chec what the listener nows about. Examining the listener configuration file, listener.o ra, could give some clues but it is not the whole story. In fact, the listener c an be started without any listener.ora file at all. The only sure way to tell wh at the listener nows about is to as it directly, with the lsnrctl command: 01 [oracle@vmlnx01 ~]$ lsnrctl status 02 03 LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 15-MAR-2011 19:11: 49 04 05 Copyright (c) 1991, 2007, Oracle. All rights reserved. 06 07 Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)) 08 STATUS of the LISTENER 09 -----------------------10 Alias LISTENER 11 Version TNSLSNR for Linux: Version 10.2.0.4.0 - Produc tion 12 Start Date 15-MAR-2011 18:45:24 13 Uptime 0 days 0 hr. 26 min. 25 sec 14 Trace Level off 15 Security ON: Local OS Authentication 16 SNMP OFF 17 Listener Log File /ora00/app/oracle/product/10.2.0/db_1/networ / log/listener.log 18 Listening Endpoints Summary... 19 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=vmlnx01.vmdomain)(PORT=1521) )) 20 Services Summary... 21 Service "vlnxora1" has 1 instance(s). 22 Instance "vlnxora1", status READY, has 1 handler(s) for this service.. . 23 Service "vlnxora1XDB" has 1 instance(s). 24 Instance "vlnxora1", status READY, has 1 handler(s) for this service.. . 25 Service "vlnxora1_XPT" has 1 instance(s). 26 Instance "vlnxora1", status READY, has 1 handler(s) for this service.. . 27 The command completed successfully 28 [oracle@vmlnx01 ~]$ Fig. 5 This listener nows about three service names (vlnxora1, vlnxora1XDB, and vlnxor a1_XPT), all associated with the instance vlnxora1 . (The XDB and XTP services are for special use we can ignore them for general connection problems.) The vast ma jority of the time, that s all the debugging we need to do. We now that we should be requesting a connection to service vlnxora1 instead of fubar . Since that request comes from the client, we have to fix tnsnames.ora 01 02 03 C:\>type C:\oracle\product\10.2.0\client_1\NETWORK\ADMIN\tnsnames.ora vlnxora1 = (DESCRIPTION =

04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 tions 21 22 Fig. 6

(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = vmlnx01)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = vlnxora1) ) ) C:\>sqlplus scott/tiger@vlnxora1 SQL*Plus: Release 10.2.0.4.0 - Production on Tue Mar 15 19:14:41 2011 Copyright (c) 1982, 2007, Oracle. All Rights Reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing op SQL>

We see in Fig. 6, line 12 that we have made the necessary correction in tnsnames .ora. The subsequent connection request is successful (fig. 6, line 18), thus va lidating our analysis and corrective action. Registering the service with the listener So how did the listener come to now about service vlnxora1 in the first place? Th ere are two methods by which a service is registered with the listener static and d ynamic . We ll discuss each in turn. Static registration Static registration is accomplished by configuring the SID_LIST section of the l istener.ora file. 01 [oracle@vmlnx01 admin]$ cat listener.ora 02 # listener.ora Networ Configuration File: /ora00/app/oracle/product/10. 2.0/db_1/networ /admin/listener.ora 03 04 SID_LIST_LISTENER = 05 (SID_LIST = 06 (SID_DESC = 07 (SID_NAME = PLSExtProc) 08 (ORACLE_HOME = /ora00/app/oracle/product/10.2.0/db_1) 09 (PROGRAM = extproc) 10 ) 11 (SID_DESC = 12 (GLOBAL_DBNAME=myfubardb) 13 (ORACLE_HOME = /ora00/app/oracle/product/10.2.0/db_1) 14 (SID_NAME = fubar) 15 ) 16 (SID_DESC = 17 (GLOBAL_DBNAME=vlnxora1) 18 (ORACLE_HOME = /ora00/app/oracle/product/10.2.0/db_1) 19 (SID_NAME = vlnxora1) 20 ) 21 ) 22 23 LISTENER =

24 25 26 27 28 29 30 31 Fig. 7

(DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = vmlnx01.vmdomain)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0)) ) ) [oracle@vmlnx01 admin]$

In Fig. 7 we see three SIDs listed: PLSExtProc, fubar, and vlnxora1 (lines 7,14, and 19). Chec ing the status of the listener, we get 01 [oracle@vmlnx01 admin]$ lsnrctl status 02 03 LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 16-MAR-2011 18:27: 25 04 05 Copyright (c) 1991, 2007, Oracle. All rights reserved. 06 07 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vmlnx01.vmdomain )(PORT=1521))) 08 STATUS of the LISTENER 09 -----------------------10 Alias LISTENER 11 Version TNSLSNR for Linux: Version 10.2.0.4.0 - Produc tion 12 Start Date 16-MAR-2011 18:25:56 13 Uptime 0 days 0 hr. 1 min. 28 sec 14 Trace Level off 15 Security ON: Local OS Authentication 16 SNMP OFF 17 Listener Parameter File /ora00/app/oracle/product/10.2.0/db_1/networ / admin/listener.ora 18 Listener Log File /ora00/app/oracle/product/10.2.0/db_1/networ / log/listener.log 19 Listening Endpoints Summary... 20 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=vmlnx01.vmdomain)(PORT=1521) )) 21 (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0))) 22 Services Summary... 23 Service "PLSExtProc" has 1 instance(s). 24 Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this servi ce... 25 Service "myfubardb" has 1 instance(s). 26 Instance "fubar", status UNKNOWN, has 1 handler(s) for this service... 27 Service "vlnxora1" has 2 instance(s). 28 Instance "vlnxora1", status UNKNOWN, has 1 handler(s) for this service ... 29 Instance "vlnxora1", status READY, has 1 handler(s) for this service.. . 30 Service "vlnxora1XDB" has 1 instance(s). 31 Instance "vlnxora1", status READY, has 1 handler(s) for this service.. . 32 Service "vlnxora1_XPT" has 1 instance(s). 33 Instance "vlnxora1", status READY, has 1 handler(s) for this service.. . 34 The command completed successfully 35 [oracle@vmlnx01 admin]$

Fig. 8 Notice the entry for service myfubardb (fig. 8, line 25) maps bac to (GLOBAL_DBNAM E=myfubardb) (fig 7, line 12) and is related to instance fubar , which maps to fig 7 , line 14). Further, notice that its status is UNKNOWN. This status of UNKNOWN i s the indication that this registration came from the SID_LIST section of listen er.ora. It is un nown because the listener doesn t ma e a chec to see if there is an instance named fubar broadcasting a service name of myfubardb . The listener is j ust saying if you as for a connection to myfubardb , I ll see what I can do to servic e it. In fact, I have no database named fubar or myfubardb . Notice also that service vlnxora1 has two instances, one un nown, and one READY. L i e myfubardb, the UNKNOWN vlnxora1 comes from listener.ora (fig. 7, line 19); t he READY instance comes from the database having registered with the listener (d ynamic registration). Again, for our current discussion, we can ignore the services vlnxora1XDB and vl nxora1_XTP. These have special internal uses for Oracle. For the remainder of the discussion, I am going to completely remove listener.or a, then restart the listener so that it has no static registrations and is runni ng with all default values: 01 [oracle@vmlnx01 admin]$ rm listener.ora 02 03 [oracle@vmlnx01 admin]$ ls -l listener.ora 04 ls: listener.ora: No such file or directory 05 06 [oracle@vmlnx01 admin]$ lsnrctl stop 07 08 LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 16-MAR-2011 18:44: 43 09 10 Copyright (c) 1991, 2007, Oracle. All rights reserved. 11 12 Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)) 13 The command completed successfully 14 [oracle@vmlnx01 admin]$ lsnrctl start 15 16 LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 16-MAR-2011 18:44: 49 17 18 Copyright (c) 1991, 2007, Oracle. All rights reserved. 19 20 Starting /ora00/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait. .. 21 22 TNSLSNR for Linux: Version 10.2.0.4.0 - Production 23 Log messages written to /ora00/app/oracle/product/10.2.0/db_1/networ /lo g/listener.log 24 Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=vmlnx01.vmdomain )(PORT=1521))) 25 26 Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)) 27 STATUS of the LISTENER 28 -----------------------29 Alias LISTENER 30 Version TNSLSNR for Linux: Version 10.2.0.4.0 - Produc tion

31 Start Date 16-MAR-2011 18:44:49 32 Uptime 0 days 0 hr. 0 min. 0 sec 33 Trace Level off 34 Security ON: Local OS Authentication 35 SNMP OFF 36 Listener Log File /ora00/app/oracle/product/10.2.0/db_1/networ / log/listener.log 37 Listening Endpoints Summary... 38 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=vmlnx01.vmdomain)(PORT=1521) )) 39 The listener supports no services 40 The command completed successfully 41 [oracle@vmlnx01 admin]$ Fig. 9 With no static registration the listener will start with all default values and support no services until a pmon process registers itself. Dynamic registration Dynamic registration is accomplished when the pmon process of the database insta nce contacts the listener and requests registration. This occurs at instance sta rtup, and every few minutes during the life of the instance. There are three initialization parms that affect what service name(s) pmon will register with the listener: DB_NAME SERVICE_NAMES DB_DOMAIN You should loo up each one in the Reference Manual and read the descriptions. ( Clic on the lin s) Notice particularly in the description of SERVICE_NAMES the following: If you do not qualify the names in this parameter with a domain, Oracle qual ifies them with the value of the DB_DOMAIN parameter. If DB_DOMAIN is not specif ied, then no domain will be applied to the non-qualified SERVICE_NAMES values. There is another interaction that is not spelled out in the Reference Manual, bu t mentioned in the Net Services Administrator s Guide: The service name defaults to the global database name, a name comprising the database name (DB_NAME parameter) and domain name (DB_DOMAIN parameter) Since neither DB_DOMAIN nor SERVICE_NAMES are required parameters, let s start wit h an instance with neither of those set, then start observing how service names get constructed with various settings. For each iteration I will do the followin g: 1) alter an initialization parm 2) bounce the database (some of the parms require it. To eep things clean and c onsistent, I ll do it for all of them) 3) restart the listener, to flush the old registrations 4) force a new registration 5) show the listener status, with the results of the new registration 6) show the values of all three parms, for comparison

001 [oracle@vmlnx01 ~]$ sqlplus / as sysdba 002 003 SQL*Plus: Release 10.2.0.4.0 - Production on Wed Mar 16 19:17:57 2011 004 005 Copyright (c) 1982, 2007, Oracle. All Rights Reserved. 006 007 Connected to: 008 Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production 009 With the Partitioning, OLAP, Data Mining and Real Application Testing op tions 010 011 SQL> alter system set service_names='' scope=spfile; 012 013 System altered. 014 015 SQL> alter system set db_domain='' scope=spfile; 016 017 System altered. 018 019 SQL> @doit 020 SQL> startup force 021 ORACLE instance started. 022 023 Total System Global Area 285212672 bytes 024 Fixed Size 1267068 bytes 025 Variable Size 138414724 bytes 026 Database Buffers 142606336 bytes 027 Redo Buffers 2924544 bytes 028 Database mounted. 029 Database opened. 030 SQL> !lsnrctl stop 031 032 LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 16-MAR-2011 19:18: 52 033 034 Copyright (c) 1991, 2007, Oracle. All rights reserved. 035 036 Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)) 037 The command completed successfully 038 039 SQL> !lsnrctl start 040 041 LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 16-MAR-2011 19:19: 01 042 043 Copyright (c) 1991, 2007, Oracle. All rights reserved. 044 045 Starting /ora00/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait. .. 046 047 TNSLSNR for Linux: Version 10.2.0.4.0 - Production 048 Log messages written to /ora00/app/oracle/product/10.2.0/db_1/networ /lo g/listener.log 049 Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=vmlnx01.vmdomain )(PORT=1521))) 050 051 Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)) 052 STATUS of the LISTENER 053 -----------------------054 Alias LISTENER

055 Version TNSLSNR for Linux: Version 10.2.0.4.0 - Produc tion 056 Start Date 16-MAR-2011 19:19:01 057 Uptime 0 days 0 hr. 0 min. 0 sec 058 Trace Level off 059 Security ON: Local OS Authentication 060 SNMP OFF 061 Listener Log File /ora00/app/oracle/product/10.2.0/db_1/networ / log/listener.log 062 Listening Endpoints Summary... 063 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=vmlnx01.vmdomain)(PORT=1521) )) 064 The listener supports no services 065 The command completed successfully 066 067 SQL> alter system register; 068 069 System altered. 070 071 SQL> !lsnrctl status 072 073 LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 16-MAR-2011 19:19: 01 074 075 Copyright (c) 1991, 2007, Oracle. All rights reserved. 076 077 Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)) 078 STATUS of the LISTENER 079 -----------------------080 Alias LISTENER 081 Version TNSLSNR for Linux: Version 10.2.0.4.0 - Produc tion 082 Start Date 16-MAR-2011 19:19:01 083 Uptime 0 days 0 hr. 0 min. 0 sec 084 Trace Level off 085 Security ON: Local OS Authentication 086 SNMP OFF 087 Listener Log File /ora00/app/oracle/product/10.2.0/db_1/networ / log/listener.log 088 Listening Endpoints Summary... 089 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=vmlnx01.vmdomain)(PORT=1521) )) 090 Services Summary... 091 Service "vlnxora1" has 1 instance(s). 092 Instance "vlnxora1", status READY, has 1 handler(s) for this service.. . 093 Service "vlnxora1XDB" has 1 instance(s). 094 Instance "vlnxora1", status READY, has 1 handler(s) for this service.. . 095 Service "vlnxora1_XPT" has 1 instance(s). 096 Instance "vlnxora1", status READY, has 1 handler(s) for this service.. . 097 The command completed successfully 098 099 SQL> show parameter db_name; 100 101 NAME TYPE VALUE 102 ------------------------------------ ----------- ----------------------------103 db_name string vlnxora1

104 105 106 107 ------108 109 110 111 112 ------113 114 Fig. 10

SQL> show parameter service_names; NAME TYPE VALUE ------------------------------------ ----------- ----------------------service_names SQL> show parameter db_domain; string

NAME TYPE VALUE ------------------------------------ ----------- ----------------------db_domain SQL> string

In Fig. 10, at lines 91,93 and 95, we see three service names. All three are ass ociated with the instance vlnxora1 and derived their name from the initialization parameter db_name . Next, we add a simple service name. While normal practice might be to ma e it th e same as the db_name, I ll ma e it different so that we can trace it to the end r esult. Remember, it is quite acceptable to have multiple service_names, which we will get to in a moment. 01 SQL> alter system set service_names='edstevens' scope=spfile; 02 03 System altered. 04 05 SQL> @doit 06 ---- snip repetitive commands and output ---07 SQL> !lsnrctl status 08 09 LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 16-MAR-2011 19:22: 06 10 11 Copyright (c) 1991, 2007, Oracle. All rights reserved. 12 13 Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)) 14 STATUS of the LISTENER 15 -----------------------16 Alias LISTENER 17 Version TNSLSNR for Linux: Version 10.2.0.4.0 - Produc tion 18 Start Date 16-MAR-2011 19:22:06 19 Uptime 0 days 0 hr. 0 min. 0 sec 20 Trace Level off 21 Security ON: Local OS Authentication 22 SNMP OFF 23 Listener Log File /ora00/app/oracle/product/10.2.0/db_1/networ / log/listener.log 24 Listening Endpoints Summary... 25 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=vmlnx01.vmdomain)(PORT=1521) )) 26 Services Summary... 27 Service "edstevens" has 1 instance(s). 28 Instance "vlnxora1", status READY, has 1 handler(s) for this service.. . 29 Service "vlnxora1" has 1 instance(s). 30 Instance "vlnxora1", status READY, has 1 handler(s) for this service..

. 31 32 . 33 34 . 35 36 37 38 39 40 ------41 42 43 44 45 ------46 47 48 49 50 ------51 52 Fig. 11

Service "vlnxora1XDB" has 1 instance(s). Instance "vlnxora1", status READY, has 1 handler(s) for this service.. Service "vlnxora1_XPT" has 1 instance(s). Instance "vlnxora1", status READY, has 1 handler(s) for this service.. The command completed successfully SQL> show parameter db_name; NAME TYPE VALUE ------------------------------------ ----------- ----------------------db_name SQL> show parameter service_names; string vlnxora1

NAME TYPE VALUE ------------------------------------ ----------- ----------------------service_names SQL> show parameter db_domain; string edstevens

NAME TYPE VALUE ------------------------------------ ----------- ----------------------db_domain SQL> string

Now we see that all of the service names derived from db_name are still in place , but we have also added one derived from service_names (Fig. 11, line 27) Next we set db_domain 01 02 03 04 05 06 07 08 09 01 10 11 12 13 14 15 16 17 tion 18 19 20 21 22 SQL> alter system set db_domain='acme.com' scope=spfile; System altered. SQL> @doit ---- snip repetitive commands and output ---SQL> !lsnrctl status LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 16-MAR-2011 19:24: Copyright (c) 1991, 2007, Oracle. All rights reserved. Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)) STATUS of the LISTENER -----------------------Alias LISTENER Version TNSLSNR for Linux: Version 10.2.0.4.0 - Produc Start Date Uptime Trace Level Security SNMP 16-MAR-2011 19:24:01 0 days 0 hr. 0 min. 0 sec off ON: Local OS Authentication OFF

23 Listener Log File /ora00/app/oracle/product/10.2.0/db_1/networ / log/listener.log 24 Listening Endpoints Summary... 25 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=vmlnx01.vmdomain)(PORT=1521) )) 26 Services Summary... 27 Service "edstevens.acme.com" has 1 instance(s). 28 Instance "vlnxora1", status READY, has 1 handler(s) for this service.. . 29 Service "vlnxora1.acme.com" has 1 instance(s). 30 Instance "vlnxora1", status READY, has 1 handler(s) for this service.. . 31 Service "vlnxora1XDB.acme.com" has 1 instance(s). 32 Instance "vlnxora1", status READY, has 1 handler(s) for this service.. . 33 Service "vlnxora1_XPT.acme.com" has 1 instance(s). 34 Instance "vlnxora1", status READY, has 1 handler(s) for this service.. . 35 The command completed successfully 36 37 SQL> show parameter db_name; 38 39 NAME TYPE VALUE 40 ------------------------------------ ----------- ----------------------------41 db_name string vlnxora1 42 SQL> show parameter service_names; 43 44 NAME TYPE VALUE 45 ------------------------------------ ----------- ----------------------------46 service_names string edstevens 47 SQL> show parameter db_domain; 48 49 NAME TYPE VALUE 50 ------------------------------------ ----------- ----------------------------51 db_domain string acme.com 52 SQL> Fig. 12 Notice that all service names those derived from db_name as well as the one deri ved from service_names have the value of db_domain appended to them. Next we add a second service name, this one qualified with a second domain name. Not something you d normally do, but useful for demonstrating the interaction of the parameters 01 pfile; 02 03 04 05 06 07 08 09 07 SQL> alter system set service_names='edstevens,wiley.coyote.com' scope=s System altered. SQL> @doit ---- snip repetitive commands and output ---SQL> !lsnrctl status LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 16-MAR-2011 19:27:

10 11 Copyright (c) 1991, 2007, Oracle. All rights reserved. 12 13 Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)) 14 STATUS of the LISTENER 15 -----------------------16 Alias LISTENER 17 Version TNSLSNR for Linux: Version 10.2.0.4.0 - Produc tion 18 Start Date 16-MAR-2011 19:27:07 19 Uptime 0 days 0 hr. 0 min. 0 sec 20 Trace Level off 21 Security ON: Local OS Authentication 22 SNMP OFF 23 Listener Log File /ora00/app/oracle/product/10.2.0/db_1/networ / log/listener.log 24 Listening Endpoints Summary... 25 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=vmlnx01.vmdomain)(PORT=1521) )) 26 Services Summary... 27 Service "edstevens.acme.com" has 1 instance(s). 28 Instance "vlnxora1", status READY, has 1 handler(s) for this service.. . 29 Service "vlnxora1.acme.com" has 1 instance(s). 30 Instance "vlnxora1", status READY, has 1 handler(s) for this service.. . 31 Service "vlnxora1XDB.acme.com" has 1 instance(s). 32 Instance "vlnxora1", status READY, has 1 handler(s) for this service.. . 33 Service "vlnxora1_XPT.acme.com" has 1 instance(s). 34 Instance "vlnxora1", status READY, has 1 handler(s) for this service.. . 35 Service "wiley.coyote.com" has 1 instance(s). 36 Instance "vlnxora1", status READY, has 1 handler(s) for this service.. . 37 The command completed successfully 38 39 SQL> show parameter db_name; 40 41 NAME TYPE VALUE 42 ------------------------------------ ----------- ----------------------------43 db_name string vlnxora1 44 SQL> show parameter service_names; 45 46 NAME TYPE VALUE 47 ------------------------------------ ----------- ----------------------------48 service_names string edstevens,wiley.coyote. com 49 SQL> show parameter db_domain; 50 51 NAME TYPE VALUE 52 ------------------------------------ ----------- ----------------------------53 db_domain string acme.com 54 SQL> Fig. 13

As before, all of the unqualified service names derived from db_name and service _names have been qualified with the value of db_domain. But notice that we have a new service name (Fig. 13, line 35) from the second value supplied from servic e_names. Since this was fully qualified in the service_names initialization parm , the value of db_domain was not applied. Conclusion We have explored the relationship between the connect descriptor issued by the c lient and the services supported by the listener, as well as the factors that co ntrol what services the listener supports. In the concluding post in this serie s, I will discuss how the database locates the listener in order to register its services the LOCAL_LISTENER initialization parameter. Film at eleven

S-ar putea să vă placă și