-
Hi guys!
Do me a favour remind me undocumented command to coalesce free extents in version 7.2.
Sergey.
-
alter tablespace <tablespace_name> coalesce;
Ac
-
Sorry
Alter tablespace tablespace_name coalesce;
Ac
-
Thanks. I got it. It works on since version 7.3...
Actually it's the following script:
-------------------------------------------------
set serveroutput on
DECLARE
tsid number;
cnt number;
lev number;
dummy integer;
cur integer;
nothing boolean := TRUE;
cursor contig is
select a.ts#, count(*)
from sys.fet$ a, sys.fet$ b
where a.ts#=b.ts#
and a.file#=b.file#
and (a.block#+a.length)=b.block#
group by a.ts#;
begin
open contig;
while TRUE LOOP
fetch contig into tsid, cnt;
exit when contig%NOTFOUND;
nothing:= FALSE;
lev := power(2,16)*cnt + tsid;
if (lev < 0) or (lev > 4294967296) then
raise INVALID_NUMBER;
end if;
cur:= dbms_sql.open_cursor;
dbms_sql.parse(cur, 'alter session set events
''immediate trace name coalesce level '||lev|| ' ''', dbms_sql.v7);
dummy:= dbms_sql.execute(cur);
dbms_sql.close_cursor(cur);
dbms_output.put_line('Tablespace '||tsid||' -- coalesced '||cnt||
' extents.');
end loop;
close contig;
if (nothing) then
dbms_output.put_line('Nothing to coalesce!');
end if;
end;
/
---------------------------------------
Sergey.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|