How can I run a command to find the total database space and the remaining database space? The dbinfo command doesn't seem to have the information I am looking for.

asked 11 Sep, 16:27

solomond's gravatar image

solomond
3116
accept rate: 0%


You can do-it-yourself...

SELECT
CAST ( DB_PROPERTY ( 'PageSize'  ) AS INTEGER ) AS PageSize,
CAST ( DB_PROPERTY ( 'FileSize'  ) AS BIGINT ) AS FileSize,
CAST ( DB_PROPERTY ( 'FreePages' ) AS INTEGER ) AS FreePages,
CAST ( ( PageSize * FileSize ) / 1024.0 / 1024.0 AS DECIMAL ( 11, 1 ) ) AS FileMB,
CAST ( ( PageSize * FreePages ) / 1024.0 / 1024.0 AS DECIMAL ( 11, 1 ) )  AS FreeMB,
CAST ( ( ( FileSize - FreePages ) * 100.0 ) / FileSize AS DECIMAL ( 11, 1 ) )  AS UsedPercent;

   PageSize             FileSize   FreePages        FileMB        FreeMB   UsedPercent 
----------- -------------------- ----------- ------------- ------------- ------------- 
       4096              1650235      235264        6446.2         919.0          85.7 

or let Foxhound monitor the numbers...

alt text

permanent link

answered 12 Sep, 16:55

Breck%20Carter's gravatar image

Breck Carter
27.0k444614889
accept rate: 21%

Are you using dbinfo -u.

That output is very detailed about number of pages - used and free, usage percentages by table for table and index pages.

Here is an example dbinfo -u output. If it is not sufficient for your needs, can you describe what other information is needed:

SQL Anywhere Information Utility Version 17.0.8.4003
Database  : c:\sa\sa17\samples\demo.db
Log file  : c:\sa\sa17\samples\demo.log
Free pages: 565275
Page size : 4096

     Table   Table            Index           Percent  Name
      id     Pages    %used   Pages    %used  of File
     -----  --------  -----  --------  -----  -------  ----
         1        11  ( 84)        10  ( 44)      0    ISYSTAB
...
      3008         1  (  3)         2  (  9)      0    Departments
            ========         ========
Total:           355 table +      496 index + 565275 free + 0 bit map + 162 other = 566288 pages
permanent link

answered 11 Sep, 20:58

Chris%20Keating's gravatar image

Chris Keating
3.2k1956
accept rate: 29%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×6
×2

question asked: 11 Sep, 16:27

question was seen: 133 times

last updated: 12 Sep, 16:55