nerdexam
Oracle

1Z0-062 · Question #201

You have the following entry in the tnsnames.ors file of your hq.us.example.com host machine: ORCL = (DESCRIPTION = (ADDRESS_LIST = (ADRESS = (PROTOCOL = TCP)(HOST = hq.us.example.com)(PORT = 1521))…

The correct answer is D. The connection succeeds, provided the ORCL.us.example.com database service is registered. When connecting via SQL*Plus using a net service name from tnsnames.ora, the connection succeeds only if the database service specified in CONNECT_DATA is registered with the Oracle listener.

Configuring the Oracle Network Environment

Question

You have the following entry in the tnsnames.ors file of your hq.us.example.com host machine:

ORCL = (DESCRIPTION = (ADDRESS_LIST = (ADRESS = (PROTOCOL = TCP)(HOST = hq.us.example.com)(PORT = 1521)) ) CONNECTED_DATA = (SERVICE_NAME = ORCL.us.example.com) ) ) You issue the following command at the command prompt:

Sqlplus HR/HR@ORCL Which statement is true about the connection to the ORCL database instance?

Options

  • AThe connection succeeds, provided the NAMES.DEFAULT_DOMAIN parameter is set to
  • BThe connection fails because the net service name does not have the suffix us.example.com.
  • CThe connection succeeds, provided the SERVICE_NAMES initialization parameter is set to
  • DThe connection succeeds, provided the ORCL.us.example.com database service is registered

How the community answered

(41 responses)
  • A
    5% (2)
  • B
    2% (1)
  • C
    2% (1)
  • D
    90% (37)

Why each option

When connecting via SQL*Plus using a net service name from tnsnames.ora, the connection succeeds only if the database service specified in CONNECT_DATA is registered with the Oracle listener.

AThe connection succeeds, provided the NAMES.DEFAULT_DOMAIN parameter is set to

While NAMES.DEFAULT_DOMAIN affects how unqualified net service names are resolved, ORCL is already a fully defined entry in tnsnames.ora, so this parameter is not the determining factor for this connection.

BThe connection fails because the net service name does not have the suffix us.example.com.

The net service name ORCL is resolved by exact match lookup in the local tnsnames.ora file and does not require a domain suffix to be appended for successful resolution.

CThe connection succeeds, provided the SERVICE_NAMES initialization parameter is set to

The SERVICE_NAMES initialization parameter controls how the database registers its services with the listener, but the connection ultimately requires the service ORCL.us.example.com to be actively registered - setting the parameter alone does not guarantee registration has occurred.

DThe connection succeeds, provided the ORCL.us.example.com database service is registeredCorrect

The tnsnames.ora entry for ORCL maps to SERVICE_NAME = ORCL.us.example.com. For SQL*Plus to successfully connect using this alias, the Oracle listener must have the ORCL.us.example.com service registered - either through dynamic registration by the PMON process or via static listener configuration. Without this service registration, the listener cannot route the connection.

Concept tested: Oracle Net tnsnames.ora service name resolution and listener registration

Source: https://docs.oracle.com/en/database/oracle/oracle-database/19/netag/identifying-and-accessing-database.html

Topics

#TNS resolution#SQL*Plus connection#service name#tnsnames.ora

Community Discussion

No community discussion yet for this question.

Full 1Z0-062 Practice