cancel
Showing results for 
Search instead for 
Did you mean: 

Max DB start and stop

mohitsahu
Participant
0 Kudos

Hello Folks,

We have SAP system running on Max DB database. We have windows patching maintenance for that we have to stop SAP and Max DB database.

I am new to Max DB so can someone tell me the correct steps for stopping the database (including the service stopping sequence) and starting it again after the maintenance gets over.

We have two Max DB services running MAXDB: SID and XServer.


I checked on some document that states that taking max DB instance offline from Database manager is not a good idea.


Regards,

Mohit

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hello Mohit,

Please NOTE that 'db_stop' initiates database HARD stop - It is not recommended to stop the database using db_stop unless required in special circumstances where the normal shutdown does not work (db_offline).

Here are the correct dbmcli commands to start/stop MaxDB Instance:

Shutdown:

dbmcli –d <db_name> -u <dbm_user>,<password> db_offline

Restart:

dbmcli –d <db_name> -u <dbm_user>,<password> db_online

Note:

If you want to perform some administrative tasks and no user should be connected to the database instance, you can put the database into state ADMIN:

dbmcli –d <db_name> -u <dbm_user>,<password> db_admin

More information go to SAP MaxDB: The SAP Database - Documentation

Glossary -> Start

=> Since you are new to MaxDB you can check out some free training videos/slides here - SAP MaxDB: The SAP Database - Training

Regards,

Yashwanth

mohitsahu
Participant
0 Kudos

Hello Yashwanth,

Thank you so much for the detailed information. I will go through the documents. I would like to know few things.

Please correct me if i am wrong or something needs to be added in it

1. Stop SAP

2. Run cmd and then dbmcli –d <XYZ> -u <control>,<control> db_offline

3. stop service MAXDB: XYZ

4. and XServer

----------------------------------------

Once the OS patching is done then

1. Start Service Xserver

2. Start Service MAXDB: XYZ

3. Run cmd and then dbmcli –d <XYZ> -u <control>,<control> db_online.

4. Start SAP

Please correct if i am wrong in the sequence. Many Thanks!

Regards,

Mohit

thorsten_zielke
Contributor
0 Kudos

Hi Mohit,

there is no need to start/stop the MaxDB service - this is all handled automatically via the db_online/db_offline command.

With the 'MAXDB: ...' service you can have the database autostart on Windows start-up, but other than that there is no need to change that setting.

Depending on your database version, the x_server should be automatically stopped by the upgrade or you will need to halt it via the 'x_server stop' command. Again, no need to directly start/stop the xserver service...

Regards,
Thorsten

mohitsahu
Participant
0 Kudos

Hello Thorsten,

Both services are in automatic mode and while performing windows patching the server will restart many times and then these services will start and stop many times.

So my idea was to make these services manual and then stop both the services. After that windows administrator will perform the OS patching.

Then I will start both the services and make it automatic again.

So is it okay to do?

And you also mentioned that stop the service by command.. this is new for me too please drop some more light on it.

Many Thanks!

Regards,

Mohit

thorsten_zielke
Contributor
0 Kudos

Hello Mohit,

what I meant to say was that the MaxDB tools will keep care of the services automatically, e.g if you start the Database from offline to online with:

dbmcli -d <database name> -u <user,passwd> db_online

on Windows, this will start the corresponding MaxDB service followed by triggering the start of the MaxDB 'kernel' process.

Likewise, If you shutdown the database via


dbmcli -d <database name> -u <user,passwd> db_offline

this will stop the MaxDB service and end the 'kernel' process

Regards,
Thorsten

Answers (1)

Answers (1)

former_member188883
Active Contributor
0 Kudos

Hi Mohit,

Based on the MaxDB version you may have DMBGUI or Database studio installed on the server.

Please connect to Database using these tools.

You may right click and stop the database to make it offline.

Alternative you may use command line to stop the database

Login with sidadm

Open command prompt

dbmcli -u control,<password for control> -d <DBSID>

db_stop db_offline

Later on Windows services you may stop X_server service.

Hope this helps.

Regards,

Deepak Kori

Message was edited by: Thorsten Zielke changed db_stop to db_offline, please be very careful and be aware of the consequences when using db_stop

mohitsahu
Participant
0 Kudos

Hello Deepak,

Thanks for the reply.

We have Max DB with database release 7.6.06.24.

Please clear two things to me

1. After stopping the database with the GUI or cmd, It will stop the MAXDB: SID service and we just have to stop the xserver service then?? If not then what would be the sequence of that then.

2. If I use command prompt will I be able to connect with

dbmcli -u control,<password for control> -d <DBSID>

when database is stopped?

Regards,

Mohit

former_member188883
Active Contributor
0 Kudos

Hi Mohit,


1. After stopping the database with the GUI or cmd, It will stop the MAXDB: SID service and we just have to stop the xserver service then?? If not then what would be the sequence of that then.

Service is mostly in auto mode. So no need to stop DB services manually.


2. If I use command prompt will I be able to connect with

dbmcli -u control,<password for control> -d <DBSID>

when database is stopped?

Yes you can still connect to database and execute db_state to check whether db is online or offline.

Regards,

Deepak Kori