Search code examples
sap-ase

What would cause a compressed database dump to be broken into two stacks (or segments)?


I've been trying determine the uncompressed size of a compressed database dump. I've been able to use the lsize in the dump header information to do this. In my testing I have created an empty test database in the following way:

create database foo on default=100

We are using master as the default. I realize this is not a production-realistic scenario. Then I created a dump of the database like this:

dump database foo to '/var/tmp/foo_compressed_9.dmp' with compression=9

I noticed the header shows there are two segments (pardon if my terminology is wrong):

segmap: 0x00000007 lstart=0 vstart=[vpgdevno=0 vpvpn=61444] lsize=5120 unrsvd=4240
segmap: 0x00000007 lstart=5120 vstart=[vpgdevno=0 vpvpn=68612] lsize=33536 unrsvd=33405

Most dumps I've seen have only one segment (one "segmap:" line in the header). What conditions could cause a dump to have two of them? Could there ever be more than two, and what would cause that?

Thanks


Solution

  • Segmap is related to the devices used by a database.

    In you case, the database foo should have two devices (maybe one for data and another for log) and that's why there are two Segmap.

    You may use the following query to see how many devices are used by database foo:

    select distinct s.name, u.segmap from master..sysusages u
    inner join master..sysdatabases s on u.dbid = s.dbid and s.name = 'foo'