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

How to build a data daemon in DM7

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces how to build DM7 data guard, the article is very detailed, has a certain reference value, interested friends must read it!

Data Guardian (DG)

Environment description

The following machines have DM software installed beforehand, the installation path is / dm7, the execution program is saved in the / dm7/bin directory, and the data storage path is / dm7/data

Machine name IP address initial state operating system 19c1 10.13.13.141 (external) main library dm1 redhat 6.7 10.10.10.141 (mal internal) 19c2 10.13.13.142 (external) 10.10.10.142 (mal) Internal) standby dm2 redhat 6.7ora19c 10.13.13.140 confirm monitor redhat 6.7 instance name port_num dw_port mal_host mal_port mal_dw_portdm1 5236 5239 10.10. 10.141 5237 5238dm2 5236 5239 10.10.10.142 5237 5238

Data preparation

Initialize the database to the directory / dm7/data on the main library machine:

[dmdba@19c1 bin] $. / dminit path=/dm7/data db_name=DAMENG instance_name=DM1 port_num=5236 page_size=8 charset=0initdb V7.1.6.46-Build (2018.02.08-89107) ENTdb version: 0x7000afile dm.key not found, use default license will expire in 14 day (s) on 2020-06-17log file path: / dm7/data/DAMENG/DAMENG01.loglog file path: / dm7/data/DAMENG/DAMENG02.logwrite to dir [/ dm7/data/DAMENG] .create dm database success. 2020-06-03 02:55:43

The registration service is used to start the database

[root@19c1 root] #. / dm_service_installer.sh-I / dm7/data/DAMENG/dm.ini-p DM1-t dmserverln-s'/ usr/lib/systemd/system/DmServiceDM1.service''/ etc/systemd/system/multi-user.target.wants/DmServiceDM1.service'Finished to create the service (DmServiceDM1)

Start the database normally and shut down normally

[root@19c1 root] # service DmServiceDM1 startRedirecting to / bin/systemctl start DmServiceDM1.service [root@19c1 root] # ps-ef | grep dmserverdmdba 21312 1 14 02:59? 00:00:03 / dm7/bin/dmserver / dm7/data/DAMENG/dm.ini-noconsoleroot 21536 18668 0 03:00 pts/2 00:00:00 grep-- color=auto dmserver [dmdba@19c1 bin] $. / disql SYSDBA/SYSDBAServer [LOCALHOST:5236]: mode is normal State is openlogin used time: 5.903 (ms) disql V7.1.6.46-Build (2018.02.08-89107) ENTConnected to: DM 7.1.6.46SQL > exit [root@19c1 root] # service DmServiceDM1 stopRedirecting to / bin/systemctl stop DmServiceDM1.service

ARCH_INI=1 (Open Archive)

MAL_INI=1 (open MAL configuration)

DW_PORT=5239 (DW port)

Configure the dmmal.ini file

When configuring a MAL system, the dmmal.ini configuration of each master / slave database must be exactly the same. MAL_HOST uses internal network IP,MAL_PORT and PORT_NUM in dm.ini uses different port values. MAL_DW_PORT is the communication port between the daemons corresponding to each instance, and between daemons and monitors. The configuration is as follows:

[dmdba@19c1 DAMENG] $vi dmmal.iniMAL_CHECK_INTERVAL = 5MAL_CONN_FAIL_INTERVAL = 5 [MAL_INST1] MAL_INST_NAME = DM1MAL_HOST = 10.10.10.141MAL_PORT = 5237MAL_INST_HOST = 10.13.13.141MAL_INST_PORT = 5236MAL_DW_PORT = 5238 [MAL_INST2] MAL_INST_NAME = DM2MAL_HOST = 10.10.10.142MAL_PORT = 5237MAL_INST_HOST = 10.13.13.142MAL_INST_PORT = 5236MAL_DW_PORT = 5238

Configure dmarch.ini

Modify dmarch.ini to configure local archiving and real-time archiving. In addition to local archiving, ARCH_DEST in other archiving configuration items indicates that when the instance is in Primary mode, the target instance name of the archived data needs to be synchronized. The current instance DM1 is the main database, and data needs to be synchronized to DM2 (real-time backup database), so the ARCH_DEST for real-time archiving is configured as DM2.

[dmdba@19c1 DAMENG] $vi dmarch.ini [archive _ REALTIME] ARCH_TYPE = REALTIMEARCH_DEST = DM2 [archive _ LOCAL1] ARCH_TYPE = LOCALARCH_DEST = / dm7/data/DAMENG/archARCH_FILE_SIZE = 128ARCH_SPACE_LIMIT = 0

Configure dmwatcher.ini

Modify the dmwatcher.ini configuration daemon to be configured as a global daemon type, using automatic switching mode.

[dmdba@19c1 DAMENG] $vi dmwatcher.ini [GRP1] DW_TYPE = GLOBALDW_MODE = AUTODW_ERROR_TIME = 60INST_ERROR_TIME = 10INST_OGUID = 453331INST_INI = / dm7/data/DAMENG/dm.iniINST_AUTO_RESTART = 1INST_STARTUP_CMD = / dm7/bin/dmserverRLOG_SEND_THRESHOLD = 0RLOG_APPLY_THRESHOLD = 0

Configure dmwatcher.ctl

The same daemon group must use the same dmwatcher.ctl. Therefore, you just need to use the dmctlcvt tool to generate a dmwatcher.ctl file and copy it to each database directory. After configuring dmwatcher.ini, use the dmctlcvt tool to generate dmwatcher.ctl: (note that the DEST directory is one level above DAMENG, otherwise no control files are generated)

[dmdba@19c1 bin] $. / dmctlcvt TYPE=3 SRC=/dm7/data/DAMENG/dmwatcher.ini DEST=/dm7/dataDMCTLCVT V7.1.6.46-Build (2018.02.08-89107) ENTconvert txt to ctl success!

A GRP1 directory is generated in the / dm7/data directory, and a dmwatcher.ctl control file is generated in the GRP1 directory

[root@19c1 data] # ls-lrttotal 4drwxr-xr-x 8 dmdba dinstall 4096 Jun 3 03:44 DAMENGdrwxr-xr-x 2 dmdba dinstall 26 Jun 3 03:53 GRP1 [root@19c1 data] # cd GRP1 [root@19c1 GRP1] # ls-lrttotal 4Kui RW Mustang

Copy the generated dmwatcher.ctl file to the data file directory / dm7/data/DAMENG.

Transfer the files related to the main library to the standby:

[dmdba@19c1 dm7] $scp-r data/ dmdba@10.13.13.142:/dm7/The authenticity of host '10.13.13.142 (10.13.13.142)' can't be established.ECDSA key fingerprint is 7f:1f:9a:0f:8b:d1:e0:17:32:08:12:73:d8:1d:9c:da.Are you sure you want to continue connecting (yes/no)? YesWarning: Permanently added '10.13.13.142' (ECDSA) to the list of known hosts.dmdba@10.13.13.142's password:dminit20200603025444.log 100% 783 0.8KB/s 00:00sqllog.ini 100% 479 0.5KB/s 00:00dm.ctl 100% 5120 5.0KB/s 00:00DAMENG01.log 100% 256MB 256.0MB/s 00:01DAMENG02.log 100% 256MB 128.0MB/s 00:02dm_20200603025543_320471.ctl 100% 5.0KB/s 00:00dm _ 20200603030017_373808.ctl 100% 5120 5.0KB/s 00:00SYSTEM.DBF 100% 21MB 21.0MB/s 00:01dm_service.prikey 100% 633 0.6KB/s 00:00MAIN.DBF 100% 128MB 128.0MB/s 00:01ROLL.DBF 100% 128MB 128.0MB/s 00:01dminst.sys 100% 220 0.2KB/s 00:00TEMP.DBF 100% 10MB 10.0MB/s 00:00rep_conflict.log 100% 12 0.0KB/s 00:00dm.ini 100% 40KB 39.8KB / s 00:00dmmal.ini / 558 0.5KB/s 00:00dmarch.ini / 367 0.4KB/s 00:00dmwatcher.ini / 615 0.6KB/s 00:00dmwatcher.ctl / 512 0.5KB/s 00:00

Modify the relevant configuration of the standby

Modify dm.iniINSTANCE_NAME = DM2

Modify dmarch.ini

ARCH_DEST = DM1

Where dmwatcher.ini,dmmal.ini,dmwatcher.ctl is consistent with the main library.

Two: start to mount status to set oguid

Main library

[dmdba@19c1 bin] $. / dmserver / dm7/data/DAMENG/dm.ini mountfile dm.key not found, use default licenseurs version info: developUse normal os_malloc instead of HugeTLBUse normal os_malloc instead of HugeTLBDM Database Server x64 V7.1.6.46-Build (2.08 / 89107) ENT startup...License will expire in 14 day (s) on 2020-06-17ckpt lsn: 32981SYSTEM IS READY. [dmdba@19c1 bin] $. / disql SYSDBA/SYSDBAServer [LOCALHOST:5236]: mode is normal State is mountlogin used time: 6.020 (ms) disql V7.1.6.46-Build (2018.02.08-89107) ENTConnected to: DM 7.1.6.46SQL > sp_set_oguid (453331) DMSQL executed successfullyused time: 38.995 (ms). Execute id is 1.SQL > exit

Prepare the library

