Technical FAQs

Ask a Question

Power Monitoring Expert - Database Scheduled Task Files and Supporting Files

Issue
Database jobs are periodically run using scheduled tasks. These tasks can also be run manually via the PowerShell scripts which may aid in troubleshooting as the PowerShell console may give additional errors on why the tasks were originally failing. This article describes the alternative method used to manually run the tasks.

Product Line
Power Monitoring Expert 8.x
Power Monitoring Expert 7.2.x

Environment
Windows PowerShell

Cause
Provides a better understanding on the database tasks and a way of trouble shooting in case of issues.

Resolution
Supporting Files
The supporting files are located in ...\config\cfg\dbscheduledtasks\support\ folder and are used by the script files; they are not to be run by themselves.

The one of importance is Configuration.ps1 which has the following three parameters and values:
     $locationForBackupFiles = "cfg\DBBackups\"
     $databaseSizeNotificationThresholdPercentage = 85
     $diagnosticsDaysToKeep = 30

Script Files
There are four script files and they are located in ...\config\cfg\dbscheduledtasks\ folder.
Each script file requires a database name to be passed as a parameter.  This is identified by opening the file and observing the first line:
     param($databaseIdentifier)

How to Manually Execute a Tasks
Note: Powershell is required for manual execution of the scripts.
  1. Open Powershell
    • Click Start and search for 'Windows PowerShell (x86)'
    • Right-click on 'Windows PowerShell (x86)' (Note: Be sure to open the (x86) version of PowerShell)
    • Select Run as administrator.
  2. Navigate to the \Power Monitoring Expert\config\cfg\DbScheduledTasks directory within PowerShell
    • Locate the exact location of the DbScheduledTasks directory using Windows Explorer
    • Use the change directory command, cd, to change to the DbScheduleTasks directory
For example, to change the PowerShell directory to C:\Program Files (x86)\Schneider Electric\Power Monitoring Expert DC Ed\config\cfg\DbScheduledTasks as seen in the below example, type the following command: cd 'C:\Program Files (x86)\Schneider Electric\Power Monitoring Expert\config\cfg\DbScheduledTasks' 
  1. Once in the proper directory, run the command corresponding to the desired database task. The tables below contain the commands and required database parameters required to run the script manually.

Backup.ps1
Database Parameter Command to Run from PowerShell
ION_Data ion .\backup.ps1 ion
ION_Network nom .\backup.ps1 nom
ION_SystemLog syslog .\backup.ps1 syslog
ApplicationModules apps .\backup.ps1 apps



DatabaseMaintenance.ps1
Database Parameter Command to Run from PowerShell
ION_Data ion .\databasemaintenance.ps1 ion
ION_Network nom .\databasemaintenance.ps1 nom
ION_SystemLog syslog .\databasemaintenance.ps1 syslog
ApplicationModules apps .\databasemaintenance.ps1 apps



DatabaseSizeNotification.ps1
Database Parameter Command to Run from PowerShell
ION_Data ion .\databasesizenotification.ps1 ion
ION_Network nom .\databasesizenotification.ps1 nom
ION_SystemLog syslog .\databasesizenotification.ps1 syslog
ApplicationModules apps .\databasesizenotification.ps1 apps
                   


TrimDiagnostics.ps1
Database Parameter Command to Run from PowerShell
ION_SystemLog syslog .\trimdiagnostics.ps1 syslog
ApplicationModules apps .\trimdiagnostics.ps1 apps
                  
Was this helpful?
What can we do to improve the information ?