Saturday, 14 January 2017

DBCONSOLE Installation on RAC

#set the environment

[rac1] /u01/app/oracle/product/11.2.0/dbhome_1/bin $ export ORACLE_UNQNAME=joshi
[rac1] /u01/app/oracle/product/11.2.0/dbhome_1/bin $ echo $ORACLE_UNQNAME
joshi
[rac1] /u01/app/oracle/product/11.2.0/dbhome_1/bin $ echo $ORACLE_SID
joshi1
[rac1] /u01/app/oracle/product/11.2.0/dbhome_1/bin $ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/dbhome_1


##
SQL> show parameter service

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
service_names                        string      joshi.nabh.com
SQL> show parameter db_uniq

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_unique_name                       string      joshi


##

[rac1] /u01/app/oracle/product/11.2.0/dbhome_1/bin $ ./emctl status dbconsole
OC4J Configuration issue. /u01/app/oracle/product/11.2.0/dbhome_1/oc4j/j2ee/OC4J_DBConsole_rac1_joshi not found.
[rac1] /u01/app/oracle/product/11.2.0/dbhome_1/bin $


##

[rac1] /u01/app/oracle/product/11.2.0/dbhome_1/bin $ emca -config dbcontrol db -repos create -cluster -EM_NODE rac1 -EM_NODE_LIST rac1,rac2

##error##
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/gye/emca_2017_01_14_02_29_57.log. 
Jan 14, 2017 2:32:15 AM oracle.sysman.emcp.DatabaseChecks performReposChecks 
SEVERE: Dbcontrol Repository already exists. Fix the error(s) and run EM Configuration Assistant again in standalone mode. 
[rac1] /u01/app/oracle/product/11.2.0/dbhome_1/bin $ 



###To overcome this error please follow below steps ###

To Cleanup Repository :

DROP USER sysman CASCADE;
DROP PUBLIC SYNONYM setemviewusercontext;
DROP ROLE mgmt_user;
DROP PUBLIC SYNONYM mgmt_target_blackouts;
DROP USER mgmt_view;


The public synonym for SYSMAN objects must be dropped

DECLARE  
CURSOR c1 IS  
SELECT owner, synonym_name name  
FROM dba_synonyms  
WHERE table_owner = 'SYSMAN';  
BEGIN  
FOR r1 IN c1 LOOP  
IF r1.owner = 'PUBLIC' THEN  
EXECUTE IMMEDIATE 'DROP PUBLIC SYNONYM '||r1.name;  
ELSE  
EXECUTE IMMEDIATE 'DROP SYNONYM '||r1.owner||'.'||r1.name;  
END IF;  
END LOOP;  
END;  
/  


#######

SQL> DROP USER sysman CASCADE;

User dropped.

SQL> DROP PUBLIC SYNONYM setemviewusercontext;

Synonym dropped.

SQL> DROP ROLE mgmt_user;

Role dropped.

SQL> DROP PUBLIC SYNONYM mgmt_target_blackouts;

Synonym dropped.

SQL> DROP USER mgmt_view;

User dropped.

SQL> DECLARE
CURSOR c1 IS
SELECT owner, synonym_name name
FROM dba_synonyms
WHERE table_owner = 'SYSMAN';
BEGIN
FOR r1 IN c1 LOOP
IF r1.owner = 'PUBLIC' THEN
EXECUTE IMMEDIATE 'DROP PUBLIC SYNONYM '||r1.name;
ELSE
EXECUTE IMMEDIATE 'DROP SYNONYM '||r1.owner||'.'||r1.name;
END IF;
END LOOP;
END;
/   2    3    4    5    6    7    8    9   10   11   12   13   14   15

PL/SQL procedure successfully completed.

SQL>

###

###CREATE password file##

orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password=sysoracle entries=5 force=y

##Run the below command###
emca -config dbcontrol db -repos create -cluster -EM_NODE rac1 -EM_NODE_LIST rac1,rac2


#we need sys,sysman,dbsnmp,asmsnmp password for installation##


