Showing posts with label EM. Show all posts
Showing posts with label EM. Show all posts

Saturday, December 5, 2009

Oracle Enterprise Manager Excercises


As we begin our journey through the world of Oracle and explore the Oracle database architecture and functionality, it might first be helpful to start becoming familiar with one of the Oracle tools that you have not yet had a chance to work with in some of your other database courses.
Oracle Enterprise Manager (OEM) is the Oracle database GUI tool that allows the DBA to do many of the administrative and analytical functions in the database without having to write code.  Although we will do much of our work in SQL*Plus for this course, it is always helpful to at least look at those other tools that are part of the Oracle architecture. 



I N D I V I D U A L     E X E R C I S E S

HANDS-ON #1: Using Schema Manager 


Using the Schema Manager, find the AQ$_QUEUES table in the SYSTEM schema.  These tables are part of the Oracle Data Dictionary.   Answer the following questions based on what you can find using the tabs on the right-hand side of the OEM screen.

  1. Who owns this table?
  2. What tablespace is it located in?
  3. How many columns does the table have?
  4. Which column is the Primary Key column?
  5. Are there any other constraints associated with this table?  If yes, what is the name of the constraint.
Place and save your answers in a Word document named week1_exercise.doc.
HANDS-ON #2: The Analyze Wizard tool


Run the Analyze Wizard on the AQ$_QUEUES table in the SYSTEM schema (while the table is highlighted, select Objects => Analyze from the top menu then follow the prompts).  Now, view the results under the Statistics tab and answer these questions:
  1. How many rows are in the table?
  2. What is the average length of a row?
  3. How many empty blocks are there for the table?
Place and save your answers in the Word document named week1_exercise.doc that you have started for this week’s exercises.
HANDS-ON #3: Finding Specific Objects


For the third part of the exercise you will look at some of the database files and settings in your database instance.  First you will look at the SYSTEM datafile.  Navigate to Storage =>Tablespaces => SYSTEM => Datafiles and highlight the datafile you find there.  Then, answer the following questions:
  • How large is the file?
  • What are the storage parameter settings for the file?
  • What is the full path to the file?
Now take a look at the file associated with the Redo Logs and answer the following questions:
  • How many log files do you currently have?
  • What is the full path to each?
  • What is storage unit for these files?
  • How large is each file?

Tuesday, December 1, 2009

You must have CREATE TARGET privilege to perform this operation

Problem Description
In the Enterprise Manager main page (connected with SYS as SYSDBA or as SYSTEM), when I click on performance tab, it gives me following notification.

MemberShip Configuration
The membership configured for the cluster database does not match the instance list of the database. Please update your configuration from the following link:

Database Configuration

And when I click on Database Configuration link, it drops the following error:
Error
You must have CREATE TARGET privilege to perform this operation.

Cause of the Problem
The error may mislead you and you may wonder your login user has not proper privilege and it might need CREATE TARGET privilege. But in fact the problem happens if you configure dbconsole of your RAC cluster database instance for a single database, not for cluster daratabase.

Solution of the Problem
You need to configure your RAC database dbconcole with the -cluster keyword. So rerun the following command in your RAC database instance. One thing you should keep you in mind that your unique database name would be RAC database, it does not indicate any single instance of the RAC database.
$emca -config dbcontrol db -repos recreate -cluster
STARTED EMCA at Dec 1, 2009 10:08:50 AM
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.

Enter the following information:
Database unique name: EAIAPP
Database Control is already configured for the database EAIAPP
You have chosen to configure Database Control for managing the database EAIAPP
This will remove the existing configuration and the default settings and perform a fresh configuration
Do you wish to continue? [yes(Y)/no(N)]:
Listener port number: 1522
Cluster name: EAIAPP
.
.

You have specified the following settings

Database ORACLE_HOME ................ /opt/oracle/product/dbs

