OCM實驗-網路配置

super_sky發表於2014-01-07
網路配置裡主要配置監聽和客戶端連線,這裡我著重寫一下我平時如何來建監聽的。前面我也寫過一次《手動建立監聽》大家有興趣的可以看看。

首先獲取建立監聽的模板,這個監聽模板在$ORACLE_HOME/network/admin/samples下面,將模板拷貝到$ORACLE_HOME/network/admin目錄
[oracle@icsts ~]$ cd $ORACLE_HOME/network/admin/
[oracle@icsts admin]$ cd samples
[oracle@icsts samples]$ ls
listener.ora  sqlnet.ora  tnsnames.ora
[oracle@icsts samples]$ cp listener.ora ../
[oracle@icsts samples]$ cd ..
[oracle@icsts admin]$ ls
listener.ora  samples  shrept.lst

修改監聽模板
[oracle@icsts admin]$ vi listener.ora
# copyright (c) 1997 by the Oracle Corporation

# NAME
#   listener.ora
# FUNCTION
#   Network Listener startup parameter file example
# NOTES
#   This file contains all the parameters for listener.ora,
#   and could be used to configure the listener by uncommenting
#   and changing values.  Multiple listeners can be configured
#   in one listener.ora, so listener.ora parameters take the form
#   of SID_LIST_, where is the name of the listener
#   this parameter refers to.  All parameters and values are
#   case-insensitive.

#
#   This parameter specifies both the name of the listener, and
#   it listening address(es). Other parameters for this listener
#   us this name in place of .  When not specified,
#   the name for defaults to "LISTENER", with the default
#   address value as shown below.
#
LISTENER =
  (ADDRESS_LIST=
        (ADDRESS=(PROTOCOL=tcp)(HOST=icsts)(PORT=1521))
        (ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))
#這裡是配置監聽資訊,主要修改HOST 和 PORT

# SID_LIST_
#   List of services the listener knows about and can connect 
#   clients to.  There is no default.  See the Net8 Administrator's
#   Guide for more information.
#
SID_LIST_LISTENER=
   (SID_LIST=
        (SID_DESC=
          (GLOBAL_DBNAME=ICSTEST)
          (SID_NAME=ICSTEST)
          (ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1)
         )
   )
#這裡是配置監聽的靜態資訊,需要配置GLOBAL_DBNAME 、 SID_NAME 和ORACLE_HOME

啟動監聽
[oracle@icsts admin]$ lsnrctl start
LSNRCTL for Linux: Version 10.2.0.5.0 - Production on 07-JAN-2014 14:25:15
Copyright (c) 1991, 2010, Oracle.  All rights reserved.
Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.5.0 - Production
System parameter file is /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=icsts)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=icsts)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 10.2.0.5.0 - Production
Start Date                07-JAN-2014 14:25:15
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=icsts)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))
Services Summary...
Service "ICSTEST" has 1 instance(s).
  Instance "ICSTEST", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

基本上網路配置完成。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/11590946/viewspace-1067897/,如需轉載,請註明出處,否則將追究法律責任。

相關文章