Design question


Author
Message
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Keith....I'm guessing you saw Transformers BigGrin  Great movie!!!
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
When you create the DatabaseMigrator class you provide the SQL server and authentication information.

_DatabaseSetup = New DatabaseMigrator(_SQLServer, False, Me, _SQLUserName, _SQLPassword)

Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
found it.....

Keith Chisarik
Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
where would you tell it what SQL server/security information to use?

Keith Chisarik
Ben Hayat
Ben Hayat
Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)Advanced StrataFrame User (516 reputation)
Group: Forum Members
Posts: 374, Visits: 1.2K
Greg McGuffey (07/05/2007)
So what might be cool is to do this in a console app, and pass in the db name





' Main sub of a deployment console app named 'DeployDb'

Sub Main(args() As String)

'-- First argument is package path and second is database name

Dim loPackageFile As String = args(0)

Dim loDataBaseName As String = args(1)



Dim loDatabase As New DatabaseTargetName(loDataBaseName )

loDatabase.NameOnServer = "MyProfileDBName_One"

_DatabaseSetup.DeployMetaData(loPackageFile , New DatabaseTargetName() {loDatabase})

End Sub





Then you could create a batch file to update all the databases easily, even build it into the build script in VS.





:: In batch file

DeployDb "c:\data\myPackage.pkg","companyA_DbName"

DeployDb "c:\data\myPackage.pkg","companyB_DbName"

DeployDb "c:\data\myPackage.pkg","companyC_DbName"



Greg, I think you just earned your "Advance SF User" title! Wink

..ßen
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
So what might be cool is to do this in a console app, and pass in the db name





' Main sub of a deployment console app named 'DeployDb'

Sub Main(args() As String)

'-- First argument is package path and second is database name

Dim loPackageFile As String = args(0)

Dim loDataBaseName As String = args(1)



Dim loDatabase As New DatabaseTargetName(loDataBaseName )

loDatabase.NameOnServer = "MyProfileDBName_One"

_DatabaseSetup.DeployMetaData(loPackageFile , New DatabaseTargetName() {loDatabase})

End Sub





Then you could create a batch file to update all the databases easily, even build it into the build script in VS.





:: In batch file

DeployDb "c:\data\myPackage.pkg","companyA_DbName"

DeployDb "c:\data\myPackage.pkg","companyB_DbName"

DeployDb "c:\data\myPackage.pkg","companyC_DbName"


Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
You will just do this at deployment time through the DatabaseMigrator class.  You can see a sample of this in the sample titled "Database Installer" through the sample console.  Below is some code showing how to use a different database name while using the same package file.  Be sure that your data file in your file group uses the $DbName$ tag within the DDT itself so it can create a proper file name for each database on the server....otherwise you will get an error because the file name for the file group is already in use.

Dim loDatabase As New DatabaseTargetName("MyProfileDBName")

loDatabase.NameOnServer = "MyProfileDBName_One"
_DatabaseSetup.DeployMetaData(PackageFilePathandFileName, New DatabaseTargetName() {loDatabase})

loDatabase.NameOnServer = "MyProfileDBName_Two"
_DatabaseSetup.DeployMetaData(PackageFilePathandFileName, New DatabaseTargetName() {loDatabase})

loDatabase.NameOnServer = "MyProfileDBName_Three"
_DatabaseSetup.DeployMetaData(PackageFilePathandFileName, New DatabaseTargetName() {loDatabase})

Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
Trent said: the DDT has the ability to take a single profile and allow you to deploy to a different database name using the same profile package



how might one do this please? and then automate it....



Would I create a command line project as suggested above, how do I change the database name to deploy to?



Thanks.

Keith Chisarik
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
It just occurred to me that as part of the automation you could write a command line DDT package installer. That way you could use batch/command files to update all dbs at once. You could have the db name as one of the parametersw (package file would likely be a parameter as well). Then you could easily update gagillions of dbs with one script BigGrin
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Yep, it seems in your situation, multiple would be the better approach. If I were you however, I'd spend some time automating some of the admin, such that 500 dbs will be only a slightly more work to update than 20 BigGrin



I'd suggest that you have a rule that any customization only ADDS to the database, so any updates to the standard schema are always valid in all cases. You could of course ignore existing columns/tables for a customer, but you don't want to get into the situation where you can't update a customer because the standard schema has been customized...that would get ugly very fast.



GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search