Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2009
    Posts
    13

    Unanswered: Space information for a given Table.

    Hi All,

    I am using Sybase IQ/12.6.0/070611/P/ESD 10/Sun_svr4/OS 5.8/64bit/2007-06-11 03:03:38 version of Sybase.

    Can someone let me know how to get the space information of given table.

    I am using UNIX. I need a query which will give me Total allocated space, Used Space & Free Space for a given table. So that i can compare it with incoming file & then start loading it.

    Basically i am Oracle guy, & does not know much about sybase.

    Thanks for you help.

    Regards,
    ACE

  2. #2
    Join Date
    Sep 2003
    Location
    Switzerland
    Posts
    443
    Have a look at Adaptive Server IQ Reference Manual

    exec dbo.sp_iqtablesize <table>

    Theres no free space at the table level. Its what you have in the Main.

  3. #3
    Join Date
    Mar 2009
    Posts
    13
    Hi trvishi,

    Thanks for the information. My problem is there is no procedure which gives me desired output. If someone has the handy procedure or query which gives all required information including Total allocated space, used space & free space for a given table, i am highly appriciate.

    Thanks for your understanding.

    Regards,
    Amit

  4. #4
    Join Date
    Sep 2003
    Location
    Switzerland
    Posts
    443
    You can just get the code from sp_iqtablesize and change how you want to I guess.

    <code>
    ALTER PROCEDURE "dbo"."sp_iqtablesize"(in tablename char(128))
    result(Ownername varchar(128),Tablename varchar(128),Columns char(20),KBytes char(20),Pages char(20),CompressedPages char(20),NBlocks char(20))
    begin
    declare local temporary table iq_tablesize_temp(
    Ownername varchar(128) null,
    Tablename varchar(128) null,
    Columns char(20) null,
    KBytes char(20) null,
    Pages char(20) null,
    CompressedPages char(20) null,
    NBlocks char(20) null,
    )
    in SYSTEM on commit preserve rows;execute immediate 'iq utilities main into iq_tablesize_temp table size ' ||
    tablename;
    select Ownername,
    Tablename,
    Columns,
    KBytes,
    Pages,
    CompressedPages,
    NBlocks from
    iq_tablesize_temp;
    drop table iq_tablesize_temp
    end
    </code>

  5. #5
    Join Date
    Mar 2009
    Posts
    1
    trvishi,

    I'm having trouble getting the data written out to a file.

    I tried putting the >#D:\file.txt after the last select statement

    I tried doing it as an extract.

    Neither worked.

    Any other ideas?

    Thx,

    Tom

  6. #6
    Join Date
    Mar 2009
    Posts
    13
    I do not know how to do it on Window. But if you are using UNIX then..


    TMPDIR = /var/opt/seql/


    eval isql -b -w999 -SServ_name -Iintfile -UUSER_ID -PPWD <<finis > >${TMPDIR}/a.txt 2>&1
    select * from xyz_table
    go
    finis

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •