With 9i, I could edit the listener.ora and tnsnames.ora and substitute
localhost for the actual system name. This worked perfectly and
permitted cloning of the systems for the classroom.
With 10.2.0.1, however that technique doesn't seem to work. Once the
files are changed to localhost and I've restarted the listener, I
can't get the database to register with the listener. I get "listener
does not currently know of service requested".
Using lsnrctl status confirms that the listener is not aware of the
instance. There is no error in the log, other than the unknown
service.
Any suggestions will be appreciated.
have you tried just using the (tcp) loopback address of
127.0.0.1
explicitly?
Might you consider to use IPC instead of TCP if only local connections
are to be supported?
what OS, btw?
-bdbafh
Thanks for the reply.
I tried using 127.0.0.1, same problem as localhost. Also tried
aliasing localhost in the hosts file - didn't help.
I need to use TCP because there are other applications involved.
I should have stated, up front, that the platform is Windows XP.
Unless I can figure out a way around this, I'm going to have to write
a program to edit listener.ora and tnsnames.ora each time the system
is cloned.
The file listener.ora is not required.
Have you tried on a clean system with a fresh install of the Oracle
10g database server software:
C:\> lsnrctl start
which will create an OS service and start a listener process up on the
default nic?
that handles half of the issue.
as far as the tnsnames.ora file, could you construct an entry using
the environment variable %COMPUTERNAME% in the connect descriptor in a
script that gets run on each host?
untested, but should work for demo purposes:
c:\> echo mydb=(ADDRESS=(PROTOCOL=TCP)(HOST=%COMPUTERNAME%)(PORT=1521)
(CONNECT_DATA=(SERVICE_NAME=mydb)) > tnsnames.ora
c:\> type tnsnames.ora
mydb=(ADDRESS=(PROTOCOL=TCP)(HOST=RevMaynard)(PORT=1521)
(CONNECT_DATA=(SERVICE_NAME=mydb))
-bdbafh
Here's what I've figured out so far (I think). It looks as though the
problem with using localhost is only with the registration of the
database with the listener. The other functions of the listener seem
to still work.
I modified the listener.ora file to include the db instance. I created
a SID_DESC entry for it (like the old days). Now it will listen for
that instance.
Does this make sense or am I whistling in the dark?
My objective here is to avoid having to modify the files after cloning
the systems. It's not uncommon to need to clone 100 systems per week.
AFAIK Oracle 10 registers with the listener automatically. Changing
the host name *after* installation of Oracle is generally a bad idea
and will create a mess in my experience.
However, a solution in your case might be to install while machines
are called localhost.localdomain and give them proper hostnames
afterwards. You will have to make sure that "localhost" and
"localhost.localdomain" are properly mapped afterwards. All this is
assuming that you use a *nix OS (could not find a ref to OS in your
postings).
You might find some more helpful remarks in Oracle Net Configuration
documentation.
Kind regards
robert
All replies so far are way off, IMHO.
The problem you are facing is service naming; that can
either be done explicitly, in listener.ora, or dynamically.
To find out, what services are supported, try
lsnrctl services
Here's a sample output:
[oracle102@cs-frank03 ~]$ lsnrctl services
LSNRCTL for Linux: Version 10.2.0.3.0
Copyright (c) 1991, 2006, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
The listener supports no services
The command completed successfully
As you can see - no services. As a result of that,
connection efforts fail with the error you provided:
[oracle102@cs-frank03 ~]$ sqlplus system@o10gr2
SQL*Plus: Release 10.2.0.3.0 - Production on Thu Jan 17 11:44:17 2008
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Enter password:
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in
connect descriptor
There's two things you can do about that (3, actually):
1) wait a while, until the instance has registered itself
2) force the instance to register (alter system register).
3) start the listener before opening the instance - it will try
to register then, or opt for 1)
Anyway - as soon as the lsnrctl services command results in
something like this (version snipped for brevity):
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
Services Summary...
Service "o10gr2" has 1 instance(s).
Instance "o10gr2", status READY, has 1 handler(s) for this service...
You're OK - that is, when your tnsnames.ora is OK... Using a wrong
service_name in tnsnames.ora will still generate the TNS-12514:
tnsping Arch:
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS =
(PROTOCOL = TCP)(HOST = cs-frank03)(PORT = 1521))) (CONNECT_DATA =
(SERVICE_NAME = arch)))
OK (0 msec)
[oracle102@cs-frank03 ~]$ sqlplus system@arch
SQL*Plus: Release 10.2.0.3.0 - Production
Enter password:
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in
connect descriptor
Which also demonstrates the limited use for tnsping...
The correct service_name would be db_name and db_domain, concatenated
with a dot (db_name||'.'||db_domain).
--
Regards,
Frank van Bortel
Top-posting in UseNet newsgroups is one way to shut me up