1.3 注册实例服务
1.3.1 服务说明
达梦数据库管理系统DM8中默认有12个功能模块,每个模块都有对应的服务脚本。将这些模块注册成服务后,可以使用服务来管理这些功能,命令如下。

在使用这些服务脚本前,需要根据实际的情况对这些脚本进行修改,服务说明如表1-1所示。
表1-1 服务说明

(续表)

1.3.2 命令行注册和删除服务
1.注册服务
DM服务注册和卸载脚本在/dm/dmdbms/scripts/root目录下进行,查看当前路径下的文件的命令如下。

需要使用“root”用户执行注册。在脚本后加“-h”可以查看脚本的帮助,命令如下。

注意,服务注册脚本在不同版本中有区别,在实际使用中以help中的说明为准。
(1)注册前创建的USTC实例。


(2)通过服务启动和关闭USTC实例。

2.删除服务
服务删除脚本为dm_service_uninstaller.sh,直接调用该脚本并指定服务名即可,举例如下。

1.3.3 DBCA工具中的注册和删除服务
除了使用脚本,DBCA工具还提供了注册和删除服务。
使用dmdba用户执行dbca命令。

1.数据库配置助手
在“达梦数据库配置助手”界面,选择“注册数据库服务”,将数据库实例注册到Linux系统中,如图1-21所示。

图1-21 数据库配置助手
2.注册数据库服务
选择数据库实例所对应的dm.ini文件,如图1-22所示。

图1-22 注册数据库服务
3.执行配置脚本
注册中会提示应使用“root”用户执行配置脚本,如图1-23所示。

图1-23 执行配置脚本

4.完成注册
单击“完成”按钮,完成数据库实例的注册,如图1-24所示。

图1-24 完成注册
删除数据库和注册数据库类似,在第一步操作时,选择“删除数据库服务”即可,这里不再描述。