Database instance hostname ................ db1-eai.prod.stl.cw.intraisp.com
Listener port number ................ 1522
Cluster name ................ EAIAPP
Database unique name ................ EAIAPP
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
ASM ORACLE_HOME ................ /opt/oracle/product/asm
ASM port ................ 1522
ASM user role ................ SYSDBA
ASM username ................ SYS
Do you wish to continue? [yes(Y)/no(N)]: yes
Dec 1, 2009 10:17:00 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /opt/oracle/product/dbs/cfgtoollogs/emca/EAIAPP/emca_2009-12-01_10-10-40-AM.log.
Dec 1, 2009 10:17:01 AM oracle.sysman.emcp.util.DBControlUtil stopOMS
INFO: Stopping Database Control (this may take a while) ...
Dec 1, 2009 10:17:05 AM oracle.sysman.emcp.EMReposConfig dropRepository
INFO: Dropping the EM repository (this may take a while) ...
Dec 1, 2009 10:18:08 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Dec 1, 2009 10:18:08 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Dec 1, 2009 10:19:36 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Dec 1, 2009 10:19:38 AM oracle.sysman.emcp.EMDBCConfig instantiateOC4JConfigFiles
INFO: Propagating /opt/oracle/product/dbs/oc4j/j2ee/OC4J_DBConsole_db1-eai_EAIAPP1 to remote nodes ...
Dec 1, 2009 10:19:38 AM oracle.sysman.emcp.EMDBCConfig instantiateOC4JConfigFiles
INFO: Propagating /opt/oracle/product/dbs/oc4j/j2ee/OC4J_DBConsole_db2-eai_EAIAPP2 to remote nodes ...
Dec 1, 2009 10:19:38 AM oracle.sysman.emcp.EMDBCConfig copyAndPropagateOC4JDir
INFO: Propagating /opt/oracle/product/dbs/oc4j/j2ee/isqlplus_db1-eai.prod.stl.cw.intraisp.com to remote nodes ...
Dec 1, 2009 10:19:39 AM oracle.sysman.emcp.EMDBCConfig copyAndPropagateOC4JDir
INFO: Propagating /opt/oracle/product/dbs/oc4j/j2ee/isqlplus_db2-eai.prod.stl.cw.intraisp.com to remote nodes ...
Dec 1, 2009 10:19:41 AM oracle.sysman.emcp.EMAgentConfig deployStateDirs
INFO: Propagating /opt/oracle/product/dbs/db1-eai_EAIAPP1 to remote nodes ...
Dec 1, 2009 10:19:42 AM oracle.sysman.emcp.EMAgentConfig deployStateDirs
INFO: Propagating /opt/oracle/product/dbs/db2-eai_EAIAPP2 to remote nodes ...
Dec 1, 2009 10:19:43 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Dec 1, 2009 10:57:56 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Dec 1, 2009 10:57:56 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://db1-eai.prod.stl.cw.intrais.com:1158/em <<<<<<<<<<<
Dec 1, 2009 10:57:57 AM oracle.sysman.emcp.EMDBPostConfig showClusterDBCAgentMessage
INFO:
**************** Current Configuration ****************
INSTANCE NODE DBCONTROL_UPLOAD_HOST
---------- ---------- ---------------------

EAIAPP1 db1-eai db1-eai.prod.stl.cw.intrais.com
EAIAPP2 db2-eai db1-eai.prod.stl.cw.intrais.com


Enterprise Manager configuration completed successfully
FINISHED EMCA at Dec 1, 2009 10:57:57 AM

And you are done.

Related Documents

Wednesday, November 25, 2009

EMCA fails with ORA-06502 PL/SQL: numeric or value error: character string buffer too small


Problem Description
While configuring dbconsole using following command,
emca -config dbcontrol db -repos create


It shows following messages
.
.

Do you wish to continue? [yes(Y)/no(N)]: yes
Do you wish to continue? [yes(Y)/no(N)]: yes
Nov 25, 2009 9:21:10 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /opt/oracle/app/oracle/oracle/product/10.2.0/db_1/cfgtoollogs/emca/EAIAPP/emca_2009-11-25_09-18-57-AM.log.
Nov 25, 2009 9:21:13 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
.
.
Do you wish to continue? [yes(Y)/no(N)]: yes
Do you wish to continue? [yes(Y)/no(N)]: yes
Nov 25, 2009 9:21:10 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /opt/oracle/app/oracle/oracle/product/10.2.0/db_1/cfgtoollogs/emca/EAIAPP/emca_2009-11-25_09-18-57-AM.log.
Nov 25, 2009 9:21:13 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Do you wish to continue? [yes(Y)/no(N)]: yes
Nov 25, 2009 9:21:10 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /opt/oracle/app/oracle/oracle/product/10.2.0/db_1/cfgtoollogs/emca/EAIAPP/emca_2009-11-25_09-18-57-AM.log.
Nov 25, 2009 9:21:13 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Nov 25, 2009 9:26:30 AM oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error creating the repository
Nov 25, 2009 9:26:30 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Refer to the log file at /opt/oracle/app/oracle/oracle/product/10.2.0/db_1/cfgtoollogs/emca/EAIAPP/emca_repos_create_.log for more details.
Nov 25, 2009 9:26:30 AM oracle.sysman.emcp.EMConfig perform
SEVERE: Error creating the repository
Refer to the log file at /opt/oracle/app/oracle/oracle/product/10.2.0/db_1/cfgtoollogs/emca/EAIAPP/emca_2009-11-25_09-18-57-AM.log for more details.
Could not complete the configuration. Refer to the log file at /opt/oracle/app/oracle/oracle/product/10.2.0/db_1/cfgtoollogs/emca/EAIAPP/emca_2009-11-25_09-18-57-AM.log for more details.


And fails with above error message.

From the logfile it shows followings, /opt/oracle/app/oracle/oracle/product/10.2.0/db_1/cfgtoollogs/emca/EAIAPP/emca_2009-11-25_09-18-57-AM.log  it shows followings.


CONFIG: Setting param: RMI_PORT_EAIAPP value: 5520
Nov 25, 2009 9:21:12 AM oracle.sysman.emcp.EMDBPreConfig getFreePorts
CONFIG: Ports assigned for SID: EAIAPP : {DBCONTROL_HTTP_PORT=1158, RMI_PORT=5520, JMS_PORT=5540, AGENT_PORT=3938}
Nov 25, 2009 9:21:12 AM oracle.sysman.emcp.util.GeneralUtil initSQLEngine
CONFIG: SQLEngine connecting with SID: EAIAPP, oracleHome: /opt/oracle/app/oracle/oracle/product/10.2.0/db_1, and user: SYS
Nov 25, 2009 9:21:13 AM oracle.sysman.emcp.util.GeneralUtil initSQLEngine
CONFIG: SQLEngine created successfully and connected
Nov 25, 2009 9:21:13 AM oracle.sysman.emcp.EMReposConfig createRepository
CONFIG: Spooling to /opt/oracle/app/oracle/oracle/product/10.2.0/db_1/cfgtoollogs/emca/EAIAPP/emca_repos_create_2009-11-25_09-21-13-AM.log
Nov 25, 2009 9:21:13 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Nov 25, 2009 9:26:30 AM oracle.sysman.emcp.EMReposConfig createRepository
CONFIG: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 259
CONFIG: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 259

