轉載:http://blog.itpub.net/31392094/viewspace-2127788/linux
第一種方式(最經常使用):配置監聽,配置tnsname.ora文件sql
例如:oracle
ORA11GR2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.6)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PROD)
)
)app
第二種方式(EZConnect字符串):spa
配置sqlnet.ora文件:.net
sec@secdb /home/oracle$ cat $ORACLE_HOME/network/admin/sqlnet.ora
# sqlnet.ora Network Configuration File: /oracle/app/oracle/product/10.2.0/db_1/network/admin/sqlnet.ora
# Generated by Oracle configuration tools.blog
NAMES.DIRECTORY_PATH= (TNSNAMES,EZCONNECT)ip
cmd窗口或者 linux下:sqlplus 用戶名/密碼@ip/實例名稱;字符串