Restore and Upgrade Oracle Database from 11gR2 to 12c from Exadata X4-2 to X7-2

Upgrade from Exadata X4-2 11g (11.2.0.4) to Exadata X7-2 12CR1 (12.1.0.2.0) : ASM to ASM Oracle Database 11.2.0.3and 11.2.0.4 to Oracle 12.2.0.1 Direct upgrade is supported by Oracle. If you have Database lower than those version than you have to upgrade to 11.2.0.4 first and you can upgrade to 12cR2 In our Scenario We will … Continue reading Restore and Upgrade Oracle Database from 11gR2 to 12c from Exadata X4-2 to X7-2

Rebuild All Indexes on a Schema in Oracle

spool index_rebuild.sql select 'alter index '||owner||'.'||index_name ||' rebuild online nologging;' from dba_indexes where owner=upper('SAMPLE'); spool off

Monitor Tablespace Script Oracle 12c 11g 10g

The Below Script will generate output if percentage of tablespace space left free is less tan 20%. You can easily put in a shell script and schedule it on crontab to send alerts on a daily basis.   select df.tablespace_name tspace, round(sum(fs.bytes)/(df.bytes) * 100) "%_free", round(sum(fs.bytes)/(1024*1024)) free_ts_size, df.bytes/(1024*1024) tot_ts_size from dba_free_space fs, (select tablespace_name, sum(bytes) … Continue reading Monitor Tablespace Script Oracle 12c 11g 10g

Generate Excel and PDF in Oracle and Send Report by Email

First Install UTL_MAIL ### To install UTL_MAIL: [code language="sql"] sqlplus sys/**** @$ORACLE_HOME/rdbms/admin/utlmail.sql @$ORACLE_HOME/rdbms/admin/prvtmail.plb [/code] ### Create a Reporting User ### [code language="sql"] create user tctreport identified by tctreport; grant connect to tctreport; grant dba to tctreport; sqlplus tctreport/tctreport [/code] ## Grant TCTREPORT User permission to execute UTL_MAIL ## [code language="sql"] sqlplus "/as sysdba" grant execute … Continue reading Generate Excel and PDF in Oracle and Send Report by Email

Check ASM Diskgroup Space and Directory Size

The script below can be used to check the Disk Group Space Free and also Check Directory sizes for each Disk Group The script is written by somebody at Pythian but i cannot re-collect the original link to the blog. eg: ./asmcmd_du.sh DiskGroup Total_MB Free_MB % Free --------- -------- ------- ------ DATAC1 15962112 11215880 70 … Continue reading Check ASM Diskgroup Space and Directory Size

Configuring Oracle Wallet for Multiple RAC Databases sharing same Oracle Home

1 ) Set the environment variable also via srvctl @ oracle user. export ORACLE_UNQNAME='$ORACLE_HOME/bin/srvctl config database |grep -w ${ORACLE_SID%?}' srvctl setenv database -d secdev -T "ORACLE_UNQNAME=secdev" 2) Create wallet directory on both nodes @ oracle user. mkdir -p /u01/app/oracle/WALLETS/secdev 3) Configure sqlnet.ora as follows on both nodes @ oracle user. If the databases share the … Continue reading Configuring Oracle Wallet for Multiple RAC Databases sharing same Oracle Home

Scripts to Check Library Cache Lock Contention

One of the best sites for scripts related to checking library cache locks... http://allappsdba.blogspot.qa/2012/04/to-check-library-cache-lock-contention.html

Active – Active (Bi-Directional) Replication using Oracle Golden Gate 12c

Since it was announced in Early 2010 that Oracle GoldenGate will be the RoadMap for Replication for Oracle Database, The adoption of GoldenGate over Streams has been quite Rapid. The complexity of Streams has intimidated many adopters, specially for Multi-Master or Peer-to-Peer Replication. GoldenGate not only makes MultiMaster Replication easy but is so full of … Continue reading Active – Active (Bi-Directional) Replication using Oracle Golden Gate 12c

Hang anaylze oracle 11g

What to do when a production database goes hanging and there is no time left and your boss is standing on your head. This article could be just be your life saver http://www.dbi-services.com/index.php/blog/entry/oracle-is-hanging-dont-forget-hanganalyze-and-systemstate