search cancel

View - How do you Allocate and Copy a Database?

book

Article ID: 241789

calendar_today

Updated On:

Products

View

Issue/Introduction

I have the following View database extents created:  

 SAR.SYSTEM1.SARDBASE.D0000001 
 SAR.SYSTEM1.SARDBASE.D0000002 
 SAR.SYSTEM1.SARDBASE.I0000001 
 SAR.SYSTEM1.SARDBASE.I0000002 
 SAR.SYSTEM1.SARDBASE.I0000003 

I have reviewed an example of SARDBASE COPY as follows:

NAME SAR.SYSTEM1                       
RENAME SAR.OLDSYS1                     

NAME SAR.SYSTEM1                       
ADDDS UNIT=3390 VOL=SAR001 CYL=50 INDEX
ADDDS UNIT=3390 VOL=SAR002 CYL=600 DATA
COPY SAR.OLDSYS1 

How does View know what database extents to copy?

How does View associate the D000001, D000002, and I000001-3  extents to do the copy to?

Environment

Release : 14.0

Component : View

Resolution

A copy of a View database can be done the following ways:

 . An allocation of a new, empty database, followed by a run of SARDBASE COPY
 . An allocation of a new, empty database, followed by runs of SARDBASE UNLOAD and LOAD

Note: SARDBASE COPY works the same as SARDBASE UNLOAD/LOAD. 

Once database extents are created (I0000001, I0000002, D0000001, D0000002, etc.), they are considered as part of the cohesive whole of the database, and no longer have any individual characteristics. 

In a SARDBASE UNLOAD, the database is written to a physical-sequential file. 

In a SARDBASE LOAD, the allocated database is populated with the data from the physical-sequential file, and is scattered throughout the database, for performance purposes. 

With that, for example, the D0000001 extent of a source database will not be the same as the D0000001 extent of the target database. 

Here are the steps used in a SARDBASE RENAME/COPY:

 . NAME SAR.SYSTEM1                       
 . RENAME SAR.OLDSYS1  (Rename "to")

                  
 . NAME SAR.SYSTEM1                       
 . ADDDS UNIT=3390 VOL=SAR001 CYL=50 INDEX
 . ADDDS UNIT=3390 VOL=SAR002 CYL=600 DATA

 . COPY SAR.OLDSYS1  (Copy "from") 

In the above:

 . The source View database is renamed to another name. 
 . A new database is allocated. 
 . The new database is populated with the content from the renamed database. 

Note: If a SARDBASE COPY is being run to decrease the size of a database (from 3 extents to 2 extents), the extents would be similar in any way.