Hello and welcome to the SAP HANA Academy.
The topic of this video tutorial series is SAP HANA Installation and Update and in this
video I will discuss automatic startup of the system, system database, and tenant database.
This video has been recorded on release SAP HANA 2.0 SPS 03, released in April 2018.
For earlier or later releases, please check the playlist on the SAP HANA Academy.
Hi, I am Denys van Kempen.
When you install or update the SAP HANA server using the SAP HANA Lifecycle Management tool
—here we are looking at the graphical version— in Step 4b, Define System Properties, you can select,
it is disabled by default— to, quote “Restart system after machine reboot”.
This will set the autostart parameter in the SAP profile to 1, meaning on, yes, or true
causing the SAP start service to startup the SAP HANA system when the Linux operating system
starts (and this includes a reboot, of course).
I have posted a blog to the SAP HANA community some time ago —I will put the link in the
description of this video on our YouTube channel— about this topic, how this works exactly
it would take me off-topic a bit, so if you are interested, please check it out.
For our hands-on, let’s just briefly take a look at the profile file.
It is in the sapmnt directory, defaults to /hana/shared but this could be any mount point,
then the SID, here T01, and /profile.
Typically, there will be two: default and the profile with name,
SID_ HDB instance number _hostname
and that’s the one we are interested in.
If we print out the contents, we can see that the 6th parameter is Autostart and that currently
the value is 0, meaning off.
When this Linux server starts, the SAP HANA system T01 will not be started.
So, we need to start it up manually later on using ‘HDB start’ on the command line,
or using SAP HANA cockpit or studio.
If we want to change this behaviour, we need to edit this file. It is the only way.
There is no box in studio or cockpit we can tick.
For tenant databases, we can use SAP HANA cockpit, I will show you in a minute, but
not for the system as a whole and not for the system database.
You can use your favorite editor.
I will use vi.
Vi +6 (line 6), uppercase A (append end of line), backspace, 1, escape :wq (write quit)
Done. If you are not sure about your vi skills,
you can check with a grep on Autostart.
It is on, now.
For those familiar with SAP AS ABAP or BW, you will recognise the SAP profile file.
As often, the startup mechanism for the SAP HANA system was not a wheel re-invented but
leveraged from Netweaver.
OK - How about the tenant?
Easy.
Connect to your system database in the SAP HANA cockpit.
Overal Tenant Statuses.
Click the tile.
Manage Databases.
Select the Tenantand then in the header menu, select Set Restart Mode
Tenant T01 Restart Mode is ‘Default’ or ‘No auto-restart’.
Sounds a bit cryptical.
Default means: same as for the system database.
We just looked at that.
No auto-restart means: in case the system database is set to autostart, do not autostart this tenant.
We cannot set a tenant to autostart if autostart for the system as a whole is disabled.
Hence the reason, it is formulated this way.
Using the gear icon, we can display the Restart Mode here in the cockpit.
Alternatively, you can use the SAP HANA interactive terminal, hdbsql, HANA studio or the SQL prompt
of the Database Explorer to set the restart mode of a tenant.
ALTER DATABASE database_name NO RESTART and query M_DATABASES for the restart mode.
For system database is it always DEFAULT, that is, whatever is set in the profile.
To enable auto-restart for the tenant again, the SQL is
ALTER DATABASE database_name DEFAULT RESTART.
OK— autostart is documented in the SAP HANA Server Installation and Update Guide.
Here we see it.
It is also available as installation parameter, so for automated installations, we can configure
this in the hdblcm parameter file or even pass it on the command line
and tenant restart mode is documented in the SAP HANA Administration Guide
Well, that’t it.
Thanks for watching.
You can find more video tutorials on our YouTube channel and 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 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 this video.
Thank you for watching.