输入:表空间名字 输出:表空间下的一个文件即退出 /tmp/1.sql select name from v$database; set serveroutput on; declare i1 varchar2(100); i2 varchar2(50); i3 number(16); begin for i in (select distinct(tablespace_name) name from dba_data_files) loop select max(file_name) into i1 from dba_data_files where tablespace_name=i.name; select tablespace_name,bytes/1024/1024 into i2,i3 from dba_data_files where file_name=i1; dbms_output.put_line(i1); dbms_output.put_line(i2); dbms_output.put_line(i3); dbms_output.put_line(‘-------‘); end loop; end; /
时间: 2024-10-12 08:23:35