cancel
Showing results for 
Search instead for 
Did you mean: 

How to get database size in DB6

ladislav_rydzyk
Explorer
0 Kudos

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

Thank you.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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

ladislav_rydzyk
Explorer
0 Kudos

thank you for your answer.

you said:

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

so, when I need to get database size from DB6 database, is it okay to use GET_DBSIZE_INFO method for db2?

could you please give me an example of ABAP code?

thank you very much

former_member188883
Active Contributor
0 Kudos

Hi,

You can use function module DB02_GET_MAIN_SCREEN_DB2

Field TBSIZE should give you database size.

Hope this helps.

Regards,

Deepak Kori

ladislav_rydzyk
Explorer
0 Kudos

Thank you for the answer, but even your FM doesn't work. All output values from this FM are zeros.

Well, I will probably have to debug TX DB02 .

ladislav_rydzyk
Explorer
0 Kudos

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.

Former Member
0 Kudos