Upload
donhan
View
215
Download
1
Embed Size (px)
Citation preview
ContentsSET UP.........................................................................................................................................................................................3
WORK FLOW FOR MODEL REFRESH:..............................................................................................................................9
HIGH LEVEL STEPS TO MODEL REFRESH:....................................................................................................................9
DETAILED STEPS:.................................................................................................................................................................10
SQL TRANSFORM FOR DETACH OPERATION:.........................................................................................................................10FILE COPY TRANSFORM:.........................................................................................................................................................12FILE RENAME TRANSFORM:....................................................................................................................................................13DELETE FILE TRANSFORM:.....................................................................................................................................................14SQL OPERATION – ATTACH MODEL......................................................................................................................................15SYNCHRONIZE LOGIC CONTROL:............................................................................................................................................17
Generate LNP Model in DG Page 2 of 18 5/7/2023 8:33:26 AM
SET UP
Create a new Data Guru project with all database connections set to SQL2008R2 (My workspace included).Key is to have a LNP model built in SQL 2008 version (In order to run the model using LNP tool)Have a backup of LNP model and LNPModel.mdf in the .\Templates folder for the project created
Connect to SQL Server Console to get the user instance name for SQL 2008 R2
Generate LNP Model in DG Page 3 of 18 5/7/2023 8:33:26 AM
Now go to SQL Server Management Studio (SMSS)
In the dropdown choose database engine option. The following dialog appears. In the Server name paste the pipe name value captured using SQL Server Console as indicated in the red box below.
Generate LNP Model in DG Page 4 of 18 5/7/2023 8:33:26 AM
Note that the pipe name varies from machine to machine
Once the connection to User instance is established as seen the image below
Right click on Databases Attach
Generate LNP Model in DG Page 5 of 18 5/7/2023 8:33:26 AM
Click on Add and navigate to the location to the .MDF file in the .\Templates folder
Generate LNP Model in DG Page 6 of 18 5/7/2023 8:33:26 AM
Attach the backup to the .\Templates location in the DG project subfolders
Once the model is attached refresh the Databases in Object Browser to see the LNPModel as one of them.
Now create a new SQL database connection in Data Guru. Use the pipe name for the server name to connect the database that was attached previously. As indicated the image to follow.
Generate LNP Model in DG Page 7 of 18 5/7/2023 8:33:26 AM
Work Flow for Model Refresh:
High Level steps to model refresh:
o Detach LNPModel from the pipe named servero Copy the model from .\Templates to .\Outputs folder using a File Transform Actiono Rename the copied over file in the .\Outputs folder to a different name using File Rename
Transformo Delete the log files (ldf) for both the .\Templates folder (only need the first time) and also
for the renamed files on subsequent runso Now reattach the mdf file from the .\Outputs folder to pipe named user instanceo Use a synchronize logic control to allow the database engine to make the newly attached
database ready for use before running any actions on the database
Generate LNP Model in DG Page 9 of 18 5/7/2023 8:33:26 AM
Detailed steps: First the detach operation is a SQL transform with a connection to the My Workspace database.
SQL Transform for Detach operation:
SQL operation – Detach Model pic 1
Generate LNP Model in DG Page 10 of 18 5/7/2023 8:33:26 AM
File Rename Transform:File moved to the .\Outputs folder is now renamed
Generate LNP Model in DG Page 13 of 18 5/7/2023 8:33:26 AM
Delete File Transform:
Delete the log files for both the first time ever run. In the image below #2 will only be needed the first time around. As the macro is run repeatedly #1 will be needed.
SQL Operation – Attach Model
Generate LNP Model in DG Page 14 of 18 5/7/2023 8:33:26 AM
Synchronize Logic Control:
‘A must use action’ after executing Attach DB script. This helps the DB engine process the command and ensures the attached database is ready for use. This is to be executed on My Workspace database as well
Generate LNP Model in DG Page 17 of 18 5/7/2023 8:33:26 AM