You are on page 1of 8

Procedure to Restore a PlantTriage Database from Backup Restoring a PlantTriage database from backup

1) Disable PlantTriage start on re-boot by un-checking Services start automatically after reboot on the Services tab of the PlantTriage Administrator window. 2) Bring up the PlantTriage Administrator window Directories tab and note the Logging and Archive directories on your hard drive. 3) Re-boot the computer. Note: as part of the Restoration procedure, all user accounts that were configured in the Backup database will be restored. Ensure that you have a known valid user acct. and password in the Backup PlantTriage installation to use to log into the restored PlantTriage database. 4) If the Admin Backup function was selected to back up to 3 .zip files: uncompress the files Archive.zip and Logging.zip on the backup disk. Also if restoring to a different computer, copy all of the files in the Xtune\PT\TRENDS folder from the server being backed up to the server where the PlantTriage database will be restored because these files will not be restored using the below-described procedure. 5) Delete all the files and subdirectories from the Logging directory on your hard drive. You may have to make the files not read-only before you can delete them. Right-click the files, choose Properties and un-check the readonly box. Copy all the files and subdirectories in the Logging directory on the backup disk to the PlantTriage Logging directory on your hard drive subfolders 6) If the Admin Backup function was selected to back up to 3 .zip files: uncompress the file TriageSqlBackup.zip and copy the files CalcSqlBackup.dat, TriageSqlBackup.dat; and if restoring a PlantTriage v.9 or higher database also the file CountsSqlBackup.dat that are in the decompressed Logging folder and copy them into the Logging directory on your hard drive. 7) Right-click on the Logging root directory, choose Properties, un-check the read-only box and apply this change to all subfolders and included files. 8) Delete all the files and subdirectories from the Archive directory on your hard drive. You may have to make the files not read-only before you can delete them. Right-click the files, choose Properties and un-check the readonly box. Copy all the files and subdirectories in the Archive directory on the backup disk to the PlantTriage Archive directory on your hard drive. 9) Right-click on the Archive root directory, choose Properties, un-check the read-only box and apply this change to all subfolders and included files. Page 1 of 8

Procedure to Restore a PlantTriage Database from Backup


10) There should be a file, TriageSqlRestore.sql, in the xtune\pt directory. You will need to use an ASCII edit program, e.g., Notepad to open it. Here are the contents of the file: EXEC sp_dropdevice 'TriageSqlBackup' GO EXEC sp_addumpdevice 'disk', 'TriageSqlBackup', 'F:\PT_Logging\TriageSqlBackup.dat' GO RESTORE DATABASE xppmsql FROM TriageSqlBackup GO where 'F:\PT_Logging\TriageSqlBackup.dat' is the path to the PlantTriage logging directory on your hard drive. This line goes at the end of the previous line that commences EXEC sp_addumpdevice. Ensure that the PlantTriage logging directory, e.g. F:\PT_Logging\CalcSqlBackup.dat, does contain the backup Logger database: TriageSqlBackup.dat. If you are restoring on a different computer from the computer on which the backup was taken, you may have to create the file TriageSqlRestore.sql yourself manually. 11) There should be a file, CalcSqlRestore.sql, in the xtune\pt directory. You will need to use an ASCII edit program, e.g., Notepad to open it. Here are the contents of the file: EXEC sp_dropdevice 'CalcSqlBackup' GO EXEC sp_addumpdevice 'disk', 'CalcSqlBackup', 'F:\PT_Logging\CalcSqlBackup.dat' GO RESTORE DATABASE xptcalc FROM CalcSqlBackup GO where 'F:\PT_Logging\CalcSqlBackup.dat' is the path to the PlantTriage logging directory on your hard drive. This line goes at the end of the previous line that commences EXEC sp_addumpdevice. Ensure that the PlantTriage logging directory, e.g. F:\PT_Logging\CalcSqlBackup.dat, does contain the backup Equation Builder database: CalcSqlBackup.dat. If you are restoring on a different computer from the computer on which the backup was taken, you may have to create the file CalcSqlRestore.sql yourself manually.

Page 2 of 8

Procedure to Restore a PlantTriage Database from Backup


12) There should be a file, CountsSqlRestore.sql, in the xtune\pt directory. You will need to use an ASCII edit program, e.g., Notepad to open it. Here are the contents of the file: EXEC sp_dropdevice 'CountsSqlBackup' GO EXEC sp_addumpdevice 'disk', 'CountsSqlBackup', 'F:\PT_Logging\CountsSqlBackup.dat' GO RESTORE DATABASE xpcounts FROM CountsSqlBackup GO where 'F:\PT_Logging\CalcSqlBackup.dat' is the path to the PlantTriage logging directory on your hard drive. This line goes at the end of the previous line that commences EXEC sp_addumpdevice. Ensure that the PlantTriage logging directory, e.g. F:\PT_Logging\CalcSqlBackup.dat, does contain the backup Counts database: CountsSqlBackup.dat. If you are restoring on a different computer from the computer on which the backup was taken, you may have to create the file CountsSqlRestore.sql yourself manually. 13) Restoring the PlantTriage database. At Start/Run, browse to the TriageSqlRestore.sql file, and type the following command in front of the path to the TriageSqlRestore.sql file. if PlantTriage version 8 was installed clean: sqlcmd -E -S .\sqlexpress -i c:\xtune\pt\TriageSqlRestore.sql or if PlantTriage version 8 was installed as an upgrade: sqlcmd -E -S . -i c:\xtune\pt\TriageSqlRestore.sql Note: the -E S parameters are case sensitive. You need to be logged into Windows with an account that has Administrator privileges. Click on OK to execute the Run command, and observe the progress in the DOS command window. 14) Restoring the Equation Builder database. The Equation Builder database is backed up in addition to the PlantTriage database by a Backup command. You may wish to restore the Equation Builder database individually or in addition to the PlantTriage database. To restore the Equation Builder database proceed as above, but there is no need to repeat the above steps to restore the files in the Logging and Archive directories. Page 3 of 8

Procedure to Restore a PlantTriage Database from Backup


This time use the file, CalcSqlRestore.sql, which should also be in the ..\xtune\pt folder. The file holding the Equation Builder database is named CalcSqlBackup.dat. The resulting sqlcmd should be: if PlantTriage version 8 was installed clean: sqlcmd -E -S .\sqlexpress -i c:\xtune\pt\CalcSqlRestore.sql or if PlantTriage version 8 was installed as an upgrade: sqlcmd -E -S . -i c:\xtune\pt\CalcSqlRestore.sql Note: the -E S parameters are case sensitive. You need to be logged into Windows with an account that has Administrator privileges. Click on OK to execute the Run command, and observe the progress in the DOS command window. 15) For PlantTriage v9 and above: Restoring the Counts database. The Counts database is backed up in addition to the PlantTriage database by a Backup command. To restore the Counts database proceed as above, but there is no need to repeat the above steps to restore the files in the Logging and Archive directories. This time use the file, CountsSqlRestore.sql, which should also be in the ..\xtune\pt folder. The file holding the Counts database is named CountsSqlBackup.dat. The resulting sqlcmd should be: sqlcmd -E -S .\sqlexpress -i c:\xtune\pt\CountsSqlRestore.sql Note: the -E S parameters are case sensitive. You need to be logged into Windows with an account that has Administrator privileges. Click on OK to execute the Run command, and observe the progress in the DOS command window. 16) Restoring the Equation Builder Formulae, Subroutines, OPC Tags, and Timers Using the ExperTune Import Wizard (Alternative Method). Open the ExperTune Import Wizard, select Equation Builder, then select Import Equation Builder data. Open the previously exported (Backup) Equation Builder *.csv backup file, then once the importation has completed, a message should be displayed that the Equation Builder database was successfully restored along with a summary count of the Formulae, Subroutines, OPC Tags, and/or Timers that were restored. 17) Running the Check Database Command. It is recommended to run the Check Database command after using the above instructions to restore the various databases. Right-click the PlantTriage icon under Start, Programs, ExperTune, and click Properties. Select the Shortcut tab. In the Page 4 of 8

Procedure to Restore a PlantTriage Database from Backup