oracle.sysman.assistants.util.sqlEngine.SQLFatalErrorException: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 259

        at oracle.sysman.assistants.util.sqlEngine.SQLEngine.executeImpl(SQLEngine.java:1474)
        at oracle.sysman.assistants.util.sqlEngine.SQLEngine.executeScript(SQLEngine.java:848)
        at oracle.sysman.assistants.util.sqlEngine.SQLPlusEngine.executeScript(SQLPlusEngine.java:267)
        at oracle.sysman.assistants.util.sqlEngine.SQLPlusEngine.executeScript(SQLPlusEngine.java:308)
        at oracle.sysman.emcp.EMReposConfig.createRepository(EMReposConfig.java:422)
        at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:192)
        at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:134)
        at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:171)
        at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:486)
        at oracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1142)
        at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:470)
        at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:419)
Nov 25, 2009 9:26:30 AM oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error creating the repository
Nov 25, 2009 9:26:30 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Refer to the log file at /opt/oracle/app/oracle/oracle/product/10.2.0/db_1/cfgtoollogs/emca/EAIAPP/emca_repos_create_.log for more details.
Nov 25, 2009 9:26:30 AM oracle.sysman.emcp.EMConfig perform
SEVERE: Error creating the repository
Refer to the log file at /opt/oracle/app/oracle/oracle/product/10.2.0/db_1/cfgtoollogs/emca/EAIAPP/emca_2009-11-25_09-18-57-AM.log for more details.
Nov 25, 2009 9:26:30 AM oracle.sysman.emcp.EMConfig perform
CONFIG: Stack Trace:
oracle.sysman.emcp.exception.EMConfigException: Error creating the repository
        at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:204)
        at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:134)
        at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:171)
        at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:486)
        at oracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1142)
        at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:470)
        at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:419)





Cause of the Problem
There is a bug during the create of the EM Repository. Somehow terrible oracle bug :).
When hostname exceeds 32 characters emca will fail with 
ORA-06502
 PL/SQL: numeric or value error: character string buffer too small

Now let's verify it. From OS, you can simply do this by issuing hostname.

EAIAPP:/home/oracle>hostname
db1-eai.test1.hrn.eai.clearditlab.com


Unfortunately our database name is more than 32 characters and hence bug fired. You can also check the database hostname and length using following query,

sqlplus / as sysdba
SQL> set line 200
SQL> select host_name,length(host_name),instance_name from v$instance where rownum=1;



By both ways we see that our hostname is more than 32 characters and our bug fired.


Solution of the Problem
In order to avoid the bug you either need to change the hostname of the operating system. In order to change hostname on linux environment you have to look at http://arjudba.blogspot.com/2008/08/how-to-change-hostname-in-linux.html

If you don't want to change hostname you can bypass this bug by  apply the following steps:



1) Drop the repository with emca
emca -deconfig dbcontrol db -repos drop

2) cd to $ORACLE_HOME/sysman/admin/emdrep/sql/core/latest/self_monitor/



cd $ORACLE_HOME/sysman/admin/emdrep/sql/core/latest/self_monitor/

3) Make a copy of self_monitor_post_creation.sql
cp self_monitor_post_creation.sql self_monitor_post_creation.sql.bak

4) Edit the script and change the l_host_name from varchar2(32) to higher varchar2 for example varchar2(128).

 l_host_name varchar2(128)
Note: The l_host_name variable is declared 2 times in the script.

5) Create repository with emca
emca -config dbcontrol db -repos create


And now you are done.


Related Documents
http://arjudba.blogspot.com/2008/04/troubleshooting-dbconsole-error-oc4j.html
http://arjudba.blogspot.com/2008/04/how-to-drop-create-and-recreate-db.html
http://arjudba.blogspot.com/2008/04/stack-of-problems-while-creating.html

Thursday, September 18, 2008

EM Daemon is not running

On windows whenever I try to start my dbconsole in one time during process it shows me message EM Daemon is not running.

First I invoke status command to see whether my dbconcole is started or not by,
C:\Documents and Settings\Queen>emctl status dbconsole
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
http://Queen:1158/em/console/aboutApplication
Oracle Enterprise Manager 10g is not running.
------------------------------------------------------------------
Logs are generated in directory E:\oracle\product\10.2.0\db_1/QUEEN_arju/sysman/log

So it is not running. To start it on windows you can fix it by,
Right click on my computer icon> Click Manage> Select Services and Application>Select Services>On the right side From a list a Name select OracleDBConsolearju where arju is the name of database> Right click on OracleDBConsolearju and click start.

