Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • CPU speed on Linux Linux/Unix
  • Privileges Required to Create Procedures and Functions that uses objects from other schema. Oracle
  • Transfer SQL Profiles from One database to other database. Oracle
  • sbind.sql Find Bind variable from sql_id sqlid Oracle
  • Display the top 5 salaries for each department using single SQL Oracle
  • How do I get Oracle to automatically start when my server boots up? Oracle
  • OPENING A STANDBY DATABASE IN READ-ONLY MODE Oracle
  • Adding addidional hard drive and attach it to a linux box. Linux/Unix
  • How to set Processes Parameter Oracle
  • arch_configUOCIOTTO.ora Oracle
  • How to connect to Oracle Database with Wallet with Python. Oracle
  • Best approach for Oracle database patching sequence to latest/required patchset along with CPU/PSU/any-other-one-off patch ID 865255.1 Oracle
  • fkwoind.sql fkwoindex.sql Oracle
  • Very clear article about oracle dataguard Oracle
  • adding new line after specific pattern using sed Linux/Unix

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

  • Restoring a user’s original password 1051962.101 Oracle
  • Drop all SPM baselines for SQL handle Oracle
  • How to find password change date for user Oracle
  • SYSOPER Mystery Oracle
  • export import with parameter file. Oracle
  • Oracle Connections expire_time and firewall 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
  • Load testing on Oracle 19C RAC with HammerDB Oracle
  • Processes parameter and its dependencies on OS kernel parameters Linux/Unix
  • find_du.ksh to find # of files, their sizes in current folder and its subdolder Linux/Unix
  • alter database backup controlfile to trace Oracle
  • To see mem usage and CPU usage system wide. Linux/Unix
  • process id based files and processes Linux/Unix
  • Some useful Unix Commands Linux/Unix
  • How to find the real execution plan and binds used in that explain plan in Oracle 10g?? Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme