1Z0-062 · Question #347
Examine the command: SQL> CONNECT hr/hr@orcl Which two configurations allow this command to execute successfully? (Choose two.)
The correct answer is B. The SERVICE_NAMES initialization parameter should contain the name orcl in the database C. The orcl TNS alias should be defined such that it is resolvable by a client running on the. For a successful connection using CONNECT hr/hr@orcl, the client must be able to resolve the 'orcl' alias to a database service, and the database itself must be configured to register a service named 'orcl'.
Question
Examine the command:
SQL> CONNECT hr/hr@orcl Which two configurations allow this command to execute successfully? (Choose two.)
Options
- AIn the tnsnames.ora file, the SERVICE_NAME value of CONNECT_DATA should be explicitly
- BThe SERVICE_NAMES initialization parameter should contain the name orcl in the database
- CThe orcl TNS alias should be defined such that it is resolvable by a client running on the
- DThe orcl TNS alias should be defined in the tnsnames.ora file on both the client and the
- EThe TNS_ADMIN environment variable should be set to orcl on the client.
How the community answered
(34 responses)- A3% (1)
- B94% (32)
- D3% (1)
Why each option
For a successful connection using `CONNECT hr/hr@orcl`, the client must be able to resolve the 'orcl' alias to a database service, and the database itself must be configured to register a service named 'orcl'.
The `SERVICE_NAME` value in `tnsnames.ora` should typically match the database's actual service name; it's the `orcl` TNS alias itself that needs to resolve to this service, rather than the `SERVICE_NAME` within `CONNECT_DATA` explicitly being `orcl`.
The `SERVICE_NAMES` initialization parameter in the database instance defines the service names that the database registers with the listener, making it discoverable and connectable via those names.
The `orcl` TNS alias must be defined in a client-side configuration file (like tnsnames.ora) or via a naming method (like LDAP) so that the client application can resolve 'orcl' to the database's network address and service name.
The `tnsnames.ora` file is a client-side configuration for resolving network aliases and is not typically required on the database server itself for a client to connect to that server.
The `TNS_ADMIN` environment variable specifies the directory where client network configuration files (like `tnsnames.ora`) are located, not the TNS alias itself.
Concept tested: Oracle Net client-server connection resolution
Source: https://docs.oracle.com/en/database/oracle/oracle-database/19/netag/configuring-naming.html#GUID-7570494E-1C04-4B2E-A9A5-F9B2735C0320
Topics
Community Discussion
No community discussion yet for this question.