Skip to Content
avatar image
Former Member

How to get database size in DB6

Is there any function module or kind of native SQL that will provide database size for DB6 database system?

Thank you.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Nov 30, 2011 at 03:33 PM
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 30, 2011 at 09:27 PM

    db2 => call GET_DBSIZE_INFO(?,?,?,0)

    Result would look something like below- parameter DATABASESIZE gives the size in bytes.

    Value of output parameters

    -


    Parameter Name : SNAPSHOTTIMESTAMP

    Parameter Value : 2011-11-17-13.42.02.072858

    Parameter Name : DATABASESIZE

    Parameter Value : 1034256545312

    Parameter Name : DATABASECAPACITY

    Parameter Value : -1

    Return Status = 0

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Well, here is the anwer:

      call FM DB6_HIS_OVERVIEW to get the information:

        DATA lt_db6 TYPE STANDARD TABLE OF db6pmdb02.
        FIELD-SYMBOLS:
            <ls_db6> LIKE LINE OF lt_db6.
      
        CALL FUNCTION 'DB6_HIS_OVERVIEW'
      *   EXPORTING
      *     CONNECTION                  =
          TABLES
            it_db6pmdb02                = lt_db6
         EXCEPTIONS
           no_history_found            = 1
           invalid_parameter_set       = 2
           adbc_error                  = 3
           system_error                = 4
           OTHERS                      = 5.
      
        READ TABLE lt_db6 ASSIGNING <ls_db6> INDEX 1.
        IF <ls_db6> IS ASSIGNED.
          cv_size = <ls_db6>-totalkb.
          cv_size = cv_size / 1024.                               "2 get MB
        ENDIF.