banner



How To Start And Stop Sap System In Windows Command

In this web log post, we'll discuss starting, stopping, and restarting an case of SAP HANA.

You can offset and terminate the SAP HANA instance via the command line and with SAP HANA Studio; we describe both methods in the first ii sections. The SAP documentation vaguely mentions that it's too possible to practice with the SAP HANA cockpit, but this doesn't appear to be true at this time. By default, starting the SAP HANA instance also starts the tenant databases, simply information technology'due south of course besides possible to commencement and terminate them individually. You can also disable the automated startup for one or more than tenants. Nosotros cover these subjects later on by showing how you can check the current status of the instance and the tenant databases, and in the last section nosotros take a closer look at the SAP outset service process.

With the Command Line

The commands to showtime and end an SAP HANA instance are operations implemented as options of the HDB command, as shown here:

HDB offset

HDB stop

HDB restart(stop + beginning)

These commands run in the foreground; that is, the server session remains blocked until the process finishes. If you want to do other things, such as monitoring the trace files, during startup or shutdown, and so you must open an actress session on the database server.

There'southward cipher particularly interesting about the output of the commands, so we won't show it hither—except for this little intriguing line in the HDB terminate output:

hdbdaemon will await maximal 300 seconds for NewDB services finishing.

Find the proper name NewDB . We think the developers left this in on purpose to commemorate the very early on days of SAP HANA by referring to information technology—just this in one case—by its quondam working proper name.

With SAP HANA Studio

In SAP HANA Studio, y'all find the functions to start, terminate, and restart (stop + start) the organization when you lot right-click a connection to the system database (not a tenant database). You then see the options Start Organisation , Cease System , and Restart System in the context menu, as shown in the figure below. Let'southward now look at each of those options in more detail, and also take a cursory look at the trace files for these processes.

Menu to Start, Stop, or Restart System in SAP HANA Studio

Starting

Choose Start Organization from the context carte. Confirm in the popup window that you want to first the system now. The condition of the services on the Processes screen will gradually modify from yellow to green (encounter below); this screen refreshes every few seconds. The instance is fully started when all services are green.

Service Status during Startup

Stopping

Choose Stop System from the context menu. The popular-up window below will appear; here you cull betwixt a soft shutdown, which waits for all active sessions to end, and a hard shutdown, which kills and rolls back the currently open up transactions. For a soft shutdown, you lot tin too specify a timeout; if at that place are still open sessions at the finish of the timeout menstruation, SAP HANA Studio volition exercise a hard shutdown. The default timeout period is 10 minutes.

Shutdown Options

As soon as the shutdown sequence begins, the statuses of the services on the Processes screen volition start to modify from green to yellow. When the shutdown is complete, just the HDB daemon service volition be listed with a red status icon.

All Services Stopped

Restarting

This pick shuts down and immediately restarts the instance. Cull Restart System from the context card. Every bit when stopping the system, you tin can cull between a soft shutdown (with a timeout) and a hard shutdown.

Trace Files

While the starting time or cease process is ongoing, information technology's interesting (and necessary, if there's problem) to look at the case trace files. In SAP HANA Studio, y'all tin practise and so by opening the Diagnosis Files tab (to the right of the Processes tab in the figure above). The trace file you lot may want to await at first is the one for the hdbdaemon process ( daemon_<hostname>. <service>.000.trc ). Double-click the name to display the contents of the file (see below). The screen will show the most contempo messages; yous can enable an autorefresh function (right-hand side of the toolbar) then that you always become up-to-date status information.

Monitoring Daemon Trace File

With SAP HANA Cockpit

According to the SAP HANA Administration Guide , you lot tin start and cease the system by using the Offset System and End Organization buttons at the acme of the Database Directory screen. We cannot confirm this considering in all the cockpit versions we checked, and despite satisfying the connection requirements, these buttons proved elusive.

Not that nosotros really run across this as a major shortcoming. Given that information technology's extremely easy to stop and start SAP HANA from the command line, this is actually what we suggest you to practise. And if you insist on using a GUI, the function works impeccably in SAP HANA Studio, which will probably still be around by the time the issue in the cockpit gets fixed.

Starting and Stopping Tenant Databases

By default, the tenant databases start up automatically when the SAP HANA instance starts. It's possible to change this behavior with post-obit SQL statement:

change database <DB> no restart;

To reinstate the automatic start, use this statement:

alter database <DB> default restart;

4

These operations require a connection to the system database. You lot can use iii methods for this:

  1. With the command line : Tenant databases can be started and stopped manually with these statements (also when connected to the system database):

alter system terminate database <DB>;

alter system beginning database <DB>;

  1. With SAP HANA cockpit : In the Database Directory window, open a connection to the organization database. In Database Overview , choose Database Management (if you don't see this button, then you lot're in a tenant database). On the side by side screen, in that location's a Stop or Get-go button to the right of each tenant.

Start/Stop Tenant Database in SAP HANA Cockpit

  1. With SAP HANA Studio : There is no specific office in SAP HANA Studio to cease and start tenant databases; to do this, open up a SQL console for a system database connection and apply the alter arrangement first database/finish database statements shown earlier.

Checking the Instance and Database Status

To check the example condition from the server command line, utilise HDB info .

If the instance is running, y'all'll see the HDB daemon process with the service processes underneath it. The presence of one or more than hdbindexserver processes indicates that the tenant databases are also active.

To run across the condition of all databases, use the following query when continued to the system database:

select * from M_DATABASES;

The ACTIVE_STATUS column shows the electric current land of the tenant database; if ACTIVE_ Status is 'NO' , so ACTIVE_STATUS_DETAILS gives the reason the tenant is down—for example, considering information technology was stopped manually or because autorestart is disabled.

M_DATABASES View : The M_DATABASES view only provides data nigh all databases when executed in the system database. The view besides exists for the tenant databases, but in that location it merely shows the data for the tenant itself.

Managing the SAP Start Service

Stopping the SAP HANA case using whatever of the methods we saw in the previous sections does non end the SAP first service ( sapstartsrv ) process itself. This is fine; at that place's ordinarily no need to finish it, and its resource use is shut to nothing. In that location may be exceptional situations, all the same, when you do want to stop the service process; furthermore, sapstartsrv has numerous management and data functions that you might want to brand use of.

All communication with the sapstartsrv procedure is done using another program, sapcontrol . This program interfaces with the service procedure using spider web service calls. A sapcontrol control mostly takes this form:

sapcontrol -nr <xx> -function <servicename> [<parameters>]

Here, <xx> is the ii-digit SAP HANA instance number, <servicename> is the name of the service function you want to call, and <parameters> represents the parameters to exist passed to the service function (not every function takes parameters). There are more command line arguments than this, but only -nr and -function are mandatory. Utilize sapcontrol -h for a list of all options and all service functions with their parameters.

To facilitate the utilise of commands similar sapcontrol that need the example number, an environment variable TINSTANCE is commonly set in the environment of the <hsid>adm case ambassador. In the first section nosotros offset describe how yous can end and start the SAP outset service process; then we look at some of the interesting services you can invoke with sapcontrol .

Stopping and Starting sapstartsrv

To end the service process, use this command:

sapcontrol -nr <twenty> StopService

The service will normally stop almost immediately. Information technology's safety to practise this even while the SAP HANA instance is running; this is considering, every bit we mentioned earlier, sapstartsrv is not attached to the SAP HANA process tree (the process at the top of the tree is sapstart ). Nevertheless, every bit long as the service process is stopped, you can't use HDB to stop or showtime SAP HANA considering it needs to interact with sapstartsrv .

To restart the service procedure, use this command:

sapcontrol -nr <xx> StartService <HSID>

Notice that the StartService part has the HSID as a mandatory parameter.

There is also a role to restart (stop + start) the service, as follows:

sapcontrol -nr <xx> RestartService

Other Service Functions

We won't go through the entire listing of available functions (and some don't apply to SAP HANA anyhow), only nosotros'll show some of the more than useful ones.

To bank check the status of the SAP HANA example processes, use this command:

sapcontrol -nr $TINSTANCE GetProcessList

If the instance is up, the output is a list of processes with Light-green status. If the output contains a YELLOW status, then this ways that the process is non fully operational (eastward.g., still starting), and Grayness means that the process is stopped. For a stopped instance, y'all'll see something similar this:

sapcontrol -nr $TINSTANCE -function GetProcessList

GetProcessList

OK

name, description, dispstatus, textstatus, starttime, elapsedtime, pid

hdbdaemon, HDB Daemon, GRAY, Stopped, , , 15427

Use following command to brandish the log of the sapstartsrv process:

sapcontrol -nr $TINSTANCE GetTraceFile

The side by side command lists the environment in which the service process was started; this can sometimes be useful when troubleshooting if you doubtable that environment settings might have been incorrect when the instance was started:

sapcontrol -nr $TINSTANCE GetEnvironment

For version information (of the SAP get-go service, not of SAP HANA), use this command:

sapcontrol -nr $TINSTANCE GetVersionInfo

/usr/sap/HXE/HDB90/exe/sapstartsrv, 753, patch 512, changelist 1949210, ...

Editor's note: This post has been adapted from a department of the volume SAP HANA 2.0 Administration by Mark Mergaerts and Bert Vanstechelman.

Source: https://blog.sap-press.com/how-to-start-and-stop-an-instance-of-sap-hana

Posted by: millswisted.blogspot.com

0 Response to "How To Start And Stop Sap System In Windows Command"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel