listener.ora tnsnames.ora
cd $ORACLE_HOME/network/admin/listener.ora,添加
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = orcl)
(ORACLE_HOME = $ORACLE_NAME)
(PROGRAM = extproc)
)
SID_DESC =
(GLOBAL_DBNAME = ORCL)
(ORACLE_HOME = $ORACLE_NAME) #查看 echo $ORACLE_NAME
(SID_NAME = ORCL) #查看 echo $ORACLE_SID
)
)
cd $ORACLE_HOME/network/admin/listener.ora,添加
orcl =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ip地址)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME =db) #查看SERVICE_NAME : sqlplu / as sysdba
#SQL> show parameter service
)
)
最后保存修改,重启监听: lsnrctl stop lsnrctl start
(总结)Oracle监听服务lsnrctl参数及查询状态详解:http://blog.sina.com.cn/s/blog_5e3455e70101bl01.html