二、Starting and Stopping Systems in SAP HANA Studio

2.1 Start a System 启动HANA

Procedure

1.在需要启动的系统上右键选择 Configuration and Monitoring>Start System

Note:在SYSTEMDB上执行Start System,在租户数据库上Start System是不可用的,租户数据库如何启动和关闭在后面章节介绍

二、Starting and Stopping Systems in SAP HANA Studio

2、输入<sid>adm 用户名和密码,这个操作系统帐号是在安装HANA数据库的时候创建的,点击OK,开始启动数据库
二、Starting and Stopping Systems in SAP HANA Studio

Results
  • Administration editor在诊断模式(diagnosis mode)下打开,数据库服务按次序启动,当所有服务都启动之后,系统在System view里面显示为(二、Starting and Stopping Systems in SAP HANA Studio)
  • 所有租户数据库启动,如果租户数据库先前是stop状态的,它不会随着系统数据库启动而启动

2.2 Stop a System 关闭HANA

Procedure

1.在需要关闭的系统上右键选择 Configuration and Monitoring>Stop System

2.选择如何关闭HANA
  • Soft 当正在运行的语句都结束了或者是到了设置的时间点开始关闭
  • Hard 直接关闭,正在执行的事务失效并且回滚
二、Starting and Stopping Systems in SAP HANA Studio

3、输入<sid>adm 用户名和密码,这个操作系统帐号是在安装HANA数据库的时候创建的,点击OK,开始关闭数据库

Results
  • Administration editor在诊断模式(diagnosis mode)下打开,数据库服务按次序关闭,当所有服务都关闭之后,系统在System view里面显示为(二、Starting and Stopping Systems in SAP HANA Studio
  • 所有租户数据库都关闭了

2.3 关闭或者启动一个数据库的service

Prerequisites
需要SERVICE ADMIN的系统权限


使用场景
  • 在一个分布式系统中,一台主机挂了,备用机接管,然而当主机再次可用的时候,服务还是不可用状态,这个时候就需要手工重启这些服务
  • 在对HANA XS更新之后,需要对xsengine服务进行重启

Note:HANA在支持高可用方面提供一些功能,其中有一点就是服务的自动重启(service auto-restart)。当一些事件或者是管理员人为干预导致服务不可用了,HANA的自动重启功能会自动识别这些失败的services,并且重启他们

Procedure
二、Starting and Stopping Systems in SAP HANA Studio

  • Stop...                                          服务正常停掉,然后通常会被重启
  • Kill...                                             服务立即停掉,然后通常会被重启
  • Reconfigure Service...            服务重新配置,意味着对系统的配置文件的修改会生效
  • Start Missing Services...        任何非**状态的服务被重启

2.4 在HANA关闭或者启动的时候监控系统

你能够在系统关闭或者启动的时候,通过诊断模式(diagnosis mode)去访问系统的诊断文件(diagnosis files)。

HANA studio一般是通过SQL来收集系统信息的,当HANA处于未启动状态时,SQL connection是不可用的。所以,当系统未启动的时候,HANA是通过与SAP start service(sapstartsrv)来收集信息,如果你有<sid>adm的帐号密码,你就可以在诊断模式下查看诊断文件的信息。
这样就能分析HANA在启动或者关闭出现的问题原因。

你可以通过如下方式选择系统为诊断模式

二、Starting and Stopping Systems in SAP HANA Studio


2.5 Restart Sequence

1.The data volume of each service is accessed in order to read and load the restart record.
2.The list of open transactions is read into memory.
3.Row tables are loaded into memory.
4.Open transactions are processed using the redo log:
   1.Write transactions that were open when the database was stopped are rolled back.
   2.Changes of committed transactions that were not written to the data area are rolled forward.the first column tables start being reloaded into memory as they are accessed for roll forward.
After this step, the database is technically available and logon is possible.
5.Aborted transactions are determined and rolled back.
6.A savepoint is performed with the restored consistent state of the database.
7.Column tables that are marked for preload and their attributes are asynchronously loaded in the background (if they have not already been loaded as part of log replay).
The preload parameter is configured in the metadata of the table. This feature is useful for example to make certain tables and columns used by important business processes available more quickly.
8.Column tables that were loaded before restart and their attributes start reloading asynchronously in the background (if they have not already been loaded as part of log replay or because they are marked for preload).During normal operation, the system tracks the tables currently in use. This list is used as basis for reloading tables after a restart.

Reloading column tables as described in steps 7 and 8 restores the database to a fully operational state more quickly. However, it does create performance overhead and may not be necessary in non-production systems. You can deactivate the reload feature in the indexserver.ini file by setting the reload_tables parameter in the sql section to false. In addition, you can configure the number of tables whose attributes are loaded in parallel using the tables_preloaded_in_parallel parameter in the parallel section of indexserver.ini. This parameter also determines the number of tables that are preloaded in parallel.