Database and Log Sizing
Since the database is a dynamic environment, allow plenty of space for the models you create. Tests have shown that models generate between 10 KB and 20 KB of data per entity during initial save times. Log overhead per object is approximately 15 KB to 21 KB per entity. Allocate 50 to 65 percent of the database size to the log to avoid running out of room in the log for a typical model save.
An average mart can range in size between 200 MB and 1 Gig. Size the transaction log accordingly. A 50 MB data device can store several large models (about 2,500 entities and 100,000 total objects), but keep in mind that the database becomes more flexible and has less storage space issues when the data device is large.
The following table shows the recommended database size and log size for small, medium, and large marts:
Database Size |
Database Device |
Transaction Log Device |
---|---|---|
Small |
200 MB |
100 MB |
Medium |
500 MB |
200 MB |
Large |
1 GB |
400 MB |
How to Maintain an Efficient Database
To maintain an efficient database, perform the following maintenance tasks:
- Run UPDATE STATISTICS and execute sp_recompile frequently on every table in the database. This keeps the statistics up-to-date for the indexes, resulting in better overall performance.
- Periodically recreate the clustered indexes in the database to reduce fragmentation. Be sure to back up the database and transaction log daily.
- Run DBCC CheckDB(), DBCC CheckCatalog(), and DBCC CheckAlloc() or DBCC NewAlloc() on the database nightly, to check for corruption and inconsistencies in the database. Check the output of these queries and look for keywords like corrupt. Any problems detected by these commands are sent to the query output, so save the files and scan them regularly.
The following table shows maintenance tasks and the recommended frequency for performing these tasks:
Maintenance Task |
Recommended Frequency |
Reason |
---|---|---|
DBCC Checkdb |
Nightly |
Check for corruption in databases. |
DBCC NewAlloc |
Weekly |
Check for allocation corruption (Microsoft SQL Server only). |
DBCC CheckAlloc |
Weekly |
Check for allocation corruption (Microsoft SQL Server only). |
DBCC CheckCatalog |
Weekly |
Check for system table inconsistencies. |
UPDATE STATISTICS |
Nightly |
Recreates the statistics page for each index. |
EXEC sp_recompile |
Nightly |
Tells which stored procedures have changed. |
Backup Database |
Weekly |
Full backup of database should be done at least weekly, if not nightly. |
Backup Transaction Log |
Daily |
Backing up the transaction log daily saves all committed transactions and clears the log. |
Copyright © 2023 Quest Software, Inc. |