达梦数据库服务启动的三种方式

最近学习了达梦数据库的安装部署,整理了关于数据库服务启动的三种方式,以做记录。

1、前台启动数据库
[dmdba@dmdb ~/dmdbms/bin]$ ./dmserver /home/dmdba/dmdata/dmdb/dm.ini
file dm.key not found, use default license!
Global parameter value of RT_HEAP_TARGET is illegal, use min value!
version info: develop
Use normal os_malloc instead of HugeTLB
Use normal os_malloc instead of HugeTLB
DM Database Server x64 V7.6.0.96-Build(2018.09.19-97292)ENT startup…
License will expire in 14 day(s) on 2020-01-24
ckpt lsn: 39244
ndct db load finished
ndct fill fast pool finished
set EP[0]'s pseg state to inactive
iid page’s trxid = 1156
NEXT TRX ID = 1157
pseg recv finished
nsvr_startup end.
aud sys init success.
aud rt sys init success.
systables desc init success.
ndct_db_load_info success.
nsvr_process_before_open begin.
nsvr_process_before_open success.
SYSTEM IS READY.

这个方式启动会进入一个交互界面,退出界面数据库就会关闭,可以考虑使用nohup启动:
[dmdba@dmdb ~/dmdbms/bin]$ nohup ./dmserver /home/dmdba/dmdata/dmdb/dm.ini &

2、配置数据库服务脚本
[dmdba@dmdb ~/dmdbms/bin/service_template]$ vim DmService
INI_PATH=/home/dmdba/dmdata/dmdb/dm.ini

[dmdba@dmdb ~/dmdbms/bin/service_template]$ ./DmService start
Starting DmService: [ OK ]
[dmdba@dmdb ~/dmdbms/bin/service_template]$ ./DmService status
DmService (pid 8484) is running…
[dmdba@dmdb ~/dmdbms/bin/service_template]$ cp DmService /home/dmdba/dmdbms/bin

3、注册系统服务:
[root@dmdb ~]# cd /home/dmdba/dmdbms/script/root
[root@dmdb /home/dmdba/dmdbms/script/root]# ./dm_service_installer.sh -t dmserver -p dmdb -i /home/dmdba/dmdata/dmdb/dm.ini
Move the service script file(/home/dmdba/dmdbms/bin/DmServicedmdb to /etc/rc.d/init.d/DmServicedmdb)
Finished to create the service (DmServicedmdb)

[root@dmdb ~]# chown dmdba:dinstall /etc/rc.d/init.d/DmServicedmdb
[dmdba@dmdb ~]$ service DmServicedmdb start
Starting DmServicedmdb: [ OK ]
[dmdba@dmdb ~]$ service DmServicedmdb status
DmServicedmdb (pid 8776) is running…

查看数据库服务:
[dmdba@dmdb ~/dmdbms/script]$ ps -ef | grep dmserver
dmdba 5826 2226 0 05:57 pts/0 00:00:01 ./dmserver /home/dmdba/dmdata/dmdb/dm.ini
dmdba 5914 5881 0 05:59 pts/1 00:00:00 grep dmserver

你可能感兴趣的:(达梦数据库服务启动的三种方式)