Configure Oracle Enterprise Manager 13c In Silent Mode

教程发布:风哥 教程分类:ITPUX技术网 更新日期:2022-02-12 浏览学习:2783

Configure Oracle Enterprise Manager 13c In Silent Mode

本文从两大部分分别介绍如何静默创建数据库以及如何静默安装配置OEM 13C。
一、OEM数据库创建
1、Oracle官方下载OEM13c,文件列表如下:
12.1.0.2.0_Database_Template_for_EM13_1_0_0_0_Linux_x64.zip
em13100_linux64.bin
em13100_linux64-2.zip
em13100_linux64-3.zip
em13100_linux64-4.zip
em13100_linux64-5.zip

2、解压oem数据库模板:
[oracle@odb ~]$ cd $ORACLE_HOME/assistants/dbca/templates
[oracle@odb templates]$ unzip /oem13/oem13c/12.1.0.2.0_Database_Template_for_EM13_1_0_0_0_Linux_x64.zip
Archive: /oem13/oem13c/12.1.0.2.0_Database_Template_for_EM13_1_0_0_0_Linux_x64.zip
inflating: set_repo_param_12.1.0.2.0_Database_SQL_for_EM13_1_0_0_0_Large_deployment.sql
inflating: set_repo_param_12.1.0.2.0_Database_SQL_for_EM13_1_0_0_0_Medium_deployment.sql
inflating: set_repo_param_12.1.0.2.0_Database_SQL_for_EM13_1_0_0_0_Small_deployment.sql
inflating: shpool_12.1.0.2.0_Database_SQL_for_EM13_1_0_0_0.sql
inflating: 12.1.0.2.0_Database_Template_for_EM13_1_0_0_0_Large_deployment.dbc
inflating: 12.1.0.2.0_Database_Template_for_EM13_1_0_0_0_Medium_deployment.dbc
inflating: 12.1.0.2.0_Database_Template_for_EM13_1_0_0_0_Small_deployment.dbc
inflating: 12.1.0.2.0_Database_Template_for_EM13_1_0_0_0.dfb
inflating: 12.1.0.2.0_Database_Template_for_EM13_1_0_0_0.ctl

3、创建OEM数据库实例:
//dbca静默文件内容
[oracle@odb ~]$ vim db_12c.rsp
[GENERAL]
RESPONSEFILE_VERSION = "12.1.0"
OPERATION_TYPE = "createDatabase"
#-----------------------*** End of GENERAL section ***------------------------
[CREATEDATABASE]
GDBNAME = "emrep"
SID = "emrep"
#############
TEMPLATENAME = "12.1.0.2.0_Database_Template_for_EM13_1_0_0_0_Medium_deployment.dbc"
SYSPASSWORD = "abcABC12"
SYSTEMPASSWORD = "abcABC12"
EMCONFIGURATION = "NONE"
SYSMANPASSWORD = "abcABC12"
DBSNMPPASSWORD = "abcABC12"
STORAGETYPE=FS
DATAFILEDESTINATION = /u02/oradata
RECOVERYAREADESTINATION=/u02/oradata/flash_recovery_area
CHARACTERSET = "ZHS16GBK"
NATIONALCHARACTERSET= "AL16UTF16"
AUTOMATICMEMORYMANAGEMENT = "TRUE"
TOTALMEMORY = "8192"
#-----------------------*** End of CREATEDATABASE section ***------------------------

//创建数据库实例
[oracle@odb ~]$ dbca -silent -responsefile /home/oracle/db_12c.rsp
Copying database files
1% complete
3% complete
10% complete
16% complete
23% complete
30% complete
33% complete
Creating and starting Oracle instance
35% complete
40% complete
44% complete
49% complete
50% complete
53% complete
55% complete
Completing Database Creation
58% complete
62% complete
65% complete
75% complete
85% complete
88% complete
Running Custom Scripts
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/emrep/emrep.log" for further details.

//netca静默文件
[oracle@odb ~]$ vim netca_12c.rsp
[GENERAL]
RESPONSEFILE_VERSION="12.1"
CREATE_TYPE="CUSTOM"
[oracle.net.ca]
INSTALLED_COMPONENTS={"server","net8","javavm"}
INSTALL_TYPE=""typical""
LISTENER_NUMBER=1
LISTENER_NAMES={"LISTENER"}
LISTENER_PROTOCOLS={"TCP;1521"}
LISTENER_START=""LISTENER""
NAMING_METHODS={"TNSNAMES","ONAMES","HOSTNAME"}
NSN_NUMBER=1
NSN_NAMES={"EXTPROC_CONNECTION_DATA"}
NSN_SERVICE={"PLSExtProc"}
NSN_PROTOCOLS={"TCP;HOSTNAME;1521"}

