You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-5Lines changed: 11 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -100,9 +100,15 @@ Accepted formats:
100
100
-`<user>/<password>@<TNSName>`
101
101
-`/@<TNSName>` - credentials are taken from an Oracle Wallet (Secure External Password Store), see [Oracle Wallet](#oracle-wallet-secure-external-password-store)
102
102
103
-
To connect using TNS, you need to have either the TNS_ADMIN or the ORACLE_HOME environment variable set.
104
-
The file tnsnames.ora must exist in the TNS_ADMIN directory or in %ORACLE_HOME%/network/admin
105
-
The file tnsnames.ora must contain valid TNS entries.
103
+
To connect using a TNS name, the file `tnsnames.ora` with a valid entry for that name must be found.
104
+
The directory holding `tnsnames.ora` (and `ojdbc.properties`, if used) is taken from the first of these that is set:
105
+
106
+
1.`TNS_ADMIN` parameter in the connect string, e.g. `app/pass@MYDATABASE?TNS_ADMIN=/path/to/network/admin`
107
+
2. Java system property `oracle.net.tns_admin`, e.g. `export JAVA_OPTS="-Doracle.net.tns_admin=/path/to/network/admin"`
108
+
3.`TNS_ADMIN` environment variable
109
+
4.`$ORACLE_HOME/network/admin`, when the `ORACLE_HOME` environment variable is set
110
+
111
+
Options 1-3 are handled by the Oracle JDBC driver. Option 4 is a fallback provided by utPLSQL-cli, used only when none of the others is set.
106
112
107
113
In case you use a username containing `/` or a password containing `@` you should encapsulate it with double quotes `"`:
# tnsnames.ora with the MYDATABASE entry must be in the same directory
135
+
# tnsnames.ora with the MYDATABASE entry must be in the same directory as ojdbc.properties
130
136
export TNS_ADMIN=$HOME/oracle/network/admin
131
137
```
132
138
133
-
Instead of setting `TNS_ADMIN` you can also pass it as part of the connect string: `/@MYDATABASE?TNS_ADMIN=/path/to/network/admin`.
139
+
`ojdbc.properties` is read from the same directory as `tnsnames.ora`, so any of the options listed under [ConnectionURL](#connectionurl) can be used instead of `TNS_ADMIN`, for example `utplsql run "/@MYDATABASE?TNS_ADMIN=/path/to/network/admin"`.
134
140
135
141
The TNS alias used in the connect string must match the alias of the credential stored in the wallet.
0 commit comments