Progress
Database Administration
Guide and Reference


Copying a Database

To copy a source database to a target database, use one of the following:

These utilities copy not only the contents of a database but the database structure as well. Consequently, a target database must contain the same physical structure as the source database. For example, it must have the same number of storage areas, records, blocks, and block size.

NOTE: Do not use an operating system utility to copy a Progress database.

For more information about administration utilities, such as PROCOPY and PRODB, see Database Administration Utilities."

EXAMPLE

Use the PROCOPY utility to copy an existing database. For example, to copy the Sports2000 database to a database named mysports2000, enter the following:

procopy Sports2000 mysports2000 

PROCOPY supports storage areas. Therefore, if a target database exists, it must contain at a minimum the same type and number of storage areas and same extent types as the source database. However, the number of extents in the storage areas of the target database do not need to match the number of extents in the source database. Progress attempts to extend the existing extents in the target database to accommodate the possible increase in size.

If a target database does not exist, PROCOPY creates one using an existing structure description (ST) file in the target database directory. If an ST file does not exist, PROCOPY creates the target database using the structure of the source database and places all of the extents in the same directory as the target database structure (DB) file, even when the source database resides in multiple directories.

PROCOPY Uses Absolute Pathnames

When you use the PROCOPY utility, the target database you create always has an absolute pathname regardless of the pathname convention used by the source database. For more information on absolute pathnames, see the "Relative- and Absolute-path Databases" section in The Progress Database."

For example, if you use PROCOPY to create a database, name it example2, and use a relative path database such as sports2000 as the source database, example2 will have an absolute pathname even though the source database, sports2000, uses a relative pathname. Use PROSTRCT LIST to verify the absolute pathname of your target database. For example:

procopy sports2000 example2 
prostrct list example2 

In the following sample output of the PROSTRCT LIST utility, note the absolute pathname of the database, example2.db:

Area Name: Control Area, Type6, BlockSize 1024, Extents 1, Records/Block32 
   Ext # 1, Type VARIABLE, Size 0, Name: /usr1/wrk/example2.db 
Area Name: Primary Recovery Area, Type3, BlockSize 8192, Extents 1 
   Ext # 1, Type VARIABLE, Size 0, Name: /usr1/wrk/example2.b1 
Area Name: Schema Area, Type6, BlockSize 1024, Extents 1, Records/Block 32 
   Ext # 1, Type VARIABLE, Size 0, Name: /usr1/wrk/example2.d1 
Area Name: Employee, Type6, BlockSize 1024, Extents 2, Records/Block 32 
   Ext # 1, Type FIXED   , Size 320, Name: /usr1/wrk/example2_7.d1 
   Ext # 2, Type VARIABLE, Size 0, Name: /usr1/wrk/example2_7.d2 
Area Name: Inventory, Type6, BlockSize 1024, Extents 2, Records/Block 32 
   Ext # 1, Type FIXED   , Size 608, Name: /usr1/wrk/example2_8.d1 
   Ext # 2, Type VARIABLE, Size 0, Name: /usr1/wrk/example2_8.d2 
Area Name: Cust_Data, Type6, BlockSize 1024, Extents 2, Records/Block 32 
   Ext # 1, Type FIXED   , Size 320, Name: /usr1/wrk/example2_9.d1 
   Ext # 2, Type VARIABLE, Size 0, Name: /usr1/wrk/example2_9.d2 
Area Name: Cust_Index, Type6, BlockSize 1024, Extents 2, Records/Block 32 
   Ext # 1, Type FIXED   , Size 320, Name: /usr1/wrk/example2_10.d1 
   Ext # 2, Type VARIABLE, Size 0, Name: /usr1/wrk/example2_10.d2 
Area Name: Order, Type6, BlockSize 1024, Extents 2, Records/Block 32 
   Ext # 1, Type FIXED   , Size 1280, Name: /usr1/wrk/example2_11.d1 
   Ext # 2, Type VARIABLE, Size 0, Name: /usr1/wrk/example2_11.d2 


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095