Visit Counter

Tuesday, June 5, 2012

Unix Script for Copy Files to another Directory




root@test-server # cat mvfile.sh


SRCE_DIR=${HOME}/oradat/ssdb/archive1
DEST_DIR=${HOME}/backup/archive1

cd ${SRCE_DIR}

for FILE in `ls -1A *.dbf`
do

  if [ ! -f ${DEST_DIR}/${FILE} ]
  then
    echo 'Transferring file: '${FILE}
    cp "${FILE}" "${DEST_DIR}/${FILE}"
   
echo 'Transfer completed.'
  else
    echo 'The file: '${FILE}' already exists in '${DEST_DIR}'.'
  fi
done
root@test-server #

Saturday, June 2, 2012

Oracle Database Point In Time Recovery
















Database point-in-time recovery (DBPITR) restores the database from backups prior to the target time
for recovery, then use incremental backups and redo to roll the database forward to the target time.





Recover Archive Redo Logs Files



Catalog the missing archives to the controlfile as follow.


RMAN> catalog archivelog '/ora_dat/arc/1_14372_694624922';


RMAN> catalog start with '/ora_dat/arc' noprompt;


RMAN> list archivelog from sequence 14372 until sequence 14446;


RMAN>  run
{
set until sequence 14446;
recover database;
}

RMAN>

SQL> shutdown immediate;

SQL> alter database open resetlogs;

SQL>