Print service provided by iDogiCat:
home logo

Home > IT > Database > Oracle Frequently Used Commands

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 - Production on 10-FEB-2009 19:13:00

Copyright (c) 1997, 2007, Oracle.  All rights reserved.

Used parameter files:

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.Remote =
      (ADDRESS = (PROTOCOL = TCP)(HOST = = 1522 ))
      (SID = MY_DB)

When the above is put in the right rnsnames.ora, we can use any of MY_DB, 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