Download DDD Appendix C: File Qualifications

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Microsoft Jet Database Engine wikipedia , lookup

Database model wikipedia , lookup

Clusterpoint wikipedia , lookup

Transcript
Appendix C
File Qualifications
This appendix discusses the file qualifications for the Windows, UNIX, and VMS
operating systems. It begins with a general discussion of file categories, file descriptors,
and file names. Specific discussions for each operating system provide details for file
descriptors, file protection, and file-naming conventions. Each section contains systemspecific examples.
Categories of Database Files
A database resides on a number of files. All of these files must be defined in the
Structural Data Model (SDM). The 4 categories of database files are described below:
Data Files
The actual data records and indexes can be stored in several host system data files. One
of these files is used to hold queued records.
Journal Files
The journal files are used to record each change made to the database and are used to
recover data files and the DDB from media failure.
File Qualifications  695
Definition Database (DDB)
The definition database holds a description of the entire database and also indicates where
all of the other files are located.
File Definitions on Host Systems
Every file has a unique set of attributes which are used to identify, locate, and protect the
file. These attributes are specified in a special format called the file descriptor. One of
the attributes, the file name, uniquely identifies the file.
File Descriptors
The format of the file descriptor (FD) depends on the host system because each system
uses a slightly different set of attributes. Each of the host system file descriptor formats is
discussed in detail in the BASIS Reference manual.
File Names
On every system, the file descriptor for a permanent file contains a filename. The
filename is always required.
696  File Qualifications
Windows
This section describes database files for Windows operating systems.
File Descriptor
For a detailed description of Windows file descriptors, see BASIS Reference, “Windows
System Specifics.”
File Protection
The owner of the database is the user who created the DDB file and its journals. This
user, known as the DBA, should also INITIALIZE the record database. The DBA is then
the owner of all of the database files and has the authority to determine all permissions
(security settings) for other users.
You can view and modify file security by accessing the File Manager and selecting the
file. Once selected, go to the Security menu and select the Permissions option.
If you have permission to view the Security for that file, a dialog box where you can add
users and groups to or remove users and groups from the access list will be displayed.
You can also alter permissions granted to groups, and you can adjust permissions granted
to certain individuals even if they belong to groups that have different levels of
permissions.
For example, in the Windows File manager under the Security menu, you might see that:
Persons designated as:
Have these permissions:
File owner (DBA)
Read, write, and execute (RWX)
DM_PROD
Read, write, and execute (RWX)
System
Read, write, and execute (RWX)
If permissions are set up in the manner shown above, only the DBA and members of the
group can write to or modify the file.
File Qualifications  697
Granting Permissions to the BASIS Kernel
To ensure that the BASIS Kernel can access the files, the Kernel should run under the
username DMPROD. DMPROD (the Kernel) must be part of the DM_PROD group in
order to access the databases. This will allow the Kernel access to the database files
unless and until its file permissions are intentionally changed.
For more information about the use of the Windows Security menu, see your Windows
documentation.
The database files may reside in any directory and be owned by any user. All of the file
descriptors used for the files should be fully qualified.
Database File-Naming Conventions
The file descriptors for your database files should include a meaningful file name
identifying the database. The file name should identify the function of the file. The file
names should also include file numbers and/or version numbers if they are used. The
following file-naming conventions are recommended for use in all database file
definitions.
Note: Generated file descriptors which appear here are in lowercase. However, the file
descriptor can be entered in either upper- or lowercase.
Definition Database files:
Definition Database File:
dbname.ddb
DDB Journal File A:
dbname.dja
DDB Journal File B:
dbname.djb
DDB Journal A Backup Job:
dbname.dbja
DDB Journal B Backup Job:
dbname.dbjb
698  File Qualifications
Record Database files (single file database):
Record Database File:
dbname.rdb
RDB Journal File A:
dbname.rja
RDB Journal File B:
dbname.rjb
RDB Journal A Backup Job:
dbname.rbja
RDB Journal B Backup Job:
dbname.rbjb
RDB Journal File A Copy:
dbname.rjac
RDB Journal File B Copy:
dbname.rjbc
Record Database files (multifile/multiversion database):
Record Database Files:
dbname.rdb_fnn_vnn
RDB Journal File A:
dbname.rja_vnn
RDB Journal File B:
dbname.rjb_vnn
RDB Journal A Backup Job:
dbname.rja_bj_vnn
RDB Journal B Backup Job:
dbname.rjb_bj_vnn
RDB Journal File A Copy:
dbname.rjac_vnn
RDB Journal File B Copy:
dbname.rjbc_vnn
Listed below are some notes regarding the file-naming conventions for Windows:

