Thursday, June 16, 2016

EM express for oracle 12c

If you want to configure EM Express Diagnostics Pack and for the SQL Monitor and SQL Tuning Advisor features, you will need the Tuning Pack.
control_management_pack_access parameter=DIAGNOSTIC

starting EM express for NON CDB
[oracle@z1p12c admin]$ lsnrctl status 
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 27-MAY-2016 00:23:53
Copyright (c) 1991, 2014, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=z1p12c.ffdc.sbc.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     listener
Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date                27-MAY-2016 00:16:12
Uptime                    0 days 0 hr. 7 min. 41 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/z1p12c/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=z1p12c.ffdc.sbc.com)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "mldb69" has 1 instance(s).
  Instance "mldb69", status READY, has 1 handler(s) for this service...
The command completed successfully

Execute  DBMS_XDB.setHTTPSPort procedure to set the HTTPS port for Enterprise Manager Express
Manually set up EM Express, simply configure the HTTPS or HTTP port by logging into the database and setting the port

[oracle@z1p12c admin]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Fri May 27 00:32:57 2016
Copyright (c) 1982, 2014, Oracle.  All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Advanced Analytics
and Real Application Testing options

SQL>  select dbms_xdb_config.gethttpport() from dual;
DBMS_XDB_CONFIG.GETHTTPPORT()
-----------------------------
    0

SQL> exec dbms_xdb_config.sethttpport(8080);
PL/SQL procedure successfully completed.

SQL> select dbms_xdb.gethttpport() from dual;
DBMS_XDB.GETHTTPPORT()
----------------------
  8080

SQL> alter system register;
System altered.

SQL> alter system set shared_servers=5 scope=both;
System altered.

SQL> select dbms_xdb_config.gethttpport() from dual;
DBMS_XDB_CONFIG.GETHTTPPORT()
-----------------------------
8080

SQL> show parameter dispatcher
NAME     TYPE VALUE
------------------------------------ ----------- ------------------------------
dispatchers     string (PROTOCOL=TCP) (SERVICE=mldb69XDB)
max_dispatchers      integer

SQL> !
[oracle@z1p12c admin]$ lsnrctl status
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 27-MAY-2016 00:34:44
Copyright (c) 1991, 2014, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=z1p12c.ffdc.sbc.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     listener
Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date                27-MAY-2016 00:16:12
Uptime                    0 days 0 hr. 18 min. 32 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/z1p12c/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=z1p12c.ffdc.sbc.com)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=z1p12c.ffdc.sbc.com)(PORT=8080))(Presentation=HTTP)(Session=RAW))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=z1p12c.ffdc.sbc.com)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/admin/mldb69/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "mldb69" has 2 instance(s).
  Instance "mldb69", status READY, has 1 handler(s) for this service...
Service "mldb69XDB" has 1 instance(s).
  Instance "mldb69", status READY, has 1 handler(s) for this service...
The command completed successfully

connect to EM express for database as follows
http://192.168.1.75:8080/em/login

Grant EM Express to User #
SQL> grant EM_EXPRESS_BASIC to < User >;

--Nikhil Tatineni--


Querys to monitor RAC

following few  Query's will help to find out culprits-  Query to check long running transaction from last 8 hours  Col Sid Fo...