[dmdba@19c2 bin] $. / dmserver / dm7/data/DAMENG/dm.ini mountfile dm.key not found, use default licenseurs version info: developUse normal os_malloc instead of HugeTLBUse normal os_malloc instead of HugeTLBDM Database Server x64 V7.1.6.46-Build (2.08 / 89107) ENT startup...License will expire in 14 day (s) on 2020-06-17ckpt lsn: 32981SYSTEM IS READY. [dmdba@19c2 bin] $. / disql SYSDBA/SYSDBAServer [LOCALHOST:5236]: mode is normal State is mountlogin used time: 6.005 (ms) disql V7.1.6.46-Build (2018.02.08-89107) ENTConnected to: DM 7.1.6.46SQL > sp_set_oguid (453331) DMSQL executed successfullyused time: 46.333 (ms). Execute id is 1.

The registration service is used to start the database

[root@19c2 root] #. / dm_service_installer.sh-I / dm7/data/DAMENG/dm.ini-p DM2-t dmserverln-s'/ usr/lib/systemd/system/DmServiceDM2.service''/ etc/systemd/system/multi-user.target.wants/DmServiceDM2.service'Finished to create the service (DmServiceDM2)

Three: open the database

The main library is opened in primary

SQL > alter database primary;executed successfullyused time: 37.838 (ms). Execute id is 0.

Open the library in standby

SQL > alter database standby;executed successfullyused time: 39.682 (ms). Execute id is 0.

Four: start the daemon

Start the daemons on each primary and standby library:

Main library

[dmdba@19c1 bin] $. / dmwatcher / dm7/data/DAMENG/dmwatcher.iniDMWATCHER [2.1] V7.1.6.46-Build (2018.02.08-89107) ENTDMWATCHER [2.1] IS READY

Prepare the library

[dmdba@19c2 bin] $. / dmwatcher / dm7/data/DAMENG/dmwatcher.iniDMWATCHER [2.1] V7.1.6.46-Build (2018.02.08-89107) ENTDMWATCHER [2.1] IS READY 5: check whether the file_lsn and cur_lsn master and standby libraries are consistent SQL > select file_LSN, cur_LSN from v$rlog LINEID FILE_LSN CUR_LSN--1 34412 34412used time: 1.203 (ms). Execute id is 6.

Prepare the library

SQL > select file_LSN, cur_LSN from venerable LINEID FILE_LSN CUR_LSN- 1 34412 34412used time: 1.228 (ms). Execute id is 3.

Test data synchronization

Main library:

SQL > create table T1 (id int); executed successfullyused time: 18.410 (ms). Execute id is 7.SQL > insert into T1 values (1); affect rows 1used time: 0.890 (ms). Execute id is 8.SQL > commit;executed successfullyused time: 6.026 (ms). Execute id is 9.SQL > select file_LSN, cur_LSN from venerable LINEID FILE_LSN CUR_LSN- 1 34443 34443used time: 0.340 (ms). Execute id is 10.

Prepare the library:

SQL > select file_LSN, cur_LSN from venerable LINEID FILE_LSN CUR_LSN- 1 34443 34443used time: 0.363 (ms). Execute id is 4.SQL > select * from T1 / LINEID ID--1 1used time: 1.213 (ms). Execute id is 5.

VI: configure the monitor (basic requirements, install dm7 software)

Since the daemons of the main library and the real-time standby library are configured for automatic switching mode, the configuration confirmation monitor is selected here. Compared with the ordinary monitor, in addition to the same command support, the confirmation monitor can automatically notify the real-time standby database to take over as the new main library when the main database fails, and has the function of automatic fault handling.

Modify the dmmonitor.ini configuration to confirm the monitor, where the IP in MON_DW_IP and the MAL_HOST and MAL_DW_PORT configuration items in PORT and dmmal.ini are consistent.

[dmdba@ora19c data] $vi dmmonitor.iniMON_DW_CONFIRM = 1MON_LOG_PATH = / dm7/data/logMON_LOG_INTERVAL = 60MON_LOG_FILE_SIZE = 32MON_LOG_SPACE_LIMIT = 0 [GRP1] MON_INST_OGUID = 453331MON_DW_IP = 10.10.10.141:5238MON_DW_IP = 10.10.10.142Vol 5238

Start the monitor:

[dmdba@ora19c bin] $. / dmmonitor / dm7/data/dmmonitor.ini [monitor] 2020-06-03 09:18:20: DMMONITOR [2. 1] V7.1.6.46-Build (89107) ENT [monitor] 2020-06-03 09:18:20: DMMONITOR [2. 1] IS READY. [monitor] 2020-06-03 09:18:20: Received message from (DM1) WTIME WSTATUS INST_OK INAME ISTATUS IMODE RSTAT N_OPEN FLSN CLSN SSLSN SLSN2020-06-03 04:35:58 OPEN OK DM1 OPEN PRIMARY VALID 2 34443 34443 34443 [monitor] 2020-06-03 09:18:20: Received message from (DM2) WTIME WSTATUS INST_OK INAME ISTATUS IMODE RSTAT N_OPEN FLSN CLSN SSLSN SLSN2020-06-03 04:35:58 OPEN OK DM2 OPEN STANDBY VALID 2 34443 34443 34443 and above are all the contents of the article "how to build a data Guardian in DM7" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

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