Skip to main content
Delphix

How to Handle ASE Upgrades with Delphix Using the CLI (KBA6825)

 

 

KBA

KBA# 6825

Applicable Delphix Versions

Click here to view the versions of the Delphix engine to which this article applies
Major Release All Sub Releases
6.0 6.0.0.0, 6.0.1.0, 6.0.1.1, 6.0.2.0, 6.0.2.1, 6.0.3.0, 6.0.3.1, 6.0.4.0, 6.0.4.1, 6.0.4.2, 6.0.5.0

5.3

5.3.0.0, 5.3.0.1, 5.3.0.2, 5.3.0.3, 5.3.1.0, 5.3.1.1, 5.3.1.2, 5.3.2.0, 5.3.3.0, 5.3.3.1, 5.3.4.0, 5.3.5.0 5.3.6.0, 5.3.7.0, 5.3.7.1, 5.3.8.0, 5.3.8.1, 5.3.9.0

5.2

5.2.2.0, 5.2.2.1, 5.2.3.0, 5.2.4.0, 5.2.5.0, 5.2.5.1, 5.2.6.0, 5.2.6.1

5.1

5.1.0.0, 5.1.1.0, 5.1.2.0, 5.1.3.0, 5.1.4.0, 5.1.5.0, 5.1.5.1, 5.1.6.0, 5.1.7.0, 5.1.8.0, 5.1.8.1, 5.1.9.0, 5.1.10.0

5.0

5.0.1.0, 5.0.1.1, 5.0.2.0, 5.0.2.1, 5.0.2.2, 5.0.2.3, 5.0.3.0, 5.0.3.1, 5.0.4.0, 5.0.4.1 ,5.0.5.0, 5.0.5.1, 5.0.5.2, 5.0.5.3, 5.0.5.4

4.3

4.3.1.0, 4.3.2.0, 4.3.2.1, 4.3.3.0, 4.3.4.0, 4.3.4.1, 4.3.5.0

4.2

4.2.0.0, 4.2.0.3, 4.2.1.0, 4.2.1.1, 4.2.2.0, 4.2.2.1, 4.2.3.0, 4.2.4.0 , 4.2.5.0, 4.2.5.1

4.1

4.1.0.0, 4.1.2.0, 4.1.3.0, 4.1.3.1, 4.1.3.2, 4.1.4.0, 4.1.5.0, 4.1.6.0

How to Task

The article KBA6823 provided guidance on how to handle ASE upgrades primarily with the Delphix GUI. Due to the sheer number databases in an ASE instance, using the command line interface (CLI) to upgrade the dSources, staging databases, and VDBs can be more efficient.

Prerequisites

Upgrade your ASE instance following the upgrade instructions provided by SAP. There are typically two types of upgrades:

  1. An in place upgrade (also known as a binary overlay) is when you install a new version of ASE over an existing installation. This is probably the easiest to handle from a Delphix perspective because in most cases, you simply need to refresh the environment hosting the ASE instance and Delphix will register the new version in its metadata automatically. If you had to manually discover the ASE instance, you have to manually update Delphix with the new version (Configuring SAP ASE Manual Discovery).
  2. The other type of upgrade is when you install the new version of ASE in a separate directory. Then you use ASE utilities like sqlupgrade or DUMP/LOAD. Some customers even install the new version of ASE on a different host and give the new ASE instance a different name. This type of upgrade can certainly be handled by Delphix but takes a little more work as this article will illustrate.
Note

Notes:

If you rename an ASE instance, there is no simple way to tell Delphix that ASE instance "xyz.bc" is actually now named "xyz_16.bc".

If you rename an ASE instance, Delphix will consider this a brand new ASE instance. Basically, you will have to disable all dSources and VDBs, discover the new ASE instance (or manually add the ASE instance using manual discovery) and then migrate all of the dSources, staging databases and VDBs to the new ASE instance.

 

Enabling public key authentication to the Delphix Engine is highly recommend for the processes documented in this KBA. Without public key authentication, Delphix will prompt for a password for each CLI command:

