...
A depository database (depository) is a long-term archive , that provides time-unlimited archiving values in SQL databases. All values of an object with the option Depository enabled at its configuration , are stored in the depository database. Request A request for the storing into data in the depository database is generated immediately after storing into it in the archive database. So this storing and the storing into the archive database are executed almost in parallel. Unlike the archive database, data from the depository database is not available automatically in online mode and is never deleted. Online accessing access to the data from depository databases is allowed after their mounting into the system (which can be, in some cases, automatic).
Depository databases are available on Sybase, Oracle, and PostgreSQL platforms, and their features depend on the possibilities of the respective platforms. For the Microsoft SQL Server platform, resp. Microsoft Desktop Engine (MSDE) platform and depository databases are not implemented.
...
| Zahrnúť stránku | ||||
|---|---|---|---|---|
|
| Zahrnúť stránku | |||
|---|---|---|---|
|
...
A depository database is implemented as an independent database. Names of depository databases are defined by the configuration parameter PG_TrezorName0.
Similarly to Sybase, the configuration of the process D2000 Archiv contains a configured time period TrezorPeriod, during which the process writes data to one depository database. When this period elapses, the database is released and the process starts storing values into a new database. The released database is available for storing delayed data for a given time (configuration parameter TrezorCompressTime). After expiration of this time, a default read-only access is configured for the database (ALTER DATABASE APLIKACIA_TREZOR_#ID# SET default_transaction_read_only = true) and then if value of parameter TrezorCompressOffline=1, access to depository database is forbidden (update pg_database set datallowconn = false where datname = 'APLIKACIA_TREZOR_#ID#'). After disconnecting a depository database, it is possible to run an external program - its name and path are defined by the parameter TrezorPostCompressCmd and its parameters are defined by the parameter TrezorPostCompressPar.
This program can for example move and compress a disconnected depository database or create a dump of read-only depository database via the PostgreSQL utility pg_dump.
Note 1: In order for a database user dba (used by D2000 Archiv to connect to PostgreSQL server), to create and disconnect the databases, it is recommended to grant the dba user a superuser privilege ( ALTER ROLE dba WITH SUPERUSER; ).
Note 2: As every depository database (resp. every depository database segment) is a separate database, which is accessed by the D2000 Archiv via a separate database connection, it is necessary to configure the PostgreSQL server to permit a sufficient number of connections (parameter max_connections), for D2000 Archiv to open a connection to all mounted depository databases.
Note 3: In order for the dba user to be able to create dep;ository databases, it is necessary to give him superuser rights. This can be done from D2SMC from the archive context menu:
...
The depository database on the PostgreSQL platform supports also depository database segments (similarly to the Oracle platform). The depository database segment is a separate depository database, several of which can be created and filled in parallel. Each historical value is stored in one segment, the number of which is specified by the parameter Depository segment in the historical value configuration.
The number of segments created by the D2000 Archiv process is specified by the parameter TrezorCountSegments in the Windows registry. Historical values with the parameter depository segment higher than the value of the parameter TrezorCountSegments are to be stored in zero depository segment (it is the segment that is also created when depository database segments are disabled).
The name of the database representing depository segment 0 is specified by configuration parameter PG_TrezorName0, and names of databases representing depository segments 1..N are specified by configuration parameter PG_TrezorName.
The main purpose of depository database segments is the creation of several smaller depository databases so that reading one historical value for a long time interval requires less disk space (because only specific segments containing that historical value need to be mounted) - compared to mounting all non-segmented depository databases for a required time interval.
...
|
| Zahrnúť stránku | ||||
|---|---|---|---|---|
|
...
- H - hour
- D - day
- W - week
- M - month.
Note: Setting the parameter either to an empty value or to 0H disables the functionality of depository databases.
...
- #ID# - is replaced by depository database ID (e.g. 5).
- #OID# - is replaced by OID (object identifier) of the depository database (OID is related to the name of the directory containing the respective database inside PostgreSQL tablespace).
- #OID0#, #OID1#, #OID2#, etc - is replaced by OIDs (object identifiers) of databases representing respective depository database segments 0, 1, 2, etc.
- #TREZOR# - is replaced by the depository database name (e.g. Test_TREZOR_5).
- #TREZOR0#, #TREZOR1#, #TREZOR2#, etc - is replaced by the database name representing the respective depository database segments.
An example of a batch file used to perform a depository database maintenance and export as well as the export of trezors table located in the archive database MyApp.Archiv. The batch file requires as a parameter the name of the depository database, which can be provided by setting the TrezorPostCompressPar parameter to value #TREZOR#.
...
Example of an equivalent batch file for Linux:
...