or in other OS along with windows you can start with
$emctl start dbconsole
Now again see the status.
C:\Documents and Settings\Queen>emctl status dbconsole
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
http://Queen:1158/em/console/aboutApplication
EM Daemon is not running.
------------------------------------------------------------------
Logs are generated in directory E:\oracle\product\10.2.0\db_1/QUEEN_arju/sysman/log

The status has been changed now and it says EM Daemon is not running. In order to fix it you have to start the listener. To start listener you may follow,

Right click on my computer icon> Click Manage> Select Services and Application> Select Services> On the right side From a list a Name select OracleOraDb10g_home1TNSListener> Right click on OracleOraDb10g_home1TNSListener and click start.

Or in other OS along with windows you can start with,
$lsnrctl start [Listener_name]
Now let us see the status.
C:\Documents and Settings\Queen>emctl status dbconsole
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
http://Queen:1158/em/console/aboutApplication
Oracle Enterprise Manager 10g is running.
------------------------------------------------------------------
Logs are generated in directory E:\oracle\product\10.2.0\db_1/QUEEN_arju/sysman/log

Related Documents

Export and Import from Enterprise Manager
Login to Dbconsole, Authentication failed!null Returned

Monday, September 8, 2008

How to get port number list of EM and isqlplus

You can get your portlist information of enterprise manger or isqlplus or others web services in the location of $ORACLE_HOME/install/portlist.ini.

On my system the output is,
bash-3.00$ cat /oracle/app/oracle/product/10.2.0/db_1/install/portlist.ini
iSQL*Plus HTTP port number =5560
Enterprise Manager Console HTTP Port (DBASE) = 1158
Enterprise Manager Agent Port (DBASE) = 3938
Enterprise Manager Console HTTP Port (arjudba) = 5500
Enterprise Manager Agent Port (arjudba) = 1830
Enterprise Manager Console HTTP Port (arju) = 5501
Enterprise Manager Agent Port (arju) = 1831

But note that the ports that are listed in portlist.ini file were assigned during the installation. This file is not updated if port numbers are changed after the installation.

Related Documents
How to Notify or send email Event in Oracle from EM
In EM connection fails with ERROR: NMO not setuid-root (Unix-only)

Wednesday, September 3, 2008

In EM connection fails with ERROR: NMO not setuid-root (Unix-only)

Error Description
This problem is notified on Unix system only.
Whenever you try to connect to enterprise manager after giving host username and password as prompted it fails with message
HostPassword - Connection to host as user oracle failed: ERROR: NMO not setuid-root (Unix-only)

Cause of The Problem
There is some permission issue on the enterprise manager binary file. The reason is after installing oracle software you have not run root.sh

Solution of The Problem
1.Stop the dbconsole service
$emctl stop dbconsole
If you face this on grid control then stop the Grid Management Agent
$emctl stop agent

2.Log on as root user and run the root.sh file
bash-3.00$ su
Password:
# cd /oracle/app/oracle/product/10.2.0/db_1/
# ./root.sh

Running Oracle10 root.sh script...

The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /oracle/app/oracle/product/10.2.0/db_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: y
Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: y
Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: y
Copying coraenv to /usr/local/bin ...

Entries will be added to the /var/opt/oracle/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.

If you are on Grid Control then also run /root.sh from $ORACLE_HOME.

3.Connect to oracle user and start the dbconsole or grid management agent(if you are in grid control).
$emctl start dbconsole (dbcontrol)
$emctl start agent (grid control)

Wednesday, August 13, 2008

Authentication failed!null

Problem Description After upgrading the database containing dbconsole's repository whenever you try to logon to Enterprise Manager or DBCONSOLE it succeed but return with error,

Authentication failed!null

In the trace file I saw the following entry,
ERROR = ORA-04063: package body "SYSMAN.MGMT_USER" has errors
ORA-06508: PL/SQL: could not find program unit being called: "SYSMAN.MGMT_USER"
ORA-06512: at "SYSMAN.SETEMUSERCONTEXT", line 5
ORA-06512: at line 1

Cause of The Problem
This error occured due to following reasons,

The package MGMT_USER is invalid in the database.

Other Invalid objects under SYSMAN schema remain after the upgrade of the database.

Missing privileges for SYSMAN user which prevents the compilation of MGMT_USER
package, and other packages aswell.

Solution of The Problem
Grant the required privilege to the SYSMAN user,
GRANT EXECUTE ON SYS.DBMS_AQ TO SYSMAN;
GRANT EXECUTE ON SYS.DBMS_JOB TO SYSMAN;
GRANT EXECUTE ON SYS.DBMS_LOB TO SYSMAN;
GRANT EXECUTE ON SYS.DBMS_LOCK TO SYSMAN;
GRANT EXECUTE ON SYS.DBMS_REDEFINITION TO SYSMAN;
GRANT EXECUTE ON SYS.DBMS_RLS TO SYSMAN;
GRANT EXECUTE ON SYS.DBMS_SHARED_POOL TO SYSMAN;
GRANT SELECT ON SYS.USER_TAB_COLUMNS TO SYSMAN;

And try to reconnect to dbconsole.

Related Documents
Login to Dbconsole, Authentication failed!null Returned

Sunday, April 27, 2008

How to Change DB Control Http Port.

1)Stop the dbconsole.

