We can use the “headeronly” qualifier when reading a dumpfile to extract useful information which we can use to work out what is needed to setup a new database to load the given dump file.
Using following command to read the dumpfile:-
load database header
This would generate a output something like:-
Backup Server session id is: 21. Use this value when executing the 'sp_volchanged' system stored procedure after fulfilling any
volume change request from the Backup Server.
Backup Server: 188.8.131.52: Attempting to open byte stream device: 'compress::…::00'
Backup Server: 184.108.40.206: Dumpfile name '…' section number 1 mounted on byte stream
This is a database dump of database ID 4, name '…' , from …. ASE version: Adaptive Server
Enterprise/16.0/…Backup Server version: Backup Server/…Linux/…64-bit/OPT/.. Database page size is 16384.
Database contains 196608 pages ; checkpoint RID=(Rid pageid = 0xee22; row num = 0x6f); next object ID=1924198874; sort order ID=50,
status=0; charset ID=1.
Database log version=7; database upgrade version=35; database durability=UNDEFINED.
segmap: 0x0000000 7 lstart=0 vstart=[vpgdevno=4 vpvpn=0] lsize= 65536 unrsvd=56117
segmap: 0x0000000 7 lstart=65536 vstart=[vpgdevno=5 vpvpn=0] lsize= 131072 unrsvd=130560
From the output we can get the the database name, database pages count, database page size and that there are mixed data & log segments making up the database
To work out the exact total size of the database, use the following formula:
Database size = number pages * page size
To work out the size of each of the segments in the database we first need to refer to the database page size. To convert the “lsize” in each segmap line into MB we use the following table:
2 KB page size the unit = 512
4 KB page size the unit = 256
8 KB page size the unit = 128
16 KB page size the unit = 64
Segment Size in MB = (lsize/<Unit corresponding to page size>).
To work out what type of segment it is (data, log, or mixed data/log) you refer to the first value on the segmap line:
0x00000003 = data
0x00000004 = log
0x00000007 = mixed data & log
So in the headeronly output, if segmap is 0x00000003 and the lsize is 655360 and the database page size is 64 then the total segment size of the “data” device in MB would be 655360/64 = “10240 MB”