//创建监听
[oracle@odb ~]$ netca -silent -responsefile /home/oracle/netca_12c.rsp
Parsing command line arguments:
Parameter "silent" = true
Parameter "responsefile" = /home/oracle/netca_12c.rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Profile configuration complete.
Oracle Net Listener Startup:
Running Listener Control:
/u01/app/oracle/product/12.0.2/db_1/bin/lsnrctl start LISTENER
Listener Control complete.
Listener started successfully.
Listener configuration complete.
Oracle Net Services configuration successful. The exit code is 0
到此,OEM的数据库实例创建完成。

二、安装配置OEM 13c
1、安装OEM13c软件
//创建OEM静默文件software_only.rsp
[oracle@odb ~]$ vim software_only.rsp
RESPONSEFILE_VERSION=2.2.1.0.0
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=false
MYORACLESUPPORT_USERNAME=abc@125.com
MYORACLESUPPORT_PASSWORD=
INSTALL_UPDATES_SELECTION=skip
STAGE_LOCATION=
MYORACLESUPPORT_USERNAME_FOR_SOFTWAREUPDATES=
MYORACLESUPPORT_PASSWORD_FOR_SOFTWAREUPDATES=
ORACLE_MIDDLEWARE_HOME_LOCATION=/u01/app/oracle/Middleware
AGENT_BASE_DIR=/u01/app/oracle/Agent
ORACLE_HOSTNAME=odb
b_upgrade=false
EM_INSTALL_TYPE=NOSEED
CONFIGURATION_TYPE=LATER

[oracle@odb oem13c]$ ./em13100_linux64.bin -silent -responseFile /home/oracle/software_only.rsp
0%...............................................................100%
Launcher log file is /tmp/OraInstall2016-06-28_11-01-38AM/launcher2016-06-28_11-01-38AM.log.
Starting Oracle Universal Installer

Checking if CPU speed is above 300 MHz. Actual 1400.000 MHz Passed
Checking swap space: must be greater than 512 MB. Actual 32263 MB Passed
Checking if this platform requires a 64-bit JVM. Actual 64 Passed (64-bit not required)
Checking temp space: must be greater than 300 MB. Actual 43236 MB Passed

Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2016-06-28_11-01-38AM
====Prereq Config Location main===
/tmp/OraInstall2016-06-28_11-01-38AM/stage/prereq
EMGCInstaller args -scratchPath
EMGCInstaller args /tmp/OraInstall2016-06-28_11-01-38AM
EMGCInstaller args -sourceType
EMGCInstaller args network
EMGCInstaller args -timestamp
EMGCInstaller args 2016-06-28_11-01-38AM
EMGCInstaller args -paramFile
EMGCInstaller args /tmp/sfx_AMC1wA/Disk1/install/linux64/oraparam.ini
EMGCInstaller args -silent
EMGCInstaller args -responseFile
EMGCInstaller args /home/oracle/new_install.rsp
EMGCInstaller args -nocleanUpOnExit
DiskLoc inside SourceLoc/u02/oem13c
EMFileLoc:/tmp/OraInstall2016-06-28_11-01-38AM/oui/em/
ScratchPathValue :/tmp/OraInstall2016-06-28_11-01-38AM
EMGCInstallUpdatesInfoOnNext:: calling actionOnClickofNext
Now in EMGCInstallUpdatesInfoOnNext.actionsOnClickofNext
EMGCInstallUpdatesInfoOnNext:: End of actionOnClickofNext
Session log file is /tmp/OraInstall2016-06-28_11-01-38AM/install2016-06-28_11-01-38AM.log
Installation in progress

Install successful
Linking in progress

Link successful
Setup in progress

Setup successful
Session log file is /tmp/OraInstall2016-06-28_11-01-38AM/install2016-06-28_11-01-38AM.log
Installation in progress

Install successful
Linking in progress

Link successful
Setup in progress

Setup successful
OMS OracleHome :/u01/app/oracle/Middleware
Applying the required one-off patches.

Warning: The following configuration scripts need to be executed as the "root" user
/u01/app/oraInventory/orainstRoot.sh
/u01/app/oracle/Middleware/oms/allroot.sh
To execute the configuration scripts:
1. Open a new terminal window
2. Login in as "root"
3. Run the scripts