bash-3.00$ emctl stop dbconsole
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
http://neptune:5500/em/console/aboutApplication
Stopping Oracle Enterprise Manager 10g Database Control ...
... Stopped.

2)Take a backup of files:

$ORACLE_HOME/host_sid/sysman/config/emoms.properties
$ORACLE_HOME/host_sid/sysman/config/emd.properties
$ORACLE_HOME/oc4j/j2ee/OC4J_DBConsole_host_sid/config/http-web-site.xml


3)Edit these three files. Suppose My hostname is neptune and sid is data1 and I like to change it to port 510. To do this following is the procedures. You can either edit files directly or you can use command line utility to change the port.

Editing directly inside files
In /oracle/app/oracle/product/10.2.0/db_1/neptune_data1/sysman/config/emoms.properties

oracle.sysman.emSDK.svlt.ConsoleServerPort=5510
oracle.sysman.emSDK.svlt.ConsoleServerHTTPSPort=5510


In /oracle/app/oracle/product/10.2.0/db_1/neptune_data1/sysman/config/emd.properties

REPOSITORY_URL=http://host.domain:5510/em/upload/
emdWalletSrcUrl=http://host.domain:5510/em/wallets/emd

In /oracle/app/oracle/product/10.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_neptune_data1/config/http-web-site.xml

<web-site port="5510" ...>

Command line Options to change DB Control Http Port
To change the Oracle Enterprise Management Agent HTTP port,
$ emca -reconfig ports -AGENT_PORT 1851

To change the Oracle Enterprise Manager Database Control ports,
$ emca -reconfig ports -DBCONTROL_HTTP_PORT 5510

To change the Oracle Enterprise Manager RMI_PORT port,
$ emca -reconfig ports -RMI_PORT 5520

To change the Oracle Enterprise Manager JMS_PORT port,
$ emca -reconfig ports -JMS_PORT 5521

You can change all these by single command like,
$ emca -reconfig ports -DBCONTROL_HTTP_PORT 5510 -AGENT_PORT 1851 -RMI_PORT 5520

Related Document
EMCA fails with ORA-06502 PL/SQL: numeric or value error: character string buffer too small
EM Daemon is not running
Authentication failed!null
How to Change DB Control Http Port
Login to Dbconsole, Authentication failed!null Returned
An Stack of Problems while creating Repository using emca
Running EMCA Fails To Accept the DBSNMP Password
How to Access Database using Database Control
How To Drop, Create And Recreate DB Control In 10g Database
Troubleshooting DbConsole Error - OC4J Configuration issue
Java.lang.Exception: IOException in sending Request

Monday, April 21, 2008

Stop Alert Notification for a specified period of time

In database you probably has notification settings-whenever you have problem in database you will be notified by e-mail.

However, when you plan to bring your database down for maintenance, you can indicate that you do not want alert notifications to be sent to you by defining a blackout period.

Blackouts also allow you to suspend monitoring in order to perform other maintenance operations.

You can easily do it from Enterprise Manager.

The Steps for stopping Notifications for a period of time:
---------------------------------------

1)Log on to the Enterprise Manager with SYSTEM user.
2)In database homepage at the top right corner click the "setup".
3)Click "Blackouts" at the left pane.
4)Click "create" at the right side of the page.
5)The Create Blackout wizard appears. Fill up the required fields.
6)Fill up the five steps like, when you want to set time period for blackout or will it make it repeatedly.
7)You receive a confirmation message that your blackout has been defined whenever you finish.

Login to Dbconsole, Authentication failed!null Returned

Today I faced this error whenever I stop the listener service of my oracle (Version 10.2.0.1) and I attempt to connect to oracle Enterprise manager it returned with the error.

Login to Dbconsole, Authentication failed!null Returned


But I could not reproduce this error. Later on, whenever I tried to reproduce the error , every time I stop listener and try to connect to database using Enterprise Manager it returned with the error,

Error
Io exception: The Network Adapter could not establish the connection


Solution of these Two Problem:
----------------------------------

Your listener service is down but your enterprise manager is running. So start the listener.

From my UNIX machine,

SQL>!lsnrctl start
SQL>alter system register;


And I log on through Enterprise Manager and it is running fine.

See Also http://arjudba.blogspot.com/2008/08/authentication-failednull.html

Tuesday, April 15, 2008

Options for Shuting Down a Database

1)Shutdown a Database Using SQL*Plus
-----------------------------------------------

$sqlplus /nolog
SQL>conn / as sysdba
SQL>stutdown immediate

2)Shutdown a Database Using Recovery Manager
---------------------------------------------------
1)oracle@neptune:~$ rman target /


Recovery Manager: Release 10.2.0.1.0 - Production on Tue Apr 15 18:08:04 2008

Copyright (c) 1982, 2005, Oracle. All rights reserved.

connected to target database (not started)

2)RMAN> shutdown immediate

3)Shutdown Database Using Oracle Enterprise Manager
---------------------------------------------------------------

logon to Enterprise Manager.
Under Home there is general tab. select shutdown
Enter host and database credentials.
The default is shutdown immediate. From advance options you can choose another one.
Press yes.

Monday, April 14, 2008

An Stack of Problems while creating Repository using emca

In my database I tried to create repository and stopped several times while creating repository. I spend a significant amount of time to create repository and after analysis I got the following.

A)Manually Resolve
1)If you fail after invoking command
emca -config dbcontrol db -repos create see alert log file for more details. Also refer to another log file if it shows. Directly go to step 3)

2)However I see many errors like,
CONFIG: ORA-00955: name is already used by an existing object
CONFIG: ORA-01921: role name 'MGMT_USER' conflicts with another user or role name
and many severals errors.

3)Execute the following commands in SQL*plus and then execute emca command. I wish no more error will come. After several experiment I get this.



drop user sysman cascade;
drop public synonym SETEMVIEWUSERCONTEXT;
drop role MGMT_USER;
drop PUBLIC SYNONYM MGMT_TARGET_BLACKOUTS;
drop user MGMT_VIEW;

And then,

$ emca -deconfig dbcontrol db
$ emca -config dbcontrol db -repos create


B)Using RepManager:
If I drop the Repository using RepManager like following error will not come while creating repository.
$ORACLE_HOME/sysman/admin/emdrep/bin/RepManager -action drop

This will not remove the configuration files, but only the repository related objects from the database.

But you need to remember when RepManager is ran the database will be put in Quiescing mode.

Running EMCA Fails To Accept the DBSNMP Password

Today when I tried to create DB Control on my computer I got an interesting problem.

Problem Description:

oracle@neptune:/$ emca -config dbcontrol db -repos recreate

STARTED EMCA at Apr 15, 2008 11:05:06 AM
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.

Enter the following information:
Database SID: ARJU
Listener port number: 1521
Password for SYS user:
Password for DBSNMP user: ------Here I have given a
Invalid username/password.
Password for DBSNMP user:
Invalid username/password.



It continues to invoke password until I press ctrl+C.
Though I was giving correct password it does not accept DBSNMP password. I got tried, I search through google but did not get any clue. Even to be more sure I have changed DBNMP password though database and then tried but no result , the problem continues.

Then what I did is I have given password inside "" Double quotes and that worked. :)

oracle@neptune:/$ emca -config dbcontrol db -repos recreate

STARTED EMCA at Apr 15, 2008 11:10:29 AM
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.

Enter the following information:
Database SID: arju
Listener port number: 1521
Password for SYS user:
Password for DBSNMP user: ----Here I have given "A" or "a" Both worked.
Password for SYSMAN user:
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
-----------------------------------------------------------------

You have specified the following settings
.
.
.

How to Access Database using Database Control

We all know we can access database using SQL*plus or any other third party software like tora toad etc. Using Oracle Enterprise Manager we can also do the same task.

Oracle provides a web-based version of the SQL*Plus tool called iSQL*Plus.iSQL*Plus has a server-side listener process that must be started in order for clients to connect to a database through the browser interface.

In order to access database using iSQL*Plus we need to go through following steps.

1)Invoke lsnrctl status and ensure that listener service is running.

2)Invoke emctl status and ensure that Ddatabase Control agent is running. If not running then invoke emctl start dbconsole.

3)See the url after invoking emctl status.

4)Start the server-side listener process of iSQL*Plus.

isqlplusctl start

5)Enter the Enterprise Manager and use iSQL*Plus.

In general you can invoke the url found after invoking emctl status dbconsole

Or, http://machine_name.domain_name:port/isqlplus


The default port number is 5560.

6)Now eneter user name and password, a box will come where you can invoke regular SQL commands.

Thursday, April 10, 2008

How To Drop, Create And Recreate DB Control In 10g Database

This topic is divided into three sections.

A.Delete DB Control Objects
B.Create DB Control Objects
C.Recreate/ReConfig DB Control

A.Delete DB Control Objects:
There are various ways to delete DB Control Objects.
1).Delete DB Control Configuration Files using EMCA scripts
2).Delete DB Control Configuration Files Manually:
3).Delete DB Control Repository Objects using RepManager
4).Delete DB Control Repository Objects Manually
5).Delete DB Control Configuration Files and Repository Objects using EMCA


1).Delete DB Control Configuration Files using EMCA scripts

In 10.1g run, $emca -x sid
In 10.2g run, $emca -deconfig dbcontrol db Then enter sid as prompt and then y.


2).Delete DB Control Configuration Files Manually:

Remove the following directories from your filesystem:
$ORACLE_HOME/hostname_sid
$ORACLE_HOME/oc4j/j2ee/OC4J_DBConsole_hostname_sid

On Windows you also need to delete the DB Console service:
- run regedit
- navigate to HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services
- locate the OracleDBConsolesid entry and delete it

On, Windows XP and Windows Server 2003 you can run the following from the command line:
'sc delete service_name'

- where service_name is the DB Control service name (typically: OracleDBConsolesid)

3).Delete DB Control Repository using RepManager:

Invoke following command, RepManager hostname listener_port sid -action drop
But don't delete by RepManager. It puts the database in quiescence mode.

4).Delete DB Control Repository Objects Manually
In another post I will show it.

5).Delete DB Control Configuration Files and Repository Objects using EMCA

For 10.1,
>emca -x sid
>RepManager hostname listener_port sid -action drop


For 10.2,
>emca -deconfig dbcontrol db -repos drop


B.Create DB Control Objects
1)Create only DB Control configuration files:

on 10.1g ,>emca -r
On 10.2g, >emca -config dbcontrol db

2)Create both the DB Control Repository Objects and Configuration Files:

On 10.1g, >emca
On 10.2g, >emca -config dbcontrol db -repos create


C.Recreate/ReConfig DB Control:
1)Recreate only DB Control configuration files:
$ emca -config dbcontrol db

2)Recreate both the DB Control Repository Objects and Configuration Files:

$ emca -config dbcontrol db -repos recreate

Related Documents:

Troubleshooting Problems while Creating Repository using emca

Troubleshooting DbConsole Error - OC4J Configuration issue

Error Description:
emctl start dbconsole
fails with the exception:
EM Configuration issue. /u01/app/oracle/product/10.2.0_64/db_1/_

Solution of The Problem:
First we need to determine whether the server use dynamic IP or static IP. There are two different solutions for these two.

1)If Server is configured with dynamic IP Address:

a)In the Loopback adapter configure and assign a dummy static address.
b)Then in the "hosts" file, add an entry associated with this dummy static IP address and map that to the machine name associated with the system through the system properties.
c)Configure the loopback adapter to be the primary network adapter on the system.
d)Now, any call to get the IP address of the system will return the dummy static IP associated with the loopback adapter. In call to get the hostname associated with this dummy IP address will return the real machine name, since this was associated with the IP address in the hosts file.
e)Also, any call to get the hostname will also return the machine name since the loopback adapter is the primary network adapter.

Suppose in Windows,

a). In the SYSTEM DRIVE:\WINDOWS\system32\drivers\etc\hosts file the following entry should be present for the node :

127.0.0.1 localhost hostname.domainname hostname

b). Set this environment variable to the hostname of the machine, from a command prompt:

For 10.1,
cmd> set EMHOSTNAME=

For 10.2,
cmd> set ORACLE_HOSTNAME=

c). Start the dbconsole now from the same window
cmd> set ORACLE_HOME=ORACLE_HOME of the 10G database
cmd> set ORACLE_SID=SID of the 10G database
cmd> cd %ORACLE_HOME%\bin
cmd> emctl start dbconsole


d).If the existing files/directories in the %ORACLE_HOME%\oc4j\j2ee\OC4J_DBConsole_hostname_SID and %ORACLE_HOME%\hostname_SID have the IP address instead of the hostname then recreate DBControl.

2)If Server uses static IP address

a)Check the hosts file entry:
On Windows, the HOSTS file is under $WINDOWS\system32\drivers\etc
On Unix systems hosts file is under /etc

The file should have the IP address followed by the fully qualified hostname.domain name, and then a short hostname or alias.
For Example,

192.168.1.2 hostname.domainname hostname

b)Check hostname and IP Address:

On unix, $ hostname $ifconfig -a
On Windows >ipconfig /all

>ping 192.168.1.2
>ping hostname.domainname
>ping hostname
>nslookup 192.168.1.2
>nslookup hostname.domainname
>nslookup hostname


c). Check if directories

/_
/oc4j/j2ee/OC4J_DBConsole_


exist and have correct permissions for the same user who has installed the software.

If they does not exist then recreate dbcontrol.
You can do it by,
$emca -deconfig dbcontrol db -repos drop
$emca -config dbcontrol db -repos create

I have shown how to drop , create and recreate dbcontrol in topic,

How To Drop, Create And Recreate DB Control In 10g Database


d)Ensure ORACLE_HOME and ORACLE_SID is set properly.

Related Documentation:
How to create and recreate DBcontrol

Tuesday, April 1, 2008

Connect to EM though normal user

Use the Database Login page to log in to the current database. You can use the Database Login page to enter the Username and Password fields and to select the type of user and its associated privileges to use to log in (Normal, SYSOPER, SYSDBA).

Select Set as Preferred Credential to save the database login information to the Management Repository. For more information, see About Preferred Credentials.

If Normal role preferred credentials are set for a database and a page requiring a login is selected, you will be automatically logged in using the preferred credentials and sent directly to the selected page, bypassing the login page. If the connection attempt using the preferred credentials fails, the login page will appear.

If you choose to log out of the database, you can optionally choose to reconnect as a different user. If you choose this option, the login page will appear after you logout. After logging back in (presumably as a different user), you will return to the page from which you chose to logout. Insufficient Privilege Alert

To use any DBA management functionality as a non-DBA user, you must have the appropriate privileges. A DBA user will already have the appropriate privileges to manage the database.

You can change the privileges for a non-DBA user in Enterprise Manager by choosing Setup on the Database Home page and adding the privileges for a user using the Administrators page. For more information about changing the privileges for a user, see the online help on the Administrators page.

For version 7.x databases: The SELECT_CATALOG_ROLE must be created to allow non-DBA users to perform DBA functions. By running script sc_role.sql this role can be created. This script will have to be run as SYS.

For version 8.x databases: You must have been granted the SELECT_CATALOG_ROLE. To create, edit, or drop objects outside of your schema, you must have been granted the DBA role or the appropriate privileges for the object. Note: The SELECT_CATALOG_ROLE is only available for Oracle8.x databases.

For version 9.x, 10.x and later databases:
You must be granted the Select Any Dictionary privilege. Ask the System Administrator or Super Administrator to grant you this role.

Simply on 9.x later database issue the following,

SQL>GRANT SELECT ANY DICTIONARY TO user_name_that_will_use_em;

For any newly created user if you want to give him minimum privilege to connect through EM and see some reports using that user then your command will be simply,

SQL> grant create session, select any dictionary to arju_em identified by a;
Grant succeeded.

With this command a new user ARJU_EM will be created and he will able to connect to EM and will see various reports through EM.

Related Documents
How to get port number list of EM and isqlplus
How to Notify or send email Event in Oracle from EM

Java.lang.Exception: IOException in sending Request

The reason of this problem:
this problem will appear if you just change the Time Zone of your system.

Solution of the problem
To solve this problem you need to run "emctl resetTZ agent" like this:

1- Open the command prompt and type
set oracle_sid=(your DB name)
On unix bash shell
$export ORACLE_SID=DB_NAME
2- Then Type this command
$emctl resetTZ agent

3- You will see this message that will tell you what to do :

Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright © 1996, 2005 Oracle Corporation. All rights reserved.
Updating D:\oracle\product\10.2.0\db_1/osama-pc_orcl/sysman/config/emd.properties...
Time zone set to Africa/Cairo.
To complete this process, you must either:
connect to the database served by this DBConsole as user 'sysman', and execute:
SQL>conn sysman/password
SQL> exec mgmt_target.set_agent_tzrgn('hostname','Africa/Cairo')
-- or --
connect to the database served by this DBConsole as user 'sys', and execute:
SQL> alter session set current_schema = SYSMAN;
SQL> exec mgmt_target.set_agent_tzrgn('hostname','Africa/Cairo');

Note that you have to use your machine hostname instead of hostname here.
Instead of Africa/Cairo enter your time zone.
4- You must restart the DBCONSOLE Service Or reboot your machine and you will find that the problem has gone.

$emctl stop dbconsole
$emctl start dbconsole

How to Notify or send email Event in Oracle from EM

In this post I will show about how e-mail can be send from oracle if any critical events happen.
With Enterprise Manager the task is very simple. With this you can easily send email if any oracle related problem happens. Like Tablespace full, Any oracle error, listener issue, performance problem etc.

Step 1:

At first step you need to setup sender mail address, your SMTP server address and sender identifier.

i)On the Enterprise Manager Home page click setup link which is on the upper most right corner.
ii)..../em/console/admin/rep/userAdmin window appears. On the Setup tab click on the Notification Methods.
iii)The several boxes appears.
Outgoing Mail (SMTP) Server: Here post your SMTP server address. On my system I gave 192.168.1.1.

Identify Sender As: This is the identity of sender. I gave in this box Arju.

Sender's E-mail Address: This is thrid box. Define from whom the mail will be sent. I gave here prothoma@....com

iv)On the right side click on Test Mail Servers button A new window will come. If it display message similar like
Test Results
192.168.1.1: Test succeeded - You will also need to verify that a test e-mail has been received by prothoma@ya....com
Then this step is correct.

Step2:
In this step you will assign the mail address of the users to whom notification will be sent. To do this,
i)On the Enterprise Manager page click on preferences link which is on the upper most right corner.

ii)Under general tab type SYS password and confirmed password. Then under E-mail Addresses menu click add another row button and specify the email address to whom notification will be send.

ii)Then click on Test. A new window will appear displaying messge
.....@....com: Test succeeded - You will also need to verify that a test e-mail has been received
Now check the mail address to see whether actually mail is sent or not.

If you got mail to .....@....com address from prothoma@ya....com then you have successfully configured notification.

Step3:
i)On the Enterprise Manager page click on preferences link which is on the upper most right corner.
ii)You then specify rules and schedules in of the notifications.
iii)Click on rules and then select Listener Availability or Host Availability and Critical States or Database Availability and Critical States and then click assign methods button and check the box send me e-mail and click ok.

iv)Notification Schedule
Next, you will need to define your notification schedule. EM will NOT send you email notifications
if you do not have a schedule defined.
A notification schedule is used to represent your on-call schedule. It tells EM two things:
(a) the day and time you should be contacted and
(b) the email addresses to be used during those times.
Any time slot that is left empty in the schedule means that EM should NOT send you email
notifications, even though alert may occur during that time.
It is important to note that the schedule you specify will automatically repeat.

In a nutshell I can say "Setting up email notifications for alerts" needs following steps.

Step I. Setup the mail servers
Step II. Setup EM user accounts for your administrators
Step III. Each EM user should define their own notification settings
a) E-mail addresses -From Preferences
b) Notification Schedule
Step IV. Define and subscribe to Notification Rules

Related Documents

How to get port number list of EM and isqlplus
In EM connection fails with ERROR: NMO not setuid-root (Unix-only)
Connect to EM though normal user

Export and Import from Enterprise Manager

If u want to do operation like export or import then u have to be administrator type user of EM.To do this,u have to login as system and then setup ---> Administrators ---> create.

Now login with the new user, Now Maintenance -----> Export to Export Files
Give the OS user id and password in the Host Credentials.

Now create a directory and test it . make sure oracle has the permission to write in that directory.

Import is simple also,Maintenance -----> Import from Export Files .Then select the directory and give the file name.

Related Documents:
--------------------

Data Pump Export/Import

Export/Import from Enterprise Manager

Original Export/Import