This article has participated in the “Digitalstar Project” and won a creative gift package to challenge the creative incentive money.

🌲 preface

1. For Dameng database, a perennial top 3 domestic database, it has long been “coveted A”!

If you want to learn a database technology, the first step is of course to install the database, and then learn to use it, by the way, the author’s first installation experience! ❀ ️

πŸ’¬ introduction

Dameng Database Management System (hereinafter referred to as DM) is a database management system based on client/server mode, which can be installed on a variety of computer operating system platforms. Typical operating systems are:

  • Windows (Windows 2003 / / XP/Vista / 7/8/10 / Server, etc.)
  • Linux
  • HP-UNIX
  • Solaris
  • FreeBSD
  • AIX

There are different installation steps for different system platforms.

According to different application requirements and configurations, DM offers a variety of product families:

  • Standard Edition Standard Edition
  • Enterprise Edition Enterprise Edition
  • Security Edition Security Edition

Compared to Oracle’s official English document, damone’s official document is much more friendly and I like it at first sight! ❀ ️

As a popular domestic database, the support for the platform is bound to be extensive. Some basic installation and deployment requirements are listed below at πŸ‘‡πŸ» :

The name of the requirements
CPU Intel Pentium4(Pentium 41.6 GB or higher is recommended) processor
memory 256 MB (over 512 MB recommended)
The hard disk More than 5G available space
The network card Network adapters larger than 10M support TCP/IP
The operating system Windows(simplified Chinese server version sp2 or higher)/Linux(glibc2.3 or higher, kernel 2.6, KDE/GNOME desktop environment has been installed, it is recommended to install UnixODBC in advance)

πŸ’¦ Download the installation media

πŸ”₯ Dameng 8 installation package

The latest version is DM8, which can be downloaded directly:

The database installation media for Damon8 can be downloaded from eco.dameng.com/download

πŸ’₯ Centos7 box

For Linux I chose Centos7 and intend to install it using Vagrant:

Centos7 box image download address: app.vagrantup.com/luciferliu/…

At this point, the installation media are ready!

πŸ† DM installation in Linux

The operating system CPU The database
CentOS7 X86_64 architectures dm8_20210630_x86_rh6_64_ent

🍭 Centos7 installation

Vagrant start centos7

Go to the customized directory and start the host:

mkdir -p /Volumes/DBA/dm8
cd /Volumes/DBA/dm8
## Vagrant initializationThe vagrant init luciferliu/centos7.9## Vagrant creates and starts the host
vagrant up
Copy the code

As shown in the figure above, the Centos7.9 host is already up and running. Now let’s connect and upload the DM8 installation package.

Uploading installation Media

Copy the DM8 installation package to the current /Volumes/DBA/ DM8 directory and use vagrant SSH to connect to the host:

Copy the DM installation package
cd /Volumes/DBA/dm8
cp /Users/lpc/Downloads/dm8_20210630_x86_rh6_64_ent.zip .
Copy the code

Initial Configuration

## Connect to host
vagrant ssh
Change the password of user root to dm
echo dm | sudo passwd --stdin root
Switch to user root
su - root
# change the host name
hostnamectl set-hostname dm8 && exec bash
# configure the time zone
timedatectl set-timezone Asia/Shanghai
## Configure system Chinese
echo 'export LANG=zh_CN.UTF-8' >> /etc/profile
## Create DM package directory
mkdir /soft
Copy the DM installation package to the package directory
cp /vagrant/dm8_20210630_x86_rh6_64_ent.zip /soft
Install unzip and lsb_release
yum install -y unzip lsb*
Decompress the DM installation package
cd /soft
unzip dm8_20210630_x86_rh6_64_ent.zip
Copy the code

As shown in the preceding figure, the DM8 installation package has been decompressed to the host /soft directory.

🍰 Prepare for installation

Before installing a DM, you need to check or modify the operating system configuration to ensure that the DM is correctly installed and running.

Check the Linux(Unix) system information

