Oracle Net configuration belongs to the process using it. Start by identifying the client or listener and its launch environment, then select the file that controls the requested behavior. This prevents a change on one machine from being mistaken for a change on another client.
Oracle DBA Lesson 34A — Find the Client's Oracle Net Files
The practical decision
Identify the process making the connection, its machine, installation, and inherited environment. For a local naming alias, inspect that client's effective tnsnames.ora. Choose sqlnet.ora for the Net profile and naming-method order. Choose listener.ora for the listener's endpoint or static configuration. See Net profile parameters.
A database host can also be a client. Editing its alias file affects local clients that read it. A laptop resolves its own configuration.
Read-only example and interpretation
Baseline: Oracle 19c OCI-based SQL*Plus on Linux. Work in the same shell and environment that launches the client. No database privilege or management pack is needed for this inventory. Ordinary OS read permission is required. The paths and outputs below are authored examples. No Oracle command was executed for this lesson.
command -v sqlplus
printenv TNS_ADMIN
printenv ORACLE_HOME
sqlplus -V
command -v tnsping
tnsping LABPDB
command -v shows what the current shell resolves. Check wrappers, aliases, symlinks, and the relevant installation and library environment before inferring a home from it. sqlplus -V reports the client program version. Record its full release and level rather than substituting the remote database version. printenv reports exported variables inherited by a launched process. An unset value normally prints nothing and exits with status 1. This is useful environment evidence. A GUI or service may have different launch settings from this shell.
The teaching example assumes /opt/oracle/client19/bin/sqlplus, an ordinary full client home /opt/oracle/client19, and exported TNS_ADMIN=/home/student/net. It assumes matching TNSPING, a readable sqlnet.ora, and a local LABPDB alias in that directory, with no domain suffix and no IFILE. If TNSPING is unavailable, record that tool limitation. Do not switch silently to a utility from another home, and do not claim that the actual SQL*Plus process was tested.
A full alias could look like this:
LABPDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dbhost)(PORT = 1521))
(CONNECT_DATA = (SERVICE_NAME = LABPDB)))
TNSPING can report a parameter-file path such as /home/student/net/sqlnet.ora, the TNSNAMES adapter, and the resolved descriptor. A profile path is evidence about the profile. Combine the adapter and target with the applicable search order and the readable alias entry to establish alias provenance. Inspect referenced IFILE entries when present. Preserve the full sanitized output and the actual paths in the lab record. TNSPING tests listener reachability. Separate service login and session verification was taught in Lesson 33. See testing connections.
Which directory applies?
Oracle 19c Net Reference describes the tnsnames.ora order as TNS_ADMIN first, then the installed full-home default when that variable is unset or its alias file is absent. A standard writable home uses ORACLE_HOME/network/admin. A read-only home uses ORACLE_BASE_HOME/network/admin, then ORACLE_HOME/network/admin if its alias file was not found in the base home. Oracle installation and platform guidance can add system locations. Use the exact client's documented rules and actual file evidence. Do not treat this overview as a universal search algorithm. Consult file-specific rules. Identical filenames do not establish identical search behavior. See local naming parameters.
Oracle 19c can be configured with a read-only home. The corresponding home's bin/orabasehome reports the effective base home. This is not a requirement that an ORACLE_BASE_HOME environment variable already be exported. The profile's default also moves to the Oracle base home in read-only mode. See read-only Oracle home.
Instant Client ZIP installations use their network/admin subdirectory for optional Net files, or a directory selected by TNS_ADMIN. RPM layouts differ. Match the executable and libraries to the actual package. See Instant Client ZIP.
A GUI may use JDBC Thin, whose alias directory can be selected by the oracle.net.tns_admin property. Inventory that driver and launch configuration separately. See JDBC data sources and URLs.
The default listener can start at the local hostname on TCP 1521 without listener.ora, initially advertising no services. Dynamic registration supplies supported services, including multiple PDB services. Missing optional Net files can be compatible with defaults or another naming method. Identify the running process and its actual state before deciding to change configuration. See listener configuration.
Independent exercise
On the instructor-designated lab client, record the machine, executable, full client version and RU, relevant launch environment, utility and home identity, and the effective profile and alias source. Capture sanitized TNSPING evidence when available, and inspect the readable source containing the alias. Trace IFILE entries if they are used. For a GUI, record its driver and alias-directory settings separately.
Identify which machine and file would be selected for each request: change a client alias target, change naming-method priority, and change the listener address. Explain why a server-side alias edit does not update a laptop's alias. Success requires correct file ownership and a source path justified by that client's actual configuration, with documented observations distinguished from expected behavior.
The exercise is read-only. No file edits, listener restart, database connection, account change, or cleanup is required. Before a later separately authorized edit, retain a sanitized copy, the exact effective path, and the owner. A shared home needs its owner's change process. Record your actual observations against the success criterion.
Recap
Identify the actual process and installation, establish its effective configuration directory, and choose the right file. Client aliases, Net profile settings, and listener configuration have different owners and roles.
Quiz
1. Which file holds local net-service alias mappings?
2. Which file sets the Net profile and naming-method order?
3. A laptop uses a local alias. Whose effective configuration must you inspect?
4. Must every PDB have a separate listener.ora?
5. What does sqlplus -V report in the inspection exercise?
Names, paths, marker values, and expected results are teaching examples. Perform the practice in the designated Oracle Database 19c lab, confirm the exact release and update level, and record actual observations against the stated success criteria.
No comments:
Post a Comment