Skip to main content
Skip table of contents

CLI cookbook: linking a SQL Server database loading from a specific full backup of the source database

This topic describes how to use the command-line interface to link a SQL Server database by loading from a specific full backup of the source database as indicated by the backup UUID.

Prerequisites

  • You can get the backup UUID for the all backup files of a chosen database using the following query on the source database under the column backup_set_uuid

    CODE
    Use master
    select backupset.database_name,
          backupset.type,
          backupset.backup_set_id,
          backupset.backup_set_uuid,
          backupset.family_guid,
          backupset.position,
          backupset.first_lsn,
          backupset.last_lsn,
          backupset.database_backup_lsn,
          backupset.name,      
          backupset.has_bulk_logged_data,     
          backupset.is_damaged,      
          backupset.begins_log_chain,      
          backupset.is_copy_only,      
          backupset.backup_finish_date,      
          backupset.database_version,      
          backupset.database_guid,
          mediafamily.logical_device_name,
          mediafamily.physical_device_name
    from msdb.dbo.backupmediafamily mediafamily join msdb.dbo.backupset backupset
    on mediafamily.media_set_id = backupset.media_set_id where backupset.database_name = N'<Database Name>'
    order by backupset.backup_finish_date desc

Procedure

Enter these commands through the Delphix Engine command-line interface:

CODE
/database; 

link;
set type=LinkParameters;
set name=<dSource name>;
set group=<group name>;

set linkData.type=MSSqlLinkData;
set linkData.syncParameters.type=MSSqlExistingSpecificBackupSyncParameters;
set linkData.config=<source database>;
set linkData.sharedBackupLocations="<source database backup locations>";
set linkData.pptRepository=<SQL instance on the staging server>;
set linkData.sourcingPolicy.type=SourcingPolicy;
set linkData.mssqlUser.type=MSSqlDomainUser
set linkData.mssqlUser.user=ad\dbuser
set linkData.mssqlUser.password.password=dbuserpwd
set linkData.syncParameters.backupUUID=<backup UUID>;
set linkData.ingestionStrategy.type=<ingestion strategy type>;
set linkData.ingestionStrategy.validatedSyncMode=<validated sync mode type>; 

commit;
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.