Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

DM7 uses dminit tools to create databases

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1 functional introduction

Dminit is a DM database initialization tool. During the installation of DM, users can choose whether or not to create the initial database. If it was not created at that time, you can use the database creation tool dminit to create it after the installation is complete.

The system administrator can use various parameters provided by the dminit tool to set the database storage path, segment page size, whether it is case-sensitive, and whether to use UNICODE to create a database that meets the needs of users. The tool is located in the / bin directory of the installation directory.

2 using dminit

The dminit tool needs to be started from the command line. Find the installation directory / bin where dminit is located, enter dminit and parameters, and enter enter. The parameters are described in detail in the next section.

The syntax is as follows:

Dminit KEYWORD=value {KEYWORD=value}

KEYWORD:dminit parameter keyword. The order of multiple parameters is not affected, and spaces are used between parameters. Value: the value of the parameter.

If dminit does not take a parameter, the system will guide the user to set it. There can be no spaces between parameters, equal signs, and values, such as PAGE_SIZE=16. There is no need to add the "=" sign after the HELP parameter.

For example, initialize a database and place it in the / home/test/dmdbms directory with a data page PAGE_SIZE size of 16K.

. / dminit PATH=/home/test/dmdbms PAGE_SIZE=16

If the creation is successful, the screen displays as follows:

Initdb V7.1.5.22-Build (November 17, 2015-62910trunc) db version: 0x70009create dm database success. 2015-12-21 15:46:27

A DAMENG folder appears under the / home/test/dmdbms directory, containing the files related to the initial database DAMENG and the configuration file dm.ini necessary to start the DM database.

3 View dminit parameters

Dminit is flexible in use and has many parameters. Users can use "dminit HELP" to quickly view the parameters.

[dmdba@ora19c bin] $. / dminit helpinitdb V7.1.6.46-Build (2018.02.08-89107) ENT db version: 0x7000afile dm.key not found Use default license will expire on 2020-06-05Format:. / dminit KEYWORD=valueExample:. / dminit PATH=/public/dmdb/dmData PAGE_SIZE=16Keyword Explanation (default value)-- -INI_FILE dm.ini pathPATH database pathCTL_PATH control file pathLOG_PATH log file pathEXTENT_SIZE extent size of data file (16) Optional value: 16optional value:0 32, unit: PAGEPAGE_SIZE page size (8), optional value: 4, unit: KLOG_SIZE log file size (256), unit: M, range: 64m ~ 2GCASE_SENSITIVE whether case is sensitive (Y), optional value: y or 1/0CHARSET/UNICODE_FLAG CHARSET (0), optional value:0 [GB18030], 1 [UTF-8] 2 [EUC-KR] LENGTH_IN_CHAR whether LENGTH for VARCHAR is in characters (N), optional value: y SYSDBA N, 1/0SYSDBA_PWD set SYSDBA password (SYSDBA), password length must between 9 and 48SYSAUDITOR_PWD set SYSAUDITOR password (SYSAUDITOR) Password length must between 9 and 48DB_NAME database name (DAMENG) INSTANCE_NAME instance name (DMSERVER) PORT_NUM listener port (5236) TIME_ZONE set time zone (+ 08:00) PAGE_CHECK page check mode (0) Optional value: 0/1/2EXTERNAL_CIPHER_NAME set default encrypt/decrypt algorithmEXTERNAL_HASH_NAME set default hash algorithmEXTERNAL_CRYPTO_NAME set crypto name to encrypt svr keyRLOG_ENC_FLAG whether encrypt redo log (N), optional value: y contract N, 1/0USBKEY_PIN set usbkey pinENCRYPT_NAME set algorithm for encrypt the whole databaseBLANK_PAD_MODE set blank padding mode (0) Optional value:0/1SYSTEM_MIRROR_PATH mirror path of system data fileMAIN_MIRROR_PATH mirror path of main fileROLL_MIRROR_PATH mirror path of roll fileMAL_FLAG MAL_INI flag (0) in dm.iniARCH_FLAG ARCH_INI (0) flag in dm.iniMPP_FLAG MPP_INI (0) flag in dm.iniCONTROL Control file pathologic override whether overwrite all files with the same name (0) 0: no 1: part 2: allUSE_NEW_HASH whether use new hash algorithm for string. (default 1) DCP_MODE whether is DM CLUSTER PROXY mode (default 0) DCP_PORT_NUM in DCP mode, set dcp_port_numELOG_PATH set the path of log file recording the contents during initializationHELP print help information

4 dminit initializes the database

The CONTROL parameter is an advanced feature of the dminit tool that specifies the initialization configuration file when initializing the database. The initialization configuration file is a text that saves information such as the path and size settings of each data file, and the command line parameter settings of all dminit tools. The name is selected by the user, such as dminit.ini, abc.txt, dminit.ctl, etc.

The dminit tool uses the CONTROL parameter, so no other parameters can be specified, and the CONTROL parameter can only be used alone.

DM supports initialization of both stand-alone and RAC cluster databases. The operation is very simple, as long as you use the CONTROL parameter to specify the initialization configuration file when creating the database using the dminit tool.

