Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • CTAS with LONG Column for 9i and higher Oracle
  • Temporary tablespace explaination Oracle
  • Exadata Basics Oracle
  • SCRIPT TO LIST RECURSIVE DEPENDENCY BETWEEN OBJECTS UTLDTREE.sql Oracle
  • move_arch_files.ksh Linux/Unix
  • Optimizer SORT Operations Oracle
  • Oracle Standby Database Library Index from Metalink Oracle
  • Trace a SQL session from another session using ORADEBUG Oracle
  • Drop tempfiles from database Oracle
  • Complete Git Tutorial for Beginners GIT
  • 10g oem configuration Oracle
  • 284785.1 How to check RAC Option is currently linked into the Oracle Binary Oracle
  • Find all users who have DML privileges Oracle
  • Histogram Overview Oracle
  • Renaming Oracle Instance Name 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

  • how to find OS block size Oracle
  • CTAS with LONG Column for 7.x and 8 and 8i Oracle
  • sid_wise_cursor.sql find open cursor basis on username or SID Oracle
  • To find explain plan for a statement that occurred in past. Oracle
  • How to find where datafile is created dbf_info.sql Oracle
  • Find all users who have DML privileges Oracle

Leave a Reply Cancel reply

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

Categories

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

Recent Posts

  • Complete Git Tutorial for Beginners25-Dec-2025
  • Postgres DB user and OS user.25-Dec-2025
  • Trace a SQL session from another session using ORADEBUG30-Sep-2025
  • 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

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • handling filenname with space Linux/Unix
  • Add new columns in dataframe Python/PySpark
  • Useful Solaris Commands on 28-SEP-2005 Linux/Unix
  • tuning commmand for cpu, ip and memory stats Linux/Unix
  • scripts to take listener.log backup Linux/Unix
  • default permission on ~/.ssh/authorized_keys2 or authorized_keys Linux/Unix
  • Building Our Own Namespaces with “Create Context” Oracle
  • Database logon trigger issue Oracle

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme