{}

我們的品牌

Impact-Company-Logo-English Black-01-177x54

歡迎造訪施耐德電機全球網站

歡迎訪問我們的網站
搜尋常見問題
Power Monitoring Expert - How can I edit configurable settings for the Windows Task Scheduler database jobs?
Product Line
Power Monitoring Expert 7.2.x, 8.x, 9.0, 2020

Environment
Modifying database jobs that run as a scheduled task for PME 7.2.x, 8.x, 9.0, 2020

Cause
As of PME 7.2.x and newer all of the scheduled database tasks use the Windows Task Scheduler to execute the scheduling and powershell script files required for the job to the complete. Changing any settings (other than the schedule) from the defaults requires editing the powershell scripts.

Resolution
*Warning: Take backups of any files prior to modifying them. Ensure the backups are in a location that will not be overwritten (i.e. the Desktop).*

This article describes the various powershell scripts used by the scheduled tasks, and how to edit them.

Powershell files (only ones that include configuration options are listed):
All the files listed below can be found in the \config\cfg\dbscheduledTasks folder.

Configuration.ps1 (located in the Support subfolder).
This file allows you to specify the following:
  1. The location for the database backups. The default is \config\cfg\DBBackups
  2. The maximum size for ION_Data (for Express users). The default is 8 Gb.
  3. The percentage of this maximum size that will result in a size notification message (for Express Users). The default is 85% the maximum ION_Data size
  4. The number of days of data that you wish to retain in the Diagnostics.LogEventView view in the ApplicationModules database. The default is 30 days.
(as of PME 7.2.2)
  1. The location for the archived database. The default is “cfg\archives” – this is relative to the \config folder. You can specify and absolute path such as “d:\my_archives”
  2. The number of days worth of data to keep in your live database. The default is 370.

ArchiveDB.ps1
This file allows you to specify what type of data to archive/trim. There are three ‘types’ of data. Interval data is stored in DataLog2, Event data is stored in EventLog2 and Waveform data is stored in WaveformLog2. By default, all types of data are archived, but none are trimmed from the live database. You can edit this file to change these default settings.

Backup.ps1
This file allows you to specify the number of database backups you wish to retain. The default is 2. Below is a screenshot showing which line to change. FA210520 has a video showing how to make this change also.



More on Archives
A scheduled archive task was added back into the product in PME 7.2.2 and newer(it was removed in PME 7.2)
In PME 7.2.2 and newer the archive dts package was replaced by a number of stored procedures. The scheduled archive task uses ArchiveDB.ps1 to supply the input parameters and to run the stored procedures. Configuration.ps1 was updated in PME 7.2.2 and 8.x to include information required by the archive task. Upgrades to PME 7.2.2 or newer from PME 7.2 will not update Configuration.ps1 so scheduled archives will not work unless the PME 7.2.2 or newer version of this file is copied from the config_new_7.2.2 or config_new_8.0 folder into the active \config\cfg\dbscheduledTasks\Support folder).

IMPORTANT: Since the original version of this file contains some configuration information for the backup and size notification tasks, any custom settings will be overwritten and have to be redone. This is particularly important if any file locations for the database backups have been changed.

To configure archives:
  • Edit configuration.ps1 to set the location of the archive database and to set the number of days that will not be included in the archive. For example, if you have a database that contains three years of data, and you accept the default of 370 days, the archive database will archive from the beginning of the database to the current most recent timestamp – 370 days, approximately one year of data.
  • Edit ArchiveDB.ps1 to specify whether or not you want the archived data to be removed from the live database. To do this, look for this section in this file:

$archiveInterval = 1
$archiveEvents = 1
$archiveWaveforms = 1
$trimInterval = 0
$trimEvents = 0
$trimWaveforms = 0

Interval/Events/Waveforms refer to interval data (DataLog2), event data (EventLog2) and waveform data (Waveform2) respectively. By default, the archive task will archive all types of data, but not trim any data. Change the 0 to 1 for $trimInterval/$trimEvents/$trimWaveforms to trim data from the live database after the archive database has been created.

More on Backups
You can change backup location, number of backups to retain, and when the backup job runs
To change the backup location, edit Configuration.ps1.
To change the number of backups that are retained, edit Backup.ps1.
  • Look in the section called ‘Constants’ near the top of the file to change it.

施耐德電機Taiwan

探索更多
系列:
可能有幫助的文章
探索更多
系列: