oracle添加静态监听

来源:互联网 发布:利用淘宝店铺做淘宝客 编辑:程序博客网 时间:2024/06/03 16:27
配置静态监听
[oracle@milk11G admin]$ cd $ORACLE_HOME/network/admin
[oracle@milk11G admin]$ pwd
/u01/oracle/app/oracle/product/11.2/network/admin
如果你是还想用原来的监听端口(1521)注册静态监听,那么如方法一
如果你要用其他端口注册监听例如1527,那么就如方法二

方法一:
[oracle@milk11G admin]$ cat listener.ora 
SID_LIST_LISTENER =    
  (SID_LIST =    
    (SID_DESC =    
      (SID_NAME = PLSExtProc)    
      (ORACLE_HOME =/u01/oracle/app/oracle/product/11.2/ )         ----------根据你的环境修改
      (PROGRAM = extproc)    
    )    
    
    (SID_DESC =    
      (GLOBAL_DBNAME =milk11G )                           ----------根据你的环境修改
      (ORACLE_HOME = /u01/oracle/app/oracle/product/11.2/)     ----------根据你的环境修改
      (SID_NAME =milk11G)                                   ----------根据你的环境修改
    )        
  )
方法二:
[oracle@milk11G admin]$ cat listener.ora 
listener_1527 =                                                             
  (DESCRIPTION_LIST =                                              
    (DESCRIPTION =                                                 
      (ADDRESS_LIST =                                              
        (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.88.2)(PORT = 1527)) 
      )                                                            
    )                                                              
  )  
SID_LIST_listener_1527 =                                                    
  (SID_LIST =                                                      
   (SID_DESC =                                                     
      (ORACLE_HOME = /u01/oracle/app/oracle/product/11.2/)         
      (SID_NAME = milk11G)
      (GLOBAL_DBNAME = milk11G)                                           
    )                                                              
  )

最后你要是用方法一,记得重启监听
[oracle@milk11G admin]$  lsnrctl stop 
[oracle@milk11G admin]$ lsnrctl start
[oracle@milk11G admin]$ lsnrctl status查看状态
要是显示末尾两行如下的话:
The listener supports no services
The command completed successfully
那就进行入下操作:
oracle@milk11G admin]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Thu Aug 24 22:39:15 2017
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> alter system register;                            ---------可以多跑几次
System altered.

如方法二的话也要拉起对应的监听就行
[oracle@milk11G admin]$  lsnrctl start listener_1527
原创粉丝点击