## Get system bits
getconf LONG_BIT
Mysql > query operating system release information
lsb_release -a
## Query system information
cat /etc/issue
## Query system name
uname -a
Copy the code

Creating an Installation User

To minimize the impact on the operating system, users should not install and run the DM as root. Users can create a dedicated system user for the DM prior to installation.

Create a dinstall group
groupadd -g 12349 dinstall
Create a dmdba user
useradd -u 12345 -g dinstall -m -d /home/dmdba -s /bin/bash dmdba
Change the password of user dmdba
echo dmdba | passwd --stdin dmdba
Copy the code

Create an installation directory and authorize it

mkdir /dm
mkdir -p /dm{arch,bak,data}
chown -R dmdba.dinstall /dm /soft /dmdata /dmarch /dmbak
chmod -R 775 /dm{arch,bak,data} /dm
Copy the code

Disable the firewall and Selinux

## Disable the firewall
systemctl stop firewalld.service
systemctl disable firewalld.service
# # close selinux
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
Copy the code

Close transparent large page and NUMA

Linux6:

cat >>/etc/rc.d/rc.local <<EOF
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi
Copy the code

Linux7:

sed -i 's/quiet/quiet transparent_hugepage=never numa=off/' /etc/default/grub
grub2-mkconfig -o /boot/grub2/grub.cfg
Copy the code

Configuring System Parameters

cat <<EOF >>/etc/sysctl.conf fs.aio-max-nr = 1048576 fs.file-max = 6815744 #kernel.shmall = 2097152 #kernel.shmmax = 536870912  kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 net.ipv4.ip_local_port_range = 9000 65500 net.core.rmem_default = 262144 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 1048576 vm.swappiness = 0 vm.dirty_background_ratio = 3 vm.dirty_ratio = 80 vm.dirty_expire_centisecs = 500 vm.dirty_writeback_centisecs = 100 EOF
## Activate parameter configuration
sysctl -p
Copy the code

Configure operating system restrictions

On Linux(Unix) systems, the ulimit command limits the use of operating system resources by programs. To ensure proper running of the DM, you are advised to check the ulimit parameter of the current installation user.

# # configure PAM. D
cat <<EOF >>/etc/pam.d/login session required pam_limits.so session required /lib64/security/pam_limits.so EOF
# # to see PAM. D
cat /etc/pam.d/login | grep -v ^ "$" | grep -v "^ #"
Check operating system resource limits
ulimit -a
## Remove nice, as fsize, nproc, nofile, core, data restrictions
cat <<EOF>>/etc/security/limits.conf dmdba - nice 0 dmdba - as unlimited dmdba - fsize unlimited dmdba - nproc 131072 dmdba - nofile 131072 dmdba - core unlimited dmdba - data unlimited root - nice 0 root - as unlimited root - fsize unlimited root - nproc 131072 root - nofile 131072 root - core unlimited root - data unlimited EOF
Check the configuration file
cat /etc/security/limits.conf | grep -v ^ "$" | grep -v "^ #"
## Check resource limits for DMDBA users
su - dmdba -c "ulimit -a"
Copy the code

Checking system Memory

To ensure proper installation and running of the DM, ensure that the operating system has at least 1GB of available memory (RAM). If the available memory is too small, the DM may fail to be installed or started.

Get the total memory size
grep MemTotal /proc/meminfo
Get the swap partition size
grep SwapTotal /proc/meminfo
Get memory usage details
free -m
Copy the code

Checking Storage Space

The DM requires 1GB storage space. Plan the installation directory in advance and reserve sufficient storage space. Before installing the DM, reserve enough storage space for the database instance and plan the data path and backup path.

Query directory /dm free space
df -h /dm
The TMP directory guarantees 1GB of storage space
df -h /tmp
Copy the code

Configuring environment Variables

