Create Microsoft SQL Server Region and a Cross-Region Database Using Script Files

Use these steps to create a region database, and if one does not already exist, a cross-region database. (This process also assumes that your enterprise server region is already correctly configured to run your application.)

  1. To create a script file for a region database, on the command line, enter the following command:
    dbfhadmin -script -type:region -provider:ss -name:<ES-name> -file:<script-name.sql> 

    where <ES-name> is the name of the enterprise server region that will use the region database, and <script-name.sql> is the name of the script file to be created.

    Note: If you omit the -file option, the default name is create_region_<ES-name>_ss.sql.
  2. To create a script file for a cross-region database, on the command line, enter the following command:
    dbfhadmin -script -type:crossregion -provider:ss -file:<script-name.sql> 
    Note: If you omit the -file option, the default name is create_crossregion_ss.sql.

    Before you run the -createdb command, ensure that the sqlcmd command is on the PATH.

  3. To create the region database, on the command line, enter the following command:
    dbfhadmin -createdb -usedb:<instance> -provider:ss -type:region -name:<ES-name> -file:<script-name.sql> -user:<user> -password:<pass>

    where <instance> is the SQL server instance name, and <user> and <pass> are valid logon credentials for the database. If -user and -password are not specified, SQL Server SSPI authentication is used - see your SQL Server documentation for more details.

  4. To create the cross-region database, on the command line, enter the following command:
    dbfhadmin -createdb -usedb:<instance> -provider:ss -type:crossregion -file:<script-name.sql> -user:<user> password:<pass> 

    where <instance> is the SQL server instance name, and <user> and <pass> are valid logon credentials for the database. If -user and -password are not specified, SQL Server SSPI authentication is used - see your SQL Server documentation for more details.

Next, you must configure your enterprise server region to use the database(s).