欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Linux中oracle多库监听配置

程序员文章站 2022-05-24 11:32:06
...
os:Linux bogon 3.10.0-229.el7.i686 #1 SMP Sun May 17 14:06:40 UTC 2015 i686 i686 i386 GNU/Linux

数据库:oracle11g

listener.ora配置文件:

SID_LIST_LISTENER=
   (SID_LIST=
       (SID_DESC=
          (GLOBAL_DBNAME=yy)
          (SID_NAME=yy)
          (ORACLE_HOME=/oracle/product/11.2.0)
          (PRESPAWN_MAX=20)
          (PRESPAWN_LIST=
              (PRESPAWN_DESC=(PROTOCOL=tcp)(POOL_SIZE=2)(TIMEOUT=1))
          )
        )
          (SID_DESC=
          (GLOBAL_DBNAME=orcl)
          (SID_NAME=orcl)
          (ORACLE_HOME=/oracle/product/11.2.0)
          (PRESPAWN_MAX=20)
          (PRESPAWN_LIST=
              (PRESPAWN_DESC=(PROTOCOL=tcp)(POOL_SIZE=2)(TIMEOUT=1))
          )
        )
    )
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.88.129)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )



tnsnames.ora配置文件:
ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.88.129)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

YY =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.88.129)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = yy)
    )
  )



两个文件位置:/oracle/product/11.2.0/network/admin(我默认将oracle装到了/目录)


开启数据库:
$>sqlplus / as sysdba   #以管理员身份登录
SQL>startup             #启动
$>lsnrctl start         #开启监听


启动非默认库
export ORACLE_SID=其他库名
启动/重启


远程登录命令:conn scott/oracle@192.168.88.129/orcl


配置数据库:dbca命令打开窗口


配置监听:netca命令打开窗口


相关标签: oracle