Configure the DMDBA environment variable
cat <<EOF>>/home/dmdba/.bash_profile
umask 022
export TMP=/tmp
export TMPDIR=\$TMP
export DM_HOME="/dm"
export LD_LIBRARY_PATH="\$LD_LIBRARY_PATH:\$DM_HOME/bin"
export PATH=/usr/sbin:\$PATH
export PATH=\$DM_HOME/bin:\$PATH
export PS1="[\`whoami\`@\`hostname\`:"'\$PWD]\$ '
alias ds='disql sysdba'
EOF
## View environment variables
cat /home/dmdba/.bash_profile | grep -v ^ "$" | grep -v "^ #"
Copy the code

🍯 Install the DM8 database

Installation supports graphical installation, command-line installation, and silent installation. Since I did not install a graphical interface, I installed it using a command line setup.

You need to log in to or switch to the system installation user to perform the following installation steps (note: It is not recommended to install the system as user root).

Mount the DM ISO image

The DM8 installation package downloaded from the official website is decompressed into an ISO image file, so you need to mount the installation file to start the installation.

## Mount the DM ISO file
cd /soft/dm8_20210630_x86_rh6_64_ent
mount -o loop dm8_20210630_x86_rh6_64_ent_8.1.2.18_pack7.iso /opt
Copy the installation file to /soft
cp /opt/DM* /soft
## Cancel mount
umount /opt
## Directory authorization
chown -R dmdba:dinstall /soft
chmod -R 775 /soft
ll /soft
Copy the code

Command line installation

1. Execute installation command:

Switch to the DMDBA user
su - dmdba
cd /soft/
Execute the command line installation
./DMInstall.bin -i
Copy the code

2. Select an installation language as required. The default language is Chinese. Local installation select [no Key file] and [default time zone 21].

3. Select 1- Typical Installation and use the planned installation directory/DM to install the database software. The default installation directory is not recommended.

4. Run the root script as user root.

su - root
/dm/script/root/root_installer.sh
Copy the code

Command line configuration example

Configure the instance using the dMDba user and initialize the instance using the dminit command.

su - dmdba
Use the default parameters to initialize the instance, you need to attach the instance storage path /dmdata
dminit path=/dmdata
Copy the code

πŸ“’ Note: Multiple parameters can be set using the dminit command. You can run the following command to view the parameters.

Note page size (PAGE_SIZE), cluster size (EXTENT_SIZE), CASE_SENSITIVE (CHARSET/UNICODE_FLAG), VARCHAR type length (LENGTH_IN_CHAR) If these parameters cannot be modified, set them with caution.

  • EXTENT_SIZE Specifies the data file cluster size (16). 16, 32, 64, unit: page. The default value is 16. Index the cluster size used by data files, that is, the number of consecutive pages each time a new segment space is allocated.
  • PAGE_SIZE Data page size (8). The value can be 4, 8, 16, or 32 (unit: K). The larger the page size is, the larger the unit length is supported by the DM, but the space usage may decrease.
  • CASE_SENSITIVE specifies the size sensitive (Y). This parameter is optional. The value is Y/N, 1/0. In case sensitive cases, lowercase identifiers are enclosed in double quotation marks; otherwise, they are converted to uppercase. If the case is not sensitive, the system does not automatically change the case of the identifiers and does not compare the identifiers. The identifiers can be Y, Y, N, N, 1, or 0.
  • CHARSET/UNICODE_FLAG Character set (0), Optional value: 0[GB18030], 1[UTF-8], 2[UC-kR]; CHARSET/UNICODE_FLAG Character set (0), Optional value: 0[GB18030], 1[UTF-8], 2[UC-KR]; 1 stands for UTF-8. 2 represents the Korean character set EUC-KR; The value can be 0, 1, or 2. The default value is 0.
  • LENGTH_IN_CHAR SPECIFIES whether the length of the VARCHAR type is in characters (N). This parameter is optional.

Set the page size to 32 KB, cluster size to 32 KB, case sensitive, character set to UTF_8, database name to DMDB, instance name to LUCIFER, and port to 5237.

dminit path=/dmdata PAGE_SIZE=32 EXTENT_SIZE=32 CASE_SENSITIVE=y CHARSET=1 DB_NAME=DMDB INSTANCE_NAME=LUCIFER
Copy the code

Command line registration service

To register the service, log in as user root. Go to the /script/root directory of the database installation directory as user root, as shown below:

cd /dm/script/root
## Registration service
./dm_service_installer.sh -t dmserver -dm_ini /dmdata/DMDB/dm.ini -p DMSERVER
# configure service startup
systemctl enable DmServiceDMSERVER.service
## Start the service
systemctl start DmServiceDMSERVER.service
Check service status
systemctl status DmServiceDMSERVER.service
Copy the code

Command line to start or stop the database

After the service is successfully registered, start and stop the database as follows:

cd /dm8/bin
Check the current database service status
systemctl status DmServiceDMSERVER.service
## Close the database
systemctl stop DmServiceDMSERVER.service
Open the databaseSystemctl start DmServiceDMSERVER. Service or dmserver/dmdata/DMDB/dm. Ini# restart the database
systemctl restart DmServiceDMSERVER.service
Copy the code

You can also run the following command:

DmServiceDMSERVER start/stop/restart/status
Copy the code

Connecting to the database

disql sysdba
Copy the code

πŸ₯ˆ DM installation in Docker

🏈 Prepare for installation

The hardware and software version
terminal X86-64 architecture
Docker Version 19.0 and later

πŸ€ Download the Docker installation package

## Create a /dm8 folder under the root directory to place the downloaded Docker installation package. The command is as follows:
mkdir -p /Volumes/DBA/dm8
## Go to /dm8 and download the DM Docker installation package. The command is as follows:
cd /Volumes/DBA/dm8
wget -O dm8_docker.tar -c https://download.dameng.com/eco/dm8/dm8_docker.tar
Copy the code

⚽️ Import an image

After downloading, import the installation package, open the Docker, and run the following command:

docker import dm8_docker.tar dm8:v01
Copy the code

After the import is complete, you can use Docker images to view the imported image as follows:

docker images
Copy the code

The following information is displayed:

⚾️ Start the container

After the image is imported, use Docker run to start the container. The default port is 5236. The default account password is as follows:

docker run -itd -p 5236:5236 --name dm8_01 dm8:v01 /bin/bash /startDm.sh
Copy the code

After the container is started, use docker PS to check the startup status of the image. The command is as follows:

docker ps
Copy the code

After the startup is complete, you can view logs to view the startup status. Run the following command:

docker logs -f dm8_01
Copy the code

If the following information is displayed, the startup is successful.

🎾 Start and stop the database

The command is as follows:

docker stop/start/restart dm8_01
Copy the code

🎱 connection docker

Get the container ID
docker ps
## Connect containers
docker exec -it acd3a2211b52 /bin/bash
## Switch the dMDBA user
su - dmdba
Connect to the database
cd /dm8/bin
./disql
Copy the code

πŸ“’ Note: if disQL is used in docker container, run source /etc/profile to prevent Chinese garbled characters after entering the container.

πŸ… Install the DM in Windows

🍎 Prepare for installation

Checking System Information

Before installing the DM database, you need to check the operating system information and ensure that the DM database installation program matches the operating system to ensure that the DM database can be correctly installed and run.

Users can open the running window through Win+R on the terminal, enter CMD to open the command line tool, and enter systeminfo to query, as shown in the following figure:

Checking system Memory

To ensure proper installation and running of the DM database, ensure that the operating system has at least 1 GB of available memory (RAM). If the available memory is too small, the DM database may fail to be installed or started.

Users can view the available memory through [Task Manager], as shown below:

Checking Storage Space

The DM requires at least 1 GB of storage space. Plan the installation directory in advance and reserve sufficient storage space.

Before installing the DM, reserve enough storage space for the database instance and plan the data path and backup path.

πŸ‰ Install the DM8 database

Upload the installation package, unzip the mount, copy the installation file, and start installation!

Select a language and time zone

Double-click to run the [setup.exe] installation program, select the appropriate language and time zone according to the system configuration, and click the [OK] button to continue the installation. As shown below:

The installation wizard

Click “Next” button to continue installation, as shown below:

License Agreement

