Thursday, 6 February 2014

New to Enterprise Manger Cloud Control 12c (oem 12c)

Some Useful links and topics of Oracle Enterprise Manager 12c (OEM 12c):

oem 12c User administration

  • Login as SYSMAN user or other super admin user
  • Click Setup (top left) > Select Security > Click Administration 
  • Here you can add / edit or delete oem 12c users


oem 12c: Administer Monitoring Templates
http://www.youtube.com/watch?v=xk9y5299dX0

How to add RAC Databases to Enterprise Manager Cloud Control 12c http://www.gokhanatil.com/2014/01/how-to-add-rac-databases-to-enterprise-manager-cloud-control-12c.html 

  1. Click "Configure Auto Discovery"
  2. Click "Oracle Database, Listener and Automatic Storage Management"
  3. Add Clusterwaer Home e.g. /u01/app/11.2.0.3/grid


  1. Add Targets Manually
  2. Add Targets Using Guided Process (Also Adds Related Targets)
  3. Select "Oracle Cluster and HA Service"
  4. Click "Add Using Guided Process"
  5. Select 1st node click "Select"
  6. Click Continue

  1. Add Targets Manually
  2. Select "Add Targets Declaratively by Specifying Target Monitoring Properties"
  3. Target Type: Cluster Database
  4. Select 1st node
  5. Click Manullay

Tips to get some of the info:

  • cemutlo -n (Cluster name)
  • srvctl config scan
  • srvctl status SCAN_LISTENER

oem 12c: Incident Management: Use Incident Rule Sets




Oracle 12c clusterware ONS port

$ cat /u01/app/11.2.0.3/grid/opmn/conf/ons.config

(05 Jan 2014) I used the value remoteport value 6200, and it worked         

Friday, 10 January 2014

Standby common sqls

select thread#, max(sequence#) as "Last_Applied_Log" from v$log_history group by thread#; select process, status, sequence# from v$managed_standby; alter database recover managed standby database disconnect from session; alter database register logfile '/u02/oracle/backup_arch/o1_mf_1_57518_93s5gop2_.arc'; alter database register logfile '/u02/oracle/backup_arch/o1_mf_1_57519_93s5v0pm_.arc'; ... or you can try to use rman to register a group of them e.g. RMAN> catalog start with '/u01/oracle/arch/arc'; Shutdown Standby select process, status, sequence# from v$managed_standby; alter database recover managed standby database cancel; shutdown immediate Restore archivelog from RMAN backup. restore archivelog from logseq 69124 until logseq 69134; -- or restore archivelog from logseq 69135;

Thursday, 19 December 2013

Oracle 12c installation

# cd /etc/yum.repos.d # wget http://public-yum.oracle.com/public-yum-el5.repo # wget http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle # gpg --quiet --with-fingerprint /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle # yum install oracle-validated

Wednesday, 5 June 2013

Last Analyzed - clean format

Last Analyzed set pagesize 100 select * from ( select t.owner, to_char(t.last_analyzed, 'DD-MON-YYYY') LAST_ANALYZED, count(*) COUNT, RANK() OVER (PARTITION BY owner ORDER BY count(*) desc) "rank" from dba_tables t where owner not in ('SYS','SYSTEM','SYSMAN','OUTLN','CTXSYS','MDSYS','TSMSYS','DMSYS','EXFSYS','DBSNMP','XDB','ORDSYS','WMSYS','ORDPLUGINS','ANONYMOUS','ORACLE_OCM','DIP','XS\$NULL','APEX_PUBLIC_USER','MGMT_VIEW','SMTYPES','ORDDATA','SPATIAL_WFS_ADMIN_USR','MDDATA','SI_INFORMTN_SCHEMA','DATAADMIN','APEX_030200','OWBSYS_AUDIT','OLAPSYS','SPATIAL_CSW_ADMIN_USR','OWBSYS','APPQOSSYS','AVAIL','FLOWS_FILES') group by t.owner, to_char(t.last_analyzed, 'DD-MON-YYYY') order by t.owner, COUNT desc, LAST_ANALYZED ) where "rank" = 1;

Thursday, 23 May 2013

Tomcat with tnsname

Oracle Thin JDBC connection to a TNS alias (tnsname)

1. Log in as user that owns tomcat

2. Shutdown tomcat if running

3. export this env
export JAVA_OPTS="-Doracle.net.tns_admin=/u01/oracle/product/10.2.0/network/admin"

5. Make sure tomcat owner is able to read file sin the above TNS directory

4. Startup tomcat

5. DB connection using tns should work

Note:
  • Above worked for me on 10.2.0.1.0 database with, tomcat-5.5.20 (Linux) and jdk1.6.0_12 (May 2013)

  • Above worked for me on 11g database with, tomcat-7.0.40 (Win) and 1.7.0_21 (May 2013)

  • Similar to normal thin connection ("jdbc:oracle:thin:@nidevdb", username, password)
  • Some docs / sites also say you can use below, instead (i could not get it to work).

System.setProperty("oracle.net.tns_admin", "/u01/oracle/product/10.2.0/network/admin");


more info, see book:
Book: Oracle® Database JDBC Developer's Guide (11g Release 2 (11.2))
Chapter: 8 Data Sources and URLs

Thursday, 16 May 2013

Data Pump option

Simple Datapump create directory dump_dir as '/u11/oracle/exp_cust'; create directory log_dir as '/u11/oracle/exp_cust/logs'; grant read,write on directory dump_dir to CUST_DUMMY_STAGE; grant read,write on directory log_dir to CUST_DUMMY_STAGE; -- Export expdp CUST_DUMMY_STAGE/nidb schemas=CUST_DUMMY_STAGE dumpfile=dump_dir:expdp_09FEB2013_CUST_DUMMY_STAGE_%U.dmp logfile=log_dir:full1.log_09FEB2013_expdp_CUST_DUMMY_STAGE.log parallel=4 filesize=10G -- Import impdp system schemas=CUST_DUMMY_STAGE dumpfile=dump_dir:expdp_09FEB2013_CUST_DUMMY_STAGE_*.dmp logfile=log_dir:full1.log_09FEB2013_impdp_CUST_DUMMY_STAGE.log parallel=4 -- with remap / fromuser-touser impdp system schemas=CUST_DUMMY_PROD remap_schema=CUST_DUMMY_PROD:CUST_DUMMY_STAGE dumpfile=dump_dir:cust_dummy_prod_201305182300_01.dp logfile=dump_dir:log_imp_cust_dummy_prod_201305182300_.log parallel=4

Friday, 19 April 2013

asmcmd tips

To get size of all the archive logs asmcmd ls DG_BIN | while read; do printf 'DG_BIN/%s\n' "$REPLY"; asmcmd du "DG_BIN/$REPLY"; done