“fnn” is the file number (1:63) and “vnn” is the version number (0:99).

The “_vnn” is not needed unless versions are being used with the database.

The file descriptor can be entered in either upper- or lowercase.
File Qualifications  699
Examples
1.
2.
For the first example, suppose the TOUR database has one DDB file and one RDB
file. There is only one version of the TOUR database. The following file descriptors
are used:
DDB File:
tour.ddb
DDB Journal File A:
tour.dja
DDB Journal File B:
tour.djb
RDB Files:
tour.rdb
RDB Journal File A:
tour.rja
RDB Journal File B:
tour.rjb
In the next example, suppose the TOUR database has one DDB file and three RDB
files. There are two versions of the TOUR database. The following file descriptors
are used:
DDB File:
tour.ddb
DDB Journal File A:
tour.dja
DDB Journal File B:
tour.djb
DDB Journal A Backup Job File:
tour.dja_bj
DDB Journal B Backup Job File:
tour.djb_bj
RDB File 1, Version 0:
tour.rdb_f01_v00
RDB File 2, Version 0:
tour.rdb_f02_v00
700  File Qualifications
3.
RDB File 3, Version 0:
tour.rdb_f03_v00
RDB Journal File A, Version 0:
tour.rja_v00
RDB Journal File B, Version 0:
tour.rjb_v00
RDB Journal A Backup Job File,
Version 0:
tour.rja_bj_v00
RDB Journal B Backup Job File,
Version 0:
tour.rjb_bj_v00
RDB File 1, Version 1:
tour.rdb_f01_v01
RDB File 2, Version 1:
tour.rdb_f02_v01
RDB File 3, Version 1:
tour.rdb_f03_v01
RDB Journal File A, Version 1:
tour.rja_v01
RDB Journal File B, Version 1:
tour.rjb_v01
RDB Journal A Backup Job File,
Version 1:
tour.rja_bj_v01
RDB Journal B Backup Job File,
Version 1:
tour.rjb_bj_v01
The following are fully qualified pathnames.
'C:\company\master'
'\\myserver\myshare\payroll\master'
4.
The following is a partially qualified path with the current path prefixed to the
beginning.
'payroll\master'
5.
This is a filename with the current path prefixed to the beginning.
'master'
File Qualifications  701
6.
This is a logical name where MASTER is an environment variable.
'%MASTER%'
7.
8.
When the file is to be referenced (e.g., in DMSA), wildcards (*) can be specified to
match any number of characters in the file name or path.
'*.prc'
files ending in .prc
'dept*.prc'
.prc files starting with dept
'tour*'
all files starting with tour
To match a single character in a file name or path, the question mark can be used.
'tour.dj?'
matches both DDB journal files (dja and djb)
UNIX
This section describes database files for the UNIX operating system.
File Descriptor
For a detailed description of UNIX file descriptors, see BASIS Reference, “UNIX System
Specifics.”
File Protection
The owner of the database is the DBA who created the DDB file and its journals. This
DBA should also INITIALIZE the record database. This DBA is then the owner of all of
the database files (since the DBA’s UID matches the UID of the files).
The DMDBA module sets the file protection as:
chmod ug+rwx, o-rwx file_name
which can be changed by the owner of the file. With these protections, only the file’s
owner and members of the file’s group can gain access to the file. To insure that the
BASIS Kernel can access the files, the database group will be the group that the BASIS
702  File Qualifications
Kernel executes under (the Kernel’s GID will match the GID of the files). The DBA who
is the owner of the file need not belong to this group.
The database files may reside in any directory and be owned by any user. All of the file
descriptors used for the files should be fully qualified.
File-Naming Conventions
The file descriptors for your database files should include a meaningful file name
identifying the database. The file name should identify the function of the file. The file
names should also include file numbers and/or version numbers if they are used. The
following file-naming conventions are recommended for use in all database file
definitions.
Note: The uppercase letters show the predefined portions of the file descriptor.
Generated file descriptors are in lowercase.
Definition Database files:
Definition Database File:
DM_dbname/DDB
DDB Journal File A:
DM_dbname/DJA
DDB Journal File B:
DM_dbname/DJB
DDB Journal A Backup Job:
DM_dbname/DJA_BJ
DDB Journal B Backup Job:
DM_dbname/DJB_BJ
File Qualifications  703
Record Database files (single file database):
Record Database File:
DM_dbname/RDB
RDB Journal File A:
DM_dbname/RJA
RDB Journal File B:
DM_dbname/RJB
RDB Journal A Backup Job:
DM_dbname/RJA_BJ
RDB Journal B Backup Job:
DM_dbname/RJB_BJ
RDB Journal File A Copy:
DM_dbname/RJAC
RDB Journal File B Copy:
DM_dbname/RJBC
704  File Qualifications
Record Database files (multi-file/multi-version database):
Record Database Files:
DM_dbname/RDB_Fnn_Vvv
RDB Journal File A:
DM_dbname/RJA_Vvv
RDB Journal File B:
DM_dbname/RJB_Vvv
RDB Journal A Backup Job:
DM_dbname/RJA_BJ_Vvv
RDB Journal B Backup Job:
DM_dbname/RJB_BJ_Vvv
RDB Journal File A Copy:
DM_dbname/RJAC_Vvv
RDB Journal File B Copy:
DM_dbname/RJBC_Vvv
Listed below are some notes regarding the file-naming conventions for UNIX:

“nn” is the file number (1:63) and “vv” is the version number (0:99)

The “_Vvv” is not needed unless versions are being used with the database.

This recommendation requires the directory “DM_dbname” to exist and places all
files in that directory. For this reason, you should specify a high level directory for
the DATABASE and JOURNAL_DIRECTORY parameters of the
GENERATE_SDM.

The entire file descriptor should always be entered in lowercase.
File Qualifications  705
Examples
1.
2.
For the first example, suppose the TOUR database has one DDB file and one RDB
file. There is only one version of the TOUR database. The following file descriptors
are used:
DDB File:
dm_tour/ddb
DDB Journal File A:
dm_tour/dja
DDB Journal File B:
dm_tour/djb
RDB Files:
dm_tour/rdb
RDB Journal File A:
dm_tour/rja
RDB Journal File B:
dm_tour/rjb
In the next example, suppose the TOUR database has one DDB file and three RDB
files. There are two versions of the TOUR database. The following file descriptors
are used:
DDB File:
dm_tour/ddb
DDB Journal File A:
dm_tour/dja
DDB Journal File B:
dm_tour/djb
DDB Journal A Backup Job File:
dm_tour/dja_bj
DDB Journal B Backup Job File:
dm_tour/djb_bj
RDB File 1, Version 0:
dm_tour/rdb_f01
RDB File 2, Version 0:
dm_tour/rdb_f02
RDB File 3, Version 0:
dm_tour/rdb_f03
706  File Qualifications
3.
RDB Journal File A, Version 0:
dm_tour/rja
RDB Journal File B, Version 0:
dm_tour/rjb
RDB Journal A Backup Job File,
Version 0:
dm_tour/rja_bj
RDB Journal B Backup Job File,
Version 0:
dm_tour/rjb_bj
RDB File 1, Version 1:
dm_tour/rdb_f01_v01
RDB File 2, Version 1:
dm_tour/rdb_f02_v01
RDB File 3, Version 1:
dm_tour/rdb_f03_v01
RDB Journal File A, Version 1:
dm_tour/rja_v01
RDB Journal File B, Version 1:
dm_tour/rjb_v01
RDB Journal A Backup Job File,
Version 1:
dm_tour/rja_bj_v01
RDB Journal B Backup Job File,
Version 1:
dm_tour/rjb_bj_v01
The following are fully qualified pathnames.
'/company/master'
'/company/payroll/master'
4.
The following is a partially qualified path with the current path prefixed to the
beginning.
'payroll/master'
5.
This is a filename with the current path prefixed to the beginning.
'master'
6.
This is a logical name where MASTER is an environment variable.
'$MASTER'
File Qualifications  707
7.
8.
When the file is to be referenced (e.g., in DMSA), wildcards (*) can be specified to
match any number of characters in the file name or path.
'*.prc'
files ending in .prc
'dept*.prc'
.prc files starting with dept
'tour*'
all files starting with tour
To match a single character in a file name or path, the question mark can be used.
'dm_tour/dj?'
matches both DDB journal files (dja and djb)
VMS
This section describes database files for the VMS operating system.
File Descriptor
For a detailed description of VMS file descriptors, see BASIS Reference, “VMS System
Specifics.”
File Protection
The owner of a database is the database administrator (DBA) who creates the database
definition (DDB) file and its journal files. The same DBA should also INITIALIZE the
Record Database. This DBA is then the owner of all the database files since the DBA’s
user identification code (UIC) matches the owner UIC of the files. The database files
may reside in any directory and be owned by any member of any group. All file
descriptors used for the files should be fully qualified. If any logical names are used,
these names must be known to the Kernel. (See “Logical File Names.”)
File protection can be changed by the file owner. The DMDBA module sets file
protection as:
SET PROTECTION=(SYSTEM:RWE,GROUP:RWE,OWNER:RWE, WORLD)
With these protections, only the file owner, members of the owner’s group, and the VMS
system software can gain access to the file. The Kernel is granted SYSPRV privilege so
that, as a piece of system software, it can access the files.
708  File Qualifications
Database File-Naming Conventions
The file descriptors for your database files should include a meaningful file name
identifying the database. The file type should identify the function of the file. The file
types should also include file numbers and/or version numbers if they are used. The
following file-naming conventions are recommended for use in all database definitions.
Definition Database Files:
Definition Database File:
DM_dbname.DDB
DDB Journal File A:
DM_dbname.DJA
DDB Journal File B:
DM_dbname.DJB
DDB Journal A Backup Job:
DM_dbname.DJA_BJ
RDB Journal B Backup Job:
DM_dbname.DJB_BJ
Record Database Files (single file database):
Record Database File:
DM_dbname.RDB
RDB Journal File A:
DM_dbname.RJA
RDB Journal File B:
DM_dbname.RJB
RDB Journal A Backup Job File:
DM_dbname.RJA_BJ
RDB Journal B Backup Job File:
DM_dbname.RJB_BJ
RDB Journal File A Copy:
DM_dbname.RJAC
DDB Journal File B Copy:
DM_dbname.RJBC
File Qualifications  709
Record Database Files (multi-file/multi-version database):
Record Database Files:
DM_dbname.RDB_Fnn_Vnn
RDB Journal File A:
DM_dbname.RJA_Vnn
RDB Journal File B:
DM_dbname.RJB_Vnn
RDB Journal A Backup Job File:
DM_dbname.RJA_BJ_Vnn
RDB Journal B Backup Job File:
DM_dbname.RJB_BJ_Vnn
RDB Journal File A Copy:
DM_dbname.RJAC_Vnn
RDB Journal File B Copy:
DM_dbname.RJBC_Vnn
Fnn (File number)
When multiple files are used, nn indicates the number of
the file (01:63). If the Record Database (RDB) is
contained within a single file, the Fnn portion of the
filename is not used.
Vnn (Version number)
Indicates the version number (01:99) when multiple
versions of the file exist. The Vnn portion of the
filename is not used for version 0 of RDB files.
710  File Qualifications
Examples
1.
2.
For the first example, suppose the TOUR database has one DDB file and one RDB
file. There is only one version of the TOUR database. The following file descriptors
are used:
DDB File:
DM_TOUR.DDB
DDB Journal File A:
DM_TOUR.DJA
DDB Journal File B:
DM_TOUR.DJB
RDB Files:
DM_TOUR.RDB
RDB Journal File A:
DM_TOUR.RJA
RDB Journal File B:
DM_TOUR.RJB
In this example, suppose the TOUR database has one DDB file and three RDB files.
There are two versions of the TOUR database. The following file descriptors are
used:
DDB File:
DM_TOUR.DDB
DDB Journal File A:
DM_TOUR.DJA
DDB Journal File B:
DM_TOUR.DJB
DDB Journal A Backup Job File:
DM_TOUR.DJA_BJ
DDB Journal B Backup Job File:
DM_TOUR.DJB_BJ
RDB File 1, Version 0:
DM_TOUR.RDB_F01
RDB File 2, Version 0:
DM_TOUR.RDB_F02
RDB File 3, Version 0:
DM_TOUR.RDB_F03
RDB Journal File A, Version 0:
DM_TOUR.RJA
File Qualifications  711
RDB Journal File B, Version 0:
DM_TOUR.RJB
RDB Journal A Backup Job File, Version 0:
DM_TOUR.RJA_BJ
RDB Journal B Backup Job File, Version 0:
DM_TOUR.RJB_BJ
RDB File 1, Version 1:
DM_TOUR.RDB_F01_V01
RDB File 2, Version 1:
DM_TOUR.RDB_F02_V01
RDB File 3, Version 1:
DM_TOUR.RDB_F03_V01
RDB Journal File A, Version 1:
DM_TOUR.RJA_V01
RDB Journal File B, Version 1:
DM_TOUR.RJB_V01
RDB Journal A Backup Job File, Version 1:
DM_TOUR.RJA_BJ_V01
RDB Journal B Backup Job File, Version 1:
DM_TOUR.RJB_BJ_V01
712  File Qualifications