Before installing and using the DM database, users need to read and accept the license agreement, as shown below:

Viewing version Information

You can view the version information about the DM server and client.

The link of verifying the Key file can be skipped. If there is no Key file, click “Next”.

Select components to install

The DM installation program provides four installation modes: Typical Installation, Server installation, Client Installation, and Custom Installation. You are advised to select Typical Installation, as shown in the following figure:

  • Typical installation includes server, client, driver, user manual, and database service.
  • Server installation includes servers, drivers, user manuals, and database services.
  • Client installation includes the client, driver, and user manual.
  • Custom installation includes: Select components based on requirements, including any combination of server, client, driver, user manual, and database service.

Select an Installation Directory

By default, DM is installed in the C:\ DMDBMS directory. It is not recommended to use the default directory and change it to any other drive letter. Take E:\ DMDBS as an example, as shown below:

Here I only have a C drive, so install it by default!

πŸ“’ Note: The directory name in the installation path consists of letters, digits, and underscores (_). You are not advised to use the directory name containing Spaces or Chinese characters.

Summary before installation

The database installation information of the user is displayed, such as product name, version information, installation type, installation directory, available space, available memory and other information. After checking all information, the user clicks the “Install” button to install THE DM database, as shown below:

Database Installation

Wait 1 to 2 minutes for the installation, as shown in the following figure:

The database is installed.

After the database is installed, select initialize database:

🍏 Configuration Example

Select operation mode

It is recommended to select “Create database instance” and click “Start” to go to the next step, as shown below:

Creating a database Template

It is recommended to select [General purpose], as shown below:

Select the database directory

In this example, the database installation path is C:\ DMDBS, as shown below:

Enter the database identity

Enter the database name, instance name, port number and other parameters as shown below:

The location of the database file

Select the default Settings, as shown below:

You can select or enter the location of database control and database log files. You can click buttons on the right to add or delete files.

Database initialization parameters

Select the default Settings, as shown below:

Users can input database parameters, such as cluster size, page size, log file size, character set selection, case sensitivity, and so on.

Common parameters:

  • EXTENT_SIZE Specifies the data file cluster size (16). The value can be 16, 32, or 64, expressed in pages
  • PAGE_SIZE Indicates the data page size (8). Optional values: 4, 8, 16, or 32, unit: KB
  • LOG_SIZE Log file size (256). The unit is MB. The value ranges from 64 MB to 2 GB
  • CASE_SENSITIVE: Y/N, 1/0
  • CHARSET/UNICODE_FLAG Character Set (0), Optional: 0[GB18030], 1[UTF-8], 2[UC-kr] CHARSET/UNICODE_FLAG Character Set (0), Optional: 0[GB18030], 1[UTF-8], 2[UC-kR]

Password management

The default password is the same as the login name, as shown in the following figure:

Users can enter the passwords of SYSDBA and SYSAUDITOR to change the default passwords. If a security version is installed, the password change for the SYSSSO user will be added.

Select Create sample library

It is recommended to create the sample library BOOKSHOP or DMHR as the test environment, as shown below:

Create a database summary

Before installing the database, the parameters set by the user using the database configuration tool are displayed. Click “Finish” to initialize the database instance, as shown in the picture below:

The installation is complete

After the installation is complete, database parameters and file locations are displayed. Click “Finish”, as shown below:

Database start and Stop

In the tool directory in the database installation path, double-click the dmService. exe program to view the corresponding service, and select Start or Stop service. As shown below:

Of course, you can also use the CMD command line to start:

cd C:\dmdbms\bin
dmserver.exe C:\dmdbms\data\DAMENG\dm.ini
Copy the code

🎯 is at the end

In general, the installation of damon8 database is relatively simple. But one thing is, the official document is really simple, not detailed enough, and needs to be improved!


This is the end of sharing ~

If you think the article is helpful to you, please like it, favorites it, pay attention to it, comment on it, and support it four times with one button. Your support is the biggest motivation for my creation.

❀️ technical exchange can follow the public number: Lucifer think twice before you do ❀️