Delphix lab exercises for use with LabAlchemy hands-on labs
Perform these exercises when instructed by your Delphix Instructor. It is suggested that you use the latest version of the Windows MS SQL lab. This lab guide is designed for version 6.0.6 and on.
In this exercise, you will:
ssh sysadmin@10.0.x.10
(‘x’ is your Student Number assigned by your instructor)
storage test create
get
set duration=3
ls
at the command promptcommit
Example Storage Test Configuration
storage test
ls
select STORAGE_TEST-1
result
commit
Example Storage Test Results
From your Student Desktop home screen, double click the RDP icon. This will open Remmina Remote Desktop client. Before we can continue these labs, you must connect to your Windows Source and Target and join them to the delphix.local domain.
Please note, it may take some time for the Windows servers to come online. If the Connecting dialog stays open for more than 5-10 seconds, cancel and try again in a few minutes.
Once you have completed these steps, perform the following steps to set up the Windows Target :
See The RDP Client under Getting Started for more information on using the RDP application.
In this exercise, you will:
You will know this is successful when you see the main Delphix UI screen with a single group (Untitled) on the left hand side.
Related Links The delphix_admin and sysadmin User Roles Setting Up the Delphix Engine
In this exercise, you will:
Note: You may need to scroll down on the right-hand side of the RDP window to see the Windows Start button or expand the screen.
In this exercise, you will:
In this exercise, you will:
Before we start this exercise is important to mention that in Delphix, a Target and Staging server have the same configuration. It’s a Delphix best practice to isolate the Staging workload from the VDB workload, so that’s why it has a different name, but from a requirements point of view, they are the same.
On the Host and Server tab choose Windows as the Host OS and Target as the Host Type then click Next
Click the “ Download Delphix Connector Installer “
Once it finishes downloading, click Keep
In this exercise, you will:
The target environment is the host where the virtual databases will be created.
x
is your Student Number )In this exercise, you will:
Before users can create their own virtual databases, Delphix needs to connect to source data. In Delphix, an environment is a host that runs database software. The environment is where the Delphix engine will search for available data sources. Credentials to access the host need to be provided while configuring an environment.
The creation is successful when “Create and discover environment 10.0.x.50” completes without error and WINSOURCE appears on your Delphix Environments page
In this exercise, you will:
With an environment set up, users can then sync databases into Delphix. The Delphix engine will read the source database and create a dSource (a custom object). The dSource is not a functional image of the database but a storage-efficient object from which virtual databases can be created. When creating a dSource, Delphix will pull over the complete data set using standard database protocols. Subsequent sync operations, as governed by user-defined policies, will pull only incremental changes.
Navigate to Manage -> Datasets
Click the Plus ![images/s/en_GB/7104/0e21dd459285e7b3b5e0deaa2193b2af8bbb7c8b//images/icons/emoticons/add.png](images/s/en_GB/7104/0e21dd459285e7b3b5e0deaa2193b2af8bbb7c8b//images/icons/emoticons/add.png) and choose Add dSource from the drop-down
On the Add dSource wizard, review the information and pre-requisites on the Preparation tab then click Next
On the Source tab click the AdventureWorks2008R2 Data Source to select it and enter the information below
Environment User: delphix\delphix_src
Select the Database User radio button
Database Username: delphix_db
Database Password: delphix
Click Validate
Click Next
Click the “Add Dataset Group” link
Enter the Group Name: MS SQL Databases
Click OK and select the new group in the list
Click Next
Select “Use the most recent full or differential backup”
For Backup Path, enter: \\10.0.x.50\Backups (‘x’ is your Student Number )
For Staging Environment, select WINTARGET
For Validated Sync Mode, select Transaction log backups and click Enabled next to LogSync
Click Next
Click Next
Verify your settings and click Submit
Go to the main Delphix page by clicking Delphix in the top left corner of the GUI
Monitor the AdventureWorks dSource addition via the progress bar and the Actions pane
In this exercise, you will:
Create a VDB called devdb
Log into the VDB
The objective of Delphix virtualization is to provide easy access to virtualized databases (VDBs) that resemble production and other data systems. VDBs are fully functional database images that can be created from dSources.
Steps
Click the AdventureWorks2008R2 dSource in the MS SQL Databases group
Select the most recent snapshot and click Provision
Enter the Database Name: devdb
Click Next
Select the dataset group “MS SQL Databases group”
Click Next
Keep the defaults values for retention and click Next
Keep the defaults for hooks and click Next
Verify settings and click Submit
It may take a couple minutes for the VDB creation to complete. You can monitor the progress on the left hand side of the screen next to the devdb object in the MS SQL Databases group. On the Actions pane on the right hand side of the screen, you should see the Provision virtual database “devdb” item move to the Recently completed pane without error. Once the VDB is created, you can verify that the VDB is operational by:
Log into the Target via RDP
Click Start and go to SQL Server Management Studio
Click Connect to log in as delphix\delphix_trgt
Expand Databases
Note the “devdb” virtual database
Note the validated sync database (named with a GUID)
In this exercise, you will:
Create a new table on your source database
Snapshot the dSource
Refresh your VDB - devdb
Verify the new table appears on the VDB
VDBs can get out of sync as new data comes into the source system. Refreshing a VDB will re-provision it from the dSource. Refreshing a VDB will delete any changes that have been made to it over time.
Steps
Log into the Source via RDP
Go to Start -> All Programs -> Microsoft SQL Server 2008 R2 -> SQL Server Management Studio
Under Authentication, select “SQL Server Authentication”
Log in as sa/delphix
Expand “Databases”
Right click AdventureWorks2008R2, then select New Query
Run the following command (by clicking Execute):
select * into sourcetab from AdventureWorks2008R2.HumanResources.vEmployee;
Go back to the Delphix Engine GUI
Within a couple of minutes a new timecard will appear for the dSource
Once the refresh has completed, you can log into devdb to confirm.
Log into the Target via RDP
Go to Start -> All Programs -> Microsoft SQL Server 2008 R2 -> SQL Server Management Studio
1. Under Authentication, select "SQL Server Authentication"
2. Log in as sa/delphix
Expand “Databases”
Right click devdb, then select New Query
Run the following command:
select count(*) from sourcetab;
If this returns a count of rows, the snapshot/refresh was successful.
In this exercise, you will:
Take a snapshot of the devdb VDB
Delete a table
Rewind the devdb VDB to recover the table
Rewinding a VDB rolls it back to a previous point in its Timeflow and re-provisions the VDB. The VDB will no longer contain changes after the rewind point. it can be triggered when changes to the VDB do not need to be saved.
Steps
Log into the Target via RDP
Go to Start -> All Programs -> Microsoft SQL Server 2008 R2 -> SQL Server Management Studio
1. Under Authentication, select "SQL Server Authentication"
2. Log in as sa/delphix
Expand “Databases”
Right click devdb , then select New Query
Run the following commands:
drop table sourcetab; select count(*) from sourcetab;
You will receive an error “Invalid Object name ‘sourctab’. Do not close the query window. Now we will rewind the VDB to the last good snapshot to recover the table.
Select the devdb VDB
Select the snapshot card associated with the date/time you recorded prior to dropping the table.
Rewind the VDB to the snapshot card.
Once the rewind operation is complete, you can confirm the table has been recovered: Go to SQL Server Management Studio on Target SQL server and run the following command. select count(*) from sourcetab; The should receive a count of the table.
There are four types of Policies in Delphix. In this exercise, you will:
Create a Retention Policy
Set the new policy to keep snapshots and logs for 30 days, along with 3 monthly snapshots
Apply the policy to the VDB we created in the previous exercise
Both dSources and VDBs timeflow is governed by snapshots, which are either created manually or through policies. Retention policies govern the lifespan of such snapshots and help clean older ones that are no longer relevant.
Steps
Navigate to Manage -> Policies
Create a new retention policy (by going to the “Retention” tab and clicking the “+ Retention” blue button) for devdb with the following details:
1. Name: Long Term
2. 30 days of snapshot and log retention
3. 3 monthly snapshots taken on the 1st of the month
In this exercise, you will:
Create a Hook Operation Template called: CREATE APPUSER
Insert code into the template that will create a Login and database user named appuser
Hook operations allow users to execute custom operations at select points during linking sources and managing virtual datasets.
Steps
Create a new Hook Operation Template called: Create APPUSER
Click on the Manage menu
Click on Hook Templates
Click on Plus sign
Name - CREATE APPUSER
Type - Powershell Script
Contents (enter exactly - opening the lab in the lab server and copy/pasting this is highly recommended):
[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.SMO')
$sqlserver = "."
$dbname = $env:VDB_DATABASE_NAME
$name = "appuser"
$Server = New-Object ('Microsoft.SqlServer.Management.Smo.Server') $sqlserver
if (-Not $Server.Logins.Contains($name))
{
$Login = New-Object -TypeName Microsoft.SqlServer.Management.Smo.Login -ArgumentList $Server, $name
$Login.LoginType = 'SqlLogin'
$Login.Create('delphix')
}
$database = $server.Databases["$dbname"]
$user = new-object ('Microsoft.SqlServer.Management.Smo.User') $database, $name
$user.Login = $name
$user.Create()
—|—
IMPORTANT: Make sure the carriage returns you see here are the same in the pasted contents.
Click Create
Click Close
In this exercise, you will:
Create a VDB called qadb
Use the Hook Operation Template we created previously
Log into the Target Instance
Verify the Hook Operation Template was successful
Steps
Click the AdventureWorks2008R2 dSource in the MS SQL Databases group
Select the most recent snapshot and click the Provision icon
Select WINTARGET on the left pane of the wizard and click Next
Select the dataset group “MS SQL Databases group”
Enter the Database Name: qadb
Click Next to accept default policies
Click Next to proceed without masking
On the Hooks tab add a Configure Clone Hook (1. Click on the Plus sign. 2. Click on Create from Template)
On the Hook Operation dialog box, verify that Configure Clone is selected for the Hook Point
Enter a name - APPUSER
Click Create
It may take a couple minutes for the VDB creation to complete. You can monitor the progress on the left hand side of the screen next to the qadb object in the MS SQL Databases group. On the Actions pane on the right hand side of the screen, you should see the Provision virtual database qadb item move to the Recently completed pane without error. Once the VDB is created, you can verify that the VDB is operational by:
Log into the Target via RDP
Go to Start -> All Programs -> Microsoft SQL Server 2008 R2 -> SQL Server Management Studio
Under Authentication, select “SQL Server Authentication”
Log in as appuser/delphix
Expand “Databases”
Select qadb -> Security -> Users
This will verify that the VDB is online and that the APPUSER user was created by our hook.
Create a table
Delete the table
Backup transaction log
Recover the table from transaction log(log sync)
Steps
Create a table as follows on source server select * into Logsync_tab from AdventureWorks2008R2.HumanResources.vEmployee; ( Note the time )
Wait for few minutes (to give time for the table to be created)
Drop the table called Logsync_tab and note the time.
drop table Logsync_tab;
Take a transaction log backup (right-click on AdventureWorks2008R2 folder, click Tasks –> Back Up, and select Transaction Log from the dropdown labeled “Backup Type”)
Wait until the dSource Timeflow reflects this Transaction log time
Create a VDB by selecting date and time from the Timeflow
Choose the transaction log prior to latest log (Latest log is the log that has create and drop table actions).
Log into the Target via RDP
Click Start and go to SQL Server Management Studio
Click Connect to log in as delphix\delphix_trgt
Expand Databases
Expand the “ RecoverTable “ virtual database
In this exercise you will
Delink a dSource
Note the changes to Timeline of the dSource caused by the delink operation
Note the VDB provisioned from the delinked dSource is unaffected.
Steps
Login to the Delphix Admin UI as a user with Delphix_Admin privileges.
Navigate to Manage Datasets and click on the dSource “Adventureworks2008R2”
Unlink the dSource - Click on the ellipses (…) next to snapshot button and click on “Unlink dSource”
Click Unlink on the confirmation box that pops up.
Once action completes note the status of the dSource on the right hand side has changed to Detached. You will be unable to take additional snapshots of a detached dSource.
Note changes in the display. Click on Status and Configuration tabs and notice the changes.
Connect to the target VDB and confirm it is still running.
In this exercise you will
Create new user
Assign delphix_admin privileges to the new user.
Steps
Login to the Delphix UI as a delphix_admin
Click on Manage Users
Click on the + sign to add user
Create a new Engine Administrator user called DA_User (set in “User Type” dropdown). You can set password as ‘delphix’
Log out and re-login to the Delphix UI as DA_User
In this exercise you will:
Explore options available to check the audit logs
Identify the record representing user creation of DA_User user from previous exercise
Steps :
Login to the Delphix UI as the admin user.
Navigate to SystemAudit
Display audit records for the past week. From the Predefined Range drop down pick 1 Week to show Audit logs from the past week.
Filter the records for USER. In the filter box on the top right hand side of the Audit page enter User , to filter out only the user action related records.