StrataFrame Forum

Deployment Options for DatabaseMigrator class?

http://forum.strataframe.net/Topic27839.aspx

By Edhy Rijo - 8/5/2010

When using the DDT to deploy a package there are 3 Deployment Options available:

1- Standard Deployment

2- Deploy Stored Procedures, Views and UDFs Only.

3- Deploy Data Only



When using the DatabaseMigrator class, is there a way to provide a Deployment Option?



I have a customer with several million records and sometimes only a View or Stored Procedure changed, but the deployment will take over 30 minutes when using the DatabaseMigrator and I would like to programatically setup my update process to only update what have changed.



Thanks!
By Ivan George Borges - 8/5/2010

Hi Edhy.

Have a look at the DatabaseMigrator.DeployMetaData overload:

public void DeployMetaData(
string MetaDataPkgPathAndFileName,
string PkgPassword,
DatabaseTargetName[] DatabaseTargetNames,
bool sprocsViewsUdfsOnly)
 
Parameters
MetaDataPkgPathAndFileName (String)
The path and filename of the package file containing the metadata
PkgPassword (String)
The password for the package file
DatabaseTargetNames (array< DatabaseTargetName >[]()[])
A collection of target database names. This allows the database name to change dynamically from what is within the package file at run-time.
sprocsViewsUdfsOnly (Boolean)
By Edhy Rijo - 8/5/2010

Thank you Ivan.



I didn't notice the overload, I was using this code only:

_DatabaseSetup.DeployMetaData(_DDTPackagePathAndName, _DDTPackagePassword)



Now for the DatabaseTargetNames, I have to create a string array with the names of the database I want to create? usually will be just one name.
By Edhy Rijo - 8/5/2010

Ivan,



If you don't mind can you post a VB sample code on how to create the collection for the DatabaseTargetName?



_DatabaseSetup.DeployMetaData(_DDTPackagePathAndName, _DDTPackagePassword, DatabaseTargetName, True)

By Ivan George Borges - 8/6/2010

See if this ones help:

http://forum.strataframe.net/FindPost21603.aspx

http://forum.strataframe.net/FindPost20018.aspx

By Edhy Rijo - 8/6/2010

Thanks Ivan.
By Ivan George Borges - 8/6/2010

You're welcome, my friend. Cool
By Edhy Rijo - 8/6/2010

Hi Ivan,



This post by Randy Jean http://forum.strataframe.net/FindPost20066.aspx really helps.



Since what I am trying to do is build an self automated update process so when I release an update to the customer, based on some parameters this will update the database and deploy needed data without user intervention.



In this case, this database could have several million records and hence the need for me to control how the DatabaseMigrator class should apply the update, but I am having some problems figuring out how to let the DatabaseMigrator do their job automatically, probably using an encrypted XML file in the same folder as the DDT package file.



Anyway, thanks again for the prompt assistance and comments.
By Ivan George Borges - 8/6/2010

Yep, you really could send a parameters file and work with it depending on your situations.

Glad the links helped. Wink