DM服务查看器
dmdba用户下:$DM_HOME/tool/dmservice.sh
数据库启停命令
[root@dm1 ~]# systemctl |grep Dm
DmAPService.service loaded active running Dameng Assistant Plug-In Service(DmAPService).
DmServiceDMSERVER.service loaded active running DM database instance service
[root@dm1 ~]# systemctl status DmServiceDMSERVER.service
â— DmServiceDMSERVER.service - DM database instance service
Loaded: loaded (/usr/lib/systemd/system/DmServiceDMSERVER.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2020-03-02 11:04:58 CST; 2h 31min ago
Process: 2487 ExecStart=/dm/dmdbms/bin/DmServiceDMSERVER start (code=exited, status=0/SUCCESS)
Main PID: 2519 (dmserver)
Tasks: 51
CGroup: /system.slice/DmServiceDMSERVER.service
└─2519 /dm/dmdbms/bin/dmserver /dm/dmdbms/data/DAMENG/dm.ini -noconsole
Mar 02 11:04:43 dm1 systemd[1]: Starting DM database instance service...
Mar 02 11:04:58 dm1 DmServiceDMSERVER[2487]: [39B blob data]
Mar 02 11:04:58 dm1 systemd[1]: Started DM database instance service.
数据库启动模式查看
[dmdba@dm1 ~]$ disql sysdba/Dm1234567
Server[LOCALHOST:5236]:mode is normal, state is open
login used time: 3.298(ms)
disql V8
SQL> select status$ from v$database;
LINEID STATUS$
---------- -----------
1 4
used time: 3.109(ms). Execute id is 4.
SQL>
1:启动;2:启动,redo 完成;3:MOUNT;4:打开;5:挂起;6:关闭
通过ps -ef |grep dm.ini查看数据库状态或systemctl |grep Dm 查看已经安装的DM服务。
[root@dm1 ~]# systemctl status DmServiceDMSERVER.service
â— DmServiceDMSERVER.service - DM database instance service
Loaded: loaded (/usr/lib/systemd/system/DmServiceDMSERVER.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Mon 2020-03-02 13:39:53 CST; 1min 2s ago
Process: 6764 ExecStop=/dm/dmdbms/bin/DmServiceDMSERVER stop (code=exited, status=0/SUCCESS)
Process: 2487 ExecStart=/dm/dmdbms/bin/DmServiceDMSERVER start (code=exited, status=0/SUCCESS)
Main PID: 2519 (code=exited, status=0/SUCCESS)
Mar 02 11:04:43 dm1 systemd[1]: Starting DM database instance service...
Mar 02 11:04:58 dm1 DmServiceDMSERVER[2487]: [39B blob data]
Mar 02 11:04:58 dm1 systemd[1]: Started DM database instance service.
Mar 02 13:39:43 dm1 systemd[1]: Stopping DM database instance service...
Mar 02 13:39:53 dm1 DmServiceDMSERVER[6764]: [39B blob data]
Mar 02 13:39:53 dm1 systemd[1]: Stopped DM database instance service.
[root@dm1 ~]# ps -ef |grep dm.ini
root 6860 3622 0 13:40 pts/1 00:00:00 grep --color=auto dm.ini
[root@dm1 ~]# systemctl start DmServiceDMSERVER.service
[root@dm1 ~]# systemctl status DmServiceDMSERVER.service
â— DmServiceDMSERVER.service - DM database instance service
Loaded: loaded (/usr/lib/systemd/system/DmServiceDMSERVER.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2020-03-02 13:41:18 CST; 13s ago
Process: 6764 ExecStop=/dm/dmdbms/bin/DmServiceDMSERVER stop (code=exited, status=0/SUCCESS)
Process: 6867 ExecStart=/dm/dmdbms/bin/DmServiceDMSERVER start (code=exited, status=0/SUCCESS)
Main PID: 6887 (dmserver)
Tasks: 51
CGroup: /system.slice/DmServiceDMSERVER.service
└─6887 /dm/dmdbms/bin/dmserver /dm/dmdbms/data/DAMENG/dm.ini -noconsole
Mar 02 13:41:03 dm1 systemd[1]: Starting DM database instance service...
Mar 02 13:41:18 dm1 DmServiceDMSERVER[6867]: [39B blob data]
Mar 02 13:41:18 dm1 systemd[1]: Started DM database instance service.
通过systemctl启停后的状态在DM Service Viewer也能直观看到。
通过命令行启动,但是命令行一直要在线状态
[dmdba@dm1 ~]$ /dm/dmdbms/bin/dmserver /dm/dmdbms/data/DAMENG/dm.ini
file dm.key not found, use default license!
version info: develop
Use normal os_malloc instead of HugeTLB
Use normal os_malloc instead of HugeTLB
DM Database Server x64 V8 1-1-45-19.11.21-116030-ENT startup...
Database mode = 0, oguid = 0
License will expire on 2020-11-21
file lsn: 48949
ndct db load finished
ndct fill fast pool finished
iid page's trxid[6011]
NEXT TRX ID = 6012
pseg_collect_items, collect 0 active_trxs, 0 cmt_trxs, 0 pre_cmt_trxs, 0 active_pages, 0 cmt_pages, 0 pre_cmt_pages
pseg_process_collect_items end, 0 active trx, 0 active pages, 0 committed trx, 0 committed pages
total 0 active crash trx, pseg_crash_trx_rollback begin ...
pseg_crash_trx_rollback end
purg2_crash_cmt_trx end, total 0 page purged
set EP[0]'s pseg state to inactive
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.
total 0 active crash trx, pseg_crash_trx_rollback begin ...
pseg_crash_trx_rollback end
Server is stopping...
listener closed and all sessions disconnected
purge undo records in usegs...OK
full check point starting...
generate force checkpoint, rlog free space[536479744], used space[382976]
ckpt_lsn, ckpt_fil, ckpt_off are set as (52669, 0, 9210368)
checkpoint: 930 pages flushed.
checkpoint finished, rlog free space, used space is (536421376, 441344)
full check point end.
shutdown audit subsystem...OK
shutdown schedule subsystem...OK
shutdown timer successfully.
pre-shutdown MAL subsystem...OK
shutdown worker threads subsystem...OK
shutdown local parallel threads pool successfully.
shutdown replication subsystem...OK
shutdown sequence cache subsystem...OK
wait for mtsk link worker to exit..OK
shutdown mpp session subsystem...OK
wait for rapply is all over... OK
rapply worker threads exit successfully.
pre ending task & worker threads...OK
shutdown dblink subsystem...OK
shutdown session subsystem...OK
shutdown rollback segments purging subsystem...OK
shutdown rps subsystem...OK
shutdown transaction subsystem...OK
shutdown locking subsystem...OK
shutdown dbms_lock subsystem...OK
ending tsk and worker threads...OK
ckpt2_exec_immediately begin.
ckpt_lsn, ckpt_fil, ckpt_off are set as (53675, 0, 9651712)
checkpoint: 0 pages flushed.
checkpoint finished, rlog free space, used space is (536806400, 56320)
ckpt_lsn, ckpt_fil, ckpt_off are set as (54013, 0, 9708032)
checkpoint: 0 pages flushed.
checkpoint finished, rlog free space, used space is (536862720, 0)
ckpt_lsn, ckpt_fil, ckpt_off are set as (54013, 0, 9708032)
checkpoint: 0 pages flushed.
checkpoint finished, rlog free space, used space is (536862720, 0)
shutdown archive subsystem...OK
shutdown redo log subsystem...OK
shutdown MAL subsystem...OK
shutdown message compress subsystem successfully.
shutdown task subsystem...OK
shutdown trace subsystem...OK
shutdown svr_log subsystem...OK
shutdown plan cache subsystem...OK
shutdown file subsystem...OK
shutdown database dictionary subsystem...OK
shutdown mac cache subsystem...OK
shutdown dynamic login cache subsystem...OK
shutdown ifun/bifun/sfun/afun cache subsystem...OK
shutdown crypt subsystem...OK
shutdown pipe subsystem...OK
shutdown compress component...OK
shutdown slave redo subsystem...OK
shutdown kernel buffer subsystem...OK
shutdown SQL capture subsystem...OK
shutdown control file system...OK
shutdown dtype subsystem...OK
shutdown huge buffer and memory pools...OK
close lsnr socket
DM Database Server shutdown successfully.
[dmdba@dm1 ~]$
通过命令行启动到mount状态
[dmdba@dm1 ~]$ /dm/dmdbms/bin/dmserver /dm/dmdbms/data/DAMENG/dm.ini -noconsole mount
file dm.key not found, use default license!
version info: develop
Use normal os_malloc instead of HugeTLB
Use normal os_malloc instead of HugeTLB
DM Database Server x64 V8 1-1-45-19.11.21-116030-ENT startup...
Database mode = 0, oguid = 0
License will expire on 2020-11-21
file lsn: 54013
ndct db load finished
ndct fill fast pool finished
nsvr_startup end.
aud sys init success.
aud rt sys init success.
systables desc init success.
ndct_db_load_info success.
SYSTEM IS READY.
在open状态可以直接切换到mount状态
[dmdba@dm1 ~]$ disql sysdba/Dm1234567
Server[LOCALHOST:5236]:mode is normal, state is open
login used time: 3.180(ms)
disql V8
SQL> select status$ from v$database;
LINEID STATUS$
---------- -----------
1 4
used time: 1.810(ms). Execute id is 4.
SQL> alter database mount;
executed successfully
used time: 00:00:01.746. Execute id is 0.
SQL> select status$ from v$database;
LINEID STATUS$
---------- -----------
1 3
used time: 1.330(ms). Execute id is 5.
SQL>
数据库切换命令
ALTER DATABASE <修改数据库语句>;
<修改数据库语句>::=
RESIZE LOGFILE <文件路径> TO <文件大小>|
ADD LOGFILE <文件说明项>{,<文件说明项>}|
RENAME LOGFILE <文件路径>{,<文件路径>} TO <文件路径>{,<文件路径>}|
MOUNT |
SUSPEND |
OPEN [FORCE] |
NORMAL |
PRIMARY|
STANDBY |
ARCHIVELOG |
NOARCHIVELOG |
<ADD|MODIFY|DELETE> ARCHIVELOG <归档配置语句> |
ARCHIVELOG CURRENT
<文件说明项> ::= <文件路径>SIZE <文件大小>
<归档配置语句>::= 'DEST = <归档目标>,TYPE = <归档类型>'
<归档类型>::=
LOCAL [<文件和路径设置>] |
REALTIME|
SYNC |
ASYNC ,TIMER_NAME = <定时器名称> |
REMOTE ,ARCH_INCOMING_PATH = <远程归档路径>[<文件和路径设置>]|
TIMELY
<文件和路径设置>::=[,FILE_SIZE = <文件大小>][,SPACE_LIMIT = <空间大小限制>]