SQL Script: After Restore from PROD to TEST

Do you want PROD data in your TEST System? Easy, just restore a backup of PROD into your TEST-DB. Run the following script to clean up some AOS specific data:

Update [AX09_TEST].[dbo].[BatchServerGroup] set SERVERID = ’01@SRVAOS1′  where SERVERID = ’02@SRVAOS1′
–01: DEV, 02: PROD, 03: MIG

Update [AX09_TEST].[dbo].[BATCHSERVERCONFIG] set SERVERID = ’01@SRVAOS1′  where SERVERID = ’02@SRVAOS1′
–01: DEV, 02: PROD, 03: MIG

Update [AX09_TEST].[dbo].[SYSSERVERCONFIG] set SERVERID = ’01@SRVAOS1′ , SERVERGUID = newid() where SERVERID = ’02@SRVAOS1′
–01: DEV, 02: PROD, 03: MIG

Update [AX09_TEST].[dbo].[Batch] set SERVERID = ’01@SRVAOS1′  where SERVERID = ’02@SRVAOS1′
–01: DEV, 02: PROD, 03: MIG

delete [AX09_TEST].[dbo].[SYSCLIENTSESSIONS]

–the following has nothing to do with the restore to TEST
–remove obsolete [SYSCLIENTSESSIONS] from PROD

select * from [AX09_LIVE].[dbo].[SYSCLIENTSESSIONS] where STATUS = 0

delete [AX09_LIVE].[dbo].[SYSCLIENTSESSIONS] where STATUS = 0

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s