For example, the initialization configuration file is dminit.ini.

. / dminit CONTROL=/home/data/dminit.ini

How to write the contents of the initialization configuration file (this chapter is uniformly named dminit.ini) is slightly different in stand-alone and RAC environments, which are described in detail below.

4.1 initialize stand-alone database

DM supports initializing the database to a normal machine or to a shared storage. This section takes the file system as an example to initialize a stand-alone database. Parameter configuration involving path and file size.

For example, create a database on the file system. Parameters path, main, system, roll, ctl_path, log01 and log02 all specify the file system. The stand-alone configuration file (named dminit.ini) is written as follows:

[dmdba@ora19c dm7] $cat dminit.ini [jy]-- instance name uses the control configuration file to specify that the instance cannot use the instance_name parameter db_name = jypath = / dm7/datamain = / dm7/data/jy/main.dbfmain_size = 256system = / dm7/data/jy//system.dbfsystem_size = 256roll = / dm7/data/jy//roll.dbfroll_size = 256ctl_path = / dm7/data/jy/dm.ctllog_path = / dm7/data/jy/ Log01.loglog_path = / dm7/data/jy/log02.loglog_size = 128auto_overwrite = 2 initialize the database [dmdba@ora19c bin] $. / dminit control=/dm7/dminit.iniinitdb V7.1.6.46-Build (2018.02.08-89107) ENT db version: 0x7000afile dm.key not found Use default license will expire on 2020-06-05 log file path: / dm7/data/jy/log01.log log file path: / dm7/data/jy/log02.logwrite to dir [/ dm7/data/jy]. Create dm database success. 2020-05-22 22:36:10 register for the database service [root@ora19c root] #. / dm_service_installer.sh-t dmserver-p jy-I / dm7/data/jy/dm.ini-m openln-s'/ usr/lib/systemd/system/DmServicejy.service''/ etc/systemd/system/multi-user.target.wants/DmServicejy.service'Finished to create the service (DmServicejy) [root@ora19c root] # systemctl start DmServicejy [root@ora19c root] # ps-ef | | grep dmserverdmdba 31843 1 21 01:29? 00:00:05 / dm7/bin/dmserver / dm7/data/jy/dm.ini-noconsoleroot 31901 3225 0 01:30 pts/2 00:00:00 grep-- color=auto dmserver connection database [dmdba@ora19c ~] $disql SYSDBA/SYSDBA@10.13.13.140:5236Server [10.13.13.140 dm7/data/jy/dm.ini]: mode is normal | State is openlogin used time: 10.975 (ms) disql V7.1.6.46-Build (2018.02.08-89107) ENT Connected to: DM 7.1.6.46SQL > select * from v$version LINEID BANNER-1 DM Database Server x64 V7.1.6.46- Build (2018.02.08-89107) ENT 2 DB Version: 0x7000aused time: 3.827 (ms) Execute id is 807.

4.2 initialize the database of the RAC cluster

DM RAC is a single database, multi-instance cluster system. The database is deployed on shared storage and can be accessed by all nodes. It has the characteristics of high availability, high performance, low cost and so on. DM supports the creation of databases in a RAC environment. The parameters involved in the initialization library configuration file dminit.ini of RAC are the addition of RAC node information to the stand-alone dminit.ini. At the same time, the node_instance parameter in the stand-alone dminit.ini is removed, and the two parameters log_size,log_ path are distributed to each RAC node.

Prepare the dminit.ini profile

Create a dminit.ini configuration file in the / dm/dmdbms/data directory of the 2 nodes and add the following. Created on both nodes.

[dmdba@dmrac1 data] $vi dminit.inidb_name = racsystem_path = + DMDATA/datasystem = + DMDATA/data/rac/system.dbfsystem_size = 128roll = + DMDATA/data/rac/roll.dbfroll_size = 128main = + DMDATA/data/rac/main.dbfmain_size = 128ctl_path = + DMDATA/data/rac/dm.ctlctl_size = 8log_size = 256dcr_path = / dev/raw/raw1 # dcr disk path, asm is not supported Only bare devices dcr_seqno = 0auto_overwrite = 1 [RAC0] # inst_name and DCR_EP_NAME in DB type group in dmdcr_cfg.ini correspond to config_path = / dm7/data/rac0_configport_num = 5236mal_host = 10.10.10.161mal_port = 9340log_path = + DMLOG/log/rac0_log01.loglog_path = + DMLOG/log/rac0_ log02.log [RAC1] # inst_name and DCR_EP_ in DB type group in dmdcr_cfg.ini NAME corresponds to config_path = / dm7/data/rac1_configport_num = 5236mal_host = 10.10.10.162mal_port = 9341log_path = + DMLOG/log/rac1_log01.loglog_path = + DMLOG/log/rac1_ log02.log [dmdba @ dmrac2 data] $vi dminit.inidb_name = racsystem_path = + DMDATA/datasystem = + DMDATA/data/rac/system.dbfsystem_size = 128roll = + DMDATA/data/rac/roll.dbfroll_size = 128main = + DMDATA/data/rac/main.dbfmain_size = 128ctl _ path = + DMDATA/data/rac/dm.ctlctl_size = 8log_size = 256dcr_path = / dev/raw/raw1 # dcr disk path Asm is not currently supported Only bare devices dcr_seqno = 0auto_overwrite = 1 [RAC0] # inst_name and DCR_EP_NAME in DB type group in dmdcr_cfg.ini correspond to config_path = / dm7/data/rac0_configport_num = 5236mal_host = 10.10.10.161mal_port = 9340log_path = + DMLOG/log/rac0_log01.loglog_path = + DMLOG/log/rac0_ log02.log [RAC1] # inst_name and DCR_EP_ in DB type group in dmdcr_cfg.ini NAME corresponds to config_path = / dm7/data/rac1_configport_num = 5236mal_host = 10.10.10.162mal_port = 9341log_path = + DMLOG/log/rac1_log01.loglog_path = + DMLOG/log/rac1_log02.log

