Skip to Content

Restore SAP HANA Cloud, SAP ASE Database and Replication Server to Initial State

test
0 %
Restore SAP HANA Cloud, SAP ASE Database and Replication Server to Initial State
Details

Restore SAP HANA Cloud, SAP ASE Database and Replication Server to Initial State

Restore your instances of SAP HANA Cloud, SAP Adaptive Server Enterprise database and replication server to its initial state.

You will learn

  • How to restore the SAP HANA Cloud, SAP ASE databases to their initial state using a teardown script
  • How to drop instance information from the replication server
QR code

Prerequisites

  • You have completed the tutorial on how to run a test script on SAP HANA Cloud, SAP ASE replication.

As the last step of this tutorial, you will learn how to restore your SAP Adaptive Server Enterprise databases and replication server in SAP HANA Cloud to their initial state, as if you had not run any tests or created any tables.

Disclaimer

Within this group of tutorials, the phrase “replication server” is used to refer to “SAP HANA Cloud, SAP Adaptive Server Enterprise replication” unless mentioned otherwise.


Step 1: Restore databases using teardown script

A separate script, known as the Teardown script, can be used to undo any changes made in previous steps. The goal is to restore both SAP ASE databases and your replication server in SAP HANA Cloud to their initial state, as if you had not run the previous tests. As shown below, this script must include instance names and passwords just as with the replication script. Just look out for the same placeholders we used in the previous tutorials, and make sure to replace them with real names, host addresses, and passwords from your landscape.

# ------------------------------------------------------------------------------
# Set variables
# ------------------------------------------------------------------------------
# ASE_1 should be the name of the source SAP ASE database as listed in your interfaces file
ASE_1=
# ASE_2 should be the name of the target SAP ASE database as listed in your interfaces file
ASE_2=
# ASE_R should be the name of the replication server as listed in your interfaces file
ASE_R=
PASSWORD=
ASE_1_PASSWORD=$PASSWORD
ASE_2_PASSWORD=$PASSWORD
ASE_R_PASSWORD=$PASSWORD
Log on to answer question
Step 2: Drop subscription from replication server

The teardown script should then drop the subscription, replication definition, connections, and interfaces from the replication server. You can see this in the script given below:

echo
echo At $ASE_R, drop subscription...
echo
isql -U repadmin -P $ASE_R_PASSWORD -J utf8 -S $ASE_R -e -w 1000 <<EOF
drop subscription DBNAMEsub
for database replication definition DBNAMErep
with primary at $ASE_1.DBNAME
with replicate at $ASE_2.DBNAME
without purge
go
EOF

sleep 4

echo
echo At $ASE_R, drop replication definition...
echo
isql -U repadmin -P $ASE_R_PASSWORD -J utf8 -S $ASE_R -e -w 1000 <<EOF
drop database replication definition DBNAMErep
with primary at $ASE_1.DBNAME
go
EOF

sleep 2

echo
echo At $ASE_R, drop connections and interfaces...
echo
isql -U repadmin -P $ASE_R_PASSWORD -J utf8 -S $ASE_R -e -w 1000 <<EOF
drop connection to $ASE_1.DBNAME
go
drop connection to $ASE_2.DBNAME
go
sysadmin interface, delete, $ASE_1
go
sysadmin interface, delete, $ASE_2
go
EOF

The output of running the teardown script should look like this:

Result1 Test ASEResult2 Test ASE

Troubleshoot:

You may run into an error that requires you to increase the size of your default data cache. If this is the case, connect to your SAP HANA Cloud, SAP Adaptive Server Enterprise database instances, and run the following command.

sp_cacheconfig 'default data cache', '512M'
Log on to answer question
Step 3: Test yourself

With the help of this tutorial group, you have seen how to use and adjust scripts to set up, connect, test, and finally wipe your instances of SAP HANA Cloud, SAP Adaptive Server Enterprise and SAP HANA Cloud, SAP Adaptive Server Enterprise replication.

You can also build on these scripts to automate your set up process, whether you wish to run simple tests or even set up your production environment.

Related Content

For more learning materials on SAP HANA Cloud, click here. Follow our tag in the SAP Community to stay up-to-date on the latest updates and newest content!

Which among these statements are true regarding a Teardown script?
×

Next Steps

Back to top