Hello and welcome to the SAP HANA
Academy. My name is Denys van Kempen and
in this video tutorial series we will
discuss what's new with SAP HANA SPS 12.
The topic of this video tutorial is
HANA system administration Capture and
Replay Workloads. For this topic we’ll
briefly take a look at the documentation
and then switch to a live system to do
some capturing and replaying. Ok so
what's the objective here. Capturing and
replaying workloads from an SAP HANA
system can help you evaluate potential
impact on performance or stability after
a change in hardware or software
configuration. And as you can see
possible use cases or hardware change,
SAP HANA revision upgrade, ini
parameter changes, partitioning or index
change or even a full landscape
reorganization for SAP HANA scale-out
systems. SAP HANA workbook replay is
not activated by default. So you will
need to install it as a delivery unit
and then you will have to assign the
different roles to capture. We have the
SAP HANA replay roles capture and to
replay we have to replay role. Before you
can actually replay you need to
pre-process the captured workload. We’ll
take a look at that. And when that's done
you can replay it. To replay a workload
you need a Replayer Service and this
requires you to create a configuration
file and to start the service for which
workload replay admin system privilege
is required. The Replayer Service takes
different parameters which are listed in
this table here. The hostname, the
instance number, control admin key.
Optionally a database name in case of
Multitenant Database containers and any
free port where it will listen up. to
check if the replayer is running you
can call the workload replay function.
Then after you've captured and replay
the workloads it's time to analyze
them. For this there's another tile
analyze workload in the SAP HANA
cockpit and the workload analyzer roles
administrator or operator are needed to
work with this tile. You will see them
capture workload, replay workload and
analyze workload.
Three new tiles in the SAP HANA
performance management catalog and again
as mentioned you need to install the
delivery unit HANA replay for this
catalog to become available. Quick recap
of the rules required to access the
tiles in this catalog capture and replay
for replay and administrator and operator.
For workload analyzer the operator only
has read only access. And here we have
the two system privileges, capture admin
and replay admin that authorizes the
access to the monitoring views and the
built-in procedures associated with
workload capture and replay. So let's
take a look at our live system. I’m
connected here to a Windows computer and
have started SAP HANA Studio with a
connection to an SPS 12 SAP HANA
system. Before we can start using capture
and replay we need to import a delivery
unit. The different ways how you can do
it. You could use the web interface of
the SAP HANA application lifecycle
management tool. I will use HANA Studio
here. Menu, file, import SAP HANA
content delivery unit. Select my system.
On this client I have the full DVD of SAP
HANA SPS 12 and there's a directory
workload replay which contains the
HANA replay zipped tar file with the
tgz extension. I'll open it. Import
simulation is okay and it's completed
successfully. Next I will set up my user.
Here we have two replay roles capture and
replay and for workload I will use
operator and grant these roles to my
admin user. Now let's start SAP HANA
Cockpit. Connect. The analyzed workload
tile has been added automatically.
Capture a replay and the documentation I
will do manually.
Very good. Let's start a capture. Select
configure capture. You can limit here
trace file size and the trace buffer
size and also the capture destination.
Which by default goes into the trace
directory under the host name in slash
USR SAP. Typically this is a local
directory so you have to make sure you
have sufficient disk space. Alternatively
of course you could point to a different
location. I'll confirm. Then I'll start a
new capture. Give it a name. You have the
option to schedule a capture. So you
could for example schedule it at
nighttime when you run certain batch
jobs or at day times at specific hours.
By default collect explain plan is on
and you have the option to also collect
performance details. Then there are a
number of filters like the application
name, a database username, statement types
update, insert, lead or creator drop
procedure transaction session systems
and so on. Select start capture to
capture it. We have a graphic here
showing the disk space on our system. The
duration of the capture, the number of
statements collected and the size. Now we
need to have some activity of course. So
let's open the administration console of
HANA Studio to generate some
traffic enough for our demo and I can
select stop capture. Status will change
to captured and if we return to the SAP
HANA cockpit the capture work load
tile will display the current status.
Then we can switch to replay workload.
First we need to pre-process our capture.
So select it and select start
pre-processing. Obviously for our very
small capture this will be very fast but
if you have larger captures this might
take some time. Select it and then we can
configure our replay. Which in our case
will inform us that the replayer is not
found. So we need to set it up first. You
only need to do is once of course when
you set up your new system. Let's verify
our retrieval.
Create our file. Edit it. I’m using VI
here. Then we need to create a secure key
using the HTTP user store command. Give
the key a name. I’m using workload here.
Then the environment that's your host
and the port. The port of the index
server which by default is three.
Instance number and then 15 and our
instance number here is 12. So we get 3
12 15. The username and because I've set
the command with a minus I for
interactive mode I will be prompted for
my password so it won't be stored in my
command history. Key is being created.
Let's test our connection. Well this is
looking good. So now we can start to
replayer. Specifying hostname, instance
number, the control admin key which is
user name comma and your secure store key
and then any free port and the replayer
is now accepting requests. By
calling the workload replay function we
can see that it's up and running. So
let's return to replay management and
open our replay workload tile again. So
let's configure replay. Enter host name
and instance number. The replay admin
user. That's the one you granted the role.
Then either the secure store or a
password. I will use password here. Any
replay speed and collect explain
plan. Our replayer is listed here and as
I opened SAP HANA Studio as the
system user I will need to provide the
authentication as well for the
statements to be execute. So I can
select start replay then. The capture
duration was one minute and as I’m
replaying here at capture speed the
replay will also run for one minute. And
the replay was completed successfully.
Then you can select go to report. This
gives us an overview of the number of
statements that were executed slower and
faster. A comparison and a list of some of
the statements. Let's return to the SAP
HANA cockpit home screen. Our tile is
now showing both the process and a
replayed workload and we can now
continue with the analysis
which gives us a much more in-depth
report of the workload showing cpu, disk
use, memory use, transactions, threats. And
here we have all the different
dimensions we can investigate like
service, database user, threat type and so
on. Ok so much for this brief
demonstration of capture replay and
analyze workload the feature is
mentioned in the what's new guide for
SPS 12 and documented in the
administration guide. You can read or
download both guides free of charge from
the help portal on help.SAP.com
under technology platform SAP HANA
core system administration. Thank you for
watching this SAP HANA Academy video.