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

Make indexes unusable before big insert

Make indexes unusable before doing a big insert, then rebuild them at the end, is faster than insert with indexes in place and no risk of forgetting to recreate a dropped index: create table af ( mycol varchar2(100) ) ; create index af1 on af ( mycol ) ; alter index af1 unusable ; insert […]

Read More Make indexes unusable before big insert
July 30, 2010

2 Comments