Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • move_arch_files.ksh Linux/Unix
  • My Minimum Tuning Programs Oracle
  • Building Our Own Namespaces with “Create Context” Oracle
  • database trigger failing Oracle
  • OEM-troubleshooting on 20-MAY-08 Oracle
  • Adding a new disk and mount it automatically. on VMWARE LINUX Linux/Unix
  • ORA-3136 Oracle
  • How to Decide upto what level you can decrement your datafile size. ( Shrink Datafile) Oracle
  • Monitor and Trace Unix processes using truss Linux/Unix
  • How to hide author name in WordPress BLOG PHP/MYSQL/Wordpress
  • Multiple listeners Oracle
  • How to check current redo log progress redo_progress.sql Oracle
  • cold backup scripts to copy locally Linux/Unix
  • Oracle 10g for solaris 10 Oracle
  • switchover for primary database Oracle

online_ts_bkup.sql

Posted on 29-Jul-2005 By Admin No Comments on online_ts_bkup.sql

set serveroutput on

execute dbms_output.enable(20000);

declare

cursor c1 is

select distinct tablespace_name

from dba_data_files

order by tablespace_name;

cursor c3 is

select name from v$controlfile

order by name;

cursor c4 is

select member from v$logfile

order by member;

staging_copy_area varchar2(100) := ‘10.201.43.51:/uocdb1/oradata/CIF’;

begin

for cur in c1 loop

dbms_output.put_line (‘alter tablespace ‘ || cur.tablespace_name || ‘ begin backup;’);

declare

cursor c2 is

select file_name

from dba_data_files

where tablespace_name = cur.tablespace_name

order by file_name;

begin

for cur1 in c2 loop

dbms_output.put_line (‘! scp ‘ || cur1.file_name || ‘ ‘ || staging_copy_area );

end loop;

end;

dbms_output.put_line (‘alter tablespace ‘ || cur.tablespace_name || ‘ end backup;’);

end loop;

/********* Binary control file backup **************/

for cur3 in c3 loop

dbms_output.put_line (‘! scp ‘ || cur3.name || ‘ ‘ || staging_copy_area );

end loop;

/********* Binary control file backup **************/

for cur4 in c4 loop

dbms_output.put_line (‘! scp ‘ || cur4.member || ‘ ‘ || staging_copy_area );

end loop;

end;

/

Oracle, SQL scripts

Post navigation

Previous Post: switchlogfile.sh
Next Post: Paste command syntax

Related Posts

  • Rman Notes -1 Oracle
  • How to find password change date for user Oracle
  • Caching sequence in Memory Oracle
  • Restoring a user’s original password 1051962.101 Oracle
  • longtx.sql with the flag whether session is blocking any DML locks or not. Oracle
  • JSON/XML Types in Oracle Oracle

Leave a Reply Cancel reply

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

Categories

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

Recent Posts

  • load SPM baseline from cursor cache05-Jun-2025
  • Drop all SPM baselines for SQL handle05-Jun-2025
  • Load SPM baseline from AWR05-Jun-2025
  • Drop specific SQL plan baseline – spm05-Jun-2025
  • findinfo.sql (SQL for getting CPU and Active session info)27-May-2025
  • SQL Tracker by SID sqltrackerbysid.sql22-Apr-2025
  • How to connect to Oracle Database with Wallet with Python.21-Mar-2025
  • JSON/XML Types in Oracle18-Mar-2025
  • CPU Core related projections12-Mar-2025
  • Exadata Basics10-Dec-2024

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • kill all processes from specific user in solaris. Linux/Unix
  • How to stop OCSSD Daemon Oracle
  • Explain Plan Output 2 Oracle
  • mutex in Oracle 10.2.0.2 or Oracle 10g Oracle
  • Find nth max and min. Oracle
  • to see when crontab is changed. Linux/Unix
  • check_copy_progress.sh Linux/Unix
  • Changing unix system clock when Oracle database is running. Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme