CentOS安裝達夢(DM7)資料庫詳解

2021-10-25 19:02:39 字數 2017 閱讀 8852

1、檢視軟硬體資訊

1.1軟硬體安裝條件確認:

[root@localhost home]# lscpu

檢視cpu型別,選擇適配的達夢資料庫。(或者使用cat /proc/cpuinfo檢視cpu資訊)

[root@localhost home]# free -h

檢視記憶體資訊,物理記憶體至少為1g

[root@localhost home]# df -th

檢視掛載磁碟資訊,/tmp分割槽需要800m以上(解壓達夢資料庫安裝包時用到,過小可能會報錯)

注意:如果資料庫需要遠端訪問,關閉伺服器防火牆(測試環境),或者是開啟防火牆並開放資料庫埠號(生產環境)。

[root@localhost home]# systemctl stop firewalld

[root@localhost home]# systemctl status firewalld

2、安裝步驟

2.1建立安裝目錄

[root@localhost home]# mkdir -p /dm7

2.2建立組和使用者,並將使用者新增到組

[root@localhost home]# groupadd dinstall

[root@localhost home]# useradd -g dinstall dmdba

[root@localhost home]# passwd dmdba

2.3修改目錄(含目錄包含內容)所屬使用者及所屬組

[root@localhost home]# chown dmdba:dinstall -r /dm7

2.3設定檔案最大開啟數

[root@localhost home]# vi /etc/security/limits.conf

dmdba soft nofile 65536

dmdba hard nofile 4096

臨時修改ulimit -n 65536

2.4將安裝包dm7_setup_rh7_64_ent_7.6.1.60_20200603.iso上傳到/opt下,然後掛載到/mnt下

[root@localhost home]# mount -o loop /opt/dm7_setup_rh7_64_ent_7.6.1.60_20200603.iso /mnt

[root@localhost home]# su - dmdba

[dmdba@localhost ~]$ cd /mnt

[dmdba@localhost mnt]$ ./dminstall.bin -i

結合實際需要輸入正確引數,生產環境需要指定key檔案。

3、建立資料庫例項

3.1命令列方式建立庫並註冊服務

[dmdba@localhost home]$ cd /dm7/bin/

[dmdba@localhost bin]$ ./dminit path=/dm7/data db_name=dameng instance_name=test port_num=5236

[dmdba@localhost bin]$ exit

[root@localhost bin]# cd /dm7/script/root/

[root@localhost root]# ./dm_service_installer.sh -t dmserver -p test -dm_ini /dm8/data/dameng/dm.ini

4、啟動資料庫

[dmdba@localhost bin]$ su -dmdba

[dmdba@localhost bin]$ sh /dm7/bin/dmservicetest start

5、連線資料庫測試

[dmdba@localhost bin]$ ./disql 使用者名稱/密碼@127.0.0.1:5236

sql>select * from v$version;

若出現資料庫版本,恭喜你安裝完成!

DM7 達夢資料庫 日常操作

吐槽 國產達夢資料庫,不得不說,還想模仿人家oracle和postgresql的模式 但是這ui和效能,個人感覺差的一批,還搞這麼複雜 介紹 山寨版的達夢資料庫,無論是工具還是操作都是非常的感人 按照使用者來建立表空間,一對一的關係,乙個使用者就是乙個模式也對應著乙個表空間 使用 建立表空間 cre...

達夢資料庫DM7備份還原實操

達夢資料庫dm7備份還原實操 達夢資料庫備份分為冷備和熱備,今天實踐的內容是熱備,熱備的三個前置條件為 1.dmap服務是開啟的 2.資料庫是開啟的 3.資料為歸檔模式 檢視兩個服務狀態 dmdba xubk service dmapservice status dmapservice is sto...

達夢資料庫(DM7)的部分TRACE事件說明

dm7 中存在一些動態trace,在enable monitor 0的情況下依然可以用來跟蹤一些問題,以下是部分trace事件說明 1事件 普通,出現執行時錯誤將sql語句輸出到trace檔案中 alter session 0 set events 1 trace name errorstack,l...