Oracle Frequently Used Commands
Locate config file dir
We need to put a config file (something like tnsnames.ora), and put configurations in it. The dir can be found as follows:
C:\>tnsping NYPTRADP
TNS Ping Utility for 32-bit Windows: Version 11.1.0.6.0 - Production on 10-FEB-2009 19:13:00
Copyright (c) 1997, 2007, Oracle. All rights reserved.
Used parameter files:
C:\my\oracle\path\sqlnet.ora
So the path 'C:\my\oracle\path\' above is the dir in which we can locate rnsnames.ora.
The entry in rnsnames.ora looks like follows:
MY_DB,MY_DB.my_company.com,MY_DB.Remote =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = my_db_server.idogicat.com)(PORT = 1522 ))
)
(CONNECT_DATA =
(SID = MY_DB)
)
)
When the above is put in the right rnsnames.ora, we can use any of MY_DB, MY_DB.idogicat.com or MY_DB.Remote to access the database:
sqlplus db_user/db_pwd@MY_DB
or execute a sql:
sqlplus -S -L db_user/db_pwd@MY_DB @/path/to/my.sql