一、管理组件
Oracle
10g数据库管理包含三个组件,本文主要介绍Database
Control,SQL*Plus及iSQL*Plus
Database
instance(数据库实例)
-->系统使用的后台进程
Listener
(监听器)
-->监听客户端连接到数据库
Management interfance
Database
Control
-->OEM
Management agent (when using
Grid Control) --网格管理
二、使用OEM管理Oracle
1.关于OEM:Oracle
从i开始就随软件提供企业管理器(OEM)
在g中,oracle在dbca建库过程中会出现四个用户:sys,system,dbsnap,sysman
(--dbsnap
用户用于OEM智能代理管理工作,sysman用户则是OEM的管理员帐号)
如果在dbca建库过程中没有选择安装OEM,则没有dbsnap和sysman用户,如果在dbca建库时选择启用database
control管理数据库,
则需要在数据库中建立一个sysman的schema,用于保存OEM的一些数据,这个就是OEM的资料档案库(repository),在G版本中,
这个库存储在sysaux表空间中
2.OEM的启动和关闭
启动:emctl start dbconsole
启动后用浏览器http://IP:1158/em
来登陆OEM,进行图形化操作数据库
关闭:emctl stop dbconsole
状态:emctl status
dbconsole
*/
--下面演示EM启动到停止的过程
[oracle@robinson scripts]$ emctl start dbconsole
--启动
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release
10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All
rights reserved.
http://robinson.com:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 10g Database Control
...................... started.
------------------------------------------------------------------
Logs are generated in directory
/u01/app/oracle/10g/robinson.com_orcl/sysman/log
[oracle@robinson scripts]$ emctl status
dbconsole
--查看状态
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release
10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All
rights reserved.
http://robinson.com:1158/em/console/aboutApplication
Oracle Enterprise Manager 10g is running.
------------------------------------------------------------------
Logs are generated in directory
/u01/app/oracle/10g/robinson.com_orcl/sysman/log
[oracle@robinson scripts]$ emctl stop
dbconsole
--停止
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release
10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All
rights reserved.
http://robinson.com:1158/em/console/aboutApplication
Stopping Oracle Enterprise Manager 10g Database Control ...
... Stopped.
[oracle@robinson scripts]$ emca -config dbcontrol db -repos
recreate
STARTED EMCA at Apr 21, 2010 3:09:04 PM
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle. All rights
reserved.
Enter the following information:
Database SID: orcl
Database Control is already configured for the database orcl
You have chosen to configure Database Control for managing the
database orcl
This will remove the existing configuration and the default
settings and perform a fresh configuration
Do you wish to continue? [yes(Y)/no(N)]: y
Listener port number: 1521
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
-----------------------------------------------------------------
You have specified the following settings
Database ORACLE_HOME ................ /u01/app/oracle/10g
Database hostname ................ robinson.com
Listener port number ................ 1521
Database SID ................ orcl
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: y
Apr 21, 2010 3:09:24 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at
/u01/app/oracle/10g/cfgtoollogs/emca/orcl/emca_2010-04-21_03-09-04-PM.log.
Apr 21, 2010 3:09:25 PM oracle.sysman.emcp.util.DBControlUtil
stopOMS
INFO: Stopping Database Control (this may take a while) ...
Apr 21, 2010 3:09:32 PM oracle.sysman.emcp.EMReposConfig
dropRepository
INFO: Dropping the EM repository (this may take a while) ...
Apr 21, 2010 3:11:41 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Apr 21, 2010 3:11:41 PM oracle.sysman.emcp.EMReposConfig
createRepository
INFO: Creating the EM repository (this may take a while) ...
Apr 21, 2010 3:16:01 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Apr 21, 2010 3:16:08 PM oracle.sysman.emcp.util.DBControlUtil
startOMS
INFO: Starting Database Control (this may take a while) ...
Apr 21, 2010 3:17:55 PM oracle.sysman.emcp.EMDBPostConfig
performConfiguration
INFO: Database Control started successfully
Apr 21, 2010 3:17:55 PM oracle.sysman.emcp.EMDBPostConfig
performConfiguration
INFO:
>>>>>>>>>>>
The Database Control URL is http://robinson.com:1158/em
<<<<<<<<<<<
Enterprise Manager configuration completed successfully
FINISHED EMCA at Apr 21, 2010 3:17:55 PM
[oracle@robinson scripts]$ emctl status dbconsole
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release
10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All
rights reserved.
http://robinson.com:1158/em/console/aboutApplication
Oracle Enterprise Manager 10g is running.
------------------------------------------------------------------
Logs are generated in directory
/u01/app/oracle/10g/robinson.com_orcl/sysman/log
[oracle@robinson scripts]$ cat
$ORACLE_HOME/install/portlist.ini
iSQL*Plus HTTP port number =5560
Enterprise Manager Console HTTP Port (orcl) = 1158
Enterprise Manager Agent Port (orcl) = 3938
[oracle@robinson scripts]$ sqlplus / as
sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Apr 21 15:38:54
2010
Copyright (c) 1982, 2005, Oracle. All rights
reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 -
Production
With the Partitioning, OLAP and Data Mining options
SQL>
[oracle@robinson scripts]$ isqlplusctl start
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
iSQL*Plus 10.2.0.1.0
Copyright (c) 2003, 2005, Oracle. All rights
reserved.
Starting iSQL*Plus ...
iSQL*Plus started.
[oracle@robinson scripts]$ isqlplusctl stop
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
iSQL*Plus 10.2.0.1.0
Copyright (c) 2003, 2005, Oracle. All rights
reserved.
Stopping iSQL*Plus ...
iSQL*Plus stopped.
/*
修改iSQL*Plus默认端口号
[oracle@robinson scripts]$ cat
$ORACLE_HOME/oc4j/j2ee/isqlplus/config/http-web-site.xml |grep
5560
--将改为其他端口号即可
启动isqlplus,然后通过浏览器登陆http://IP:5560/isqlplus
注意:默认情况下,sysdba用户无法通过isqlplus登陆
转发至微博
转发至微博