Enterprise Manager Cloud Control Installation has finished.

[root@odb ~]# /u01/app/oraInventory/orainstRoot.sh
[root@odb ~]# /u01/app/oracle/Middleware/allroot.sh

2、配置OEM
//静默文件new_install.rsp
[oracle@odb ~]$ vim new_install.rsp
RESPONSEFILE_VERSION=2.2.1.0.0
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=false
MYORACLESUPPORT_USERNAME=abc@125.com
MYORACLESUPPORT_PASSWORD=
INSTALL_UPDATES_SELECTION=skip
STAGE_LOCATION=
MYORACLESUPPORT_USERNAME_FOR_SOFTWAREUPDATES=
MYORACLESUPPORT_PASSWORD_FOR_SOFTWAREUPDATES=
PROXY_USER=
PROXY_PWD=
PROXY_HOST=
PROXY_PORT=
ORACLE_MIDDLEWARE_HOME_LOCATION=/u01/app/oracle/Middleware
ORACLE_HOSTNAME=jxhisdb
AGENT_BASE_DIR=/u01/app/oracle/Agent
WLS_ADMIN_SERVER_USERNAME=weblogic
WLS_ADMIN_SERVER_PASSWORD=abcABC12
WLS_ADMIN_SERVER_CONFIRM_PASSWORD=abcABC12
NODE_MANAGER_PASSWORD=abcABC12
NODE_MANAGER_CONFIRM_PASSWORD=abcABC12
ORACLE_INSTANCE_HOME_LOCATION=/u01/app/oracle/gc_inst
CONFIGURE_ORACLE_SOFTWARE_LIBRARY=true
SOFTWARE_LIBRARY_LOCATION=/u02/swlib
DATABASE_HOSTNAME=jxhisdb
LISTENER_PORT=1521
SERVICENAME_OR_SID=emrep
SYS_PASSWORD=abcABC12
SYSMAN_PASSWORD=abcABC12
SYSMAN_CONFIRM_PASSWORD=abcABC12
DEPLOYMENT_SIZE=MEDIUM
MANAGEMENT_TABLESPACE_LOCATION=/u02/oradata/emrep/mgmt.dbf
CONFIGURATION_DATA_TABLESPACE_LOCATION=/u02/oradata/emrep/mgmt_ecm_depot.dbf
JVM_DIAGNOSTICS_TABLESPACE_LOCATION=/u02/oradata/emrep/mgmt_ad4j.dbf
AGENT_REGISTRATION_PASSWORD=abcABC12
AGENT_REGISTRATION_CONFIRM_PASSWORD=abcABC12
STATIC_PORTS_FILE=
PLUGIN_SELECTION=
b_upgrade=false
EM_INSTALL_TYPE=NOSEED
CONFIGURATION_TYPE=ADVANCED
CONFIGURE_SHARED_LOCATION_BIP=false
CONFIG_LOCATION=
CLUSTER_LOCATION=

[oracle@odb ~]$ cd /u01/app/oracle/Middleware/sysman/install
[oracle@odb install]$ ./ConfigureGC.sh -silent -responseFile /home/oracle/new_install.rsp
====Prereq Config Location main===
EMGCInstaller args -onlyconfig
EMGCInstaller args -oh
EMGCInstaller args /u01/app/oracle/Middleware
EMGCInstaller args -scratchPath
EMGCInstaller args /u01/app/oracle/Middleware
EMGCInstaller args -sourceLoc
EMGCInstaller args /u01/app/oracle/Middleware
EMGCInstaller args -silent
EMGCInstaller args -responseFile
EMGCInstaller args /home/oracle/new_install.rsp
DiskLoc inside SourceLoc/u01/app/
EMFileLoc:/u01/app/oracle/Middleware/oui/em/
ScratchPathValue :/u01/app/oracle/Middleware
.............................
AgentConfiguration:agent configuration has been started
Validating OMS_HOST and EM_UPLOAD_PORT
Performing free port detection..

AgentConfiguration: Executing emctl deploy agent command...

AgentConfiguration: Executing emctl config agent command...

AgentConfiguration:agent configuration finished with status = true

2016-06-28_03-53-36PM: Configuration Assistant "Agent Configuration Assistant" has Succeeded.

*** The Installation was Successful. ***

This information is also available at:

/u01/app/oracle/Middleware/install/setupinfo.txt

See the following for information pertaining to your Enterprise Manager installation:

Use the following URL to access:

1. Enterprise Manager Cloud Control URL: https://odb:7802/em
2. Admin Server URL: https://odb:7102/console
3. BI Publisher URL: https://odb:9803/xmlpserver

The following details need to be provided while installing an additional OMS:

1. Admin Server Host Name: odb
2. Admin Server Port: 7102

You can find the details on ports used by this deployment at : /u01/app/oracle/Middleware/install/portlist.ini

NOTE:
An encryption key has been generated to encrypt sensitive data in the Management Repository. If this key is lost, all encrypted data in the Repository becomes unusable.
A backup of the OMS configuration is available in /u01/app/oracle/gc_inst/em/EMGC_OMS1/sysman/backup on host odb. See Cloud Control Administrators Guide for details on how to back up and recover an OMS.
NOTE: This backup is valid only for the initial OMS configuration. For example, it will not reflect plug-ins installed later, topology changes like the addition of a load balancer, or changes to other properties made using emctl or emcli. Backups should be created on a regular basis to ensure they capture the current OMS configuration. Use the following command to backup the OMS configuration:
/u01/app/oracle/Middleware/bin/emctl exportconfig oms -dir
到此,oem13c的安装配置已完成。

PS:补充下OEM 13c R2的安装说明
如果使用oracle database 12c作为OEM 13c R2的数据库,则必须使用插入式数据库,可以使用官方提供的模板进行创建。
http://candon123.blog.51cto.com/704299/1794486

手工安装OEM插件

OEM中,有些插件需要手工下载并注册到OEM中。通过下面的命令即可:
[oracle@odb bin]$ ./emcli login -username=sysman
Enter password
Login successful

[oracle@odb bin]$ ./emcli sync
Synchronized successfully

[oracle@odb bin]$ ./emcli import_update -file=/home/oracle/plugin/12.1.0.3.0_oracle.mysql.omys_2000_0.opar -omslocal
Processing update: Plug-in - Enterprise Manager for MySQL Database
Successfully uploaded the update to Enterprise Manager. Use the Self Update Console to manage this update.

注册完成后,可以通过WEB界面查看也可以使用下面的SQL进行查询:
SQL> SELECT epv.plugin_id, epv.version, epv.rev_version
2 FROM em_plugin_version epv, em_current_deployed_plugin ecp
3 WHERE epv.plugin_type NOT IN ('BUILT_IN_TARGET_TYPE', 'INSTALL_HOME')
4 AND ecp.dest_type = '2'
5 AND epv.plugin_version_id = ecp.plugin_version_id;
PLUGIN_ID VERSION REV_VERSION
-------------------- ---------- -----------
oracle.sysman.cfw 13.1.1.0.0 0
oracle.sysman.emas 13.1.1.0.0 0
oracle.sysman.si 13.1.1.0.0 0
oracle.sysman.db 13.1.1.0.0 0
oracle.sysman.xa 13.1.1.0.0 0
oracle.sysman.orhc 13.1.1.0.0 0
oracle.em.satc 13.1.1.0.0 0
oracle.fmw.gg 13.1.1.0.0 0
oracle.mysql.omys 12.1.0.3.0 0
oracle.db.ott 13.1.1.0.0 0

Create Oracle 12c Template Database In Silent

1、静默文件
[oracle@odb07 ~]$ cat create_template_db.rsp
[GENERAL]
RESPONSEFILE_VERSION = "12.1.0"
OPERATION_TYPE = "createTemplateFromDB"
[createTemplateFromDB]
SOURCEDB = "rhndb"
SYSDBAUSERNAME = "system"
SYSDBAPASSWORD = "abcABC12"
TEMPLATENAME = "rhn_db_12c"

2、静默创建
[oracle@odb07 ~]$ dbca -silent -responseFile /home/oracle/create_template_db.rsp
Creating a template from the database
10% complete
20% complete
30% complete
40% complete
50% complete
60% complete
70% complete
80% complete
90% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/silent.log_2016-07-11_04-54-15-PM" for further details.
以上命令执行完成后,会在$ORACLE_HOME/assistants/dbca/templates下生成rhn_db_12c.dbt文件。后续批量创建db可以使用此模板。当然也可以根据实际需求对此模板进行手工编辑。

本文标签:
网站声明:本文由风哥整理发布,转载请保留此段声明,本站所有内容将不对其使用后果做任何承诺,请读者谨慎使用!
【上一篇】
【下一篇】