Enter the following information:
Database unique name: pca
Service name: pca.nabh.com
Listener port number: 1521
Listener ORACLE_HOME [ /u01/app/11.2.0/grid ]:
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Password for SYSMAN user: Cluster name: joshi-cluster
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
ASM ORACLE_HOME [ /u01/app/11.2.0/grid ]:
ASM port [ 1521 ]:
ASM username [ ASMSNMP ]:
ASM user password: 



##

STARTED EMCA at Jan 14, 2017 3:23:48 AM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle.  All rights reserved.

Enter the following information:
Database unique name: joshi
Service name: joshi.nabh.com
Listener port number: 1521
Listener ORACLE_HOME [ /u01/app/11.2.0/grid ]:
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:  a
Cluster name: msldb-cluster
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
ASM ORACLE_HOME [ /u01/app/11.2.0/grid ]:
ASM port [ 1521 ]:
ASM username [ ASMSNMP ]:
ASM user password:  B$y$16
Jan 14, 2017 3:24:52 AM oracle.sysman.emcp.util.GeneralUtil initSQLEngineRemotely
WARNING: Error during db connection : ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ /u01/app/oracle/product/11.2.0/dbhome_1

Database instance hostname ................ Listener ORACLE_HOME ................ /u01/app/11.2.0/grid
Listener port number ................ 1521
Cluster name ................ rac-cluster
Database unique name ................ joshi
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
ASM ORACLE_HOME ................ /u01/app/11.2.0/grid
ASM port ................ 1521
ASM user role ................ SYSDBA
ASM username ................ ASMSNMP

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Jan 14, 2017 3:25:02 AM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/joshi/emca_2017_01_14_03_23_48.log.
Jan 14, 2017 3:25:05 AM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Jan 14, 2017 3:30:17 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Jan 14, 2017 3:30:23 AM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Jan 14, 2017 3:31:07 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Jan 14, 2017 3:31:08 AM oracle.sysman.emcp.EMDBCConfig instantiateOC4JConfigFiles
INFO: Propagating /u01/app/oracle/product/11.2.0/dbhome_1/oc4j/j2ee/OC4J_DBConsole_rac1_joshi to remote nodes ...
Jan 14, 2017 3:31:09 AM oracle.sysman.emcp.EMDBCConfig instantiateOC4JConfigFiles
INFO: Propagating /u01/app/oracle/product/11.2.0/dbhome_1/oc4j/j2ee/OC4J_DBConsole_rac2_joshi to remote nodes ...
Jan 14, 2017 3:31:13 AM oracle.sysman.emcp.EMAgentConfig deployStateDirs
INFO: Propagating /u01/app/oracle/product/11.2.0/dbhome_1/rac1_joshi to remote nodes ...
Jan 14, 2017 3:31:15 AM oracle.sysman.emcp.EMAgentConfig deployStateDirs
INFO: Propagating /u01/app/oracle/product/11.2.0/dbhome_1/rac2_joshi to remote nodes ...
Jan 14, 2017 3:31:19 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Jan 14, 2017 3:31:41 AM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Jan 14, 2017 3:32:05 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Jan 14, 2017 3:32:06 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://rac1.nabh.com:5505/em <<<<<<<<<<<
Jan 14, 2017 3:32:09 AM oracle.sysman.emcp.EMDBPostConfig showClusterDBCAgentMessage
INFO:
****************  Current Configuration  ****************
 INSTANCE            NODE           DBCONTROL_UPLOAD_HOST
----------        ----------        ---------------------

joshi               rac1               rac1.nabh.com
joshi               rac2               rac1.nabh.com


Jan 14, 2017 3:32:09 AM oracle.sysman.emcp.EMDBPostConfig invoke
WARNING:
************************  WARNING  ************************

Management Repository has been placed in secure mode wherein Enterprise Manager data will be encrypted.  The encryption key has been placed in the file: /u01/app/oracle/product/11.2.0/dbhome_1/rac1_joshi/sysman/config/emkey.ora. Ensure this file is backed up as the encrypted data will become unusable if this file is lost.

***********************************************************
Enterprise Manager configuration completed successfully
FINISHED EMCA at Jan 14, 2017 3:32:09 AM                                  ^C
[rac1] /u01/app/oracle/product/11.2.0/dbhome_1/bin $
[rac1] /u01/app/oracle/product/11.2.0/dbhome_1/bin $
[rac1] /u01/app/oracle/product/11.2.0/dbhome_1/bin $

