QUESTION: How to setup Oracle Enterprise Manager for Oracle releases 8.1.5 and on in a windows based machine? ANSWER: Setting up the Oracle Enterprise Manager has changed since the earlier releases where you can just install it from the cd. Oracle has changed their structure to include three tiers and hence we need to configure the enterprise manager. First, we need to understand the enterprise manager's architecture which in turn help us understand how to set it up. Oracle Enterprise Manager implements a three-tier architecture, which consists of the following: First-tier: The first-tier consists of the Client tools like: Enterprise Manager Console (EM), DBA Management Pack (utilities such as SQL PLUS) and other Integrated Oracle Applications. These tools can be launched locally from Windows 2000, Windows NT, Windows 98, Windows 95 or Sun Solaris machines. The tools can also be downloaded as JAVA applets through a Web Browser on Windows 2000, Windows NT, Windows 98 or Windows 95 systems. Middle-tier: The middle-tier or second-tier consists of the Oracle Management Server (OMS) which is installed on Windows 2000, Windows NT or Sun Solaris server. At least one Oracle Management Server must be configured to use the EM Console and Job and Event subsystem. The OMS provides: - Access to information in the EM Repository - Dispatching of the console requests - Control of job execution - Monitoring of the events - Notification of executed jobs and triggered events by email or by pager Multiple OMSs provide: - A distribution of the load without any additional management overhead - A workload to be shared and balanced automatically - A level of fault tolerance where an OMS can assume the workload of another OMS Third-tier: The third-tier consists of the Intelligent Agent, which must be installed on each server for job execution and event monitoring to occur on the server's managed objects. Managed objects include network nodes (server), databases, listeners and other Oracle services installed on those nodes. These three tiers can exist on the same machine, separate machines, or any combination. After understanding the three-tier architecture, we now have to setup the framework. For ease of setup, each tier should each be configured and verified before moving to the next tier. To facilitate this building process, set up the tiers in reverse order so that you would implement the third-tier first and the first-tier last. Configuring the Third-Tier: To manage nodes and other Oracle services on those nodes, an Intelligent Agent must be configured and running on the node. The Intelligent Agent is installed from the Oracle Server CD. For details on installing an Intelligent Agent, consult your Oracle Server Installation Guide or the Intelligent Agent Users Guide. To configure and run the intelligent agent, you need to run through these steps: 1. Start the Intelligent Agent: To start the Intelligent Agent on Windows NT (Windows 2000 is similar except, you need to go to Administrative tools first), perform the following steps: a. Double-click the Services icon in the Control Panel folder. b. Select the OracleAgent service. c. Click the Start push-button to start the agent. To stop the agent on Windows NT, perform the following steps: a. Double-click the Services icon in the Control Panel folder. b. Select the OracleAgent service. c. Click the Stop push-button to stop the agent. To verify the agent is running, perform any combination of the following: a. Check the status of OracleAgent in the control panel services b. Verify the process dbsnmp.exe is running in the NT Task Manager c. Type net start at a command prompt. OracleAgent should appear in the list of services. 2. Set up a Windows NT or Windows 2000 user account for running jobs / events: Because Windows NT or Windows 2000 is a secure Operating System, the Intelligent Agents must execute jobs and events through a Windows NT or 2000 user that has "Log on as a batch job" privilege. The privilege can be assigned to an existing local or domain user, or a new NT, 2000 user. Follow the steps below to setup the Windows NT, 2000 User Account. NOTE: To create or modify accounts on Windows NT or 2000, you must be logged in to NT or 2000 with an account that has "Administrator" privileges. Determine the type of Windows NT or 2000 System that Oracle is installed on. Is it a primary domain controller (PDC), a backup domain controller (BDC), or a standalone Server or Workstation? If the machine is a PDC or BDC, perform the following instructions to create/modify a Domain user. If the NT or 2000 system is a standalone machine, start at the section for "Setting Up a Local User." Set Up a Domain User (These steps are done with an NT machine while a 2000 machine will have subtle differences): 1) Run User Manager for Domains 2) Click Start => Programs =>Administrative Tools => User Manager for Domains The title bar of the window will have "USER MANAGER - " Continue creating the user by skipping to Step (a) below. Set Up a Local User: 1) Run User Manager (for Domains) 2) Click Start => Programs => Administrative Tools => User Manager (For Domains) The title bar of the window will have: USER MANAGER - \\ If the title bar has a domain name listed, click User => Select Domain. Type in "\\" (ie.\\bobpc) NOTE: If an existing Windows NT or 2000 account will be used by the Intelligent Agent, skip to the section "Grant Logon as a Batch Job Privilege" (step (d) below). Create a User: a. Highlight an Administrator's account and click User => Copy to copy the account and all its existing privileges. b. Enter a new username and password for the Enterprise Manager account. (i.e. EMUSER) c. Verify Password Never Expires is the only box checked. Click Add. NOTE: If a Domain account and a Local account exist with the same name on this domain, the passwords must be identical. Passwords are case sensitive. The local account takes precedence. Grant "Logon as Batch Job" privilege locally on each third-tier : d. Highlight the user that was created in Step (a) above. Click Policies =>User Rights. e. Click on the box next to Show advanced user rights. f. Click on the Rights drop down list and choose Logon as a Batch Job. If any account has been granted this permission, the "Grant to" box will contain the name of that account. g. Click Add. Verify the List Names From box contains the correct name: (1) the Domain Name if you're creating a Domain user or (2) the Local Machine Name if you're creating a local user. If the wrong name appears, click the drop down list and choose the correct machine/domain name. h. Click Show Users. Find the user account that was just created and click Add. This should move the account to the bottom of the Add Names box. Verify the name is correct and click OK. This will add the user to the Grant To: box. Then click OK to close this dialog box. Close the User Manager utility. NOTE: If the privilege was added to the user that is currently logged on the system, log off the server so the privileges will take effect. Then log back on. Next we need to configure the second or middle tier. The Oracle Management Server (OMS) provides centralized control between EM Clients and Managed Nodes. The OMS must be installed. 1. Pre-Installation Setup The OMS requires an EM Repository to store all system data, application data and the state of the managed nodes throughout the environment. a. The EM Repository is a schema stored in any Oracle8x Server accessible in the network. It contains a set of tables, views and indexes, stored procedures, etc., which are needed by the OMS. b. Oracle recommends creating the EM Repository is a non-production instance so the instance can be fully managed without affecting the state of the EM Repository. c. In the init.ora file for the database that will hold the EM Repository, set the "processes =" parameter to at least 200. The instance must be stopped and started for the change to take effect. d. The Enterprise Manager Configuration Assistant will create an OEM_REPOSITORY tablespace in the database if one doesn't already exist. However, you can also create this tablespace manually. To manually create the tablespace, run the following script on an Oracle 8.x database. The script will create a tablespace with an initial datafile size of 5 megabytes; the datafile will be automatically extended up to 80 megabytes as needed. CREATE TABLESPACE "OEM_REPOSITORY" DATAFILE '' SIZE 5M AUTOEXTEND ON NEXT 25M MAXSIZE 80M DEFAULT STORAGE (INITIAL 128K NEXT 128K MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 0 ) MINIMUM EXTENT 128K 2. Run the Enterprise Manager Configuration Assistant: The Enterprise Manager Configuration Assistant (EMCA) is automatically launched at the end of the OMS installation and creates/updates the EM repository. NOTE: To launch the EMCA after the installation in two ways: - Click Programs => Oracle => Enterprise Management => Configuration Assistant or - From a command prompt enter : emca The EMCA can perform the following tasks: - Creation of the repository user - Creation of the schema objects for the repository user. - Loading the OMS registry into the EM Repository. - Setting up configuration files that will be used by the OMS. - Dropping the repository from a user's schema. - Changing the repository to which the OMS is connecting. To create a new EM repository: a. After launching the EMCA, choose the Create option. b. Enter a database user that has DBA privileges. This user will in turn create the EM Repository Schema owner. For the service name information, Oracle recommends using a JDBC connect string (::) to connect to the EM Repository database. By using this type of connect string, the local TNSNAMES.ORA file is not used. The same JDBC connect string will be stored in the omsconfig.properties file and will be used when making connections from the OMS to the EM Repository. c. Enter the EM Repository schema name: The repository username is the name of a database user schema where the repository will be stored. This can either be an existing user, or one that the EMCA will create. If you plan to create several repositories in the same intranet, the username of the owner of the repository must be unique. See [NOTE:95480.1] for details. d. If the EMCA creates the user, the default and temporary tablespaces for the repository user must be identified. Otherwise, the repository will be created in the default tablespace for the user given. The default tablespace is OEM_REPOSITORY. e. The EMCA automatically displays a screen showing the details of the different steps to complete the configuration. After the configuration completes successfully, a prompt appears for a new operation to perform. At this point, the configuration is complete. The next step will be to start the OMS. 3. Start the Oracle Management Server: To start the OMS on Windows NT or 2000, perform the following steps: a. Double-click the Services icon in the Control Panel folder. b. Select the OracleManagementServer service. c. Click the Start push-button to start the agent. Last but not least, we need to configure the first tier. 1. Start the EM Console To launch the console, on Windows NT or 2000: Click Programs => Oracle => Enterprise Management => Configuration Assistant or from a command prompt, type: oemapp console The default EM logon is: sysman / oem_temp After entering the default logon, you will be forced to change the initial password - REMEMBER IT! After logging on, additional EM users can be setup. These users are known only to the EM console/OMS. They are not database accounts but simply users stored in a table in the EM Repository. 2. Discover the Managed Nodes In order to manage nodes and databases using jobs and events in the EM Console, the nodes must be "discovered" through the EM Console. In order to discover a node, there must be an Intelligent Agent running on the node. Network TCP/IP resolution must exist between the OMS machine and the node. To verify this network resolution, you must be able to ping the server's hostname and ipaddress from the OMS machine and you must be able to ping the OMS machine's hostname and ipaddress from the server machine. If the two-way ping of hostnames is not complete, consult the local Network Administrator. In the EM Console, go to Navigator => Discover Nodes. Enter the TCP hostname of the machine you wish to discover. When finished, the Navigator pane will contain entries for the services on the server. EM reads this information directly from the services.ora file written by the Intelligent Agent on the server. If this information does not look correct, then the Intelligent Agent discovery process will need to be evaluated. See the Intelligent Agent Users Guide for more details. After the discovery process has been performed on the managed nodes from the EM Console, update the local TNSNAMES.ORA by clicking : System => Update TNS Alias. If a variable TNS_ADMIN is set, tnsnames.ora must be copied there. 3. Set up Preferred Credentials In order to run jobs and events against the discovered services; preferred logon credentials need to be setup in the EM Console. These credentials will be passed to the Intelligent Agent when the job / event is submitted. In the EM Console, go to System => Preferences => Preferred Credentials tab. - For each Database service type, a database user must be entered. - For each Node service type, an Operating System user must be entered. NOTE: For Windows NT or 2000 nodes, a user with Logon as a Batch Job must be used. 4. Test the Configuration To verify that the Third, Second and First Tiers are setup properly, create a simple test job. a) In the EM Console, go to Job => Create Job. b) Under the General tab, give the job a name, and choose a database to run the job against. c) Click on the Tasks tab and choose "Run SQL*Plus Script" from the available tasks. d) Click on the Parameters tab. Enter select * from dual; in the script text box. Click the Submit button at the bottom of the window. In the Jobs pane, Active tab, you will see the job start to run. When it is complete, it will move to the History tab. Look at the History tab to see if the job is "Completed" or Failed". If the job status is "Completed", then the EM job system is properly setup. If the job status is "Failed", then double click on the job in the History tab. An "Edit Job" window will open. In the Edit Job window, highlight the line that says "failed" and click on the "Show Output" button. The job output window should show an error message of some kind. For further details on the error message, consult the Oracle Enterprise Manager Messages Manual. 5. Launching the DBA Tools from outside the EM console 1) On Windows 2000/NT/95/98: The tools can be launched from the Database Administrator Program Group or from command line. Syntax for command line: First change directory to ORACLE_HOME\bin C> oemapp dbastudio C> oemapp security C> oemapp schema C> oemapp instance C> oemapp storage C> oemapp worksheet NOTE: When launching the tools outside the EM Console, the service name must either be a JDBC connect string or an existing alias in TNSNAMES.ORA file. Tsnames.ora file is located in /network/admin and/or in the directory specified by a properly set TNS_ADMIN variable. IBM Rational Customer Service Policies and Information: http://www.rational.com/support/info.jsp