Target line, add /checkdatabase to the end of the Target. Be sure to include a space between the double-quote and /checkdatabase. The /checkdatabase command goes outside the double-quotes. The resulting command shortcut should be; "C:\Xtune\PT\XpPT.exe" /checkdatabase. Click Apply, then OK. Note: in SQL Server 2008 Std. Ed. and higher, the double quotes will not be visible after clicking on the Apply button. Make sure MSSQLServer is running. Open PlantTriage using the PlantTriage Icon that you've just altered. 18) Restoring the database onto the live PlantTriage computer. Doubleclick the PlantTriage icon to start PlantTriage. The Administrator window should appear. You may have to upgrade the database. Start the Logger and Assessor services. Close the Administrator window and in the PlantTriage window ensure the restore has worked by examining the loops in the Loop Properties window. Re-enable the PlantTriage start on re-boot by checking Services start automatically after reboot on the Services tab of the PlantTriage Administrator window. Restoring the database onto a different computer in Offline mode. Right-click the PlantTriage icon under Start, Programs, ExperTune, and click Properties. Select the Shortcut tab. In the Target line, add /Offline to the end of the Target. Be sure to include a space between the doublequote and /Offline. The /Offline command goes outside the double-quotes. The resulting command shortcut should be; "C:\Xtune\PT\XpPT.exe" /Offline. Click Apply, then OK. Note: in SQL Server 2008 Std. Ed. and higher, the double quotes will not be visible after clicking on the Apply button. Make sure MSSQLServer is running. Open PlantTriage using the PlantTriage Icon that you've just altered. In the PlantTriage Administrator window, click on the Re-initialize button in the Services Tab. When the logging service is showing offline, close the PlantTriage Administrator form. All PlantTriage facilities are available, but no new data is collected and no new assessments are calculated. Note: the Reinitialize command will need to be executed each time that PlantTriage is started in the Offline mode in order to close the Administrator form and allow use of the Engineering Interface.

19)

Page 5 of 8

Procedure to Restore a PlantTriage Database from Backup Using one computer for two different PlantTriage datasets
This is a requirement on a demonstration system where the user wants to show an example of data from a real plant and the PlantTriage demonstration loops on the same computer. It is not possible to use one computer for two different PlantTriage datasets at the same time. At any one time there can only be one set of logging/archive data and one database. The location of the PlantTriage logging and archive directories on your hard drive is defined within the historian.ini file in the \xtune\Canary\Historian folder or the \xtune\Canary\Shared folder. Therefore to move between different datasets requires some file copying and re-booting. For the purpose of this description, suppose Dataset A contains the Demonstration loops. It has been generated by doing a backup from a live PlantTriage demonstration system. Perhaps Dataset A resides on a network drive. Suppose Dataset B contains data from a live plant. Perhaps Dataset B resides on a removable drive that has been dumped from a PlantTriage system that is connected to a live plant. The procedure for replacing Dataset A by Dataset B, or vice-versa, is identical. It is the same as the procedure described above for restoring a PlantTriage database from backup. In both cases the TriageSqlRestore.sql file created at step (6) above is used. In summary you must:

Reboot the computer. Prior to reboot make sure then Auto restart after reboot in the Engineering Interface Administrator window, Services tab is not checked. Delete \xtune\Canary\Shared\historian.ini. If the file has already been deleted since PlantTriage installation, it will be in the \xtune\Canary\Historian folder. Run the TriageSqlRestore.sql file. (osql -E I "...\TriageSqlRestore.sql") Restart PlantTriage from the normal or /Offline icon From Tools, Administrator: o Directories tab: Set the Logging and Archive directories to the directories where the Logging and Archive backup datasets reside. This procedure creates a new historian.ini file in the \xtune\Canary\Historian folder. o Services tab: Reinitialize button if you used the PlantTriage /Offline icon or Start button if you used the PlantTriage normal icon.

Page 6 of 8

Procedure to Restore a PlantTriage Database from Backup Starting PlantTriage


There are three methods of starting PlantTriage: 1) A normal icon. There are no command line parameters. This icon is in the Start/Programs menu. This starts PlantTriage in online mode. Online mode is when PlantTriage is running normally. It is reading data from the process and calculating assessment values. If PlantTriage is not already running, the Administrator form is shown from where you can start the PlantTriage logger and assessor manually.

Page 7 of 8

Procedure to Restore a PlantTriage Database from Backup


2) An offline icon. There is a command line parameter of /Offline. This icon is not created automatically. This starts PlantTriage in offline mode. Offline mode is when you can view PlantTriage data, but PlantTriage is not connected to the process and is not calculating assessment values. Offline mode is designed for examining data that has been backed up from a live system and restored on to a different computer.

3) Automatically after a re-boot. There is a PlantTriage service, called XpPtStartServ, which runs automatically after a re-boot. This starts PlantTriage in online mode. It is designed for use in a live PlantTriage system so that a live system automatically goes online if it is re-booted. Whether or not this service starts automatically after a reboot is governed by checking or un-checking Services start automatically after reboot on the Services tab of the PlantTriage Administrator window. If you plan to use your computer for demonstrating PlantTriage with different datasets, you will not want PlantTriage to automatically start in online mode after a re-boot.

Page 8 of 8

You might also like