Create Oracle alias

dgsmith

Member²
Is there a way to create an Oracle alias at runtime, other than to write directly to TNSNames.ora? Or, is there a way to connect to a database for which no alias is defined?

David Smith
 
Actually you can use the "right side" of the alias from tnsnames.ora instead of an alias itself. So for example I can enter

(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.1)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=BENTHIC)))

as the alias/database and it will work without using tnsnames.ora. Note that Oracle says that this is unsupported and may stop working in a future version of OCI, but it works so far. Good luck!

------------------
Mark Ford
Benthic Software
Quality Oracle Tools
 
Back
Top