banner



How To Start And Stop Sap System In Windows Command

In this weblog post, we'll discuss starting, stopping, and restarting an instance of SAP HANA.

You can start and cease the SAP HANA instance via the command line and with SAP HANA Studio; nosotros describe both methods in the showtime two sections. The SAP documentation vaguely mentions that it's also possible to practise with the SAP HANA cockpit, merely this doesn't announced to be true at this time. By default, starting the SAP HANA example also starts the tenant databases, but it'southward of form likewise possible to showtime and finish them individually. You tin also disable the automatic startup for one or more tenants. Nosotros cover these subjects later on on past showing how you lot can check the electric current condition of the instance and the tenant databases, and in the last section we have a closer await at the SAP start service process.

With the Command Line

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

HDB start

HDB stop

HDB restart(cease + offset)

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, then yous must open up an actress session on the database server.

There's nada particularly interesting most the output of the commands, and then we won't bear witness it here—except for this little intriguing line in the HDB stop output:

hdbdaemon volition expect maximal 300 seconds for NewDB services finishing.

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

With SAP HANA Studio

In SAP HANA Studio, you find the functions to showtime, cease, and restart (stop + start) the system when you lot right-click a connection to the organization database (non a tenant database). You lot and then encounter the options Commencement System , Cease Organisation , and Restart Organisation in the context carte du jour, as shown in the figure below. Allow'southward now wait at each of those options in more detail, and also take a brief look at the trace files for these processes.

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

Starting

Choose Commencement System from the context menu. Confirm in the popup window that you want to first the system now. The status of the services on the Processes screen will gradually change from xanthous to green (run into 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-upwards window below volition appear; here y'all cull between a soft shutdown, which waits for all active sessions to finish, and a hard shutdown, which kills and rolls back the currently open transactions. For a soft shutdown, you lot can also specify a timeout; if there are still open up sessions at the end of the timeout menstruation, SAP HANA Studio will do a hard shutdown. The default timeout flow is 10 minutes.

Shutdown Options

As soon equally the shutdown sequence begins, the statuses of the services on the Processes screen will offset to alter from dark-green to yellowish. When the shutdown is consummate, but the HDB daemon service will be listed with a red status icon.

All Services Stopped

Restarting

This selection shuts down and immediately restarts the example. Choose Restart System from the context menu. Equally when stopping the system, you can choose between a soft shutdown (with a timeout) and a hard shutdown.

Trace Files

While the start or stop process is ongoing, information technology's interesting (and necessary, if there'south trouble) to look at the example trace files. In SAP HANA Studio, y'all tin do so by opening the Diagnosis Files tab (to the right of the Processes tab in the figure above). The trace file y'all may want to look at first is the one for the hdbdaemon procedure ( daemon_<hostname>. <service>.000.trc ). Double-click the proper noun to display the contents of the file (see below). The screen will show the most contempo messages; you lot tin enable an autorefresh function (correct-hand side of the toolbar) so that you lot ever go upwardly-to-engagement status information.

Monitoring Daemon Trace File

With SAP HANA Cockpit

According to the SAP HANA Administration Guide , you can outset and stop the organisation by using the Start System and Cease System buttons at the elevation of the Database Directory screen. We cannot ostend this considering in all the cockpit versions we checked, and despite satisfying the connection requirements, these buttons proved elusive.

Non that we really come across this as a major shortcoming. Given that information technology's extremely easy to end and start SAP HANA from the command line, this is really what we advise y'all to practice. And if you insist on using a GUI, the part works impeccably in SAP HANA Studio, which volition probably withal be around by the time the outcome in the cockpit gets fixed.

Starting and Stopping Tenant Databases

By default, the tenant databases start upwards automatically when the SAP HANA example starts. It's possible to modify this behavior with following SQL statement:

alter database <DB> no restart;

To reinstate the automatic start, use this argument:

modify database <DB> default restart;

4

These operations require a connection to the organization database. You can utilize three methods for this:

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

alter system stop database <DB>;

alter system start database <DB>;

  1. With SAP HANA cockpit : In the Database Directory window, open a connexion to the system database. In Database Overview , choose Database Direction (if you don't see this button, and then yous're in a tenant database). On the next screen, in that location's a Cease or Start button to the right of each tenant.

Start/Stop Tenant Database in SAP HANA Cockpit

  1. With SAP HANA Studio : At that place is no specific part in SAP HANA Studio to end and start tenant databases; to do this, open up a SQL console for a system database connection and apply the alter arrangement offset database/stop database statements shown earlier.

Checking the Instance and Database Status

To check the instance condition from the server control line, use HDB info .

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

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

select * from M_DATABASES;

The ACTIVE_STATUS column shows the current state of the tenant database; if ACTIVE_ Status is 'NO' , then ACTIVE_STATUS_DETAILS gives the reason the tenant is down—for example, because it was stopped manually or because autorestart is disabled.

M_DATABASES View : The M_DATABASES view only provides data about all databases when executed in the system database. The view too exists for the tenant databases, but at that place information technology merely shows the data for the tenant itself.

Managing the SAP Start Service

Stopping the SAP HANA instance using whatsoever of the methods we saw in the previous sections does not end the SAP start service ( sapstartsrv ) procedure itself. This is fine; there's commonly no need to stop information technology, and its resource use is close to nothing. There may exist exceptional situations, however, when yous do want to cease the service process; furthermore, sapstartsrv has numerous management and information functions that you might want to make use of.

All communication with the sapstartsrv process is done using another program, sapcontrol . This program interfaces with the service process using spider web service calls. A sapcontrol command more often than not takes this form:

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

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

To facilitate the use of commands like sapcontrol that need the instance number, an surroundings variable TINSTANCE is normally gear up in the surroundings of the <hsid>adm case administrator. In the kickoff section we first describe how you can end and start the SAP beginning service procedure; so we look at some of the interesting services you tin can invoke with sapcontrol .

Stopping and Starting sapstartsrv

To stop the service procedure, use this command:

sapcontrol -nr <xx> StopService

The service will normally stop almost immediately. It's safety to do 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 ). Still, as long as the service procedure is stopped, you lot can't use HDB to cease or starting time SAP HANA because information technology needs to collaborate with sapstartsrv .

To restart the service process, use this command:

sapcontrol -nr <xx> StartService <HSID>

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

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

sapcontrol -nr <xx> RestartService

Other Service Functions

We won't go through the entire list of available functions (and some don't apply to SAP HANA anyway), simply we'll prove some of the more useful ones.

To check the status of the SAP HANA instance processes, utilise this command:

sapcontrol -nr $TINSTANCE GetProcessList

If the instance is upwards, the output is a list of processes with Greenish status. If the output contains a Yellow status, then this means that the process is not fully operational (e.g., still starting), and GRAY means that the procedure is stopped. For a stopped example, you'll meet something like this:

sapcontrol -nr $TINSTANCE -function GetProcessList

GetProcessList

OK

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

hdbdaemon, HDB Daemon, Gray, Stopped, , , 15427

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

sapcontrol -nr $TINSTANCE GetTraceFile

The next command lists the environs in which the service process was started; this can sometimes be useful when troubleshooting if you suspect that environment settings might have been incorrect when the case was started:

sapcontrol -nr $TINSTANCE GetEnvironment

For version information (of the SAP start service, not of SAP HANA), utilise this command:

sapcontrol -nr $TINSTANCE GetVersionInfo

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

Editor's note: This mail service has been adapted from a section of the volume SAP HANA 2.0 Administration by Marker Mergaerts and Bert Vanstechelman.

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

Posted by: petersonbeforrome1969.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