Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • How to sort list of files on basis of their sizes. Linux/Unix
  • scripts to take listener.log backup Linux/Unix
  • block_ident.sql Oracle
  • Convert multiple rows to single column Oracle
  • set_env_dba Linux/Unix
  • Oracle Connections expire_time and firewall Oracle
  • default permission on ~/.ssh/authorized_keys2 or authorized_keys Linux/Unix
  • create PLAN_TABLE command. Oracle
  • Find sort details from Db find_sort.sql Oracle
  • Index Range Scan Oracle
  • Temporary Tablespsace Temp tablespace behaviour Oracle
  • Good Link from metalink 1 Oracle
  • TOP-N Sql to find Nth max or Top N rows Oracle
  • before_trunc.sql Before Truncate table needs to execute following: Oracle
  • Roles and Stored Object behaviour 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

  • Oracle Release Explaination Oracle
  • Test Case for Inserting Multiple (2.3 Million rows in 26 Seconds) Oracle
  • Adding or Dropping Online Redo Log Files When Physical Standby in place Oracle
  • Privilege to describe the table. Oracle
  • get_aix_vmstat.ksh Oracle
  • find_err.sql for finding errors from dba_errors. 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
  • 751131.1 New Article Error 2819 While Requesting a Systemstate Dump Oracle
  • Find_table_size.sql Oracle
  • All Hints for Oracle Databases Oracle
  • How can I tell if ASO is installed ? Oracle
  • Guide to Linux System Command Mastery Linux/Unix
  • How to set Processes Parameter Oracle
  • get_ratio.sql get the ratio of users from v$session and this uses CASE-WHEN-THEN clause Oracle
  • Good Link from metalink 1 Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme