Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Creating a foreign copy with the BS2000 COPY-FILE command

To create a foreign copy using the tools available in BS2000 you must perform the following steps:

  1. The SESAM/SQL system administrator causes the DBH to release the original database by issuing the administration statement SET-SQL-DB-CATALOG-STATUS ... STATUS=FREE (see the “Database Operation” manual).

  2. The database administrator uses the command COPY-FILE to create copies of all space files (i.e. the catalog space and all user spaces and the CAT-REC file) at BS2000 level. The file names of the copies must conform to SESAM/SQL conventions and must have the following form:


    Catalog space

    :catid:user_id.catalog.CATALOG

    User spaces:catid:user_id.catalog.space
    CAT-REC file:catid:user_id.catalog.CAT-REC
    catid is the BS2000 catalog ID.
    user_idis the BS2000 user ID, which must be the same for all copied
    spaces.

    catalog

    is the physical database name of the database duplicate.

    spaceis the name of the copy of a user space. space must be identical for
    the original and the duplicate of each user space.
  3. With the administration statement
    SET-SQL-DB-CATALOG-STATUS ... STATUS=ACTIVE the system administrator adds the original database to the SQL database catalog of the current DBH session again.

You can back up individual user spaces by closing the space with CLOSE SPACE or INTR CLOSE and then using COPY-FILE to perform the backup. To stop SESAM/SQL from immediately reopening the space on an access attempt, the statements should be issued as part of a lock sequence.

The administration statements PREPARE-FOREIGN-COPY and END-FOREIGN-COPY make it possible to cancel any “copy pending” state resulting from a utility statement that preceded the foreign copy. To do this, you should issue the statement
PREPARE-FOREIGN-COPY before step 1 and END-FOREIGN-COPY after step 3.


Sample procedure

In the procedure below a copy of the database is generated using the COPY-FILE command:

/ASSIGN-SYSDTA  TO-FILE=*SYSCMD
/START-SESADM
//START-DBH-ADMINISTRATION ...
//BEGIN-LOCK-SEQUENCE
//PREPARE-FOREIGN-COPY SELECT=*LOGICAL(CATALOG-NAME=...)
//HOLD-PROGRAM
/COPY-FILE ...
/RESUME-PROGRAM
//END-FOREIGN-COPY SELECT=*LOGICAL(CATALOG-NAME=...)
//END-LOCK-SEQUENCE
//END

The copied database files can now be backed up.