Recover RAC database

RAC has to be switched to non-cluster temporarily for the recovery. startup nomount alter system set cluster_database=false scope=spfile sid=’*’ ; shutdown immediate startup mount recover database alter database open ; alter system set cluster_database=true scope=spfile sid=’*’ ; shutdown immediate srvctl start database -d mydb

Read More Recover RAC database
October 29, 2010

Remove a parameter entry from spfile

alter system reset log_archive_start scope=spfile sid=’*’ ; Much better than old versions where you had to temporarily create a pfile, edit that, and load it in as an spfile.

Read More Remove a parameter entry from spfile
October 29, 2010

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