Showing posts with label Oracle dbconsole. Show all posts
Showing posts with label Oracle dbconsole. Show all posts

Sunday, 29 October 2017

Step by step Install and Deinstall DBconsole in Oracle 11g R2

Step 1: Check the status of dbconsole

[oracle@saidodv ~]$ emctl status dbconsole
OC4J Configuration issue. /u01/app/oracle/product/11.2.0.4/db_1/oc4j/j2ee/OC4J_DBConsole_saidodv.localdomain_orcl not found.
[oracle@saidodv ~]$

Step 2: Deinstall/Drop existing dbconsole

[oracle@saidodv ~]$ cd $ORACLE_HOME/bin
[oracle@saidodv bin]$ ./emca -deconfig dbcontrol db -repos drop

STARTED EMCA at Oct 30, 2017 11:44:53 AM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle.  All rights reserved.

Enter the following information:
Database SID: orcl
Listener port number: 1521
Password for SYS user: 
Oct 30, 2017 11:45:04 AM oracle.sysman.emcp.DatabaseChecks checkRestrictedMode
WARNING: ORA-01034: ORACLE not available

Oct 30, 2017 11:45:04 AM oracle.sysman.emcp.DatabaseChecks checkDataGuardEnabled
WARNING: ORA-01034: ORACLE not available

Step 3 : The error showing above due to Database instance is down. Bring up Database Instance and Listener

[oracle@saidodv bin]$ sqlplus

SQL*Plus: Release 11.2.0.4.0 Production on Mon Oct 30 11:45:27 2017

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

Enter user-name: /as sysdba
Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  764121088 bytes
Fixed Size     2257152 bytes
Variable Size   499126016 bytes
Database Buffers   255852544 bytes
Redo Buffers     6885376 bytes
Database mounted.
Database opened.
SQL>


Step 4 : Create / Install dbconsole

[oracle@saidodv bin]$ ./emca -deconfig dbcontrol db -repos drop

STARTED EMCA at Oct 30, 2017 11:48:02 AM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle.  All rights reserved.

Enter the following information:
Database SID: orcl
Listener port number: 1521
Password for SYS user: 
Password for SYSMAN user: 

----------------------------------------------------------------------
WARNING : While repository is dropped the database will be put in quiesce mode.
----------------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Oct 30, 2017 11:48:18 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/orcl/emca_2017_10_30_11_48_02.log.
Oct 30, 2017 11:48:18 AM oracle.sysman.emcp.EMDBPreConfig performDeconfiguration
WARNING: EM is not configured for this database. No EM-specific actions can be performed. Some of the possible reasons may be:
 1) EM is configured with different hostname then physical host. Set environment variable ORACLE_HOSTNAME= and re-run EMCA script 
 2) ORACLE_HOSTNAME is set. Unset it and re-run EMCA script
Oct 30, 2017 11:48:18 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Oct 30, 2017 11:49:23 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Enterprise Manager configuration completed successfully
FINISHED EMCA at Oct 30, 2017 11:49:23 AM
[oracle@saidodv bin]$

Step : Install dbconsole

[oracle@saidodv bin]$ ./emca -config dbcontrol db -repos create

STARTED EMCA at Oct 30, 2017 11:50:05 AM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle.  All rights reserved.

Enter the following information:
Database SID: orcl
Listener port number: 1521
Listener ORACLE_HOME [ /u01/app/oracle/product/11.2.0.4/db_1 ]:
Password for SYS user: 
Password for DBSNMP user: 
Password for SYSMAN user: 
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ /u01/app/oracle/product/11.2.0.4/db_1

