Oracle 11g利用Netmgr配置监听器和服务

如果安装数据库时,选择Install database software only选项时,安装完数据库软件后,需要进行数据库的创建,那么使用DBCA工具创建数据库前,需要配置监听器和服务,因为使用DBCA建库过程中,如果安装EM则需要启动监听器。

监听器配置

监听器示例
[oracle@sz oracle]$ more product/11.2.0/dbhome_1/network/admin/listener.ora 
# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

SID_LIST_SZ_PRI =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = szpri)
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
      (SID_NAME = szpri)
    )
  )

SZ_PRI =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = sz.pri.com)(PORT = 1521))
  )

ADR_BASE_SZ_PRI = /u01/app/oracle

下面详细介绍监听器的配置过程

1、在命令行输入下面的命令,启动Oracle Net Manager图形化工具;
[oracle@sz ~]$ netmgr
2、启动Oracle Net Manager图形化工具;
      Oracle 11g利用Netmgr配置监听器和服务_第1张图片
3、选择Listeners,并点击+按钮后,出现配置监听器名称文本框,输入sz_pri后,点击OK按钮;
      Oracle 11g利用Netmgr配置监听器和服务_第2张图片
4、点击Add Address按钮后,在上面的下拉框中选择Database Services,并点击Add Database按钮;
      Oracle 11g利用Netmgr配置监听器和服务_第3张图片
5、在Global Database Name和SID中输入数据库名称,即前面的ORACLE_SID,szpri,然后在菜单栏点击File下面的Save Network Configuration进 行保存;
      Oracle 11g利用Netmgr配置监听器和服务_第4张图片
6、配置完成后,测试配置情况,下面显示配置成功;    
[oracle@sz ~]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 05-SEP-2017 00:59:13

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Starting /u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.4.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/sz/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=sz.pri.com)(PORT=1521)))

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                05-SEP-2017 00:59:14
Uptime                    0 days 0 hr. 0 min. 1 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/sz/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=sz.pri.com)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle@sz ~]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 05-SEP-2017 00:59:23

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                05-SEP-2017 00:59:14
Uptime                    0 days 0 hr. 0 min. 9 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/sz/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=sz.pri.com)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle@sz ~]$


TNS服务配置

TNS服务示例
[oracle@sz oracle]$ more product/11.2.0/dbhome_1/network/admin/tnsnames.ora 
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

SZPRI =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = sz.pri.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = szpri)
    )
  )

下面详细介TNS服务的配置过程

1、在命令行输入下面的命令,启动Oracle Net Manager图形化工具;
      [oracle@sz ~]$ netmgr
2、启动Oracle Net Manager图形化工具,并选择Service Naming,点击+按钮;
      Oracle 11g利用Netmgr配置监听器和服务_第5张图片
3、在Net Service Name输入szpri,点击Next按钮;
     Oracle 11g利用Netmgr配置监听器和服务_第6张图片
4、点击Next按钮进入下一步;
     Oracle 11g利用Netmgr配置监听器和服务_第7张图片
5、在Host Name输入192.168.1.106,点击Next;
     Oracle 11g利用Netmgr配置监听器和服务_第8张图片
6、在Service Name输入szpri,点击Next;
     Oracle 11g利用Netmgr配置监听器和服务_第9张图片
7、点击Finish完成配置,然后在菜单栏点击File下面的Save Network Configuration进行保存;
     Oracle 11g利用Netmgr配置监听器和服务_第10张图片



你可能感兴趣的:(Oracle系列)