Before a foreign copy can be generated for individual spaces or from the entire database, the SESAM/SQL system administrator must close the spaces or the database logically or physically in the DBH.
You can close a space or a database in one of the following ways:
close the spaces of the database logically with the administration statement PREPARE-FOREIGN-COPY
If you logically close the spaces of a database using the administration statement PREPARE-FOREIGN-COPY then the spaces update is interrupted by means of a transaction lock and the buffer contents are written to a file. However, the files remain open in SESAM/SQL. No update is possible until the foreign copy has been completed. This is achieved by issuing the administration statement within a lock sequence. The transaction lock that prevents updates is then retained until the end of the lock sequence.
The administration statement PREPARE-FOREIGN-COPY allows you to logically close the whole database or individual user spaces. The spaces addressed with a PREPARE-FOREIGN-COPY form a space set and have the same backup time. PREPARE-FOREIGN-COPY also allows you to enable logging for the specified user spaces.
If you close the database only logically then you can only generate a foreign copy using tools that are suitable for backing up open files. This includes additional mirror unit division. In contrast, the BS2000 command COPY-FILE is only possible if the database or space has previously been closed.
close the space physically with the administration statement CLOSE-SPACE
Although CLOSE-SPACE physically closes a space, it does not protect it against further accesses. To achieve access protection, you must issue the administration statement within a lock sequence.
close the database physically with the administration statement SET-SQL-DB-CATALOG-STATUS ... STATUS=FREE or with the administration statement PREPARE-FOREIGN-COPY ... CLOSE=YES
After the database has been closed physically, foreign copies are also possible which require the database files to be physically closed (e.g. SNAPs).
shut down the DBH with the administration statement STOP-DBH
The precise syntax and functions of the individual statements are described in detail in the “Database Operation” manual.
When you close the database, restart information for the applying of the modifications to the log files is entered in each space. The restart information contains:
in the case of the catalog space, the CAT-LOG entry in the CAT-REC file up to which changes in the catalog space are present
in the case of user spaces, the associated DA-LOG entry in the catalog table DA_LOGS up to which changes in the spaces are present
A foreign copy of a database must consist of the CAT-REC file, the catalog space and the user spaces.
The space from which the foreign copy is generated may not have the state “recover pending”, “check pending” or “load running”.