CLI Cookbook: Configuring Key-Based SSH Authentication for Automation
 

While outside the scope of this article, it is worth mentioning that the open source utility "dxtoolkit" can do many of these steps with a single command line (see dx_ctl_dsource and dx_ctl_db ). At the time of this writing there is no dxtoolkit command to migrate VDBs so that action continues to need to be done through the CLI.

To Complete an ASE Upgrade Using the CLI

Migrate the dSources

When you migrate the dSource to point to a source database residing in a new version of ASE, you have to specify a compatible ASE instance for the staging database (also known as the "Staging Repository"). In this step, you need to set the "attachData.stagingRepository" parameter to the new ASE 16 staging instance.

When the attach/link job completes, the staging database is enabled and is effectively upgraded to the new version of ASE.

  1. Generate the CLI commands that will perform the detach/unlink and attach/link. Do not detach/unlink the dSources until you have generated the CLI commands. Any dSource that has been detached/unlinked will not show up in the list of dSources:
# Generate the list of dSources to detach/unlink:
echo "/source list display=name,virtual,config" | ssh admin@neal5381.dcenter.delphix.com | grep false |egrep -v "dx|staging" | awk '{print "/database; select "$1"; detachSource; set source="$1"; commit"}' > /tmp/detach_dSource.out

# Generate the list of dSources to attach/link:
echo "/source list display=name,virtual,config" | ssh admin@neal5381.dcenter.delphix.com | grep false |egrep -v "dx|staging" | awk '{print "/database; select "$1"; attachSource;set attachData.config=ASE160_SRC/delphix;set attachData.dbUser=sa;set attachData.dbCredentials.password=sybase;set attachData.loadBackupPath=/home/sybase/dump;set attachData.sourceHostUser=nealrh68.dcol1.delphix.com/sybase;set attachData.stagingHostUser=nealrh68.dcol1.delphix.com/sybase;set attachData.stagingRepository=ASE160_SRC;commit"}' > /tmp/attach_dSource.out
  1. Perform the actual detach/unlink from the old ASE instance and the attach/link to the new ASE instance:
# Be sure to edit the above files (attach_dSource.out and detach_dSource.out) to make sure they contain the desired dSources and nothing else!

# Detach the dSources
while read in; do echo "$in" | ssh admin@neal5381.dcenter.delphix.com; done < /tmp/detach_dSource.out

# Attach the dSources
while read in; do echo "$in" | ssh admin@neal5381.dcenter.delphix.com; done < /tmp/attach_dSource.out

Migrate Staging Databases

This section is optional if you successfully migrated the dSource in the section above. This section shows how to migrate staging databases from one ASE instance to another en masse. It provides a detailed example with command output to illustrate the expected outcome of various commands.

  1. Disable the dSources for the staging databases that are to be migrated:
# Generate the CLI command to disable the dSources:
echo "/source list display=name,virtual,config" | ssh admin@neal5381.dcenter.delphix.com | grep false |egrep -v "dx|staging" | awk '{print "/source; select "$1";disable; set type=SourceDisableParameters; commit"}' > /tmp/disable_dSources.out

# Edit the file to make sure it contains the desired dSources:
vi /tmp/disable_dSources.out

# Pass the CLI commands to the Delphix Engines to disable the dSources:
while read in; do echo "$in" | ssh admin@neal5381.dcenter.delphix.com; done < /tmp/disable_dSources.out
  1. List the ASE staging databases using the following command:
$ echo "/source list display=name,virtual,stagingSource,config" | ssh admin@neal5350.dcenter.delphix.com | grep dx
Pseudo-terminal will not be allocated because stdin is not a terminal.
Password: 
ETS_CostBasisTaxDB                               false    dx1a7a19P64sLTtu9K_asisTaxDB                     ASE160_SRC_NEW/ETS_CostBasisTaxDB
bigdb                                            false    dxmZfdG9N24yzvDvP93o94_bigdb                     nealrh74.dcenter.delphix.com/ASE160_SRC/bigdb
ceramic                                          false    dxs79lXP9fvsip36njTW_ceramic                     ceramic
...etc...
  1. Formulate the syntax to do a mass update. Be careful especially if you use more than one staging ASE instance (ensure you match each staging database to the correct ASE instance):
