How to configure monitoring of oracle database under linux operating system

1. Modify the listener configuration file
The Oracle listener configuration file under Linux is at: $ ORACLE_HOME/network/admin/listerer.ora, such as:
/bank/oracle/oracle10g/product/10.2.0/network/admin/listener.ora

Modify And configure the relevant information to monitor the SID, such as:
#listener.ora Network Configuration File: /bank/oracle/oracle10g/product/10.2.0/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /bank/oracle/oracle10g/product/10.2.0)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL DBNAME = bkserver) 
(SID_NAME = bkserver)
)
)
LISTENER =
( DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.7.13.242)(PORT = 1521))
)
)

2. Start the listener
(1). Switch to oracle installation User (usually oracle)
su - oracle 
(2). Start the listener
lsnrctl start 
Another: stop the listener
lsnrctl stop
3. Test whether the listener is running normally
Modify the tnsnames.ora configuration file on the client to access the Oracle database, such as:
BKSERVER =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.7.13.242)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = BKSERVER)
)
)

Test whether it can be done by command tnsping Access to the listener, such as:
M:\>tnsping bkserver
TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 12-8月 -
2010 17:11:04
Copyright (c) 1997, 2005, Oracle. All rights reserved.
已使用的参数文件:
D:\oracle\product\10.2.0\client_1\network\admin\sqlnet.ora

已使用 TNSNAMES 适配器来解析别名
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
(HOST = 10.7.13.242)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVIC
E_NAME = BKSERVER)))
OK (20 毫秒)
注意: 监听器是否能被tnsping通跟数据库的开启/关闭无关,所以就算可以tnsping通监听器但未必能连接到数据库,这时请检查listener.ora文件配置信息是否正确,还有数据库是否已经被开启。

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326092036&siteId=291194637