Configuring Oracle Database Control with EMCA installation under the command line interface

Source: Internet
Author: User
Tags sqlplus

As a loyal user of the command line, server-side software operations tend to use commands or scripts to complete, very annoying resources occupy a large GUI. The Oracle database is an important server-side software, and its installation operations naturally fully support a purely command-line approach, although it also provides the GUI installer for Oui. As for the pure command line silent installation oracle11g, I have written a detailed blog post, there is a need to refer to, the blog address http://blog.csdn.net/smstong/article/details/7352036. The database installed according to this post is fully available. This article is a supplement to the previous blog post, is to install the database installed on the basis of the configuration of Oracle Enterprise Manager, so that administrators tired of simple sqlplus, can use the browser to manage the Oracle database.

1 Oracle Enterprise Manager and Oracle Database Control

OEMs are collectively referred to as the graphical enterprise-level management tools provided by Oracle. There are three types of tools available:

(1) Database Control

It is used to manage a database (can be a RAC cluster database), with real-time management and monitoring functions, running scheduling job function, alarm function.

(2) Application Server Control

Used to manage one or more application server instances.

(3) Grid Control

Grid control can manage multiple databases and application servers , manage computer nodes, and support third-party products through third-party plug-ins.


In the oracle9i and before, the OEM is the C/s architecture, starting from 10g, using the B/s architecture, so that administrators do not have to install the client directly through the browser management. This article focuses on the database control tool, which does not need to be installed separately and is installed automatically when Oracle is installed, but it must be carefully configured to be used.

2 Oracle Database Control directory structure and how it worksanalysis of any software needs to start from static and dynamic two aspects, static corresponding to the software after the installation of the physical directory and file layout, dynamic corresponding to the software run-time between the various parts of the interaction process and memory layout. 2.1 directory Structure

The directory structure of the Database control in 10g and 11g is slightly different, this article is based on the description of 11g.


After the ORACLE 11g is installed, there will be a directory specifically serviced for database control $ORACLE The _home directory, as shown in. Where oc4j is the abbreviation for the Oracle container for EE, the Oracle-dedicated Java EE container is similar to Tomcat.

2.2 Working principleIn essence, the database control itself is a Java EE application, but this application is a single function, is to manage the Oracle database. It runs on Oracle's custom Java EE container, uses its managed Oracle database to hold its own data, and uses the agent process to collect system information outside the database.
purely from a procedural point of view, the database control itself is not associated with its managed Oracle database (known as the target database) and can use a separate database (such as a separate Oracle database or MySQL database) to store its own data. You can also run in a Java-compliant container (such as Tomcat) in a separate machine. But Oracle, with its efficiency and configuration in mind, has customized its own containers, and itself uses the target database to hold management data, and runs on the same machine as the target DB instance.
Database control works as shown in.


The management data used by the Database control itself is stored in the Sysman mode.

Knowing how it works, its configuration is easy to understand. As with the deployment of other Java EE programs, there are two aspects of data and program files that need to be carried out. In essence, all of these operations can be done by hand one by one, but whether it's building a large number of profiles or creating a large number of data tables, the purely manual approach is inefficient and error-prone. As a result, Oracle provides specialized tool software for deploying database control.


If using Oui to install Oracle can be configured in the installation phase of the database Control, after the installation can also be configured through DBCA, these are good GUI tools, but the purpose of this article is to be configured on a pure command line, so the above method is not available.


To address the configuration in command-line mode, Oracle provides configuration Assistant EMCA (Enterprise Manager configuration Assistant) specifically for database control.

3 Configuring Database Control with EMCA3.1 Configuration Data

The command used is: Emca-repos create

Its role is to create the necessary user (schema) (Sysman, DBSNMP, etc.) and schema objects (stored procedures, tables, indexes, and so on) in the database control. The EMCA itself is a script file that ultimately calls the Java program to do the actual work. Because you need to invoke some of the functions or procedures provided by the Oracle database as a Sysman user during the creation of the object, you must ensure that the Sysman has the relevant permissions. This is where the configuration usually goes wrong.


It is important to note that EMCA first creates the Sysman account as SYS and then creates the subsequent objects in the Sysman account. Then the two are contiguous, without giving us the opportunity to modify the Sysman permissions. So we have to give Sysman required permissions to the public account before running EMCA, so that when the Sysman account is created, it will automatically have the appropriate permissions.


So what exactly does it take to give sysman those privileges? The answer is a lot. My approach is to run EMCA first, if there is a problem with the permissions EMCA will be coarse, and then based on the error log to find the missing permissions, then assign this permission to public, and then Emca-repos recreate.

Here is an example of a troubleshooting:

