Use piconfig to set maximum size of database file
- Last UpdatedJun 29, 2023
- 2 minute read
- PI System
- PI Server
Use the piconfig utility to limit the size of the database file by setting the ConnectionHistoryMaximumFileSize parameter in the pitimeout table. The value is in Megabytes (MBs): the minimum is 0 (which lets the database grow without limitation), the maximum is 524,288 MBs (512 GBs), and the default is 512 MBs.
ConnectionHistoryMaximumFileSize controls the maximum allowable size, in MBs, for the connection history database file. Periodically, Data Archive checks the size of the database file. If the file size is greater than the value of ConnectionHistoryMaximumFileSize, the smallest number of database entries that reduces the file size to no greater than the parameter value are removed. The oldest entry is removed first. For example, if you set ConnectionHistoryMaximumFileSize to 1,024, if Data Archive determines the database file to be greater than 1,024 MBs, sufficient older entries are removed to reduce the file size to no more than 1,024 MBs.
Note: If you set ConnectionHistoryMaximumFileSize to 0, no data is removed from the database file, and the file might grow large.
The following example sets the maximum size of the connection history database file to 700 MBs.
C:\Program Files\PI\adm>piconfig
* (Ls - ) PIconfig> @mode edit
* (Ed - ) PIconfig> @tabl pitimeout
* (Ed - PITIMEOUT) PIconfig> @istr name,value
* (Ed - PITIMEOUT) PIconfig> ConnectionHistoryMaximumFileSize,700
*> ConnectionHistoryMaximumFileSize,700
* (Ed - PITIMEOUT) PIconfig> @mode list
* (Ls - PITIMEOUT) PIconfig> @ostr name,value
* (Ls - PITIMEOUT) PIconfig> @istr name
* (Ls - PITIMEOUT) PIconfig> ConnectionHistoryMaximumFileSize
*> ConnectionHistoryMaximumFileSize
ConnectionHistoryMaximumFileSize,700
* (Ls - PITIMEOUT) PIconfig> @ends
* (Ls - PITIMEOUT) PIconfig> @quit
PIconfig 2 Data lines
9 Command line
2 Records in error...
1 Records Edited
1 Records Listed