$ echo "/source list display=name,virtual,stagingSource,config" | ssh admin@neal5350.dcenter.delphix.com | grep dx | awk '{print "/sourceconfig; select "$1"; update; set repository=nealrh74.dcenter.delphix.com/ASE160_SRC_NEW; commit"}' | grep "select dx"
Pseudo-terminal will not be allocated because stdin is not a terminal.
Password: 
/sourceconfig; select dxmZfdG9N24yzvDvP93o94_bigdb; update; set repository=nealrh74.dcenter.delphix.com/ASE160_SRC_NEW; commit
/sourceconfig; select dx1a7a19P64sLTtu9K_asisTaxDB; update; set repository=nealrh74.dcenter.delphix.com/ASE160_SRC_NEW; commit
/sourceconfig; select dxs79lXP9fvsip36njTW_ceramic; update; set repository=nealrh74.dcenter.delphix.com/ASE160_SRC_NEW; commit
  1. Run the same command as above but dump it out to a file:
$ echo "/source list display=name,virtual,stagingSource,config" | ssh admin@neal5350.dcenter.delphix.com | grep dx | awk '{print "/sourceconfig; select "$1"; update; set repository=nealrh74.dcenter.delphix.com/ASE160_SRC_NEW; commit"}' | grep "select dx" > staging_databases.out
  1. You may wish to edit the final "staging_databases.out" script to make sure it consists of only the staging databases you wish to migrate to the new version of ASE.
  2. Feed the file into the CLI to do the updates:
$ while read in; do echo "$in" | ssh admin@neal5350.dcenter.delphix.com; done < staging_databases.out

Migrate the VDBs

  1. Disable each VDB that needs to be migrated to the new, upgraded ASE instance:
# Generate the CLI commands:
echo "/source list display=name,virtual,config" | ssh admin@neal5381.dcenter.delphix.com | grep true |egrep -v "dx|staging" | awk '{print "/source; select "$1";disable; set type=SourceDisableParameters; commit"}' > /tmp/disable_VDBs.out

# Edit the script to make sure it has the VDBs you wish to disable:
vi /tmp/disable_VDBs.out

# Feed the script back to Delphix to execute the CLI commands:
while read in; do echo "$in" | ssh admin@neal5381.dcenter.delphix.com; done < /tmp/disable_VDBs.out
  1. Use the Delphix Command Line Interface (CLI) to perform the migration to the new ASE instance:
# After the VDBs have  been disabled, point them to the new ASE instance:
echo "/source list display=name,virtual,config" | ssh admin@neal5381.dcenter.delphix.com | grep true |egrep -v "dx|staging" | awk '{print "/sourceconfig; select "$1";update; set repository=nealrh68.dcol1.delphix.com/ASE160_SRC; commit"}' > /tmp/VDBs_to_migrate.out

# Edit the list of VDBs to migrate to make sure they are correct:
vi /tmp/VDBs_to_migrate.out

# Feed the script back to Delphix to execute the CLI commands:
while read in; do echo "$in" | ssh admin@neal5381.dcenter.delphix.com; done < /tmp/VDBs_to_migrate.out

# Generate the commands to enable the VDBs:
echo "/source list display=name,virtual,config" | ssh admin@neal5381.dcenter.delphix.com | grep true |egrep -v "dx|staging" | awk '{print "/source; select "$1";enable; set type=SourceEnableParameters; commit"}' > /tmp/enable_VDBs.out

# Edit the list of VDBs to make sure they are correct:
vi /tmp/enable_VDBs.out

# Feed the script back to Delphix to execute the CLI commands:
while read in; do echo "$in" | ssh admin@neal5381.dcenter.delphix.com; done < /tmp/enable_VDBs.out

When each VDB is enabled, Delphix issues the ASE the "ONLINE DATABASE". ASE will recognize that the VDB's database devices were from ASE 15.7 and perform its upgrade steps.

Related Articles

The following articles may provide more information or related information to this article: