0% found this document useful (0 votes)
14 views20 pages

Tech Note 918 - Moving Historian Server Custom Tables

Uploaded by

profilemail8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views20 pages

Tech Note 918 - Moving Historian Server Custom Tables

Uploaded by

profilemail8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Moving Historian Custom Tables

Tech Note 918


Moving Historian Server Custom Tables

All Tech Notes, Tech Alerts and KBCD documents and software are provided "as is" without warranty of any kind. See the Terms of Use for more information.

Topic#: 002731
Created: Jamuary 2013

Introduction
This Tech Note explains moving custom tables from one Historian Server to another.

Custom tables are tables you create to store information beyond the built-in tables already included in the Historian Server's Runtime
database. These custom tables are not automatically migrated when Historian software is upgraded, it is necessary to migrate them
manually.

This Tech Note uses Historian1 (existing Historian Server) and Historian2 (Target/New Historian Server) for reference and context.

Application Versions
Wonderware Historian 10.0 and later

Microsoft SQL Server 2008 and later

Procedure

To move custom tables from one Historian to another

Complete the following tasks:

Create a backup for the current Runtime database on the target server

file:///C|/inetpub/wwwroot/t002731/t002731.htm[3/11/2013 8:48:29 AM]


Moving Historian Custom Tables

FIGuRE 1: CREAtE BAcKuP Of tHE RuNtIME DAtAbASE

Use SSMS to create scripts from the original Runtime Database


1. From SQL Server Management Studio (SSMS) right click on the Runtime database and click Tasks/Generate Scripts.

file:///C|/inetpub/wwwroot/t002731/t002731.htm[3/11/2013 8:48:29 AM]


Moving Historian Custom Tables

FIGuRE 2: GENERAtE RuNtIME ScRIPtS

2. Click Next.

file:///C|/inetpub/wwwroot/t002731/t002731.htm[3/11/2013 8:48:29 AM]


Moving Historian Custom Tables

FIGuRE 3: ScRIPt WIZARd

The Select Database Wizard appears.

3. Select Runtime and click Next.

file:///C|/inetpub/wwwroot/t002731/t002731.htm[3/11/2013 8:48:29 AM]


Moving Historian Custom Tables

FIGuRE 4: SELEct tHE RuNtIME DAtAbASE

The Choose Script Options Wizard appears.

4. Accept the defaults and click Next (Figure 5 below).

file:///C|/inetpub/wwwroot/t002731/t002731.htm[3/11/2013 8:48:29 AM]


Moving Historian Custom Tables

FIGuRE 5: ScRIPt OPtIONS

The Choose Object Types Wizard appears (Figure 6 below).

file:///C|/inetpub/wwwroot/t002731/t002731.htm[3/11/2013 8:48:29 AM]


Moving Historian Custom Tables

FIGuRE 6: ObJEct TYPES OPtIONS

5. Select Tables and click Next.

The Choose Tables Wizard appears (Figure 7 below).

file:///C|/inetpub/wwwroot/t002731/t002731.htm[3/11/2013 8:48:29 AM]


Moving Historian Custom Tables

FIGuRE 7: CHOOSE CuStOM TAbLES

6. Select the Custom tables for which you want to generate script and click Next.

7. Select the location at which to save script file and click Save, then Next (Figure 8 below).

file:///C|/inetpub/wwwroot/t002731/t002731.htm[3/11/2013 8:48:29 AM]


Moving Historian Custom Tables

FIGuRE 8: SELEct A LOcAtION

8. Click Finish (Figure 9 below).

file:///C|/inetpub/wwwroot/t002731/t002731.htm[3/11/2013 8:48:29 AM]


Moving Historian Custom Tables

FIGuRE 9: ScRIPt WIZARd SuMMARY

9. After the Script Generation operation finishes (Figure 10-11 below), close the SQL Server Management Studio.

file:///C|/inetpub/wwwroot/t002731/t002731.htm[3/11/2013 8:48:29 AM]


Moving Historian Custom Tables

FIGuRE 10: GENERAtE ScRIPt PROGRESS

file:///C|/inetpub/wwwroot/t002731/t002731.htm[3/11/2013 8:48:29 AM]


Moving Historian Custom Tables

FIGuRE 11: CLOSE tHE WIZARd

Move the Scripts to Another Historian Machine


To do this, run the scripts to create the new tables on the target machine.

1. From SSMS click Open/File from the main menu.

file:///C|/inetpub/wwwroot/t002731/t002731.htm[3/11/2013 8:48:29 AM]


Moving Historian Custom Tables

FIGuRE 12: OPEN tHE ScRIPt FILE

2. Browse to the script file location and click Open.

file:///C|/inetpub/wwwroot/t002731/t002731.htm[3/11/2013 8:48:29 AM]


Moving Historian Custom Tables

FIGuRE 13: OPEN tHE <ScRIPtNAME>.SQL FILE

3. Click the Execute button in the main Toolbar.

Copy the Custom Table Data to the New Runtime Database


Create a linked server cube between the old Historian and new Historian.

1. On the Historian 1 (Existing) machine, Open SQL Server Management Studio and connect to it.

2. In the Connect to Server dialog box, specify the name of the appropriate SQL Server, and then click Connect.

3. In SQL Server Management Studio, double-click Server Objects, right-click Linked Servers, then click New Linked Server.

file:///C|/inetpub/wwwroot/t002731/t002731.htm[3/11/2013 8:48:29 AM]


Moving Historian Custom Tables

FIGuRE 14: NEw LINKEd SERVER

4. In the New Linked Server dialog box, type the Network name of the SQL Server you want to link to.

file:///C|/inetpub/wwwroot/t002731/t002731.htm[3/11/2013 8:48:29 AM]


Moving Historian Custom Tables

FIGuRE 15: TYPE tHE NEtwORK NAME Of tHE LINKEd SERVER

5. For Server type, click SQL Server, then click OK.

Note: This procedure often refers to the server you are linking to as the remote server. This is for convenience only, to indicate the
relationship of the linked (remote) server to the local server. Do not confuse this usage with the obsolete remote server functionality in
SQL Server.

file:///C|/inetpub/wwwroot/t002731/t002731.htm[3/11/2013 8:48:29 AM]


Moving Historian Custom Tables
6. In the New Linked Server dialog box, click the Security page (Figure 16 below).

FIGuRE 16: SEcuRItY SEttING fOR NEw LINKEd SERVER

7. Click the Be made using this security context option, then provide the Admin level Remote Login and Password.

file:///C|/inetpub/wwwroot/t002731/t002731.htm[3/11/2013 8:48:29 AM]


Moving Historian Custom Tables

FIGuRE 17: PROVIdE SEcuRItY CONtEXt

11. Click Server Options.

12. Set the RPC and RPC Out parameters to True, then click OK.

file:///C|/inetpub/wwwroot/t002731/t002731.htm[3/11/2013 8:48:29 AM]


Moving Historian Custom Tables

FIGuRE 18: RPC ANd OtHER LINKEd SERVER OPtIONS

13. Click OK.

Transfer all Records from the Old Tables to the New Tables
Now you have a Historian Server that contains custom tables, and you have tables in the target Historian Server with the same tables

file:///C|/inetpub/wwwroot/t002731/t002731.htm[3/11/2013 8:48:29 AM]


Moving Historian Custom Tables
but no data.

You have a linked server relationship between the Servers, and you are now ready to copy data from the original tables to the new
tables.

Use the following SQL statement to copy the data (provide your actual table names).

INSERT CustomTable1 (ID, Name)


SELECT * FROM OPENQUERY([ORIGINALHISTORIANSERVERNAME],'SELECT ID,Name FROM [Runtime].[dbo].[CustomTable1]')

M. Salah

Tech Notes are published occasionally by Wonderware Technical Support. Publisher: Invensys Systems, Inc., 26561 Rancho Parkway South, Lake Forest, CA 92630. There is also
technical information on our software products at Wonderware Technical Support.

For technical support questions, send an e-mail to [email protected].

Back to top

©2013 Invensys Systems, Inc. All rights reserved. No part of the material protected by this copyright may be reproduced or utilized in any form or by any means, electronic or
mechanical, including photocopying, recording, broadcasting, or by anyinformation storage and retrieval system, without permission in writing from Invensys Systems, Inc.
Terms of Use.

file:///C|/inetpub/wwwroot/t002731/t002731.htm[3/11/2013 8:48:29 AM]

You might also like