Find delete old files

# Delete files older than 15 minutes find /ORA_DISK/redoarch/ -name ‘arch_*.dbf’ -mmin +15 -delete #Delete files older than 2 days 50 8 * * * find /ORA_DISK/redoarch/ -name ‘arch_*.dbf’ -mtime +2 -delete Old versions of unix find do not have the -delete option, so instead: # Delete files older than 15 minutes find /ORA_DISK/redoarch/ -name […]

Read More Find delete old files
October 29, 2010

RAC alter database archivelog

Switch a RAC database into archivelog mode: srvctl stop database -d dbname startup mount –only one instance alter database archivelog alter database open srvctl start database -d dbname –this will start the remaining instances on the cluster And switch it into noarchivelog mode: srvctl stop database -d dbname startup mount –only one instance alter database […]

Read More RAC alter database archivelog
October 28, 2010

Tivoli Storage Manager simple restore

Sample restore from command line Tivoli Storage Manager. Run as root. ps -ef | grep dsm #here look to see if ‘optfile’ is set cd /mydir dsmc -optfile=/opt/tivoli/tsm/client/ba/bin/dsm-ora.opt tsm> restore /mydir/*.dbf -inactive -pick tsm> 1 #here choose which file number you want tsm> 2 #choose another file if needed tsm> o #o=’ok’ tsm> quit You […]

Read More Tivoli Storage Manager simple restore
October 28, 2010

RMAN set until time recover

run { set until time “to_date(’21-OCT-2010 14:45:00′,’DD-MON-YYYY HH24:MI:SS’)”; restore database ; recover database ; alter database open resetlogs ; } (H/t Stefan Knecht)

Read More RMAN set until time recover
October 22, 2010

One Comment

Move MV from one refresh group into another

select name, refgroup,rname from dba_refresh_children where name in (‘MV1′,’MV2’); exec dbms_refresh.subtract(‘RGOWNER.RG1’, ‘MVOWNER.MV1’) exec dbms_refresh.add(‘RGOWNER.RG2’, ‘MVOWNER.MV1’) List refresh groups with: select rowner, rname, count(*) from dba_refresh_children group by rname, rowner order by 1,2;

Read More Move MV from one refresh group into another
October 22, 2010

Avoiding Mistakes with ITIL

Avoiding Mistakes with ITIL (IT Infrastructure Library) ITIL is best practice advice and guidance. It is a common mistake to take as prescriptive. Needs adapted/customised to be organisation specific. So is not a silver bullet. Not a standard. You cannot be ITIL compliant. You need to adopt and adapt components of ITIL. Decide on the […]

Read More Avoiding Mistakes with ITIL
September 3, 2010

Select out all code refererencing some tables

This allows you to get code listings for all code (procedures, views, materialized views, etc.) that reference particular tables: set long 200000 pages 0 verify off lines 131 feed off column txt format a121 word_wrapped column spoolfile new_value spoolfile noprint spool go.tmp select ‘@2 ‘|| decode(type , ‘MATERIALIZED VIEW’ , ‘MATERIALIZED_VIEW’ , type) ||’ ‘||name||’ […]

Read More Select out all code refererencing some tables
August 26, 2010

mutt email attachment

Send email from unix with attachment, which in this case has been zipped with a password: zip -P mypassword /tmp/myfile.zip myfile.csv mutt -a /tmp/myfile.zip -s “Zipfile Attached” user@email.com < /dev/null

Read More mutt email attachment
July 30, 2010