Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Rman Notes -1 Oracle
  • 10g RAC: Troubleshooting CRS Root.sh Problems Oracle
  • Identical Dblink Issue… Oracle
  • Find_planinfo.sql Oracle
  • Absolute file number and relative file number Oracle
  • checking connectivity between two servers Linux/Unix
  • pvm_pre_change.sql Oracle
  • In Addition to previous note, following grants needed on PERFSTAT user. Oracle
  • note id 373303.1 Linux/Unix
  • Oracle GoldenGate lag monitoring shell script Linux/Unix
  • find_log_switch.sql Find log switches in graphical manner Oracle
  • Changing Instance Name ( No DB_NAME) Oracle
  • Another Tuning Article for subheap of shared pool Oracle
  • Removing first line Linux/Unix
  • Query to Generate aggregate on every 30 mins. Oracle

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

  • Find Plan Hash value fphv.sql Oracle
  • How to Modify the statistics collection by MMON for AWR repository Oracle
  • Insert cause enqueue locks Oracle
  • 339939.1 Running Cluster Verification Utility to Diagnose Install Problems Oracle
  • Reclaim temp tablespace for oracle 8, 8i Oracle
  • myfile 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
  • ORA-00064: object is too large to allocate on this O/S during startup Oracle
  • Absolute file number and relative file number Oracle
  • find_cons.sql Oracle
  • good note for shared pool tunnig Oracle
  • All About Trace Fils Oracle
  • Search and Replace vi editor command. Linux/Unix
  • Space padding in korn shell Linux/Unix
  • fdisk -l explaination about Primary-Logical-Extended Partitions Linux/Unix

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme