Monitor Oracle Dbaas using Oracle Cloud EM

Now in this post after creating Dbaas and connect the database using SQL developer, Oracle Provide you with Enterprise manager to manage your DB and giving you General Information about the database status and Storage … etc

Before start working on the EM You should Enable the https Connection ,

  • Press on the upper left panel, and choose compute Cloud.
  • Press on network tab.
  • Choose ora_httpssl and console and update then Enabled.
  • Now Back to Database cloud console, press on the Dbaas you want and Open the panel, EM Console Login.

And Enjoy
Enjoy the Cloud !!!
Thank you
Osama Mustafa

Enable Debug Mode Oracle Enterprise Manager

you need to change directory to below :

/u01/app/oracle/product/11.2.0/dbhome_1/sysman/config

under this directory you will work on

  • emd.properties
  • emagentlogging.properties
Backup two files. using cp command.
Open 

  • emagentlogging.properties
File :

change 

log4j.rootCategory=WARN, emagentlogAppender, emagenttrcAppender
TO 
log4j.rootCategory=DEBUG, emagentlogAppender, emagenttrcAppender
  • emd.properties
Change 
EMAGENT_PERL_TRACE_LEVEL=WARN
TO 
EMAGENT_PERL_TRACE_LEVEL=DEBUG
Restart dbconsole
Thank you 
Osama mustafa

3872 Actual Result: Port 3872 passed is busy Check complete

This error appear while trying to deploy agent for Enterprise manager 12c (em12c) and the cause for this error that port 3872 is already in use :

solution

[root@em12c Middleware]# netstat -anp | grep 3872

tcp        0      0 :::3872                     :::*                        LISTEN      2391/java    
     
[root@em12c Middleware]# kill -9 2391

[root@em12c Middleware]# netstat -anp | grep 3872

Deploy Again

Thank you
Osama Mustafa

emca/emcaDbUtil: perl/bin/perl: not found

Error

sept 24, 2012 4:01:02 AM oracle.sysman.emcp.util.PlatformInterface executeCommand
CONFIG: Exit value of 1
sept 24, 2012 4:01:02 AM oracle.sysman.emcp.util.PlatformInterface executeCommand
CONFIG: /u01/oracle/product/11.2.0/sysman/admin/scripts/emca/emcaDbUtil: /u01/oracle/product/11.2.0/perl/bin/perl: not found
 
 

Solution :

1- go to $ORACLE_HOME/bin open emca script using

vi emca 

And Correct $ORACLE_HOME inside it .

2-if the above solution not working  , go to emca log location and check perl executable location ,

for example :
/u01/oracle/product/11.2.0/perl/bin/perl

We get this location from the error log , then find out the Location of perl in $ORACLE_HOME/perl and try to create link to actual location :

ln -s /u01/oracle/product/11.2.0/perl   /u01/oracle/product/11.2.0/perl

sysman.emcp.ParamsManager setFlag

This error Appears when are trying maunally creating EM using :

emca -config dbcontrol db -repos create 


To Solve this error make sure you do all the below steps :

1-In your local users and groups add User to ORA_DBA group.
2-Set ORACLE_HOME and ORACLE_SID.

3- sqlplus / as sysdba

@$ORACLE_HOME/rdbms/admin/dbmspool.sql
Package created.

Create the dbmspool package body:

@$ORACLE_HOME/rdbms/admin/prvtpool.plb
View created.
Package body created.

Grant execution privilege on the package:
 

 SQL> grant execute on dbms_shared_pool to sysman;
Grant succeeded.


SQL> grant execute on dbms_shared_pool to dba;
Grant succeeded.

4-Reinstall EM Using
 
emca -deconfig dbcontrol db -repos drop
emca -config dbcontrol db -repos create

Script to Restart the OEM Agent When It Has Failed

Gaurav Batta has published this nice script to restart the OEM agent when it has failed:

$ cat agent_check.sh
#!/usr/bin/ksh
#
agent_status=`ps -ef|awk ‘{print $8}’|grep agent10g/bin/emagent`

if [[ -z $agent_status ]]
then
$AGENT_HOME/bin/emctl start agent
echo Agent started on server `hostname` at `date`
else
echo Agent is running fine on server `hostname` at `date`
fi

It is running every 30min.
crontab –l

00,30 * * * * /home/oemagent/agent_check.sh >> /home/oemagent/agent_status.log




Enjoy 


Thank you
Osama Mustafa

DBSNMP User Dose not Exists

This error appear while you are trying to create enterprise manager via DBCA 

Casue :

DBSNMP Not Found On dba_users

Solution:

So Simple run the following scripts :

@?/rdbms/admin/catnsnmp.sql    

@?/rdbms/admin/catsnmp.sql      

Thank you
Osama mustafa

Change Enterprise manager password for 11g

For the DB Control Release 11.2 and higher, you need to set the environment variable ORACLE_UNQNAME to the value of the DB_UNIQUE_NAME database parameter.

Steps :

1.Stop the DB Control
On Unix
$ emctl stop dbconsole

On Windows
Open a Command Window and type
**> emctl stop dbconsole

2.Check that the DB Control is stopped
 On Unix
$ emctl status dbconsole
 

On Windows
Open a Command Window and type
 **>emctl status dbconsole

3.Connect to the database as a user with DBA privilege with SQL*Plus and execute:

SQL> alter user sysman identified by ;
 
4.Check the new password
SQL> connect sysman/[@database_alias]
 
5.From the database directory $ORACLE_HOME/bin, execute:
On Unix

$ emctl setpasswd dbconsole
Provide the new SYSMAN password
 
On Windows

**>: emctl setpasswd dbconsoleProvide the new SYSMAN password
 
6.Restart the DB Control
On Unix
$ emctl start dbconsole
 
On Windows
Open a DOS Command Window and type
**>: emctl start dbconsole
 

Thank you 

Osama Mustafa

Change Oracle Enterprise Manager 10g Password

How to change the password of the Database User SYSMAN when the database is hosting a DB Control Repository. 

1.Stop the DB Control
On Unix
$ emctl stop dbconsole

On Windows
Open a Command Window and type
**> emctl stop dbconsole

2.Check that the DB Control is stopped
On Unix

$ emctl status dbconsole

On Windows
Open a DOS Command Window and type
**> emctl status dbconsole


3.Connect to the database as a user with DBA privilege with SQL*Plus and execute:

SQL> alter user sysman identified by ;

4.Check the new password 

SQL> connect sysman/[@database_alias]
 

5.Go to $ORACLE_HOME/host_sid/sysman/config do the following :

    1. Save the file emoms.properties to emoms.properties.orig
    2. Edit the file emoms.properties
      1. Search for the line beginning with:
        oracle.sysman.eml.mntr.emdRepPwd=
        Replace the encrypted value by the new password value
        Example:
        oracle.sysman.eml.mntr.emdRepPwd=rainbow
      2. Search for the line:
        oracle.sysman.eml.mntr.emdRepPwdEncrypted=TRUE
        Replace TRUE by FALSE

6.Restart the DB Control
On Unix

$ emctl start dbconsole
 
Open a DOS Command Window and type
**> emctl start dbconsole
 
 
7.Check that the password has been encrypted
  1. Edit the file $ORACLE_HOME/host_sid/sysman/config/emoms.properties
    1. Search for the line beginning with:
      oracle.sysman.eml.mntr.emdRepPwd=
      Check that the password is encrypted
    2. Search for the line beginning with:
      oracle.sysman.eml.mntr.emdRepPwdEncrypted=
      Check that the value is TRUE

I Publish the same lesson but on 11g .

  Thank you 
Osama mustafa