Delphix lab exercises for use with LabAlchemy hands-on labs
Optional Advanced Exercise – Perform a Storage Performance Test through the CLI
Exercise 2 - Create delphix_disc login on Source and delphix_db login on target
This guide will get you started with Delphix's virtualization for SAP ASE. You will learn how to to securely copy and share datasets. Using virtualization, you will ingest data from sources and create virtual copies, which are full read-write capable database instances that use a small fraction of the resources a normal database copy would require.
Delphix Virtualization’s functionality is exposed through two interfaces: management/admin and self-service. Through the management/admin interface (the topic of this guide), DB administrators connect to source datasets and create resources such as virtual databases. Through the self-service interface, non-admin users can operate on data provided by administrators. A guide for self-service can be found here.
We also provide a guide for Delphix masking, and for other virtualization data sources such as MS SQL and postgresql.
=============
Perform these exercises when instructed by your Delphix Instructor.
Host | IP |
---|---|
Delphix Data Platform | 10.0.x.10 |
Source | 10.0.x.20 |
Target | 10.0.x.30 |
In the above IP addresses, the x denotes your Student Number. For example, if your student number is 5 , your Delphix Data Platform will be located at 10.0. 5.10.
User | Password |
---|---|
Initial Delphix sysadmin | sysadmin |
Initial Delphix admin | delphix |
At the login screen for the lab server, enter the username and password: delphix/delphix
In this exercise, you will:
Steps
As an advanced exercise, this lab has no corresponding Lab Solution. Instead, we will walk through the steps to get you acquainted with your lab system and the Delphix CLI.
Type: ssh sysadmin@10.0.x.10 (‘x’ is your Student Number assigned by your instructor)
a. If you receive a prompt asking you if you are sure you want to connect, enter: Yes
b. Enter the password: sysadmin
c. Escape to the standard CLI prompt by typing: discard
d. You are now at the root of the Delphix CLI as a System Administrator
Create a storage test by typing: storage test create (see figure !!!)
a. List the default storage test parameters by typing get
b. Override the duration and set it to 5 minutes: set duration=5
c. Begin the storage test by typing: commit
d. This test will take anywhere between 5-10 minutes to complete.
View the storage test results
a. Get back to the storage test section of the CLI by typing: storage test list
b. View a list of completed tests by typing: ls
c. Type “select” followed by the name of the test from the list. For example: select STORAGE_TEST-1
d. Enter the result command by typing: result
e. Then type: commit
In this exercise, you will:
Steps
Configure the Delphix Engine and accept all defaults (confirm that it is your local timezone).
Note - you can just mark the appliance as registered; no support credentials are required for this lab.
Additional resources to learn more:
The admin and sysadmin User Roles
Setting Up the Delphix Data Platform
In this exercise, you will:
Context
Delphix requires access to database users with certain privileges. These are configured through automated scripts.
Steps
Execute the following on the source instance. This is creating the delphix_disc user with select on privileges on sysdatabases, sysservers, and syslisteners:
isql –Usa –Pdelphixdb –SLINUXSOURCE
sp_addlogin delphix_disc, delphix_disc
go
sp_adduser delphix_disc
go
grant select on sysdatabases to delphix_disc
go
grant select on sysservers to delphix_disc
go
grant select on syslisteners to delphix_disc
go
exit
See below for what this will look like:
Steps
Execute the following on the target instance. This is creating the delphix_db user and grant sa_role and sybase_ts_role to delphix_db login
isql –Usa –Pdelphixdb –SLINUXTARGET
sp_addlogin delphix_db, delphix_db
go
sp_adduser delphix_db
go
sp_role “grant”, sa_role, delphix_db
go
sp_role “grant”, sybase_ts_role, delphix_db
go
exit
a. Validate Source Environment with Hostchecker
In this exercise, you will:
Steps
tar -xvf hostchecker_linux_x86.tar
./hostchecker/hostchecker.sh
to run the hostchecker utility.source
If you have completed all of the checks and they have returned SUCCESS and ALL OK, you have completed
this exercise. You can type quit
to exit hostchecker.
Note: The sshd_config test may return a WARNING response, which is normal in a production installation due to permissions on the file. If hostchecker is run as root for this test, it will perform the test properly.
b. Validate the Target Environment with Hostchecker
In this exercise, you will:
Steps
tar -xvf hostchecker_linux_x86.tar
./hostchecker/hostchecker.sh
to run the hostchecker utility.target
If you have completed all of the checks and they have returned SUCCESS and ALL OK, you have completed
this exercise. You can type quit
to exit hostchecker.
Note: The sshd_config test may again return a WARNING response, which is normal in a production installation due to permissions on the file. If hostchecker is run as root for this test, it will perform the test properly
In this exercise, you will:
a. Adding Source Environment
Context
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.
Steps
You should now see the Source environment listed under the Environments panel.
b. Adding a Target Environment
Context
The target environment is the host where the virtual databases will be created.
Steps
You should now see the Target environment listed under the Environments panel.
Context
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. Additional details on sync functionality can be found here.
Steps
Perform the following steps after the Source and Target Environment is created:
ssh 10.0.x.20
with x as your student number) as the delphix user. Run the following commands: cd labs
./dumpfull_testdb.sh
Special Note: This lab has a specific configuration that leverages the Target Host as a Staging Host. This is fine for simple use cases. However, for optimal performance, the two should be separate. In order to complete this lab, you must register the Target Host as the Staging Host as well. This is done by accessing the Target Host from the “Environments” tab, going to the “Databases” tab, selecting the edit pencil on LINUXTARGET, and the clicking the “Use as Staging” option. See below:
/u02/sybase_back
c. Choose Target as the Staging Environment and LINUXTARGET as the Repository
d. Click Enabled for LogSyncYou will know this is successful if the dSource completes in the Actions pane without errors. Click on Actions in the top menu bar if you don’t see this pane. You can monitor job progress here, and see what fails or is completed.
In this exercise, you will:
Context
Hook operations allow users to execute custom operations at select points during linking sources and managing virtual datasets.
Steps
$SYBASE/OCS-15_0/bin/isql –Usa –Pdelphixdb –SLINUXTARGET << EOF
sp_addlogin appuser, appuser
go
sp_adduser appuser
go
EOF
IMPORTANT: Make sure the carriage returns you see are the same as above. e. Click the Create button
In this exercise, you will:
Context
The objective of Delphix virtualization is to provide easy access to virtualized databases that resemble production and other data systems. Here, we provision a Virtual Database (VDB). VDBs are fully functional database images that can be created from dSources.
Steps
Go to Manage -> Datasets, and select the testdb dSource. Provision a VDB by clicking on the leftmost icon on the snapshot. In the wizard, include the following details: a. Destination Environment: Target b. Select “Add Dataset Group” and name this target group “DB Target” c. Database Name: devdb d. Truncate Log On Checkpoint: Enabled e. Click Next f. Accept default policies e. Click Next to proceed without masking g. On the Hooks page, click the plus sign. Select “Create from Template.” h. Call the new Hook Operation “Create APPUSER” and select Hook Point = “Configure Clone.” i. Click Create, then Next j. Review the summary and click Submit.
Complete the VDB creation
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 DB Targets 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:
- SSH to Linux Target A as the delphix user
- Run the following commands:
isql –Usa –Pdelphixdb –SLINUXTARGET
sp_helpdb devdb
go
sp_displaylogin appuser
go
This will verify that the VDB is online with the VDB Operation Template we specified, and that the appuser user was created by our hook.
There are four types of Policies in Delphix. In this exercise, you will:
Context
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
In this exercise, you will:
Context
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
isql –Usa –Pdelphixdb –SLINUXSOURCE
use testdb
go
create table t1 ( comments varchar(100))
go
insert into t1 values (‘test data’)
go
exit
Transaction log dump on testdb:
cd /home/delphix/labs
./dumptran_testdb.sh
Once the refresh has completed, you can log into devdb to confirm:
isql –Usa –Pdelphixdb –SLINUXTARGET
use devdb
go
select * from t1
go
If this returns a count of 1 row, the refresh was successful.
In this exercise, you will:
Context
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
isql –Usa –Pdelphixdb –SLINUXTARGET
use devdb
go
insert into t1 values (‘before rewind’)
go
isql –Usa –Pdelphixdb –SLINUXTARGET
use devdb
go
drop table t1
go
We just dropped the t1 table. Now we will rewind the VDB to that last good snapshot to fix this.
Once the rewind operation is complete, you can confirm the rewind was successful by connecting to the server again and querying the database:
isql –Usa –Pdelphixdb –SLINUXTARGET
use devdb
go
select * from t1
go
The count should return 2 rows. You are back in action!
Note: This exercise is only possible if your classroom has been configured with 2 or more students.
In this exercise, you will:
Steps
As an advanced exercise, this lab has no corresponding Lab Solution. Instead, we will walk through the steps to get you acquainted the Delphix Replication capability.
Add a Replication Profile called DR Replica
a. Click the plus sign next to Replication Profiles on the top left
b. Enter a Replica Profile Name: DR Replica
c. For Target Engine, enter the Delphix Engine IP address for the next student in your classroom environment. If you are the last student, use the Delphix Engine IP address for Student 1. For example, in a class with 3 students:
i. Student 1 Delphix Engine is at 10.0.1.10, and they will replicate to 10.0.2.10 ii. Student 2 Delphix Engine is at 10.0.2.10, and they will replicate to 10.0.3.10 iii. Student 3 Delphix Engine is at 10.0.3.10, and they will replicate to 10.0.1.10 iv. Ask your instructor if you have any questions or confusion about this configuration.
d. Enter the User Name: delphix_admin
e. Enter the Password: delphix
f. Do not enable Automatic Replication or configure Traffic Options
g. For the Objects Being Replicated, select: Entire Delphix Engine
h. Click Create at the bottom when ready.
Once the initial full replication is complete, you will see a message stating “Last Replication Successful.”
Check the results on your target Delphix Engine
a. In your lab server browser, enter the IP address you used for the Target Engine in your replica profile. For example, if you are Student 1, your Delphix Engine is at 10.0.1.10, and your target would have been 10.0.2.10.
b. Log in as user delphix_admin with the password delphix Lab Exercises 21 © 2015 Delphix Corp. All rights reserved
c. Observe the dropdown list next to Databases on the top left corner of your screen. It currently says Available which is the default Namespace for Delphix replica targets.
d. In order to see the replica objects, click on the dropdown list and select the second entry, which should be the IP address of the Source Delphix Engine that sent the replica.