Skip to content

Instantly share code, notes, and snippets.

@bulain
Created March 31, 2012 06:18
Show Gist options
  • Save bulain/2259916 to your computer and use it in GitHub Desktop.
Save bulain/2259916 to your computer and use it in GitHub Desktop.
oracle instant client sqlplus configuration in windows
oracle server configuration
#listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME = C:\oracle\product\11.2.0\dbhome_1)
(SID_NAME = orcl)
)
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\oracle\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\oracle\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
ADR_BASE_LISTENER = C:\oracle
#tnsnames.ora
orcl =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
oracle client configuration
Option 1:
1. using next command to connect
sqlplus /nolog
conn system/[email protected]:1521/orcl
Option 2:
1. set env
ORACLE_HOME=<DIR>
TNS_ADMIN=%ORACLE_HOME%
PATH=%PATH%;%ORACLE_HOME%
2. create new file %ORACLE_HOME%\network\admin\sqlnet.ora
NAMES.DIRECTORY_PATH= (LDAP, TNSNAMES, HOSTNAME)
3. create new file %ORACLE_HOME%\network\admin\tnsnames.ora
orcl =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.190)(PORT = 1521))
)
(CONNECT_DATA =
(SID = orcl)
(SERVER = DEDICATED)
)
)
4. using next command
sqlplus /nolog
conn system/admin@orcl
QA: ORA-12154: TNS:could not resolve the connect identifier specified
Resolution:
cd %ORACLE_HOME%\network\admin
dos2unix *.ora
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment