Setting up the ION_Data archive task for Distributed PME systems

Setting up the archive task for ION_Data is similar to setting up other database maintenance tasks but requires some additional steps.

NOTE: It is best to automate the archive task, but you can also run it manually on demand using Database Manager.

To set up the scheduled archive task for ION_Data:

  1. Complete Steps 1 - 3 described in Setting up database maintenance tasks for Distributed PME systems.

    NOTE: You can use the same Windows user account (created in Step 1) that is used for other scheduled PME database maintenance tasks to run the archive task. You can also create a new account that is only used for the archive task, because only this task requires sysadmin role privileges on the database server (see next step).

  2. On the database server, open SQL Server Management Studio and add the sysadmin server role to the Windows user account created in Step 1. This account is used to run the archive task; it needs sysadmin permissions to create new archive databases.
  3. On the database server, in the folder created in Step 3, create a subfolder called etc and inside this folder a subfolder called Database, for example C:\PME_Database_Maintenance\etc\Database.
  4. Copy the Data folder from ...\Power Monitoring Expert\system\etc\Database\, on the PME application server, into the new Database folder on the database server.
  5. On the database server, open Task Scheduler in Windows.
  6. (Optional) In the Task Scheduler Library, create a new folder for the PME database maintenance tasks, if it does not already exist. For example, Task Scheduler Library > Power Monitoring Expert.
  7. Create the scheduled archive task for ION_Data:

    Name: [ION_Data] - ARCHIVE - Job
    Security options: Set the Windows user account created in Step 1 to run the task.
    Security options: Select Run whether user is logged on or not.
    Trigger: Monthly at 01:00 (1:00 AM) on January 3rd
    Action: Select Start a program.
    Action: Program/script: C:\Windows\syswow64\WindowsPowerShell\v1.0\powershell.exe
    Action: Arguments: -noninteractive -nologo -file "<Folder Path>\DbScheduledTasks\ArchiveDB.ps1" -DatabaseIdentifier ION

    NOTE: The "<Folder Path>\DbScheduledTasks\ArchiveDB.ps1" path must be an absolute path, not a relative path.

    NOTE: The task name and trigger time shown above are recommendations. You can choose a different name or trigger if necessary.

  8. (Optional) Manually run the archive task to verify its correct operation.
  9. Close Task Scheduler.

To change the archive location, open the Configuration.ps1 script file, as described in Step 3 in Setting up database maintenance tasks for Distributed PME systems and change the value of the variable:

Setting Variable Default Value Comments

Archive folder location

$locationForArchiveDBFiles

As defined in the script file; see Step 3-7.

Sets the folder to which the database archives are saved.

NOTE: The Windows user account used to run the archive task needs Read and Write permissions on this folder.