oracle 修改默认端口:
1. 查看状态:
lsnrctl status
2. 停止监听:
lsnrctl stop
文件1: ${oracle_home1}\NETWORK\ADMIN\listener.ora 将数据库实例添加到 SID_LIST
SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = CLRExtProc) (ORACLE_HOME = ${oracle_home1}) (PROGRAM = extproc) (ENVS = "EXTPROC_DLLS=ONLY:${oracle_home1}\bin\oraclr11.dll") ) (SID_DESC = (GLOBAL_NAME = michael) (SID_NAME = michael) (ORACLE_HOME = ${oracle_home1}) ) ) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = Michael-WK)(PORT = 1521)) ) )
端口改为 1521, 增加数据库的 sid_list.
文件2:${oracle_home1}\NETWORK\ADMIN\tnsnames.ora
MICHAEL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = michael) ) )
端口改为 1521
4. 修改数据库配置.
登录:
sqlplus sys/michael@localhost:5521/michael as sysdba
alter system set local_listener="(address=(protocol=tcp)(host=localhost)(port=1521))";
5. 启动监听器:
lsnrctl start