Local hostname ................ saidodv.localdomain
Listener ORACLE_HOME ................ /u01/app/oracle/product/11.2.0.4/db_1
Listener port number ................ 1521
Database SID ................ orcl
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Oct 30, 2017 11:50:32 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/orcl/emca_2017_10_30_11_50_05.log.
Oct 30, 2017 11:50:33 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Oct 30, 2017 11:53:21 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Oct 30, 2017 11:53:28 AM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Oct 30, 2017 11:53:59 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Oct 30, 2017 11:54:01 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Oct 30, 2017 11:54:05 AM oracle.sysman.emcp.util.PlatformInterface executeCommand
WARNING: Error executing /u01/app/oracle/product/11.2.0.4/db_1/bin/emctl secure dbconsole -host saidodv.localdomain -sid orcl
Oct 30, 2017 11:54:05 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
WARNING: Error securing Database control.
Oct 30, 2017 11:54:05 AM oracle.sysman.emcp.EMDBPostConfig setWarnMsg
INFO: Error securing Database Control. Database Control has been brought-up in non-secure mode. To secure the Database Control execute the following command(s):

 1) Set the environment variable ORACLE_UNQNAME to Database unique name
 2) /u01/app/oracle/product/11.2.0.4/db_1/bin/emctl stop dbconsole
 3) /u01/app/oracle/product/11.2.0.4/db_1/bin/emctl config emkey -repos -sysman_pwd < Password for SYSMAN user > 
 4) /u01/app/oracle/product/11.2.0.4/db_1/bin/emctl secure dbconsole -sysman_pwd < Password for SYSMAN user > 
 5) /u01/app/oracle/product/11.2.0.4/db_1/bin/emctl start dbconsole

 To secure Em Key, run /u01/app/oracle/product/11.2.0.4/db_1/bin/emctl config emkey -remove_from_repos -sysman_pwd < Password for SYSMAN user >
Oct 30, 2017 11:54:05 AM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Oct 30, 2017 11:54:10 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Oct 30, 2017 11:54:10 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is http://saidodv.localdomain:1158/em <<<<<<<<<<<


Error securing Database Control. Database Control has been brought-up in non-secure mode. To secure the Database Control execute the following command(s):

 1) Set the environment variable ORACLE_UNQNAME to Database unique name
 2) /u01/app/oracle/product/11.2.0.4/db_1/bin/emctl stop dbconsole
 3) /u01/app/oracle/product/11.2.0.4/db_1/bin/emctl config emkey -repos -sysman_pwd < Password for SYSMAN user > 
 4) /u01/app/oracle/product/11.2.0.4/db_1/bin/emctl secure dbconsole -sysman_pwd < Password for SYSMAN user > 
 5) /u01/app/oracle/product/11.2.0.4/db_1/bin/emctl start dbconsole

 To secure Em Key, run /u01/app/oracle/product/11.2.0.4/db_1/bin/emctl config emkey -remove_from_repos -sysman_pwd < Password for SYSMAN user >
[oracle@saidodv bin]$

Step 5 : Check the status of dbconsole

[oracle@saidodv bin]$ emctl status dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0
Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.
http://saidodv.localdomain:1158/em/console/aboutApplication
EM Daemon is running.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/11.2.0.4/db_1/saidodv.localdomain_orcl/sysman/log
[oracle@saidodv bin]$

Step 6: Now try to login dbconsole using following link

http://saidodv.localdomain:1158/em
http://:1158/em

Thats it !!!!!!!!!!!!!!!!!

Sunday, 22 June 2014

Step by Step "How to drop and create enterprise manager dbconsole repository in Oracle 10gR2 running Windows"


1. Check Enterprise Manager service is running or not.

 C:\Users\Administrator>emctl status dbconsole
Environment variable ORACLE_SID not defined. Please define it.

2. set ORACLE_SID value

C:\Users\Administrator>set ORACLE_SID=orcl

3. Drop Dbconsole and repository – Enterprice Manager in 10g

emca -deconfig dbcontrol db -repos drop

======================
C:\Users\Administrator>emca -deconfig dbcontrol db -repos drop

