Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • ORA-01220 Oracle
  • FGA Part-I Oracle
  • Global Unique Identifier Generation in Oracle 9.2 SYS_GUID() Oracle
  • find_string_in_database.sql Oracle
  • How do I get Oracle to automatically start when my server boots up? Oracle
  • database trigger failing 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
  • pvm_metric.sql for gathering report from vmstat tables Oracle
  • Adding a new disk and mount it automatically. on VMWARE LINUX Linux/Unix
  • To find explain plan for a statement that occurred in past. Oracle
  • Oracle 11g Training on 29JAN1010 Oracle
  • Rman Notes -1 Oracle
  • Temporary Tablespsace Temp tablespace behaviour Oracle
  • TOP-N Sql to find Nth max or Top N rows Oracle
  • replacing ^M character when passing files from Windows to Unix Linux/Unix

cp_filesystem.sql

Posted on 15-Sep-2009 By Admin No Comments on cp_filesystem.sql

exec dbms_output.enable(10000);

set lines 130 pages 1000

set serveroutput on size 1000000

declare

cursor c1 is

select substr(name,1,61) complete_filename, bytes/(1024) KB,

substr(name, instr(name, ‘/’, -1)+1) only_filename

from v$datafile order by file#;

threshold_kb number(10) := 94000000 ;

size_counter number := 0;

mountpoint_counter number := 1;

mountpoint_prefix varchar2(10) := ‘/800t’;

common_mountpoint_prefix varchar2(15) := ‘/oradata/800T/’;

target_filename varchar2(61);

begin

for cur in c1 loop

if size_counter >= threshold_kb then

dbms_output.put_line (‘*************** Mountpoint ‘ || mountpoint_counter || ‘ Size reached ‘ || size_counter);

size_counter := 0;

mountpoint_counter := mountpoint_counter + 1;

end if;

select mountpoint_prefix || mountpoint_counter || common_mountpoint_prefix || cur.only_filename

into target_filename

from dual;

dbms_output.put_line(‘ panther1:’ || target_filename );

— dbms_output.put_line(‘scp -p ‘ || cur.complete_filename || ‘ 127.0.0.1:’ || target_filename || ‘;’);

— dbms_output.put_line(‘cp -p ‘ || cur.complete_filename || ‘ panther1:’ || target_filename || ‘;’);

size_counter := size_counter + cur.KB;

end loop;

dbms_output.put_line (‘*************** Mountpoint ‘ || mountpoint_counter || ‘ Size reached ‘ || size_counter);

end;

/

Oracle, SQL scripts

Post navigation

Previous Post: Caching sequence in Memory
Next Post: To see how much time or progress of long transaction

Related Posts

  • Updated LCK.SQL file. Oracle
  • Good notes on Oracle Events Oracle
  • AWR license Oracle
  • SCRIPT TO LIST RECURSIVE DEPENDENCY BETWEEN OBJECTS UTLDTREE.sql Oracle
  • pvmehta.com SQL scripts
    Find which sessions is accessing object that prevent your session to have exclusive locks in Oracle Oracle
  • Find nth max and min. Oracle

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 (393)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (0)
  • 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

  • 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
  • V$INSTANCE of Oracle in MYSQL24-Jul-2025
  • Day to day MYSQL DBA operations (Compared with Oracle DBA)24-Jul-2025

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Establishing trusted relationship between dbmonitor( central monitoring) and monitoring targets. Linux/Unix
  • default permission on ~/.ssh/authorized_keys2 or authorized_keys Linux/Unix
  • run this before doing any dbchange pvm_pre_change.sql Oracle
  • database trigger failing Oracle
  • This is from Temi Oracle
  • findx.sql /* Find Indexes on specified USER.TABLE_NAME */ Oracle
  • Read CSV file using PySpark Python/PySpark
  • find the files that are 1 day old. Linux/Unix

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme