The tnsnames.ora file has an entry for the service alias ORCL as follows: The TNS ping
command executes successfully when tested with ORCL; however, from the same OS user
session, you are not able to connect to the database instance with the following command:
SQL > CONNECT scott/tiger@orcl What could be the reason for this?
A.
The listener is running on a different port.
B.
The DEFAULT_DOMAIN parameter is set to the wrong value in the sqlnet.ora file.
C.
The orcl.oracle.com database service is not registered with the listener.
D.
The listener is not running on the database node.
E.
The TNS_ADMIN environment variable is set to the wrong value.
Explanation:
B.
The DEFAULT_DOMAIN parameter is set to the wrong value in the sqlnet.ora file.
I happen to be commenting to make you understand of the fantastic experience my princess undergone reading through your webblog. She came to understand several details, with the inclusion of how it is like to possess a marvelous giving character to let men and women just fully understand certain extremely tough subject areas. You truly did more than our own desires. Many thanks for imparting these powerful, safe, revealing as well as fun tips about your topic to Mary.
http://www.bastcilkdoptb.com/
Correct answer should be B:
https://DOCS.ORACLE.COM/CD/E11882_01/NETWORK.112/E10835/SQLNET.HTM#NETRF191
NAMES.DEFAULT_DOMAIN
Purpose
To set the domain from which the client most often looks up names resolution requests. When this parameter is set, the default domain name is automatically appended to any unqualified net service name or service name.
For example, if the default domain is set to us.example.com, then the connect string CONNECT scott@sales gets searched as sales.us.example.com. If the connect string includes the domain extension, such as CONNECT [email protected], then the domain is not appended to the string.
Default None
Example
NAMES.DEFAULT_DOMAIN=example.com
> oracle@ora12cdbhost1(ORA-SID=CDBTST):/oracle/product/dbase/12102/CDBTST/network/admin/samples oracle@ora12cdbhost1(ORA-SID=CDBTST):/oracle/product/dbase/12102/CDBTST/network/admin/samples < $
C should be the right answer. I tried and got following. The use of DEFAULT_DOMAIN is as below.
Use the parameter NAMES.DEFAULT_DOMAIN to set the domain from which the client most often looks up names resolution requests. When this parameter is set, the default domain name is automatically appended to any unqualified net service name or service name.
For example, if the default domain is set to us.acme.com, the connect string CONNECT scott/tiger@sales gets searched as sales.us.acme.com. If the connect string includes the domain extension, such as CONNECT scott/[email protected], the domain is not appended.
Reference: https://docs.oracle.com/cd/B10501_01/network.920/a96581/sqlnet.htm
SYS@orcl:SQL> show parameter service
NAME TYPE VALUE
———————————— ———– ——————————
service_names string orcl
Enter user-name: sys/oracle_4U@orcl as sysdba
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = ora12c.localdomain)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl.localdomain)))
OK (0 msec)
SYS@orcl:SQL> show parameter service
NAME TYPE VALUE
———————————— ———– ——————————
service_names string orcl.localdomain
@:SQL> connect sys/oracle_4U@orcl as sysdba
Connected.
SYS@orcl:SQL>
Answer is actually B
NAMES.DEFAULT_DOMAIN
Purpose
To set the domain from which the client most often looks up names resolution requests.
When this parameter is set, the default domain name is automatically appended to any unqualified net service name or service name.
For example, if the default domain is set to us.example.com, then the connect string CONNECT scott@sales gets searched as sales.us.example.com. If the connect string includes the domain extension, such as CONNECT [email protected], then the domain is not appended to the string.
Default
None
Example
NAMES.DEFAULT_DOMAIN=example.com
If this were a multi option question, answer should be B and C, as is not giving the error number or message to determine the exact kind of error.
Given the current question, strictly, my experience takes me to C, given the fact that a TNSPING receives a correct answer from listener process.
If you set NAMES.DEFAULT_DOMAIN, tnsping command also doesn’t work. So the right answer is C
Given the current question, strictly, my experience takes me to C, given the fact that a TNSPING receives a correct answer from listener process.
Tested here. C is the right one.
IF orcl.oracle.com database service is not registered with the listener, TNSPING works, but SQLPLUS doesn’t, evenv if you add NAMES.DEFAULT_DOMAIN.
NAMES.DEFAULT_DOMAIN add the domain to the end of the connection entry name, there’s no influence on the service name of the target database. If you add any NAMES.DEFAULT_DOMAIN tnsping command also doesn’t work.