DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Coalesce free extents in RDBMS 7.2

  1. #1
    Join Date
    Mar 2000
    Location
    Atlanta, GA,USA
    Posts
    155
    Hi guys!

    Do me a favour remind me undocumented command to coalesce free extents in version 7.2.

    Sergey.

  2. #2
    Join Date
    Nov 2000
    Posts
    178
    alter tablespace <tablespace_name> coalesce;

    Ac

  3. #3
    Join Date
    Nov 2000
    Posts
    178
    Sorry

    Alter tablespace tablespace_name coalesce;

    Ac

  4. #4
    Join Date
    Mar 2000
    Location
    Atlanta, GA,USA
    Posts
    155
    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
  •  


Click Here to Expand Forum to Full Width