[[email protected] ~]$ emca-repos recreate; STARTED EMCA at Jul 4:18:24 pmem Configuration Assistant, Version 11.2.0.0.2 Productioncopyright (c) 2003, 2005,  Oracle. All rights reserved. Enter the following information:database sid:xgdblistener Port Number:1521password for SYS User:password for SYSMAN user :P assword for Sysman User:do do wish to continue? [Yes (Y)/no (N)]: Yjul, 4:18:37 PM oracle.sysman.emcp.EMConfig performinfo:this operation is being logged At/oracl E/cfgtoollogs/emca/xgdb/emca_2014_07_10_16_18_24.log. Jul 4:18:37 PM oracle.sysman.emcp.EMReposConfig invokeinfo:dropping the EM repository (this is a while). . Jul, 4:19:44 PM oracle.sysman.emcp.EMReposConfig invokeinfo:repository successfully droppedjul, 4:19:44 P M oracle.sysman.emcp.EMReposConfig createrepositoryinfo:creating The EM repository (this is a while) ... Jul 4:21:53 PM oracle.sysman.emcp.EMReposConfig invokesevere:error Creating the ReposiToryjul 4:21:53 PM oracle.sysman.emcp.EMReposConfig invokeinfo:refer to the log file At/oracle/cfgtoollogs/emca /xgdb/emca_repos_create_<date>.log for more details. Jul 4:21:53 PM oracle.sysman.emcp.EMConfig performsevere:error Creating the Repositoryrefer to the log file at/ Oracle/cfgtoollogs/emca/xgdb/emca_2014_07_10_16_18_24.log for more details. Could not complete the configuration. Refer to the log file At/oracle/cfgtoollogs/emca/xgdb/emca_2014_07_10_16_18_24.log for more details.

The above is an example of error, as seen in the Red section, the creation of data failed, according to the information provided, view the log file:

313 Jul, 4:19:44 PM oracle.sysman.emcp.EMReposConfig createRepository314 config:spooling to/oracle/cfgtoollogs/ emca/xgdb/emca_repos_create_2014_07_10_16_19_44.log315 Jul, 4:19:44 PM oracle.sysman.emcp.EMReposConfig createRepository316 info:creating the EM repository (this is a while) ... 317 Jul, 4:21:53 PM oracle.sysman.emcp.EMReposConfig createRepository318 config:ora-04063:package Body "sysman.m Gmt_login_assistant "have errors319 ora-06508:pl/sql:could not the Find program unit being called:
It can be seen here that the general error is sysman.mgmt_login_assistant This package is compiled with a problem, in order to get detailed errors, continue to view the prompt log file.

PL/SQL procedure successfully completed.commit complete. Begin*error at line 1:ora-04063:package body "Sysman. Mgmt_login_assistant "had Errorsora-06508:pl/sql:could not the Find program unit being called:" Sysman. Mgmt_login_assistant "

this will make sure it is the problem with this package, so why is this package compiling failed? At this point, the Sysman account has been established, we log in to the Sysman account Sqlplus, and then manually compile the package to see where the error is.

Execute sql> ALTER package mgmt_login_assistant compile body;

At this point, the error will continue to see the cause:

Sql> Show errors;

Displays the function encrypt invalid.

This shows that magmt_login_assistant this package relies on the Encrypt function, and the Encrypt function itself has a problem. So go ahead and see what the Encrypt function really is.

Sql> alter function encrypt compile; Warning:function altered with compilation errors. Sql> Show errors; Errors for FUNCTION encrypt:9/5      pl/sql:statement ignored10/22    pls-00201:identifier ' SYS. utl_i18n ' must be declared

The visible error is that the encrypt function relies on sys.utl_i18n this package, and this package is not declared, in fact, Sysman user does not have execute permission.

Finding the source of the error, the solution is much easier, log in with the SYS account, and then give the public role the ability to execute sys.utl_i18n this package.


Sql>  Grant execute on utl_i18n to public; Grant succeeded.

then re-login with Sysman, and compile the Encrypt function successfully, continue to compile Mgmt_login_assistant also succeeded, this shows that the problem is found. Summarize the dependencies above:

Sysman. Mgmt_login_assistant Bags < Sysman. Encrypt function < SYS. utl_i18n package.


Then exit SQL and re-execute Emca-repos recreate. If it is still an error, please follow the above to find the problem to solve the problem until success.

[[email protected] ~]$ emca-repos recreate; STARTED EMCA at Jul 4:37:11 pmem Configuration Assistant, Version 11.2.0.0.2 Productioncopyright (c) 2003, 2005,  Oracle. All rights reserved. Enter the following information:database sid:xgdblistener Port Number:1521password for SYS User:password for SYSMAN user :D o wish to continue? [Yes (Y)/no (N)]: Yjul, 4:37:24 PM oracle.sysman.emcp.EMConfig performinfo:this operation is being logged At/oracl E/cfgtoollogs/emca/xgdb/emca_2014_07_10_16_37_11.log. Jul 4:37:25 PM oracle.sysman.emcp.EMReposConfig invokeinfo:dropping the EM repository (this is a while). . Jul, 4:38:28 PM oracle.sysman.emcp.EMReposConfig invokeinfo:repository successfully droppedjul, 4:38:29 P M oracle.sysman.emcp.EMReposConfig createrepositoryinfo:creating The EM repository (this is a while) ... Jul 4:42:47 PM oracle.sysman.emcp.EMReposConfig invokeinfo:repository successfully createdenterprise Manager CoNfiguration completed successfullyfinished EMCA at Jul 4:42:47 PM 

3.2 configuration file LayoutUse the Emca-config Dbcontrol DB command to create the necessary configuration files. This operation is generally not error, pay attention to fill in the correct password for each account.
[[email protected] ~]$ emca-config dbcontrol dbstarted emca at Jul 4:47:43 pmem Configuration Assistant, Ve  Rsion 11.2.0.0.2 Productioncopyright (c) 2003, 2005, Oracle. All rights reserved. Enter the following information:database sid:xgdblistener Port Number:1521listener oracle_home [/oracle/11.2.0]:P Asswo  Rd for SYS User:password for Dbsnmp User:password for Sysman User:email address for notifications (optional): Outgoing Mail (SMTP) server for notifications (optional):----------------------------------------------------------------- have specified the following Settingsdatabase oracle_home ...../oracle/11.2.0local hostname, .... 1521Database SID ..... xgdbemail address for notifications .................. Outgoing Mail (SMTP) server for notifications.....------------------------------------------------------- ----------Do you wIsh to continue? [Yes (Y)/no (N)]: Yjul, 4:48:05 PM oracle.sysman.emcp.EMConfig performinfo:this operation is being logged At/oracl E/cfgtoollogs/emca/xgdb/emca_2014_07_10_16_47_43.log. Jul 4:48:08 PM oracle.sysman.emcp.EMReposConfig uploadconfigdatatorepositoryinfo:uploading configuration data To EM repository (this is a while) ... Jul 4:49:06 PM oracle.sysman.emcp.EMReposConfig invokeinfo:uploaded configuration Data Successfullyjul 10, 2014 4:49:08 PM oracle.sysman.emcp.util.DBControlUtil Configuresoftwarelibinfo:software library configured successfully. Jul 4:49:08 PM oracle.sysman.emcp.EMDBPostConfig configuresoftwarelibraryinfo:deploying Provisioning Archives ... Jul 4:49:34 PM oracle.sysman.emcp.EMDBPostConfig configuresoftwarelibraryinfo:provisioning Archives deployed Successfully. Jul 4:49:34 PM oracle.sysman.emcp.util.DBControlUtil securedbconsoleinfo:securing Database Control (This May tak e a while) ... Jul 10, 2014 4:50:11 PM Oracle.sysman.emcp.util.DBControlUtil securedbconsoleinfo:database Control secured successfully. Jul 4:50:11 PM oracle.sysman.emcp.util.DBControlUtil startomsinfo:starting Database Control (This could take a whi Le) ... Jul 4:50:29 PM oracle.sysman.emcp.EMDBPostConfig performconfigurationinfo:database Control started Successfullyjul, 4:50:29 PM oracle.sysman.emcp.EMDBPostConfig performconfigurationinfo: >>>>> >>>>>> the Database Control URL is https://localhost:1158/em <<<<<<<<< <<jul, 4:50:34 PM oracle.sysman.emcp.EMDBPostConfig invokewarning:************************ WARNING * * * * * *   Management Repository have been placed in secure mode wherein Enterprise Manager data would be encrypted.   The encryption key has been placed in the file:/oracle/11.2.0/localhost_xgdb/sysman/config/emkey.ora. Ensure this file is backed up as the encrypted data would become Unusable if this file is lost.***********************************************************enterprise Manager configuration Completed successfullyfinished EMCA at Jul 4:50:34 PM

4 Browser access to database Controlonce configured, the Database control has been automatically started. You can use Emctl status Dbconsole to view the status.
[Email protected] ~]$ emctl status dbconsole;oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0Copyright ( C) 1996, Oracle Corporation.  All rights reserved.https://localhost:1158/em/console/aboutapplicationoracle Enterprise Manager 11g is Running.------------------------------------------------------------------Logs is generated in directory/oracle/ 11.2.0/localhost_xgdb/sysman/log[[email protected] ~]$

You can use Emctl stop dbconsole to stop the database Control.You can start the database Control using Emctl start Dbconsole.
[[email protected] ~]$ emctl stop dbconsoleoracle Enterprise Manager 11g Database Control Release 11.2.0.1.0Copyright (c) 1996, Oracle Corporation.  All rights reserved.https://localhost:1158/em/console/aboutapplicationstopping Oracle Enterprise Manager 11g Database Control ...  Stopped.  [[email protected] ~]$ emctl start dbconsoleoracle Enterprise Manager 11g Database Control Release 11.2.0.1.0Copyright (c) 1996, Oracle Corporation.  All rights reserved.https://localhost:1158/em/console/aboutapplicationstarting Oracle Enterprise Manager 11g Database Control ... started.------------------------------------------------------------------Logs is generated in Directory/oracle/11.2.0/localhost_xgdb/sysman/log

Make sure that database Conrol is started and accessed using the browser: Https://IP:1158/em.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.