Hello and welcome to the SAP HANA Academy.
You are watching the video tutorial series: What’s New for SAP HANA 2.0 SPS 01.
The topic of this video tutorial is system administration.
Hi, I am Denys van Kempen.
The biggest impact on system administration for SAP HANA 2.0 SPS 01, no doubt, will be
the fact that the multi-container database mode, MDC in short,
is now the default and only operation mode.
Obviously, if you are already running with tenants, there is no change at all
but if all your HANA systems are single-container, you will have a bit of work to do with SPS 01
We have already discussed this topic in the What’s New video for Installation and Update,
so I will not repeat myself here and skip this part.
So what’s new for system administration?
To start, we have the new Dynamic Result Cache.
Now, if there is a cache that’s dynamic, you might have guessed that
there is a static one as well and that’s correct.
Static caching has been available as of SPS 11 (November 2015)
with support for the caching of virtual tables - data federation - the ones used with Smart Data Access, SDA,
added in the previous release SAP HANA 2.0 SPS 00.
Here we have some examples: ADD CACHE RETENTION and WITH HINT(RESULT_CACHE) are the key words.
Now, the new Dynamic Result Cache of SPS 01 completely eliminates the risk of querying any stale data.
So, it might be a better option for complex queries that are used a lot.
However, just as with the static cache, this is certainly not one-size-fits-all.
It is not suitable for any view and the performance gain depends very much
upon the nature of the data, the query itself, and how often the cache is used.
Populating the dynamic cache is as easy as with the static one.
Here we have the SQL.
In the best-case scenario, the result of the query comes straight from the cache,
with maybe a couple of delta records from new inserts, updates or deletes.
If the delta records can no longer be found then the query will go straight to the source tables.
However, in the background then, in a separate thread, the result set will be used to refresh the cache again for next use.
So, you may have to wait a bit but at least you keep the door open for the next person.
Nice.
As with the static result cache, careful testing is key.
So make sure, you check the documentation on this topic:
SAP HANA Troubleshooting and Performance Analysis Guide.
Also new, - well, it’s more of a development topic - is the support for JSON DocStores.
DocStores are optional and not available by default, so if you want to use them you have to activate this first.
Just like the application function library, AFL, or dynamic tiering, this is done per tenant database
and typically a system administration activity, so this is why I am mentioning it here.
What’s a JSON DocStore?
Think of it as a database specific to JSON (JavaScript Object Notation) documents.
A relational database stores data in rows and columns and a document database stores JSON documents.
MongoDB is probably the most well known example but there are many others out there.
Similarly, SAP HANA now includes persistence for document storage.
It is a separate operating system process, much like the DocStore used by SAP Vora.
So, we are not inserting JSON as a binary object, a CLOB, in a column and then with
standard SQL functions like JSON_QUERY or JSON_VALUE extract the JSON in SQL format,
so we can do SELECTs and JOINs and so on
- this is what some database vendors do -
with HANA it is a separate type of persistence.
So, we have the row store, the column store, and also now the document store.
If you are not familiar at all with JSON, this has nothing to do with Word documents.
It more resembles XML.
Here we have some sample SQL.
To create a DocStore, just run the SQL statement
ALTER DATABASE ADD ‘docstore’
and then with
create collection
the developer, or application, can create a collection.
Mind you, it is called a collection, not a schema, because, unlike an XML schema,
the structure is not imposed.
You can insert any data as long as it is valid JSON and select using document path expressions
in dot notation: address.city here, in quotes.
You can also update and delete, of course, or join the collection to a regular HANA table.
The Document Store is documented in both the Administration Guide and the Developer Guide.
The remaining new features, changes and enhancements for SPS 01 are minor topics.
Let’s start with Workload Management.
SAP HANA 2.0 SPS 00 added Admission Control.
This enabled the system administrator to define a door policy for when the club was almost full.
No more complex queries, only VIP users, and so on.
Well, sort of.
The ins and outs of Admission Control are discussed in the video What’s New SPS 00.
So, if this is new to you, you might want to review the video.
SPS 01 adds two enhancements.
First, we have two additional configuration parameters to manage queued transactions:
“queue_wait_time_threshold”, which defines the length of time for which an query can be queued
and “record_limit”, which sets the maximum record count permitted in the queue.
Next, we now also have a new monitoring view,
M_ADMISSION_CONTROL_EVENTS,
which you can query to get information about why a particular statement was queued.
Also in workload management, the WORKLOAD_CLASS hint has been added.
This is similar to the way other hints are used.
So, you use the WITH HINT clause and then between brackets specify the workload class you want to use
and here we see an example.
If you want to run a query that you know will use a lot of resources but you want to run
it as a background job, specify a workload class with limited resources
or vice versa, if the system is heavy loaded but you still need to have an answer right here, right now,
specify a workload class with no limits on resource usage, for example.
Anything else?
Well, we can now format lines for the HANA database interactive terminal, hdbsql.
You can use the -fn option for this.
It will make debugging a bit easier, if you have a lot of code.
There is a full playlist about hdbsql on the HANA academy, if you are interested.
Couple of videos - all you need to know.
And I should probably also mention that, as of SPS 01, the statistics server now only runs in embedded mode.
What does this mean?
Well, in the initial architecture of SAP HANA, a separate Linux operating system process
- hdbstatisticsserver - took care of statistics collection.
We are not talking here about just stats on the data distribution - tables and indexes
- but about the entire internal monitoring infrastructure.
As of HANA 1.0 SPS 07 (November 2013) the statistics service could be configured to
run embedded in the hdbindexserver process.
This was necessary, for example, to use the new alerts and monitoring apps that came with
the HANA cockpit introduced with SPS 09, and, as of this version, it was the default mode.
So, my guess is that there are probably very few systems still running in the original architecture
with a separate statistics server - but as of SPS 01, coup de grâce,
the hdbstatisticsserver process is history.
Tenant databases always run with the statistics server embedded.
So together with the single-database mode we also have to say goodbye to the hdbstatisticsserver process.
Such is life.
OK, so much for System Administration, What’s New for SAP HANA 2.0 SPS 01.
You can find more video tutorials on our YouTube channel.
If you would like to be informed about new video tutorials, please subscribe to our channel.
You can connect with us on LinkedIn or follow us on Twitter, as well for updates.
And we also have a page on Facebook and Google+.
If you are watching this video on YouTube, do not hesitate to leave your comments to
the video page and, if you like, give us your vote on his video.
Thank you for watching.