STARTED EMCA at Jun 23, 2014 3:59:18 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: orcl
Listener port number: 1521
Password for SYS user:
Password for SYSMAN user:
Password for SYSMAN user:
Do you wish to continue? [yes(Y)/no(N)]: Y
Jun 23, 2014 3:59:48 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at F:\oracle\product\10.2.0\db_2\cfgtoollog
s\emca\orcl\emca_2014-06-23_03-59-17-AM.log.
Jun 23, 2014 3:59:51 AM oracle.sysman.emcp.EMDBPreConfig performDeconfiguration
WARNING: EM is not configured for this database. No EM-specific actions can be p
erformed.
Jun 23, 2014 3:59:51 AM oracle.sysman.emcp.EMReposConfig dropRepository
INFO: Dropping the EM repository (this may take a while) ...
Jun 23, 2014 4:01:14 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Enterprise Manager configuration completed successfully
FINISHED EMCA at Jun 23, 2014 4:01:14 AM

C:\Users\Administrator>
======================

4. Create Dbconsole and repository – Enterprice Manager in 10g

emca -config dbcontrol db -repos create
======================
C:\Users\Administrator>emca -config dbcontrol db -repos create

STARTED EMCA at Jun 23, 2014 4:03:02 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: orcl
Listener port number: 1521
Password for SYS user:
Password for SYS user: sys123
Password for SYSMAN user:
Password for SYSMAN user: Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ F:\oracle\product\10.2.0\db_2

Database hostname ................ saidrasel-PC.sblcorp.com
Listener port number ................ 1521
Database SID ................ orcl
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Jun 23, 2014 4:04:26 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at F:\oracle\product\10.2.0\db_2\cfgtoollog
s\emca\orcl\emca_2014-06-23_04-03-02-AM.log.
Jun 23, 2014 4:04:35 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Jun 23, 2014 4:07:21 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Jun 23, 2014 4:07:39 AM oracle.sysman.emcp.util.PlatformInterface executeCommand

WARNING: Error executing CMD /C F:\oracle\product\10.2.0\db_2\bin\emctl.bat depl
oy dbconsole F:\oracle\product\10.2.0\db_2\saidrasel-PC.sblcorp.com_orcl saidras
el-PC.sblcorp.com:3938 saidrasel-PC.sblcorp.com orcl
Jun 23, 2014 4:07:39 AM oracle.sysman.emcp.EMConfig perform
SEVERE: Error instantiating EM configuration files
Refer to the log file at F:\oracle\product\10.2.0\db_2\cfgtoollogs\emca\orcl\emc
a_2014-06-23_04-03-02-AM.log for more details.
Could not complete the configuration. Refer to the log file at F:\oracle\product
\10.2.0\db_2\cfgtoollogs\emca\orcl\emca_2014-06-23_04-03-02-AM.log for more deta
ils.

C:\Users\Administrator>
======================
5. Check the status of dbconsole

C:\Users\Administrator>emctl status dbconsole
Unable to determine local host from URL REPOSITORY_URL=http://saidrasel-PC.sblco
rp.com:%EM_UPLOAD_PORT%/em/upload/

6. The very first thing is, add your machine host name in hosts file:

127.0.0.1       localhost
10.xx.xx.xx  machine-host-name

The location of hosts file (in Windows) is C:\WINDOWS\system32\drivers\etc\hosts

7. Drop and create current Database Console repository by issuing Step 3 and 4.

8. Check the status of dbconsole

C:\Users\Administrator>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://saidrasel-PC:1158/em/console/aboutApplication
EM Daemon is not running.
------------------------------------------------------------------
Logs are generated in directory F:\oracle\product\10.2.0\db_2/saidrasel-PC_orcl/
sysman/log

C:\Users\Administrator>

9. Check the Enterprise Manager agent timezone located 

ORACLE_HOME/HOST_NAME_SID\sysman\config
emd.properties file and set the timezone (for Bangladesh)
agentTZRegion=+06:00

10. Stop and start dbconsole

11. Now run the enterprise manager dbconsole in any browser

http://saidrasel-PC:1158/em/


Note: This solution is tested in Windows 7 and Oracle 1ogR2 Database.