问题:Oracle中,假如不配置好合适的listener.ora文件,启动监听器时就会报错:The listener supports no services。该怎么配置呢?
回答:Oracle给了个监听器配置文件的例子,内容如下:
# LISTENER =
# (ADDRESS_LIST=
# (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))
# (ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))
# SID_LIST_LISTENER=
# (SID_LIST=
# (SID_DESC=
# #BEQUEATH CONFIG
# (GLOBAL_DBNAME=salesdb.mycompany)
# (SID_NAME=sid1)
# (ORACLE_HOME=/private/app/oracle/prodUCt/8.0.3)
# #PRESPAWN CONFIG
# (PRESPAWN_MAX=20)
# (PRESPAWN_LIST=
# (PRESPAWN_DESC=(PROTOCOL=tcp)(POOL_SIZE=2)(TIMEOUT=1))
# )
# )
# )
经试验,只要将其中的某些参数(比如PORT,GLOBAL_DBNAME,SID_NAME,ORACLE_HOME等)改为真实数据即可。当然,这些内容要置于listener.ora中,listener.ora放在/etc/下或者$ORACLE_HOME/network/admin/目录下。