Escolar Documentos
Profissional Documentos
Cultura Documentos
Backing up and Restoring FactoryTalk AssetCentre with Microsoft SQL Server 2005
How to properly backup and restore FactoryTalk AssetCentre data in the MSSQL database
Table of Contents
Retain your FactoryTalk AssetCentre Data .................................................................................................................1 Introduction .................................................................................................................................................................3 Planning an AssetCentre Maintenance Window ............................................................................................ 3 Backing Up FactoryTalk AssetCentre in Microsoft SQL Server 2005..........................................................................4 AssetCentre Database Backup .................................................................................................................... 4 AssetCentre Database Transaction Log Backup ........................................................................................... 8 Scheduling Backups ................................................................................................................................. 10 Restoring FactoryTalk AssetCentre in Microsoft SQL Server 2005...........................................................................15 Restoring AssetCentre Database and Transaction Log ................................................................................ 15 AssetCentreUser Configuration (optional)................................................................................................... 18 FactoryTalk AssetCentre Data Source Configuration Wizard ........................................................................ 23
Introduction
Proper retention of data is a mission critical task in any industry. For FactoryTalk AssetCentre, this means backing up the data stored in the FactoryTalk AssetCentre database. All information in FactoryTalk AssetCentre, from audits and events, to the asset tree itself, is stored in the AssetCentre database within the Microsoft SQL (MSSQL) server. This whitepaper is designed to assist MSSQL 2005 database administrators with the procedure of backing up the AssetCentre database, and in the event of an unlikely system failure, quickly restoring that backup to minimize down time.
2. Connect to the appropriate Microsoft SQL Server 2005 database server (administrative credentials needed.)
5b: Backup Set Name: This will be the name of the database backup file. Backup set will expire: This will be a retention period for each backup performed. If the backup should never expire, leave this setting at the default of 0. 5c: Destination The default destination for this backup is C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\AssetCentre.bak. To remove this location, select it, then click the Remove button. Click the Add button to select a user defined location and filename for the backup. A preferred location would be a separate hard drive from the one on which the database resides (thus saving the backup location if the databases hard drive fails.)
6. Note the Options from the tree on the left of the screen. In this example, all options are left at default.
7. Click OK to initiate the backup. 8. Upon successful completion of the backup, the following window will be displayed
RETAIN YOUR FACTORYTALK ASSETCENTRE DATA AssetCentre Database Transaction Log Backup
It is strongly recommended to backup the database transaction log in addition to the database itself. The transaction log essentially keeps audits of the database, recording actions performed upon it. Both the transaction log and database can be stored in the same file, specified in the section above on how to back up the database. 1. Right-click on the AssetCentre database and select Tools Back Up (if SQL Management Studio isnt already open, see Steps 1-4 from the AssetCentre Database Backup section.) 2. The following screen will be displayed
5a: Select AssetCentre database to 5b: Select Transaction Log as the backup type. 5c: Name backup
3. Note the Options from the tree on the left of the screen. In this example, all options are left at default.
The AssetCentre databases transaction log has now been backed up successfully.
3. Click Next on the opening screen 4. Enter a name for the maintenance plan, then click the Change button to schedule the plan.
11
6. Click Next to progress past this screen now that the schedule is configured 7. Select Back Up Database (Full) to configure this maintenance task to backup the database itself. Click Next to continue.
8. Click Next
12
Note: A preferred location would be a separate hard drive from the one on which the database resides (thus saving the backup location if the databases hard drive fails.) 11. Click Next
13
Note: It is possible to configure email reporting from this screen. 13. Click Finish to finalize the maintenance plan.
A database backup has now been scheduled. To configure a maintenance plan for the transaction log, simply follow these steps again and select Back Up Database (Transaction Log) instead of Back Up Database (Full) in Step 6.
14
3) Stop the World Wide Web Publishing service in the same way.
15
5) In the To database field, enter the name AssetCentre, then select the From Device radio button and click the corresponding browse button.
Browse to the backup file and select it, then press OK to continue.
16
Note: If different options are selected, such as overwriting on each backup, then there will not be as many rows to select from. Additionally, if no transaction logs were backed up, there will only be one checkbox available, corresponding to the AssetCentre database itself. It is also possible to perform restores of just the transaction log or database, depending on the checkbox selections. These steps show the process for restoring both at the same time. In the scheduled backup examples, the database and transaction log were backed up to separate files (.bak and .trn). These would need to be restored separately as well, as opposed to having both files in the same restore list as shown here.
17
2) Under the Owned Schemas list, check the box next to AssetCentreUser. Doing so will automatically remove ownership from the AssetCentreUser user. Click OK to continue.
18
4) Click No if prompted to delete both the user and the schema (do not delete the schema, only the user.)
5) Click OK to proceed with the deletion 6) Begin by collapsing the Databases folder and navigating to Security -> Logins from the root. Double-click on the AssetCentreUser.
Note: For MSSQL Servers that have not been previously been connected to FactoryTalk AssetCentre, it will be necessary to manually create this user (Right-click on the Logins folder and select New Login)
19
Note: This password can be overwritten by the FactoryTalk AssetCentre software (if desired) when reconnecting the FactoryTalk AssetCentre server. 8) Next, select User Mapping from the navigation pane on the left. From the new menu, check the box next to the AssetCentre database, then click the browse button under the Default Schema column
20
10) Under the Permissions list, check the box next to db_datareader, db_datawriter, and db_dataexecute.
21
13) Under the Owned Schemas list, check the box next to AssetCentreUser. Doing so automatically removes the ownership from the guest user assigned earlier.
The new AssetCentre MSSQL Server Database is now configured. Continue on to the section entitled FactoryTalk AssetCentre Data Source Configuration Wizard to finish the restore process.
22
RETAIN YOUR FACTORYTALK ASSETCENTRE DATA FactoryTalk AssetCentre Data Source Configuration Wizard
If the AssetCentre database has been moved or restored on an MSSQL Server, it is important to reconnect the FactoryTalk AssetCentre server to this new database. The steps below will walk through the FactoryTalk AssetCentre Data Source Configuration Wizard, installed by default along with the FactoryTalk AssetCentre server. Note: The FactoryTalk AssetCentre server and World Wide Web Publishing services should still be stopped at this point, following the restoration of the database. If this is not so, stop them now. 1) From the FactoryTalk AssetCentre server machine, go to Start -> Programs -> Rockwell Software -> FactoryTalk AssetCentre Server -> Data Source Configuration
23
Note: If the password specified in SQL for the AssetCentreUser account is desired, simply input it as the password here instead of accepting the default. 4) Click Next to continue 5) Enter the user credentials of a SQL Server administrator on the new SQL Server. Leave the Change FactoryTalk AssetCentre SQL Server checkbox checked.
9) Click Done to close the wizard. 10) Finally, start the FactoryTalk AssetCentre and World Wide Web Publishing services again. Open the Service Control Manager (Control Panel -> Administrative Tools -> Services). Start the World Wide Web Publishing service first (right-click, and select Start.) The PC could also just be rebooted.
The FactoryTalk AssetCentre server is now connected to the newly restored database.
25
Copyright 2009 Rockwell Automation, Inc. All Rights Reserved. Printed in USA.