This topic describes the basic concepts involved with provisioning VDBs from SQL Server dSources or even other SQL Server VDBs.
A dSource is a virtualized representation of a physical or logical source database. As a virtual representation, it cannot be accessed or manipulated using database tools. Instead, you must create a virtual database (VDB) from a dSource snapshot. A VDB is an independent, writable copy of a dSource snapshot. You can also create VDBs from other VDBs. Once you have provisioned a VDB to a target environment, you can also implement snapshot and retention policies for the VDB, which will determine how frequently Delphix Engine will take a database snapshot and how long the snapshots will be retained for recovery and provisioning purposes.
When provisioning a VDB, Delphix creates the database with the default SQL Server database options. If the database options have been altered on the source database and you wish for the VDB to reflect these same options, they would need to be altered via a Post-Script or by Customizing SQL Server VDB Management with Hook Operations.
For an overview of the high-level components involved in provisioning a SQL Server VDB, see Overview of Setting Up SQL Server Environments.
Staging (Validated Sync) Target SQL Server Database User Requirements
Database users are mapped to SQL Server Logins through a mapping that is expressed by the SID property of logins and users. A login maps to a user in a database if their SID values are identical. The existing users cloned in the VDBs might need to be remapped to login in the new target instance. You can perform this operation either using
- sp_change_users_login, or
- in SQL Server 2005 SP2 and above by using a new clause of the ALTER USER statement.
Users that are not mapped to a login as a result of the database provisioning are deemed Orphan users. Alternatively, you can create additional new users on the VDBs that have been provisioned.
Validated Sync and LogSync
When you link a source database into the Delphix Engine, you must also specify a target environment that will host a staging database for the validated sync process, as described in Overview of Setting Up SQL Server Environments. In this process, the Delphix Engine continuously monitors the source database for new full and differential backups if the source database is using simple recovery model, or transaction log backups if using full recovery model. When it detects a new backup, it restores that backup to the staging database with the storage residing in Delphix. The result is a TimeFlow with consistent points from which you can provision a VDB, also known as snapshots.
- From the Datasets panel, click the group containing the dSource.
- Select the dSource.
- Click the TimeFlow tab.
Each snapshot is displayed and includes information about the source database, operating system, end stamp, and snapshot database change number (SCN for Oracle and LSN for SQL Server). You can scroll through these cards to select the one you want, or you can enter a date and time to search for a specific snapshot.
Once you have provisioned a VDB, you can also take snapshots of it. As with the dSource snapshots, you can find these when you select the VDB in the Datasets panel. You can then provision additional VDBs from these VDB snapshots.
If there are dependencies on the snapshot, you will not be able to delete the snapshot free space; the dependencies rely on the data associated with the snapshot.
Target/Validated Sync(Staging) SQL Server Database User Requirements
Database Users are mapped to SQL Server Logins through a mapping that is expressed by the SID property of logins and users. A login maps to a user in a database if their SID values are identical. The existing users cloned in the VDBs might need to be remapped to login in the new target instance and this is an operation which could be performed using sp_change_users_login or starting SQL Server 2005 SP2 by using a new clause of the ALTER USER statement. Users that are not mapped to a login as a result of the database provisioning are deemed as Orphan users. Obviously the other option is to create additional new users on the VDBs provisioned.