Install Oracle EM Cloud Control 12c on MS Win server 2008 R2
安装介质的获取:
http://www.oracle.com/technetwork/oem/enterprise-manager/downloads/oem-windows64-download-1619155.html
在本文中,我们需要下载的介质:
em12105_winx64_disk1.zip
em12105_winx64_disk2.zip
em12105_winx64_disk3.zip
环境说明:
本文会涉及到两台服务器:
EM Server:
IP:166.100.0.140
操作系统:Microsoft Windows Server 2008 R2
内存:16G+
硬盘:50G
虚拟环境的硬件配置:
其实这里的内存配置我还是给小了,最好给到16G+。
内存如果给少了,在安装EM的时候,你会出现这样的现象:
安装进程最后可以跑完,但是,等待的时间会非常长;当然也有可能安装失败。
所以,为了避免这些问题,不要吝啬内存,最少给到16G。
Repository DB:
IP:166.100.0.4
DB版本:11g
SID:repodb
监听器端口:1521
————————————————
一、创建资料库(Repository DB)
在主机(166.100.0.4)上面以oracle用户执行dbca,建库:
这里,创建资料库,不需要配置EM支持。
设置口令,改口令需要自己记得。
如果你设置的口令过于简单,可能会有复杂性的提醒,你可以跳过,或者返回修改为一个较为复杂的口令。
这里的口令最好设置的复杂一点,否则会对下文的EM12c的安装构成影响。
复杂口令的标准:
1. 至少包含一个大写字母
2. 至少是包含字母与数字的组合
3. 长度不小于8位
选择数据库数据文件的存放位置。
这里选择文件系统,只是需要确认的是文件系统的剩余空间是足够的。
确认方式:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
[root@oracle11g ~]# ifconfig eth0 Link encap:Ethernet HWaddr 00:50:56:AE:76:B9 inet addr:166.100.0.4 Bcast:166.100.0.255 Mask:255.255.255.0 inet6 addr: fe80::250:56ff:feae:76b9/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:50954 errors:0 dropped:0 overruns:0 frame:0 TX packets:667 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:3359051 (3.2 MiB) TX bytes:65446 (63.9 KiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:97581 errors:0 dropped:0 overruns:0 frame:0 TX packets:97581 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:15153085 (14.4 MiB) TX bytes:15153085 (14.4 MiB) [root@oracle11g ~]# [root@oracle11g ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 43G 10G 31G 25% / /dev/sda1 99M 13M 81M 14% /boot tmpfs 2.0G 0 2.0G 0% /dev/shm /dev/hdc 4.1G 4.1G 0 100% /media/RHEL_5.10 x86_64 DVD [root@oracle11g ~]# |
字符集修改为Unicode。
Redo log文件的大小最好大于300MB。
这样,资料库的基本安装就完成了。
二、配置资料库的网络连通性
启动监听器:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
[root@oracle11g ~]# su - oracle [oracle@oracle11g ~]$ cd $ORACLE_HOME/network/admin [oracle@oracle11g admin]$ ls listener.ora samples shrept.lst sqlnet.ora tnsnames.ora [oracle@oracle11g admin]$ [oracle@oracle11g admin]$ cat 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. LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = oracle11g)(PORT = 1521)) ) ) ADR_BASE_LISTENER = /u01/app/oracle [oracle@oracle11g admin]$ [oracle@oracle11g admin]$ ps -ef | grep lsnr oracle 9261 9229 0 19:51 pts/2 00:00:00 grep lsnr [oracle@oracle11g admin]$ [oracle@oracle11g admin]$ lsnrctl start LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 12-MAR-2016 19:52:00 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/oracle11g/listener/alert/log.xml Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle11g)(PORT=1521))) Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production Start Date 12-MAR-2016 19:52:00 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/11.2.0/dbhome_1/network/admin/listener.ora Listener Log File /u01/app/oracle/diag/tnslsnr/oracle11g/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle11g)(PORT=1521))) The listener supports no services The command completed successfully [oracle@oracle11g admin]$ [oracle@oracle11g admin]$ ps -ef | grep lsnr oracle 9264 1 0 19:52 ? 00:00:00 /u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr LISTENER -inherit oracle 9269 9229 0 19:52 pts/2 00:00:00 grep lsnr [oracle@oracle11g admin]$ |
注册实例(repodb)到监听器:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
[oracle@oracle11g admin]$ ps -ef | grep pmon oracle 9122 1 0 19:47 ? 00:00:00 ora_pmon_repodb oracle 9272 9229 0 19:53 pts/2 00:00:00 grep pmon [oracle@oracle11g admin]$ [oracle@oracle11g admin]$ env | grep SID ORACLE_SID=orcl [oracle@oracle11g admin]$ [oracle@oracle11g admin]$ export ORACLE_SID=repodb [oracle@oracle11g admin]$ env | grep SID ORACLE_SID=repodb [oracle@oracle11g admin]$ [oracle@oracle11g admin]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Sat Mar 12 19:53:30 2016 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> alter system register; System altered. SQL> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options [oracle@oracle11g admin]$ [oracle@oracle11g admin]$ lsnrctl status LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 12-MAR-2016 19:53:42 Copyright (c) 1991, 2013, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production Start Date 12-MAR-2016 19:52:00 Uptime 0 days 0 hr. 1 min. 41 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/oracle11g/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle11g)(PORT=1521))) Services Summary... Service "repodb" has 1 instance(s). Instance "repodb", status READY, has 1 handler(s) for this service... Service "repodbXDB" has 1 instance(s). Instance "repodb", status READY, has 1 handler(s) for this service... The command completed successfully [oracle@oracle11g admin]$ |
三、配置资料库
修改实例(repodb)的参数设定。
首先,备份当前的参数设定:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
[oracle@oracle11g ~]$ ls db.rsp [oracle@oracle11g ~]$ pwd /home/oracle [oracle@oracle11g ~]$ [oracle@oracle11g ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Sat Mar 12 19:56:27 2016 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> show parameter db_name NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_name string repodb SQL> SQL> show parameter pfile NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ spfile string /u01/app/oracle/product/11.2.0 /dbhome_1/dbs/spfilerepodb.ora SQL> SQL> create pfile='/home/oracle/repodb_pfile.ora' from spfile; File created. SQL> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options [oracle@oracle11g ~]$ ll total 32 -rw-r--r-- 1 oracle oinstall 25254 Sep 29 11:12 db.rsp -rw-r--r-- 1 oracle oinstall 821 Mar 12 19:58 repodb_pfile.ora [oracle@oracle11g ~]$ [oracle@oracle11g ~]$ file repodb_pfile.ora repodb_pfile.ora: ASCII text [oracle@oracle11g ~]$ [oracle@oracle11g ~]$ cat repodb_pfile.ora repodb.__db_cache_size=687865856 repodb.__java_pool_size=16777216 repodb.__large_pool_size=33554432 repodb.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment repodb.__pga_aggregate_target=671088640 repodb.__sga_target=989855744 repodb.__shared_io_pool_size=0 repodb.__shared_pool_size=234881024 repodb.__streams_pool_size=0 *.audit_file_dest='/u01/app/oracle/admin/repodb/adump' *.audit_trail='db' *.compatible='11.2.0.4.0' *.control_files='/u01/app/oracle/oradata/repodb/control01.ctl','/u01/app/oracle/oradata/repodb/control02.ctl' *.db_block_size=8192 *.db_domain='' *.db_name='repodb' *.diagnostic_dest='/u01/app/oracle' *.dispatchers='(PROTOCOL=TCP) (SERVICE=repodbXDB)' *.memory_target=1655701504 *.open_cursors=300 *.processes=150 *.remote_login_passwordfile='EXCLUSIVE' *.undo_tablespace='UNDOTBS1' [oracle@oracle11g ~]$ |
正式开始对参数的修改:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
[oracle@oracle11g ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Sat Mar 12 20:00:29 2016 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> SQL> alter system set processes=500 scope=spfile; System altered. SQL> alter system set session_cached_cursors=500 scope=spfile; System altered. SQL> alter system set shared_pool_size=700M scope=spfile; System altered. SQL> alter system set job_queue_processes=20 scope=spfile; System altered. SQL> alter system set open_cursors=350 scope=spfile; System altered. SQL> alter system set sga_target=2G scope=spfile; System altered. SQL> alter system set pga_aggregate_target=1G scope=spfile; System altered. SQL> SQL> alter system set memory_max_target=4000M scope=spfile; System altered. SQL> alter system set memory_target=4000M scope=spfile; System altered. SQL> SQL> |
上面对Memory_target的修改有可能在接下来的实例重启中引发这样的错误:ORA-00845: MEMORY_TARGET not supported on this system。
对于这个问题的解决,可以参考这篇文档中的方法去解决:http://d-prototype.com/archives/2880
添加一个日志文件:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
SQL> set linesize 300 SQL> col member for a50 SQL> SQL> select group#,member,status from v$logfile; GROUP# MEMBER STATUS ---------- -------------------------------------------------- ------- 3 /u01/app/oracle/oradata/repodb/redo03.log 2 /u01/app/oracle/oradata/repodb/redo02.log 1 /u01/app/oracle/oradata/repodb/redo01.log SQL> SQL> alter database add logfile '/u01/app/oracle/oradata/repodb/redo04.log' size 300m; Database altered. SQL> select group#,member,status from v$logfile; GROUP# MEMBER STATUS ---------- -------------------------------------------------- ------- 3 /u01/app/oracle/oradata/repodb/redo03.log 2 /u01/app/oracle/oradata/repodb/redo02.log 1 /u01/app/oracle/oradata/repodb/redo01.log 4 /u01/app/oracle/oradata/repodb/redo04.log SQL> |
编辑资料库的账户设置:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
SQL> alter user sys identified by Oracle123; User altered. SQL> alter user system identified by Oracle123; User altered. SQL> alter user sysman identified by Oracle123; User altered. SQL> alter user dbsnmp identified by Oracle123; User altered. SQL> SQL> select username,account_status from dba_users where username='SYSMAN'; USERNAME ACCOUNT_STATUS ------------------------------ -------------------------------- SYSMAN LOCKED SQL> select username,account_status from dba_users where username='DBSNMP'; USERNAME ACCOUNT_STATUS ------------------------------ -------------------------------- DBSNMP LOCKED SQL> alter user sysman account unlock; User altered. SQL> alter user dbsnmp account unlock; User altered. SQL> select username,account_status from dba_users where username='SYSMAN'; USERNAME ACCOUNT_STATUS ------------------------------ -------------------------------- SYSMAN OPEN SQL> select username,account_status from dba_users where username='DBSNMP'; USERNAME ACCOUNT_STATUS ------------------------------ -------------------------------- DBSNMP OPEN SQL> |
删除EM的配置:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
[oracle@oracle11g ~]$ env | grep SID ORACLE_SID=repodb [oracle@oracle11g ~]$ [oracle@oracle11g ~]$ $ORACLE_HOME/bin/emca -deconfig dbcontrol db -repos drop -SYS_PWD Oracle123 -SYSMAN_PWD Oracle123 STARTED EMCA at Mar 12, 2016 8:27:33 PM EM Configuration Assistant, Version 11.2.0.3.0 Production Copyright (c) 2003, 2011, Oracle. All rights reserved. Enter the following information: Database SID: repodb Listener port number: 1521 ---------------------------------------------------------------------- WARNING : While repository is dropped the database will be put in quiesce mode. ---------------------------------------------------------------------- Do you wish to continue? [yes(Y)/no(N)]: Y Mar 12, 2016 8:27:52 PM oracle.sysman.emcp.EMConfig perform INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/repodb/emca_2016_03_12_20_27_32.log. Mar 12, 2016 8:27:52 PM oracle.sysman.emcp.EMDBPreConfig performDeconfiguration WARNING: EM is not configured for this database. No EM-specific actions can be performed. Some of the possible reasons may be: 1) EM is configured with different hostname then physical host. Set environment variable ORACLE_HOSTNAME=<hostname> and re-run EMCA script 2) ORACLE_HOSTNAME is set. Unset it and re-run EMCA script Mar 12, 2016 8:27:52 PM oracle.sysman.emcp.EMReposConfig invoke INFO: Dropping the EM repository (this may take a while) ... Mar 12, 2016 8:29:09 PM oracle.sysman.emcp.EMReposConfig invoke INFO: Repository successfully dropped Enterprise Manager configuration completed successfully FINISHED EMCA at Mar 12, 2016 8:29:10 PM [oracle@oracle11g ~]$ |
如果没有执行对资料库的EM的配置的清除,那么接下来的EM的安装,你将会遇到下图所示的告警:
最后,重启数据库实例:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL> SQL> startup ORACLE instance started. Total System Global Area 4175568896 bytes Fixed Size 2259840 bytes Variable Size 3019900032 bytes Database Buffers 1140850688 bytes Redo Buffers 12558336 bytes Database mounted. Database opened. SQL> |
到这里,资料库的配置就暂告一段落了。
四、EM Cloud Control 12c:安装
然后,就是在EM Server(166.100.0.140)上安装EM的软件了。
上传安装介质到服务器,并解压:
图形化安装:
密码:Oracle123
等待一段时间。
过了很长一段时间之后,终于安装完了。
五、感受一下。
在安装成功后,就可以通过网址访问EM了:
https://166.100.0.140:7799/em
https://166.100.0.140:7101/console
他们的账户与口令都是之前安装EM的时候,以及配置资料库的时候设定的。
用户名:
1. sysman
2. weblogic
1)EM Console
成功登录后的状态:
2)WebLogical Console
成功登录后的状态:
六、(初步)配置EM。
进入EM后,首先要配置的是“欢迎页”:
当然,就像图中提示的那样,“欢迎页”的配置稍后也是可以更改的:“SYSMAN”菜单 —> 欢迎使用页
这里,我选择“概要”作为我的EM的欢迎页,即图中红色箭头标注的位置。
成功选择后,就进入了概要界面(欢迎页),如果不做出更改,那么以后每次登入EM,第一个看到的画面就是当前设置的:概要。
由于当前的EM并没有管理什么资源,所以,概要界面并不能看出什么内容。
当前EM里面的资源都是上面搭建EM后自动被加进去的本机(EM Server)以及资料库的资源。
在接下来的内容里,将陆续为EM添加监控与管理其他资源。
————————————
Done。