Friday, September 20, 2013

Find files for a date and time and then copy to a directory



-rw-r--r-- 1 mys1idb oragrid 0 Sep 19 21:23 mys1id5_ora_19242.trc
-rw-r--r-- 1 mys1idb oragrid 0 Sep 19 21:23 mys1id5_ora_19281.trc
-rw-r--r-- 1 mys1idb oragrid 0 Sep 19 21:23 mys1id5_ora_19317.trc
-rw-r--r-- 1 mys1idb oragrid 0 Sep 19 21:23 mys1id5_ora_19325.trc
-rw-r--r-- 1 mys1idb oragrid 0 Sep 19 21:23 mys1id5_ora_19333.trc
-rw-r--r-- 1 mys1idb oragrid 0 Sep 19 21:24 mys1id5_ora_19386.trc

for i in `ls -latR | grep "Sep 19 21" | awk '{print $9}'`; do cp -pr $i /tmp/trace; done

Saturday, September 14, 2013

Trick to generate SQL from an Excel File


="INSERT INTO Table (ID, Name) VALUES (" & C2 & ", '" & D2 & "')"

Wednesday, September 11, 2013

How to resize redo logs for RAC with ASM



Find out the current redo log size

Now create some temporary groups

Now you have to keep switch them until you can drop the group 1 thru 4, you can put that in a script and
keep running until you have dropped group 1 thru 4

Now repeat the process by creating the Group 1 thur 4 with desired size (say 2G each)

Now you can drop the temporary groups 11 thru 14

Redo Threads
Each online redo log has a thread number and a sequence number. The thread number is mainly relevant in RAC databases where
there can be multiple threads; one for each instance. The thread number is not necessarily the same as the instance number.
For single instance databases there is only one redo log thread at any time.

Redo Log Groups
A redo thread consists of two or more redo log groups.

Each redo log group contains one or more physical redo log files known as members. Multiple members are configured to provide
protection against media failure (mirroring). All members within a redo log group should be identical at any time.

Each redo log group has a status. Possible status values include UNUSED, CURRENT, ACTIVE and INACTIVE. Initially redo log
groups are UNUSED. Only one redo log group can be CURRENT at any time. Following a log switch, redo log group continues to be
ACTIVE until a checkpoint has completed. Thereafter the redo log group becomes INACTIVE until it is reused by the LGWR background process.

Log Switches
Log switches occur when the online redo log becomes full. Alternatively log switches can be triggered externally by commands such as:

ALTER SYSTEM SWITCH LOGFILE;

When a log switch occurs, the sequence number is incremented and redo continues to be written to the next
file in the sequence. If archive logging is enabled, then following a low switch the completed online redo log will be copied to the archive
log destination(s) either by the ARCH background process or the LNSn background process depending on the configuration.


Tuesday, September 3, 2013

ETL Vs ELT - Explanation


Very Nice explanation of the terms ETL and ELT...

http://blog.performancearchitects.com/wp/2013/06/13/etl-vs-elt-whats-the-difference/

- credit goes to the original creator of the content.