Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Transfer SQL Profiles from One database to other database. Oracle
  • For Search and replace unix command. Linux/Unix
  • Search and replace pattern Linux/Unix
  • Sequence Resetting Oracle
  • Find_stale_dr.sql finding stale physical DR.. Oracle
  • Proc Compilation Oracle
  • Library cahe Latches and internal explaination Oracle
  • Reading parameter file and printing Linux/Unix
  • Goldengate Tutorial Oracle
  • OEM-troubleshooting on 20-MAY-08 Oracle
  • Check_recovery.sh program to run sqlplus and return its values remotely. Linux/Unix
  • move_arch_files.ksh /* Good One */ Linux/Unix
  • findinfo.sql (SQL for getting CPU and Active session info) Oracle
  • Single character replacement in Unix Linux/Unix
  • How to check current redo log progress redo_progress.sql Oracle

cold backup scripts to copy locally

Posted on 28-Oct-2009 By Admin No Comments on cold backup scripts to copy locally

==>cat SOX_BACKUP.ksh

#!/usr/bin/ksh

# +————————————————————————

# | Usage : ./SOX_BACKUP.ksh

# | Description : Cold Backup of Database. Automatically starts/stop the DB.

# +————————————————————————

. /export/home/oracle/FLRSTB.env

sqlplus -s /nolog << EOF > /mnt/ORACLEBACKUP/files.log

connect / as sysdba

set term off

set feedback off;

set head off;

set pagesize 150

select name||’ /mnt/ORACLEBACKUP/FLRPRD’ from v$datafile;

exit;

EOF

cat /mnt/ORACLEBACKUP/files.log|grep -v “Connected.” > /mnt/ORACLEBACKUP/files.dat

. /export/home/oracle/FLRSTB.env

sqlplus /nolog << EOF >> /mnt/ORACLEBACKUP/backup.log

connect / as sysdba

shutdown immediate;

exit;

EOF

echo “Backup Copy Started at :- `date` ” >>/mnt/ORACLEBACKUP/backup.log

nohup ./firecp.sh files.dat

echo “Backup Copy Ended at :- `date` ” >>/mnt/ORACLEBACKUP/backup.log

. /export/home/oracle/FLRSTB.env

sqlplus /nolog << EOF >> /mnt/ORACLEBACKUP/backup.log

connect / as sysdba

startup nomount;

alter database mount standby database;

exit;

EOF

oracle@sunrise*FLRSTB-/mnt/ORACLEBACKUP

==>

==>cat firecp.sh

#!/bin/ksh

# +————————————————————————

# | Usage : firescp.sh

# | filename – Flat file containing the operands for cp cmd

# | Description : Submits concurrent cp commands based on number of workers

# +————————————————————————

let WORKERS=5

LOGFILE=/mnt/ORACLEBACKUP/copy_dbfiles.log

while read -u3 CMDLINE

do

SRC_FILE=`echo ${CMDLINE}|awk ‘{print $1}’`

DST_FILE=`echo ${CMDLINE}|awk ‘{print $2}’`

echo “Now copying ${SRC_FILE} to ${DST_FILE}”|tee -a ${LOGFILE}

nohup /usr/bin/cp -p ${SRC_FILE} ${DST_FILE} 1>>${LOGFILE} 2>&1 &

sleep 1

while [[ `ps -ef|grep -v grep|grep “cp -p”|wc -l` -ge ${WORKERS} ]]

do

sleep 10

done

done 3<$1
wait

echo “SOX Copy of FLRPRD database is done”|mailx -s “Copy process done for FLRPRD on sunrise” bnair@1800flowers.com

Linux/Unix, shell

Post navigation

Previous Post: Oracle 10g for solaris 10
Next Post: process id based files and processes

Related Posts

  • Find total file sizes Linux/Unix
  • Reading parameter file and printing Linux/Unix
  • rm_backup_arch_file.ksh Linux/Unix
  • proper cpu stats Linux/Unix
  • process id based files and processes Linux/Unix
  • move_arch_files.ksh /* Good One */ Linux/Unix

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Linux/Unix (149)
  • MYSQL (5)
  • Oracle (392)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (0)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (341)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • SQL Server Vs Oracle Architecture difference25-Jul-2025
  • SQL Server: How to see historical transactions25-Jul-2025
  • SQL Server: How to see current transactions or requests25-Jul-2025
  • T-SQL Vs PL/SQL Syntax25-Jul-2025
  • Check SQL Server edition25-Jul-2025
  • Checking SQL Server Version25-Jul-2025
  • Oracle vs MYSQL Architecture differences (For DBAs)24-Jul-2025
  • V$INSTANCE of Oracle in MYSQL24-Jul-2025
  • Day to day MYSQL DBA operations (Compared with Oracle DBA)24-Jul-2025
  • MYSQL and Oracle Comparison for Oracle DBA24-Jul-2025

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Oracle Release Explaination Oracle
  • get_ratio.sql get the ratio of users from v$session and this uses CASE-WHEN-THEN clause Oracle
  • get_aix_vmstat.ksh Oracle
  • oracle tips… from http://www.bijoos.com/oracle/douknow.htm Oracle
  • remove archfiles only when it is applied to DR rm_archfiles.sh Linux/Unix
  • This is im telling Kishore Oracle
  • Oracle 10g Installation/Applying Patches Tips Oracle
  • Rman Notes -1 Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme