目錄
安裝教程
安裝前準(zhǔn)備
新建dmdba用戶
修改文件打開最大數(shù)
掛載鏡像
新建安裝目錄
數(shù)據(jù)庫安裝
配置環(huán)境變量
配置實例
注冊服務(wù)
啟動停止服務(wù)
啟動
查看端口
停止
數(shù)據(jù)庫目錄結(jié)構(gòu)介紹
數(shù)據(jù)庫安裝目錄
達夢數(shù)據(jù)庫
DM8下載地址產(chǎn)品下載 | 達夢數(shù)據(jù)庫 (dameng.com)
安裝教程
安裝環(huán)境:centos7.9
安裝前準(zhǔn)備
新建dmdba用戶
#創(chuàng)建用戶和組
[root@localhost ~]# groupadd dinstall
[root@localhost ~]# useradd -g dinstall -m -d /home/dmdba -s /bin/bash dmdba
[root@localhost ~]# passwd dmdba
修改文件打開最大數(shù)
[root@localhost ~]# vi /etc/security/limits.conf
#最下面添加
dmdba hard nofile 65536
dmdba soft nofile 65536
dmdba hard stack 32768
dmdba soft stack 16384
#切換到dmdba用戶,查看是否生效
[root@localhost ~]# su - dmdba
[dmdba@localhost ~]$ ulimit -a
掛載鏡像
#切回root用戶
[dmdba@localhost ~]$ su root
#上傳dm8包
[root@localhost ~]# rz
rz waiting to receive.**[root@localhost ~]#
[root@localhost ~]# ls
anaconda-ks.cfg dm8_20230418_x86_rh6_64.zip
#解壓
[root@localhost ~]# unzip dm8_20230418_x86_rh6_64.zip
Archive: dm8_20230418_x86_rh6_64.zip
inflating: dm8_20230418_x86_rh6_64.iso_SHA256.txt
inflating: dm8_20230418_x86_rh6_64.iso
[root@localhost ~]#
#掛載,掛哪都可以
[root@localhost ~]# mount -o loop /root/dm8_20230418_x86_rh6_64.iso /mnt/
mount: /dev/loop0 寫保護,將以只讀方式掛載
新建安裝目錄
[root@localhost ~]# mkdir /dm8
[root@localhost ~]# chown dmdba:dinstall -R /dm8/
[root@localhost ~]# chmod -R 755 /dm8
數(shù)據(jù)庫安裝
#切換至 dmdba 用戶下,在 /mnt 目錄下使用命令行安裝數(shù)據(jù)庫程序,依次執(zhí)行以下命令安裝 DM 數(shù)據(jù)庫。
[root@localhost ~]# su - dmdba
[dmdba@localhost ~]$ cd /mnt/
[dmdba@localhost mnt]$ ls
DM8 Install.pdf DMInstall.bin
[dmdba@localhost mnt]$ ./DMInstall.bin -i
按需求選擇安裝語言,默認為中文。本地安裝選擇【不輸入 Key 文件】,選擇【默認時區(qū) 21】。選擇【1-典型安裝】,按已規(guī)劃的安裝目錄 /dm8 完成數(shù)據(jù)庫軟件安裝,不建議使用默認安裝目錄。
?數(shù)據(jù)庫安裝完成后,需要切換至 root 用戶執(zhí)行上圖中的命令?/dm8/script/root/root_installer.sh
?創(chuàng)建 DmAPService,否則會影響數(shù)據(jù)庫備份。
配置環(huán)境變量
#切換到root用戶
[dmdba@localhost ~]$ su - root
[root@localhost dmdba]# export PATH=$PATH:$DM_HOME/bin:$DM_HOME/tool
[root@localhost dmdba]# cd /home/dmdba/
[root@localhost dmdba]# vim .bash_profile
#最后加上
export PATH=$PATH:$DM_HOME/bin:$DM_HOME/tool
#切換至 dmdba 用戶下,執(zhí)行以下命令,使環(huán)境變量生效。
[dmdba@localhost ~]$ source .bash_profile
配置實例
#進入安裝目錄
[dmdba@localhost ~]$ cd /dm8/bin
#dminit 命令可設(shè)置多種參數(shù),可執(zhí)行如下命令查看可配置參數(shù)。
[dmdba@localhost bin]$ ./dminit help
需要注意的是頁大小 (page_size)、簇大小 (extent_size)、大小寫敏感 (case_sensitive)、字符集 (charset)?這四個參數(shù),一旦確定無法修改,需謹(jǐn)慎設(shè)置。
- extent_size 指數(shù)據(jù)文件使用的簇大小,即每次分配新的段空間時連續(xù)的頁數(shù)。只能是 16 頁或 32 頁或 64 頁之一,缺省使用 16 頁。
- page_size 數(shù)據(jù)文件使用的頁大小,可以為 4 KB、8 KB、16 KB 或 32 KB 之一,選擇的頁大小越大,則 DM 支持的元組長度也越大,但同時空間利用率可能下降,缺省使用 8 KB。
- case_sensitive 標(biāo)識符大小寫敏感,默認值為 Y 。當(dāng)大小寫敏感時,小寫的標(biāo)識符應(yīng)用雙引號括起,否則被轉(zhuǎn)換為大寫;當(dāng)大小寫不敏感時,系統(tǒng)不自動轉(zhuǎn)換標(biāo)識符的大小寫,在標(biāo)識符比較時也不區(qū)分大小寫,只能是 Y、y、N、n、1、0 之一。
- charset 字符集選項。0 代表 GB18030;1 代表 UTF-8;2 代表韓文字符集 EUC-KR;取值 0、1 或 2 之一。默認值為 0。
可以使用默認參數(shù)初始化實例,需要附加實例存放路徑。此處以初始化實例到 /dm/data 目錄下為例,初始化命令如下:(執(zhí)行初始化命令前,需要使用 root 用戶授予 /dm/data 目錄相應(yīng)權(quán)限。)
#切換到root用戶,創(chuàng)建
[root@localhost dmdba]# mkdir /dm/data
[root@localhost dmdba]# chmod -R 755 /dm/data/
[root@localhost dmdba]# chown dmdba:dinstall -R /dm/data
#切回dmdba
[root@localhost dmdba]# su - dmdba
[dmdba@localhost ~]$ cd /dm8/bin/
[dmdba@localhost bin]$ ./dminit path=/dm/data
initdb V8
db version: 0x7000c
file dm.key not found, use default license!
License will expire on 2024-04-17
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
log file path: /dm/data/DAMENG/DAMENG01.log
log file path: /dm/data/DAMENG/DAMENG02.log
write to dir [/dm/data/DAMENG].
create dm database success. 2023-05-23 15:51:54
也可以自定義初始化實例的參數(shù),參考如下示例:
以下命令設(shè)置頁大小為 32 KB,簇大小為 32 KB,大小寫敏感,字符集為 utf_8,數(shù)據(jù)庫名為 DMDB,實例名為 DBSERVER,端口為 5237。
./dminit path=/dm/data PAGE_SIZE=32 EXTENT_SIZE=32 CASE_SENSITIVE=y CHARSET=1 DB_NAME=DMDB INSTANCE_NAME=DBSERVER PORT_NUM=5237
注冊服務(wù)
注冊服務(wù)需使用 root 用戶進行注冊。使用 root 用戶進入數(shù)據(jù)庫安裝目錄的?/script/root
?下,如下所示:
[root@localhost dmdba]# cd /dm8/script/root
[root@localhost root]# ./dm_service_installer.sh -t dmserver -dm_ini /dm/data/DAMENG/dm.ini -p DMSERVER
Created symlink from /etc/systemd/system/multi-user.target.wants/DmServiceDMSERVER.service to /usr/lib/systemd/system/DmServiceDMSERVER.service.
創(chuàng)建服務(wù)(DmServiceDMSERVER)完成
啟動停止服務(wù)
啟動
[root@localhost root]# systemctl start DmServiceDMSERVER.service
查看端口
[root@localhost root]# netstat -anpt |grep dmserver
tcp6 0 0 :::5236 :::* LISTEN 47294/dmserver
停止
[root@localhost root]# systemctl stop DmServiceDMSERVER.service
數(shù)據(jù)庫目錄結(jié)構(gòu)介紹
數(shù)據(jù)庫安裝目錄
-
/dm8/bin
?目錄存放 DM 數(shù)據(jù)庫的可執(zhí)行文件,例如 disql 命令、dminit 命令、dmrman 工具等。 -
/dm8/desktop
?存放 DM 數(shù)據(jù)庫各個工具的桌面圖標(biāo)。 -
/dm8/doc
?存放 DM 數(shù)據(jù)庫用戶手冊。 -
/dm8/drivers
?存放連接 DM 數(shù)據(jù)庫的驅(qū)動文件。 -
/dm8/log
?存放 DM 數(shù)據(jù)庫日志,包括工具的日志、數(shù)據(jù)庫日志、服務(wù)日志等。 -
/dm8/samples
?存放 DM 數(shù)據(jù)庫各類配置文件的示例文件。 -
/dm8/script
?存放注冊、注銷 DM 數(shù)據(jù)庫服務(wù)的工具,例如 dm_service_installer.sh 等。 -
/dm8/tool
?存放 DM 數(shù)據(jù)庫的各個工具,例如 manager 管理工具、dbca 數(shù)據(jù)庫配置助手等。 -
/dm8/uninstall
?目錄存放卸載 DM 數(shù)據(jù)庫的腳本。 -
/dm8/web
?目錄存放 DM 數(shù)據(jù)庫 dem 工具的 web 環(huán)境。
?文章來源地址http://www.zghlxwxcb.cn/news/detail-456364.html文章來源:http://www.zghlxwxcb.cn/news/detail-456364.html
?
到了這里,關(guān)于達夢數(shù)據(jù)庫安裝教程的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!