Initialize the database using dminit

Start the dminit tool at any node to initialize the database. After the dminit execution is complete, the configuration files dm.ini and dmmal.ini are generated in the config_path directory (/ dm7/data/rac0_config and / dm7/data/rac1_config).

[dmdba@dmrac1 data] $dminit control=/dm7/data/dminit.iniinitdb V7.1.6.46-Build (2018.02.08-89107) ENTdb version: 0x7000afile dm.key not found, use default license will expire on 2020-05-08 log file path: + DMLOG/log/rac0_log01.log log file path: + DMLOG/log/rac0_log02.log log file path: + DMLOG/log/rac1_log01.log log file path: + DMLOG/log/rac1_log02.logwrite to dir [+ DMDATA/data/rac] .create dm database success. 2020-04-24 16:39:03

Copy the configuration file for Node 1 to Node 2:

[dmdba@dmrac1 data] $scp-r rac1_config 10.13.13.162: `pwd`the authenticity of host '10.13.13.162 (10.13.13.162)' can't be established.RSA key fingerprint is 89:fc:3e:e3:2d:27:94:07:0e:6b:fc:c5:e8:89:44:1f.Are you sure you want to continue connecting (yes/no)? YesWarning: Permanently added '10.13.13.162' (RSA) to the list of known hosts.dmdba@10.13.13.162's password:sqllog.ini 100% 479 0.5KB/s 00:00dm.ini 100% 40KB 39.8KB/s 00:00dmmal.ini 100% 204 0.2KB/s 00:00 [dmdba@dmrac1 data] $

Start the database server

1. Register the DM database service on two nodes:

Node one:

[root@dmrac1 init.d] # / dm7/script/root/dm_service_installer.sh-t dmserver-I / dm7/data/rac0_config/dm.ini-d / dm7/data/dmdcr.ini-p rac1Move the service script file (/ dm7/bin/DmServicerac1 to / etc/rc.d/init.d/DmServicerac1) Finished to create the service (DmServicerac1) Node 2: [root@dmrac2 ~] # / dm7/script/root/dm_service_installer.sh-t dmserver-I / dm7 / data/rac1_config/dm.ini-d / dm7/data/dmdcr.ini-p rac2Move the service script file (/ dm7/bin/DmServicerac2 to / etc/rc.d/init.d/DmServicerac2) Finished to create the service (DmServicerac2)

2. Start the database

[root@dmrac1 init.d] # service DmServicerac1 startStarting DmServicerac1: [OK] [root@dmrac2 ~] # service DmServicerac2 startStarting DmServicerac2: [OK]

The manual startup command is as follows, and the window cannot be closed after manual startup, so

. / dmserver / dm7/data/rac0_config/dm.ini dcr_ini=/dm7/data/dmdcr.ini./dmserver / dm7/data/rac1_config/dm.ini dcr_ini=/dm7/data/dmdcr.ini

Connection database verification

1 configure the service name file

[dmdba@dmrac1] $vi / etc/dm_svc.confTIME_ZONE= (480) rac= (10.13.13.161) SWITCH_TIME= (10000) SWITCH_INTERVAL= (10) TIME_ZONE= (480) LANGUAGE= (en) $vi / etc/dm_svc.confTIME_ZONE= (480) rac= (10.13.13.161) SWITCH_TIME= (10000) SWITCH_INTERVAL= (10) TIME_ZONE= (480) LANGUAGE= (en)

2 connect to the RAC cluster

[dmdba@dmrac1] $disql SYSDBA/SYSDBA@racServer [10.13.13.161 ms]: mode is normal, state is openlogin used time: 10.365 (ms) disql V7.1.6.46-Build (2018.02.08-89107) ENTConnected to: DM 7.1.6.46SQL > select instance_name from vastness instance INSTANCE_NAME--1 RAC0used time: 18.248 (ms). Execute id is 807.SQL > select * from v$rac_ep_info LINEID EP_NAME EP_SEQNO EP_GUID EP_TIMESTAMP EP_MODE EP_STATUS -- 1 RAC0 0 2067076818 2067077298 MASTER OK2 RAC1 1 2067098084 2067098537 SLAVE OKused time: 2.741 (ms). Execute id is 808.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report