What is Structure File?
Structure file or .st file is a text file in a system which defines the structure of database.
What does this .st file contains?
.st files contains the information about database like,
What type of File it contains,
What is the area name,
What is the cluster,records per blocks, area number,
Where the physical location of datafile,
Is it a fixed or Variable extent
What is the maximum size of datafile,
Lets know all details one by one,
What type of File it contains?
This is the first entry in .st file,File can be of Schema and Data, Before image, After image or transaction log.
Schema and Data: this is defined as "d" in .st file and its physical file extension will be .d1-.dn, This file will be holding the schema and application data.
example:
d “Area-name”,32 /usr1/inv f 1024
you can see in the above .st file entry "d" is defined at first, which will tells it is containing data file.
Before image: The before-image file also called the "bi file", contains the primary transaction log of the Progress RDBMS. it should be there to start the Database. Without the before-image extents, the database cannot be accessed.
example:
b /path/to/bifiles.b1 f 1024
"b" is highlighted above which tells it is before image file, it doesn't require the area name unlike "d"
After Image: The after-imaging lets you to recover the Database or .bi file which are lost or damaged. You can use the AI files with the roll-forward recovery process to restore the database to the condition it was in before you lost the database.
example:
a path/to/after.a1 f 2048
"a" is highlighted above which tells it is after image file
Transaction log: The transaction log contains the transaction number of all committed distributed transactions. When there is an in-doubt transaction, this log is scanned for the transaction number to determine if the transaction committed or not. If the transaction number is found in the log, it means the transaction committed. If the transaction number is not found in the log, it means the transaction aborted.
To a structure file it is must that one before image and one schema data entry to create Database,
What is the area name?
This is the name of the area where the data gonna store physically.
What is the area number,records per blocks,blocks per cluster?
Area Number is the number of the storage area if you do not include it in .st file. while creating DB using prostrct will assign the Number to the area.
Records per blocks is the Number of DB records should be in a blocks, the value entered here can be of 1,2,4,8,26,32,64,128,256.
Blocks per Cluster is the Number of Database block should be in a cluster, if this area is blank or 1 area will be of type 1 and 8,64,512 will be of type 2.
Physical location of datafile.
This is the path mentioned where the Datafile exist physical, it could be either relative path or an absolute path.
Fixed or Variable extent.
Fixed extent can be identified by token "f" which will be mentioned after the path, if it is variable it doesnt required you to mention the size or "v".
What is the maximum size of datafile?
if it is a fixed extent you should mention the size after the token "f" in .st file, if it is variable and large files is not enabled it will be of 2 GB. it should be in multiples of 16th of DB block size.
The minimum information is required in a .st file are an before image entry and at least one data extent.
The minimum information required to define any extent is type and the path.
example:
b .
d /path/to/data1.d1
above can be a example of minimum .st file requirements.