#####

[rac1] /u01/app/oracle/product/11.2.0/dbhome_1/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.
https://rac1.nabh.com:5505/em/console/aboutApplication
Oracle Enterprise Manager 11g is running.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/11.2.0/dbhome_1/rac1_joshi/sysman/log

#######
[rac1] /u01/app/oracle/product/11.2.0/dbhome_1/bin $ ./emctl status agent
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0
Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
Agent Version     : 10.2.0.4.5
OMS Version       : 10.2.0.4.5
Protocol Version  : 10.2.0.4.5
Agent Home        : /u01/app/oracle/product/11.2.0/dbhome_1/rac1_joshi
Agent binaries    : /u01/app/oracle/product/11.2.0/dbhome_1
Agent Process ID  : 6038
Parent Process ID : 5948
Agent URL         : https://rac1.nabh.com:1835/emd/main
Repository URL    : https://rac1.nabh.com:5505/em/upload/
Started at        : 2017-01-14 03:31:43
Started by user   : oracle
Last Reload       : 2017-01-14 03:31:43
Last successful upload                       : 2017-01-14 03:33:28
Total Megabytes of XML files uploaded so far :    16.55
Number of XML files pending upload           :        0
Size of XML files pending upload(MB)         :     0.00
Available disk space on upload filesystem    :    86.29%
Data channel upload directory                : /u01/app/oracle/product/11.2.0/dbhome_1/rac1_joshi/sysman/recv
Last successful heartbeat to OMS             : 2017-01-14 03:32:53
---------------------------------------------------------------
Agent is Running and Ready

####

Setting up Email Alerts

This section explains how to set-up and configure email alerts via Grid Control. Please note, for simplicity, these instructions deal with a single notification rule and alert. Users should create or amend the notification rules and alerts to suit their own needs.
1. Configure the mail server that dbconsole will use to send emails.
  • Click on setup in the top right-hand corner of dbconsole
  • Click on Notification Methods in the side bar
  • Enter a valid Outgoing Mail (SMTP) Server
  • Enter a suitable description for Identify Sender As
  • Enter a suitable email address for Sender's E-mail Address
  • Click on Test Mail Servers
  • Check to see if an email has been received in the Sender's E-mail Address inbox.
  • Click apply if satisfied with the test.
2. Set-up the email addresses that will receive emails from dbconsole
  • Click on preferences in the top right-hand corner of dbconsole
  • Enter a valid email recipient in the E-mail Address field.
  • Select a suitable Message Format. For SMS messages, this should be set to short
  • Ensure the Select tick box is ticked and click Test
  • Click Ok
  • Click apply if satisfied with the test.
3. Define a schedule for when you wish to receive alerts.
  • Click on preferences in the top right-hand corner of dbconsole
  • Click on schedule in the side bar.
  • Click on Edit Schedule Definition
  • Select a Rotation Frequency
  • Click Edit Existing Schedule
  • Set a suitable Start Time and End Time for the schedule.
  • In the E-mail Addresses field, enter one of the email addresses defined in section 3 above.
  • Select the Days of Week that are applicable to the schedule being created.
  • Click Batch Fill-in
  • Click Finish
4. Create a notification rules.

  • Click on preferences in the top right-hand corner of dbconsole
  • Click on rules in the side bar.
  • Click create
  • Enter a Name for the notification rule.
  • Enter a Description for the notification rule.
  • Select a Target Type. For example, database.
  • Ensure Apply rule to all targets of the target type selected is selected.
  • Click Next
  • Select the availability states to be notified on.
  • Click Next
  • Select the Severity States to be notified on.
  • Use the Arrows to move the Available Metrics into the Selected Metrics box. Any metrics in the Selected Metrics box, will be alerted on.
  • Click Next.
  • Depending on which metrics were chosen, it may be necessary to define further attributes for the metric.
  • When satisfied all additional metric properties have been defined, click Next.
  • Ensure the Send Me E-mail tick box is ticked.
  • Click Next
  • Review the Notification Rule and click Finish

No comments:

Post a Comment