DM8 配置DMDSC主備環境(rac到單節點 )
配置DMDSC主備環境
DMDSC主備環境搭建和單節點主備環境搭建步驟類似,區別主要在於首先要準備DMDSC叢集環境。
配置說明
DMDSC叢集可以作為主庫,也可以作為實時備庫、即時備庫或者非同步備庫,當DMDSC叢集作為備庫配置在資料守護系統中時,要將DMDSC叢集作為一個整體配置在源庫的dmarch.ini中,也就是DMDSC叢集所有節點要配置在同一個歸檔配置項中,每個節點例項名以“/”分隔開來。
假如DMDSC叢集有兩個節點GRP1_RT_DSC01和GRP1_RT_DSC02,DMDSC叢集要作為備庫進行配置,其源庫為A,則要在A的dmarch.ini檔案中增加DMDSC叢集的歸檔配置,這裡以實時備庫為例說明如下:
[ARCHIVE_REALTIME1] ARCH_TYPE = REALTIME ARCH_DEST = GRP1_RT_DSC01/GRP1_RT_DSC02
如果DMDSC叢集要作為即時備庫或者非同步備庫來配置,ARCH_DEST的配置方式和示例中是相同的,ARCH_TYPE則要分別替換為TIMELY或者ASYNC,中括號內的配置項名稱中包含的歸檔型別也建議修改和ARCH_TYPE一致。
環境說明
下面以DMDSC叢集和單節點之間搭建實時主備環境為例,對搭建步驟進行說明。
下列機器事先都安裝了DM8,安裝路徑為’/dm8’,執行程式儲存在’/dm8/bin’目錄中,資料存放路徑為’/dm8/data’。
各主備庫的例項名建議採用“組名_守護環境_序號”的方式命名,方便按組區分不同例項,注意總長度不能超過16。本示例中組名為“GRP1”,配置為實時主備,主庫DMDSC叢集的三個節點例項名分別命名為“rac1”、“rac2”,備庫命名為“rac_st”。
本次部署為2節點DSC為主庫,單機達夢為物理備庫
IP規劃:
主機名 服務ip 心跳ip 例項名 節點用途 dm8rac1 10.10.13.201 10.10.13.201 rac1 rac節點1 dm8rac2 10.10.13.202 10.10.13.202 rac2 rac節點2 dm8rac_st 10.10.13.227 10.10.13.227 rac_st rac備庫
埠規劃:
例項名 port_num mal_inst_dw_port mal_host mal_port mal_dw_port CSS埠 ASM埠 ASM的MAL埠 DCR檢查例項埠 dm1 5236 5237 10.10.13.201 5238 5239 5240 5241 5242 5243 dm2 5236 5237 10.10.13.202 5238 5239 5240 5241 5242 5243 rac_st 5236 5237 10.10.13.227 5238 5239
DSC叢集部署
共享儲存
/dev/sdb /dev/raw/raw1 dcr disk 10G /dev/sdc /dev/raw/raw2 voting disk 10G /dev/sdd /dev/raw/raw3 log disk 10G /dev/sde /dev/raw/raw4 data disk1 10G /dev/sdf /dev/raw/raw5 data disk2 10G /dev/sdg /dev/raw/raw6 data disk3 10G
二、作業系統配置
1、關閉防火牆和SELINUX
[root@gbase ~]# systemctl stop firewalld [root@gbase ~]# systemctl disable firewalld Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service. Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service. [root@gbase ~]# systemctl status firewalld firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled) Active: inactive (dead) Docs: man:firewalld(1) Dec 06 17:22:42 gbase systemd[1]: Starting firewalld - dynamic firewall daemon... Dec 06 17:22:48 gbase systemd[1]: Started firewalld - dynamic firewall daemon. Dec 07 08:21:59 gbase systemd[1]: Stopping firewalld - dynamic firewall daemon... Dec 07 08:22:00 gbase systemd[1]: Stopped firewalld - dynamic firewall daemon. [root@gbase ~]# setenforce 0 [root@gbase ~]# sed -i s:^SELINUX=.*$:SELINUX=disabled:g /etc/selinux/config [root@gbase ~]# cat /etc/selinux/config # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=disabled # SELINUXTYPE= can take one of three values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted [root@gbase ~]# systemctl stop firewalld [root@gbase ~]# systemctl disable firewalld Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service. Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service. [root@gbase ~]# systemctl status firewalld firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled) Active: inactive (dead) Docs: man:firewalld(1) Dec 06 17:22:45 gbase systemd[1]: Starting firewalld - dynamic firewall daemon... Dec 06 17:22:51 gbase systemd[1]: Started firewalld - dynamic firewall daemon. Dec 07 08:19:39 gbase systemd[1]: Stopping firewalld - dynamic firewall daemon... Dec 07 08:19:40 gbase systemd[1]: Stopped firewalld - dynamic firewall daemon. [root@gbase ~]# setenforce 0 [root@gbase ~]# sed -i s:^SELINUX=.*$:SELINUX=disabled:g /etc/selinux/config [root@gbase ~]# cat /etc/selinux/config # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=disabled # SELINUXTYPE= can take one of three values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted
2、修改主機名
[root@gbase ~]# hostname dm8rac1 [root@gbase ~]# sed -i s:^HOSTNAME=.*$:HOSTNAME=dm8rac1:g /etc/sysconfig/network [root@gbase ~]# echo " > 10.10.13.201 dm8rac1 > 10.10.13.202 dm8rac2" >> /etc/hosts [root@gbase ~]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 10.10.13.201 dm8rac1 10.10.13.202 dm8rac2 [root@gbase ~]# hostname dm8rac2 [root@gbase ~]# sed -i s:^HOSTNAME=.*$:HOSTNAME=dm8rac2:g /etc/sysconfig/network [root@gbase ~]# [root@gbase ~]# echo " > 10.10.13.201 dm8rac1 > 10.10.13.202 dm8rac2" >> /etc/hosts [root@gbase ~]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 10.10.13.201 dm8rac1 10.10.13.202 dm8rac2
三、 安裝達夢軟體
3.1檢查Linux(Unix)系統資訊
[root@dm8rac1 ~]# getconf LONG_BIT 64 [root@dm8rac2 ~]# getconf LONG_BIT 64
查詢作業系統release資訊
[root@dm8rac1 ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.8 Beta (Maipo) [root@dm8rac2 ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.8 Beta (Maipo)
3.2建立安裝使用者
為了減少對作業系統的影響,使用者不應該以root系統使用者來安裝和執行DM。使用者可以在安裝之前為DM建立一個專用的系統使用者。
1. 建立安裝使用者組dinstall。
[root@dm8rac1 ~]# groupadd dinstall [root@dm8rac2 ~]# groupadd dinstall
2. 建立安裝使用者dmdba。
[root@dm8rac1 ~]# useradd -g dinstall -m -d /home/dmdba -s /bin/bash dmdba [root@dm8rac2 ~]# useradd -g dinstall -m -d /home/dmdba -s /bin/bash dmdba
3. 初始化使用者密碼。
[root@dm8rac1 ~]# passwd dmdba Changing password for user dmdba. New password: Retype new password: passwd: all authentication tokens updated successfully. [root@dm8rac2 ~]# passwd dmdba Changing password for user dmdba. New password: Retype new password: passwd: all authentication tokens updated successfully.
3.3 Linux(Unix)下檢查作業系統限制
在Linux(Unix)系統中,因為ulimit命令的存在,會對程式使用作業系統資源進行限制。為了使DM能夠正常執行,建議使用者檢查當前安裝使用者的ulimit引數。
執行ulimit -a進行查詢。如下圖所示:
[root@dm8rac1 ~]# ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 31152 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 31152 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited [root@dm8rac2 ~]# ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 31152 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 31152 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited
引數使用限制:
1.data seg size
data seg size (kbytes, -d)
建議使用者設定為1048576(即1GB)以上或unlimited(無限制),此引數過小將導致資料庫啟動失敗。
2. file size
file size(blocks, -f)
建議使用者設定為unlimited(無限制),此引數過小將導致資料庫安裝或初始化失敗。
3. open files
open files(-n)
建議使用者設定為65536以上或unlimited(無限制)。
4.virtual memory
virtual memory (kbytes, -v)
建議使用者設定為1048576(即1GB)以上或unlimited(無限制),此引數過小將導致資料庫啟動失敗。
如果使用者需要為當前安裝使用者更改ulimit的資源限制,請修改檔案/etc/security/limits.conf。
[root@dm8rac1 ~]# vi /etc/security/limits.conf dmdba soft data unlimited dmdba hard data unlimited dmdba soft fsize unlimited dmdba hard fsize unlimited dmdba soft nofile 65536 dmdba hard nofile 65536 [root@dm8rac2 ~]# vi /etc/security/limits.conf dmdba soft data unlimited dmdba hard data unlimited dmdba soft fsize unlimited dmdba hard fsize unlimited dmdba soft nofile 65536 dmdba hard nofile 65536 [root@dm8rac1 ~]# su - dmdba [dmdba@dm8rac1 ~]$ ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 31152 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 65536 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 4096 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited [root@dm8rac2 ~]# su - dmdba [dmdba@dm8rac2 ~]$ ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 31152 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 65536 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 4096 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited
3.4.檢查系統記憶體與儲存空間
1.檢查記憶體
為了保證DM的正確安裝和執行,要儘量保證作業系統至少1GB的可用記憶體(RAM)。如果可用記憶體過少,可能導致DM安裝或啟動失敗。使用者可以
使用以下命令檢查操作記憶體:
#獲取記憶體總大小
[root@dm8rac1 ~]# grep MemTotal /proc/meminfo MemTotal: 8009068 kB [root@dm8rac12 ~]# grep MemTotal /proc/meminfo MemTotal: 8009068 kB
#獲取交換分割槽大小
[root@dm8rac1 ~]# grep SwapTotal /proc/meminfo SwapTotal: 8257532 kB [root@dm8rac2 ~]# grep SwapTotal /proc/meminfo SwapTotal: 8257532 kB
#獲取記憶體使用詳情
[root@dm8rac1 ~]# free -g total used free shared buff/cache available Mem: 7 0 6 0 0 6 Swap: 7 0 7 [root@dm8rac2 ~]# free -g total used free shared buff/cache available Mem: 7 0 6 0 0 6 Swap: 7 0 7
2.檢查儲存空間
1) DM完全安裝需要1GB的儲存空間,使用者需要提前規劃好安裝目錄,預留足夠的儲存空間。使用者在DM安裝前也應該為資料庫例項預留足夠的儲存空間,規劃好資料路徑和備份路徑。使用者可使用以下命令檢查儲存空間:
#查詢目錄/dm8可用空間
[root@dm8rac1 ~]# mkdir /dm8 [root@dm8rac1 ~]# chown -R dmdba:dinstall /dm8 [root@dm8rac1 ~]# chmod -R 775 /dm8 [root@dm8rac2 ~]# mkdir /dm8 [root@dm8rac2 ~]# chown -R dmdba:dinstall /dm8 [root@dm8rac2 ~]# chmod -R 775 /dm8 [root@dm8rac1 ~]# df -h /dm8 Filesystem Size Used Avail Use% Mounted on /dev/mapper/rhel-root 48G 5.6G 43G 12% / [root@dm8rac2 ~]# df -h /dm8 Filesystem Size Used Avail Use% Mounted on /dev/mapper/rhel-root 48G 5.6G 43G 12% /
2) DM安裝程式在安裝時將產生臨時檔案,臨時檔案需要1GB的儲存空間,臨時檔案目錄預設為/tmp。使用者可以使用以下命令檢查儲存空間。
如下圖所示:
[root@dm8rac1 ~]# df -h /tmp Filesystem Size Used Avail Use% Mounted on /dev/mapper/rhel-root 48G 5.6G 43G 12% / [root@dm8rac2 ~]# df -h /tmp Filesystem Size Used Avail Use% Mounted on /dev/mapper/rhel-root 48G 5.6G 43G 12% /
3.5.安裝DM
建立目錄/soft/dmsoft用來儲存掛載iso檔案後來顯示軟體包中的檔案
[root@dm8rac1 ~]# cd /soft [root@dm8rac1 soft]# unzip dm8_20211021_x86_rh6_64_ent.zip Archive: dm8_20211021_x86_rh6_64_ent.zip creating: dm8_20211021_x86_rh6_64_ent/ inflating: dm8_20211021_x86_rh6_64_ent/dm8_20211021_x86_rh6_64_ent_8.1.2.84.iso extracting: dm8_20211021_x86_rh6_64_ent/dm8_20211021_x86_rh6_64_ent_8.1.2.84.iso_SHA256.txt extracting: dm8_20211021_x86_rh6_64_ent/verinfo.txt [root@dm8rac1 soft]# ls -lrt total 778320 drwxr-xr-x. 2 root root 132 Nov 12 13:43 dm8_20211021_x86_rh6_64_ent -rw-r--r--. 1 root root 796998047 Nov 29 10:25 dm8_20211021_x86_rh6_64_ent.zip [root@dm8rac1 soft]# mv dm8_20211021_x86_rh6_64_ent dm8 [root@dm8rac1 soft]# ls -lrt total 778320 drwxr-xr-x. 2 root root 132 Nov 12 13:43 dm8 -rw-r--r--. 1 root root 796998047 Nov 29 10:25 dm8_20211021_x86_rh6_64_ent.zip [root@dm8rac1 soft]# mkdir dmsoft [root@dm8rac1 soft]# mount -t iso9660 -o loop dm8/dm8_20211021_x86_rh6_64_ent_8.1.2.84.iso /soft/dmsoft mount: /dev/loop0 is write-protected, mounting read-only [root@dm8rac1 soft]# cd dmsoft [root@dm8rac1 dmsoft]# ls -lrt total 790160 -r-xr-xr-x. 1 root root 2802503 Oct 21 14:04 DM8 Install.pdf -r-xr-xr-x. 1 root root 806320703 Oct 21 14:11 DMInstall.bin [root@dm8rac12 ~]# cd /soft [root@dm8rac2 soft]# unzip dm8_20211021_x86_rh6_64_ent.zip Archive: dm8_20211021_x86_rh6_64_ent.zip creating: dm8_20211021_x86_rh6_64_ent/ inflating: dm8_20211021_x86_rh6_64_ent/dm8_20211021_x86_rh6_64_ent_8.1.2.84.iso extracting: dm8_20211021_x86_rh6_64_ent/dm8_20211021_x86_rh6_64_ent_8.1.2.84.iso_SHA256.txt extracting: dm8_20211021_x86_rh6_64_ent/verinfo.txt [root@dm8rac2 soft]# ls -lrt total 778320 drwxr-xr-x. 2 root root 132 Nov 12 13:43 dm8_20211021_x86_rh6_64_ent -rw-r--r--. 1 root root 796998047 Nov 29 10:25 dm8_20211021_x86_rh6_64_ent.zip [root@dm8rac2 soft]# mv dm8_20211021_x86_rh6_64_ent dm8 [root@dm8rac2 soft]# ls -lrt total 778320 drwxr-xr-x. 2 root root 132 Nov 12 13:43 dm8 -rw-r--r--. 1 root root 796998047 Nov 29 10:25 dm8_20211021_x86_rh6_64_ent.zip [root@dm8rac2 soft]# mkdir dmsoft [root@dm8rac2 soft]# mount -t iso9660 -o loop dm8/dm8_20211021_x86_rh6_64_ent_8.1.2.84.iso /soft/dmsoft mount: /dev/loop0 is write-protected, mounting read-only [root@dm8rac2 soft]# cd dmsoft [root@dm8rac2 dmsoft]# ls -lrt total 790160 -r-xr-xr-x. 1 root root 2802503 Oct 21 14:04 DM8 Install.pdf -r-xr-xr-x. 1 root root 806320703 Oct 21 14:11 DMInstall.bin
在/soft/dmsoft目錄下存在DMInstall.bin檔案, DMInstall.bin檔案就是DM的安裝程式。在執行安裝程式前,需要賦予DMInstall.bin檔案執行許可權。具體命令如下所示:
[root@dm8rac1 dmsoft]# chmod 755 DMInstall.bin chmod: changing permissions of ‘DMInstall.bin’: Read-only file system [root@dm8rac2 dmsoft]# chmod 755 DMInstall.bin chmod: changing permissions of ‘DMInstall.bin’: Read-only file system
在現實中,許多Linux(Unix)作業系統上是沒有圖形化介面的,為了使DM能夠在這些作業系統上順利安裝,DM提供了命令列的安裝方式。在終端進入到安裝程式所在資料夾,執行以下命令進行命令列安裝:
[dmdba@dm8rac1 dmsoft]$ ./DMInstall.bin -i Please select the installer's language (E/e:English C/c:Chinese) [E/e]:e Extract install files......... Welcome to DM DBMS Installer Whether to input the path of Key File? (Y/y:Yes N/n:No) [Y/y]:n Whether to Set The TimeZone? (Y/y:Yes N/n:No) [Y/y]:y TimeZone: [ 1]: GTM-12=West Date Line [ 2]: GTM-11=Samoa [ 3]: GTM-10=Hawaii [ 4]: GTM-09=Alaska [ 5]: GTM-08=Pacific(America and Canada) [ 6]: GTM-07=Arizona [ 7]: GTM-06=Central(America and Canada) [ 8]: GTM-05=East(America and Canada) [ 9]: GTM-04=Atlantic(America and Canada) [10]: GTM-03=Brasilia [11]: GTM-02=Middle Atlantic [12]: GTM-01=Azores [13]: GTM=Greenwich Mean Time [14]: GTM+01=Sarajevo [15]: GTM+02=Cairo [16]: GTM+03=Moscow [17]: GTM+04=AbuDhabi [18]: GTM+05=Islamabad [19]: GTM+06=Dakar [20]: GTM+07=BangKok,Hanoi [21]: GTM+08=China [22]: GTM+09=Seoul [23]: GTM+10=Guam [24]: GTM+11=Solomon [25]: GTM+12=Fiji [26]: GTM+13=Nukualofa [27]: GTM+14=Kiribati Please Select the TimeZone [21]:21 Installation Type: 1 Typical 2 Server 3 Client 4 Custom Please Input the number of the Installation Type [1 Typical]:4 1 Server component 2 Client component 2.1 Manager 2.2 Monitor 2.3 DTS 2.4 Console 2.5 Analyzer 2.6 DISQL 3 DM Drivers 4 Manual component 5 DBMS Service 5.1 Realtime Audit Service 5.2 Job Service 5.3 Instance Monitor Service 5.4 Assistant Plug-In Service Please Input the number of the Installation Type [1 2 3 4 5]:1 2 3 4 5 Require Space: 1242M Please Input the install path [/home/dmdba/dmdbms]:/dm8 Available Space:39G Please Confirm the install path(/dm8)? (Y/y:Yes N/n:No) [Y/y]:y Pre-Installation Summary Installation Location: /dm8 Require Space: 1242M Available Space: 39G Version Information: Expire Date: Installation Type: Custom Confirm to Install? (Y/y:Yes N/n:No):y 2021-12-07 10:57:53 [INFO] Installing DM DBMS... 2021-12-07 10:57:54 [INFO] Installing BASE Module... 2021-12-07 10:57:56 [INFO] Installing SERVER Module... 2021-12-07 10:57:56 [INFO] Installing CLIENT Module... 2021-12-07 10:57:57 [INFO] Installing DRIVERS Module... 2021-12-07 10:57:57 [INFO] Installing MANUAL Module... 2021-12-07 10:57:57 [INFO] Installing SERVICE Module... 2021-12-07 10:58:03 [INFO] Move log file to log directory. 2021-12-07 10:58:05 [INFO] Installed DM DBMS completely. Please execute the commands by root: /dm8/script/root/root_installer.sh End
以root使用者來執行上面的指令碼
[root@dm8rac1 ~]# /dm8/script/root/root_installer.sh Move /dm8/bin/dm_svc.conf to /etc Modify the files' mode of DM Server [dmdba@dm8rac2 dmsoft]$ ./DMInstall.bin -i Please select the installer's language (E/e:English C/c:Chinese) [E/e]:e Extract install files......... Welcome to DM DBMS Installer Whether to input the path of Key File? (Y/y:Yes N/n:No) [Y/y]:n Whether to Set The TimeZone? (Y/y:Yes N/n:No) [Y/y]:y TimeZone: [ 1]: GTM-12=West Date Line [ 2]: GTM-11=Samoa [ 3]: GTM-10=Hawaii [ 4]: GTM-09=Alaska [ 5]: GTM-08=Pacific(America and Canada) [ 6]: GTM-07=Arizona [ 7]: GTM-06=Central(America and Canada) [ 8]: GTM-05=East(America and Canada) [ 9]: GTM-04=Atlantic(America and Canada) [10]: GTM-03=Brasilia [11]: GTM-02=Middle Atlantic [12]: GTM-01=Azores [13]: GTM=Greenwich Mean Time [14]: GTM+01=Sarajevo [15]: GTM+02=Cairo [16]: GTM+03=Moscow [17]: GTM+04=AbuDhabi [18]: GTM+05=Islamabad [19]: GTM+06=Dakar [20]: GTM+07=BangKok,Hanoi [21]: GTM+08=China [22]: GTM+09=Seoul [23]: GTM+10=Guam [24]: GTM+11=Solomon [25]: GTM+12=Fiji [26]: GTM+13=Nukualofa [27]: GTM+14=Kiribati Please Select the TimeZone [21]:21 Installation Type: 1 Typical 2 Server 3 Client 4 Custom Please Input the number of the Installation Type [1 Typical]:4 1 Server component 2 Client component 2.1 Manager 2.2 Monitor 2.3 DTS 2.4 Console 2.5 Analyzer 2.6 DISQL 3 DM Drivers 4 Manual component 5 DBMS Service 5.1 Realtime Audit Service 5.2 Job Service 5.3 Instance Monitor Service 5.4 Assistant Plug-In Service Please Input the number of the Installation Type [1 2 3 4 5]:1 2 3 4 5 Require Space: 1242M Please Input the install path [/home/dmdba/dmdbms]:/dm8 Available Space:39G Please Confirm the install path(/dm8)? (Y/y:Yes N/n:No) [Y/y]:y Pre-Installation Summary Installation Location: /dm8 Require Space: 1242M Available Space: 39G Version Information: Expire Date: Installation Type: Custom Confirm to Install? (Y/y:Yes N/n:No):y 2021-12-07 10:57:53 [INFO] Installing DM DBMS... 2021-12-07 10:57:54 [INFO] Installing BASE Module... 2021-12-07 10:57:56 [INFO] Installing SERVER Module... 2021-12-07 10:57:56 [INFO] Installing CLIENT Module... 2021-12-07 10:57:57 [INFO] Installing DRIVERS Module... 2021-12-07 10:57:57 [INFO] Installing MANUAL Module... 2021-12-07 10:57:57 [INFO] Installing SERVICE Module... 2021-12-07 10:58:03 [INFO] Move log file to log directory. 2021-12-07 10:58:05 [INFO] Installed DM DBMS completely. Please execute the commands by root: /dm8/script/root/root_installer.sh End
以root使用者來執行上面的指令碼
[root@dm8rac2 ~]# /dm8/script/root/root_installer.sh Move /dm8/bin/dm_svc.conf to /etc Modify the files' mode of DM Server
四、繫結UDEV
編輯/etc/udev/rules.d/60-raw.rules檔案
ACTION=="add", KERNEL=="sdb", RUN+="/bin/raw /dev/raw/raw1 %N" ACTION=="add", KERNEL=="sdc", RUN+="/bin/raw /dev/raw/raw2 %N" ACTION=="add", KERNEL=="sdd", RUN+="/bin/raw /dev/raw/raw3 %N" ACTION=="add", KERNEL=="sde", RUN+="/bin/raw /dev/raw/raw4 %N" ACTION=="add", KERNEL=="sdf", RUN+="/bin/raw /dev/raw/raw5 %N" ACTION=="add", KERNEL=="sdg", RUN+="/bin/raw /dev/raw/raw6 %N" ACTION=="add", KERNEL=="raw[1-6]", OWNER="dmdba", GROUP="dinstall", MODE="660" [root@dm8rac1 rules.d]# /sbin/udevadm trigger --type=devices --action=change [root@dm8rac2 rules.d]# /sbin/udevadm trigger --type=devices --action=change
如果不能正常顯示就重啟作業系統
[root@dm8rac1 ~]# ls -lrt /dev/raw total 0 crw-rw---- 1 root disk 162, 0 Dec 7 14:59 rawctl crw-rw---- 1 dmdba dinstall 162, 5 Dec 7 14:59 raw5 crw-rw---- 1 dmdba dinstall 162, 6 Dec 7 14:59 raw6 crw-rw---- 1 dmdba dinstall 162, 4 Dec 7 14:59 raw4 crw-rw---- 1 dmdba dinstall 162, 3 Dec 7 14:59 raw3 crw-rw---- 1 dmdba dinstall 162, 2 Dec 7 14:59 raw2 crw-rw---- 1 dmdba dinstall 162, 1 Dec 7 14:59 raw1 [root@dm8rac2 ~]# ls -lrt /dev/raw total 0 crw-rw---- 1 root disk 162, 0 Dec 7 14:59 rawctl crw-rw---- 1 dmdba dinstall 162, 5 Dec 7 14:59 raw5 crw-rw---- 1 dmdba dinstall 162, 6 Dec 7 14:59 raw6 crw-rw---- 1 dmdba dinstall 162, 4 Dec 7 14:59 raw4 crw-rw---- 1 dmdba dinstall 162, 3 Dec 7 14:59 raw3 crw-rw---- 1 dmdba dinstall 162, 2 Dec 7 14:59 raw2 crw-rw---- 1 dmdba dinstall 162, 1 Dec 7 14:59 raw1
可以透過blockdev --getsize64 /dev/raw/raw1命令檢視裸裝置大小
[root@dm8rac1 ~]# blockdev --getsize64 /dev/raw/raw1 2147483648 [root@dm8rac1 ~]# blockdev --getsize64 /dev/raw/raw2 2147483648 [root@dm8rac1 ~]# blockdev --getsize64 /dev/raw/raw3 10737418240 [root@dm8rac1 ~]# blockdev --getsize64 /dev/raw/raw4 10737418240 [root@dm8rac1 ~]# blockdev --getsize64 /dev/raw/raw5 10737418240 [root@dm8rac1 ~]# blockdev --getsize64 /dev/raw/raw6 10737418240 [root@dm8rac2 ~]# blockdev --getsize64 /dev/raw/raw1 2147483648 [root@dm8rac2 ~]# blockdev --getsize64 /dev/raw/raw2 2147483648 [root@dm8rac3 ~]# blockdev --getsize64 /dev/raw/raw3 10737418240 [root@dm8rac4 ~]# blockdev --getsize64 /dev/raw/raw4 10737418240 [root@dm8rac5 ~]# blockdev --getsize64 /dev/raw/raw5 10737418240 [root@dm8rac6 ~]# blockdev --getsize64 /dev/raw/raw6 10737418240
五.配置dmdcr_cfg.ini檔案
在2個節點的/dm8/data目錄下建立配置檔案dmdcr_cfg.ini,在檔案中新增如下內容:
[dmdba@dm8rac1 ~]$ mkdir /dm8/data [dmdba@dm8rac2 ~]$ mkdir /dm8/data [dmdba@dm8rac1 data]$ vi dmdcr_cfg.ini DCR_N_GRP = 3 DCR_VTD_PATH = /dev/raw/raw2 DCR_OGUID = 63635 [GRP] DCR_GRP_TYPE = CSS DCR_GRP_NAME = GRP_CSS DCR_GRP_N_EP = 2 DCR_GRP_DSKCHK_CNT = 60 [GRP_CSS] DCR_EP_NAME = CSS1 DCR_EP_HOST = 10.10.13.201 DCR_EP_PORT = 5240 [GRP_CSS] DCR_EP_NAME = CSS2 DCR_EP_HOST = 10.10.13.202 DCR_EP_PORT = 5240 [GRP] DCR_GRP_TYPE = ASM DCR_GRP_NAME = GRP_ASM DCR_GRP_N_EP = 2 DCR_GRP_DSKCHK_CNT = 60 [GRP_ASM] DCR_EP_NAME = ASM1 DCR_EP_SHM_KEY = 93360 DCR_EP_SHM_SIZE = 10 DCR_EP_HOST = 10.10.13.201 DCR_EP_PORT = 5241 DCR_EP_ASM_LOAD_PATH = /dev/raw [GRP_ASM] DCR_EP_NAME = ASM2 DCR_EP_SHM_KEY = 93361 DCR_EP_SHM_SIZE = 10 DCR_EP_HOST = 10.10.13.202 DCR_EP_PORT = 5241 DCR_EP_ASM_LOAD_PATH = /dev/raw [GRP] DCR_GRP_TYPE = DB DCR_GRP_NAME = GRP_RAC DCR_GRP_N_EP = 2 DCR_GRP_DSKCHK_CNT = 60 [GRP_RAC] DCR_EP_NAME = RAC1 DCR_EP_SEQNO = 0 DCR_EP_PORT = 5236 DCR_CHECK_PORT = 5243 [GRP_RAC] DCR_EP_NAME = RAC2 DCR_EP_SEQNO = 1 DCR_EP_PORT = 5236 DCR_CHECK_PORT = 5243 [dmdba@dm8rac2 data]$ vi dmdcr_cfg.ini DCR_N_GRP = 3 DCR_VTD_PATH = /dev/raw/raw2 DCR_OGUID = 63635 [GRP] DCR_GRP_TYPE = CSS DCR_GRP_NAME = GRP_CSS DCR_GRP_N_EP = 2 DCR_GRP_DSKCHK_CNT = 60 [GRP_CSS] DCR_EP_NAME = CSS1 DCR_EP_HOST = 10.10.13.201 DCR_EP_PORT = 5240 [GRP_CSS] DCR_EP_NAME = CSS2 DCR_EP_HOST = 10.10.13.202 DCR_EP_PORT = 5240 [GRP] DCR_GRP_TYPE = ASM DCR_GRP_NAME = GRP_ASM DCR_GRP_N_EP = 2 DCR_GRP_DSKCHK_CNT = 60 [GRP_ASM] DCR_EP_NAME = ASM1 DCR_EP_SHM_KEY = 93360 DCR_EP_SHM_SIZE = 10 DCR_EP_HOST = 10.10.13.201 DCR_EP_PORT = 5241 DCR_EP_ASM_LOAD_PATH = /dev/raw [GRP_ASM] DCR_EP_NAME = ASM2 DCR_EP_SHM_KEY = 93361 DCR_EP_SHM_SIZE = 10 DCR_EP_HOST = 10.10.13.202 DCR_EP_PORT = 5241 DCR_EP_ASM_LOAD_PATH = /dev/raw [GRP] DCR_GRP_TYPE = DB DCR_GRP_NAME = GRP_RAC DCR_GRP_N_EP = 2 DCR_GRP_DSKCHK_CNT = 60 [GRP_RAC] DCR_EP_NAME = RAC1 DCR_EP_SEQNO = 0 DCR_EP_PORT = 5236 DCR_CHECK_PORT = 5243 [GRP_RAC] DCR_EP_NAME = RAC2 DCR_EP_SEQNO = 1 DCR_EP_PORT = 5236 DCR_CHECK_PORT = 5243
六.使用 DMASMCMD 工具初始化(任意一節點執行)
[dmdba@dm8rac1 ~]$ dmasmcmd DMASMCMD V8 ASM>create dcrdisk '/dev/raw/raw1' 'dcr' [Trace]The ASM initialize dcrdisk /dev/raw/raw1 to name DMASMdcr Used time: 334.533(ms). ASM>create votedisk '/dev/raw/raw2' 'vote' [Trace]The ASM initialize votedisk /dev/raw/raw2 to name DMASMvote Used time: 192.761(ms). ASM>create asmdisk '/dev/raw/raw3' 'LOG0' [Trace]The ASM initialize asmdisk /dev/raw/raw3 to name DMASMLOG0 Used time: 189.725(ms). ASM>create asmdisk '/dev/raw/raw4' 'DATA0' [Trace]The ASM initialize asmdisk /dev/raw/raw4 to name DMASMDATA0 Used time: 167.320(ms). ASM>create asmdisk '/dev/raw/raw5' 'LOG1' [Trace]The ASM initialize asmdisk /dev/raw/raw5 to name DMASMLOG1 Used time: 132.694(ms). ASM>create asmdisk '/dev/raw/raw6' 'DATA1' [Trace]The ASM initialize asmdisk /dev/raw/raw6 to name DMASMDATA1 Used time: 259.934(ms). ASM>init dcrdisk '/dev/raw/raw1' from '/dm8/data/dmdcr_cfg.ini' identified by 'dameng123' [Trace]DG 126 alloc one extent for inodes, addr(disk_id, disk_auno, extent_no):(0,0,1). [Trace]DG 126 allocate 4 extents for file 0xfe000002. [Trace]DG 126 alloc 4 extents for 0xfe000002, addr(disk_id, disk_auno, extent_no):(0, 0, 2)->(0, 0, 5), need_init = 1. Used time: 00:00:02.531. ASM>init votedisk '/dev/raw/raw2' from '/dm8/data/dmdcr_cfg.ini' [Trace]DG 125 alloc one extent for inodes, addr(disk_id, disk_auno, extent_no):(0,0,1). [Trace]DG 125 allocate 4 extents for file 0xfd000002. [Trace]DG 125 alloc 4 extents for 0xfd000002, addr(disk_id, disk_auno, extent_no):(0, 0, 2)->(0, 0, 5), need_init = 1. Used time: 00:00:01.089. ASM>
七.準備DMASM 的 MAL 配置檔案
在2個節點的/dm8/data目錄下建立 DMASM 的 MAL 配置檔案(命名為 dmasvrmal.ini),使用 DMASM 的所有節點都要配置,內容完全一樣。
[dmdba@dm8rac1 data]$ vi dmasvrmal.ini [MAL_INST1] MAL_INST_NAME = ASM1 MAL_HOST = 10.10.13.201 MAL_PORT = 5242 [MAL_INST2] MAL_INST_NAME = ASM2 MAL_HOST = 10.10.13.202 MAL_PORT = 5242 [dmdba@dm8rac2 data]$ vi dmasvrmal.ini [MAL_INST1] MAL_INST_NAME = ASM1 MAL_HOST = 10.10.13.201 MAL_PORT = 5242 [MAL_INST2] MAL_INST_NAME = ASM2 MAL_HOST = 10.10.13.202 MAL_PORT = 5242
八.準備dmdcr.ini 配置檔案
dmdcr.ini 是 dmcss、dmasmsvr、dmasmtool 工具的輸入引數。記錄了當前節點序列號以及 DCR 磁碟路徑。在2個節點的/dm/dmdbms/data目錄下建立dmdcr.ini 配置檔案,dmdcr_path 相同,dmasvrmal.ini 檔案內容也相同,dmdcr_seqo 分別為 0 和 1。
節點 1:
[dmdba@dm8rac1 data]$ vi dmdcr.ini DMDCR_PATH = /dev/raw/raw1 DMDCR_MAL_PATH =/dm8/data/dmasvrmal.ini DMDCR_SEQNO = 0 #ASM DMDCR_ASM_RESTART_INTERVAL = 10 DMDCR_ASM_STARTUP_CMD = /dm8/bin/dmasmsvr dcr_ini=/dm8/data/dmdcr.ini #DB DMDCR_DB_RESTART_INTERVAL = 30 DMDCR_DB_STARTUP_CMD = /dm8/bin/dmserver path=/dm8/data/config/rac1/dm.ini dcr_ini=/dm8/data/dmdcr.ini
節點2:
[dmdba@dm8rac2 data]$ vi dmdcr.ini DMDCR_PATH = /dev/raw/raw1 DMDCR_MAL_PATH =/dm8/data/dmasvrmal.ini DMDCR_SEQNO = 1 #ASM DMDCR_ASM_RESTART_INTERVAL = 10 DMDCR_ASM_STARTUP_CMD = /dm8/bin/dmasmsvr dcr_ini=/dm8/data/dmdcr.ini #DB DMDCR_DB_RESTART_INTERVAL = 30 DMDCR_DB_STARTUP_CMD = /dm8/bin/dmserver path=/dm8/data/config/rac2/dm.ini dcr_ini=/dm8/data/dmdcr.ini
九.啟動DMCSS、DMASM 服務程式
1、註冊 DMCSS和DMASM服務
節點一:
[root@dm8rac1 ~]# /dm8/script/root/dm_service_installer.sh -t dmcss -dcr_ini /dm8/data/dmdcr.ini -p rac1 Created symlink from /etc/systemd/system/multi-user.target.wants/DmCSSServicerac1.service to /usr/lib/systemd/system/DmCSSServicerac1.service. Finished to create the service (DmCSSServicerac1) [root@dm8rac1 ~]# /dm8/script/root/dm_service_installer.sh -t dmasmsvr -dcr_ini /dm8/data/dmdcr.ini -p rac1 -y DmCSSServicerac1 Created symlink from /etc/systemd/system/multi-user.target.wants/DmASMSvrServicerac1.service to /usr/lib/systemd/system/DmASMSvrServicerac1.service. Finished to create the service (DmASMSvrServicerac1)
節點二:
[root@dm8rac2 ~]# /dm8/script/root/dm_service_installer.sh -t dmcss -dcr_ini /dm8/data/dmdcr.ini -p rac2 Created symlink from /etc/systemd/system/multi-user.target.wants/DmCSSServicerac2.service to /usr/lib/systemd/system/DmCSSServicerac2.service. Finished to create the service (DmCSSServicerac2) [root@dm8rac2 ~]# /dm8/script/root/dm_service_installer.sh -t dmasmsvr -dcr_ini /dm8/data/dmdcr.ini -p rac2 -y DmCSSServicerac2 Created symlink from /etc/systemd/system/multi-user.target.wants/DmASMSvrServicerac2.service to /usr/lib/systemd/system/DmASMSvrServicerac2.service. Finished to create the service (DmASMSvrServicerac2)
2、啟動DMCSS和DMASM服務
節點一
[root@dm8rac1 ~]# service DmCSSServicerac1 start Redirecting to /bin/systemctl start DmCSSServicerac1.service [root@dm8rac1 ~]# ps -ef | grep dmdba root 2952 2618 0 16:28 pts/0 00:00:00 su - dmdba dmdba 2953 2952 0 16:28 pts/0 00:00:00 -bash dmdba 3468 1 0 16:48 ? 00:00:00 /dm8/bin/dmcss dcr_ini=/dm8/data/dmdcr.ini dmdba 3492 1 0 16:49 ? 00:00:00 /dm8/bin/dmasmsvr dcr_ini=/dm8/data/dmdcr.ini root 3504 3205 0 16:49 pts/1 00:00:00 grep --color=auto dmdba
節點二
[root@dm8rac2 ~]# service DmCSSServicerac2 start Redirecting to /bin/systemctl start DmCSSServicerac2.service [root@dm8rac2 ~]# ps -ef | grep dmdba root 2952 2619 0 16:28 pts/0 00:00:00 su - dmdba dmdba 2953 2952 0 16:28 pts/0 00:00:00 -bash dmdba 3456 1 0 16:49 ? 00:00:00 /dm8/bin/dmcss dcr_ini=/dm8/data/dmdcr.ini dmdba 3480 1 1 16:49 ? 00:00:00 /dm8/bin/dmasmsvr dcr_ini=/dm8/data/dmdcr.ini root 3496 3193 0 16:49 pts/1 00:00:00 grep --color=auto dmdba
css 服務啟動後會自動拉起asm服務,因為在dmdcr.ini檔案中配置自動拉起ASM和DB的操作。
十、建立DMASM磁碟組
在任意節點使用 dmasmtool 工具建立 DMASM 磁碟組。
[dmdba@dm8rac1 data]$ dmasmtool DCR_INI=/dm8/data/dmdcr.ini DMASMTOOL V8 ASM>create diskgroup 'DMLOG' asmdisk '/dev/raw/raw3' Used time: 428.934(ms). ASM>create diskgroup 'DMDATA' asmdisk '/dev/raw/raw4' Used time: 284.431(ms). ASM>
十一、準備dminit.ini 配置檔案
在2個節點的/dm8/data目錄下建立 dminit.ini 配置檔案,新增如下內容。 在2個節點都建立。
[dmdba@dm8rac1 data]$ vi dminit.ini db_name = rac system_path = +DMDATA/data system = +DMDATA/data/rac/system.dbf system_size = 128 roll = +DMDATA/data/rac/roll.dbf roll_size = 128 main = +DMDATA/data/rac/main.dbf main_size = 128 ctl_path = +DMDATA/data/rac/dm.ctl ctl_size = 8 log_size = 256 dcr_path = /dev/raw/raw1 #dcr 磁碟路徑,目前不支援 asm,只能是裸裝置 dcr_seqno = 0 auto_overwrite = 1 [RAC1] #inst_name 跟 dmdcr_cfg.ini 中 DB 型別 group 中 DCR_EP_NAME 對應 config_path = /dm8/data/config/rac1 port_num = 5236 mal_host = 10.10.13.201 mal_port = 5238 log_path = +DMLOG/log/rac0_log01.log log_path = +DMLOG/log/rac0_log02.log [RAC2] #inst_name 跟 dmdcr_cfg.ini 中 DB 型別 group 中 DCR_EP_NAME 對應 config_path = /dm8/data/config/rac2 port_num = 5236 mal_host = 10.10.13.202 mal_port = 5238 log_path = +DMLOG/log/rac1_log01.log log_path = +DMLOG/log/rac1_log02.log [dmdba@dm8rac2 data]$ vi dminit.ini db_name = rac system_path = +DMDATA/data system = +DMDATA/data/rac/system.dbf system_size = 128 roll = +DMDATA/data/rac/roll.dbf roll_size = 128 main = +DMDATA/data/rac/main.dbf main_size = 128 ctl_path = +DMDATA/data/rac/dm.ctl ctl_size = 8 log_size = 256 dcr_path = /dev/raw/raw1 #dcr 磁碟路徑,目前不支援 asm,只能是裸裝置 dcr_seqno = 0 auto_overwrite = 1 [RAC1] #inst_name 跟 dmdcr_cfg.ini 中 DB 型別 group 中 DCR_EP_NAME 對應 config_path = /dm8/data/config/rac1 port_num = 5236 mal_host = 10.10.13.201 mal_port = 5238 log_path = +DMLOG/log/rac0_log01.log log_path = +DMLOG/log/rac0_log02.log [RAC2] #inst_name 跟 dmdcr_cfg.ini 中 DB 型別 group 中 DCR_EP_NAME 對應 config_path = /dm8/data/config/rac2 port_num = 5236 mal_host = 10.10.13.202 mal_port = 5238 log_path = +DMLOG/log/rac1_log01.log log_path = +DMLOG/log/rac1_log02.log
十二、使用dminit初始化資料庫
在任意節點啟動 dminit 工具初始化資料庫。dminit 執行完成後,會在 config_path 目錄(/dm8/data/config/rac1 和/dm8/data/config/rac2)下生成配置檔案 dm.ini 和 dmmal.ini。
[dmdba@dm8rac1 data]$ dminit control=/dm8/data/dminit.ini initdb V8 db version: 0x7000c file dm.key not found, use default license! License will expire on 2022-10-21 Normal of FAST Normal of DEFAULT Normal of RECYCLE Normal of KEEP Normal of ROLL 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.log write to dir [+DMDATA/data/rac]. create dm database success. 2022-02-25 16:59:26
將節點一上的/dm8/data/config中的rac2配置目錄複製到節點二:
[dmdba@dm8rac1 config]$ scp -r rac2 110.10.13.202:/dm8/data/config/ ^C[dmdba@dm8rac1 config]$ scp -r rac2 10.10.13.202:/dm8/data/config/ The authenticity of host '10.10.13.202 (10.10.13.202)' can't be established. ECDSA key fingerprint is SHA256:6O8c9WEeEYPbL4ncdRR1RsrjxxmfzPq9Tkq4/6uLSP4. ECDSA key fingerprint is MD5:e1:73:3e:8d:79:be:5c:82:0f:c7:58:79:45:ad:df:86. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '10.10.13.202' (ECDSA) to the list of known hosts. dmdba@10.10.13.202's password: dmmal.ini 100% 208 8.7KB/s 00:00 dm.ini 100% 53KB 3.0MB/s 00:00 sqllog.ini 100% 481 15.3KB/s 00:00 [dmdba@dm8rac1 config]$
十三、啟動資料庫伺服器
1、在2個節點分別註冊DM 資料庫服務:
節點一:
[root@dm8rac1 ~]# /dm8/script/root/dm_service_installer.sh -t dmserver -dm_ini /dm8/data/config/rac1/dm.ini -dcr_ini /dm8/data/dmdcr.ini -p rac1 -y DmASMSvrServicerac1 Created symlink from /etc/systemd/system/multi-user.target.wants/DmServicerac1.service to /usr/lib/systemd/system/DmServicerac1.service. Finished to create the service (DmServicerac1)
節點二:
[root@dm8rac2 ~]# /dm8/script/root/dm_service_installer.sh -t dmserver -dm_ini /dm8/data/config/rac2/dm.ini -dcr_ini /dm8/data/dmdcr.ini -p rac2 -y DmASMSvrServicerac2 Created symlink from /etc/systemd/system/multi-user.target.wants/DmServicerac2.service to /usr/lib/systemd/system/DmServicerac2.service. Finished to create the service (DmServicerac2)
這裡可以手動啟動資料庫服務來啟動資料庫,也可以重啟CSS服務來啟動資料庫,因為配置CSS會自動拉起資料庫
[root@dm8rac1 ~]# service DmCSSServicerac1 start Redirecting to /bin/systemctl start DmCSSServicerac1.service [root@dm8rac1 ~]# ps -ef | grep dmdba root 2952 2618 0 16:28 pts/0 00:00:00 su - dmdba dmdba 2953 2952 0 16:28 pts/0 00:00:00 -bash root 3680 3629 0 16:59 pts/2 00:00:00 su - dmdba dmdba 3681 3680 0 16:59 pts/2 00:00:00 -bash dmdba 4150 1 0 17:13 ? 00:00:00 /dm8/bin/dmcss dcr_ini=/dm8/data/dmdcr.ini dmdba 4176 1 0 17:13 ? 00:00:00 /dm8/bin/dmasmsvr dcr_ini=/dm8/data/dmdcr.ini dmdba 4274 1 1 17:14 ? 00:00:00 /dm8/bin/dmserver path=/dm8/data/config/rac1/dm.ini dcr_ini=/dm8/data/dmdcr.ini root 4319 3205 0 17:14 pts/1 00:00:00 grep --color=auto dmdba [root@dm8rac2 ~]# service DmCSSServicerac2 restart Redirecting to /bin/systemctl restart DmCSSServicerac2.service [root@dm8rac2 ~]# ps -ef | grep dmdba root 2952 2619 0 16:28 pts/0 00:00:00 su - dmdba dmdba 2953 2952 0 16:28 pts/0 00:00:00 -bash root 3681 3630 0 17:00 pts/2 00:00:00 su - dmdba dmdba 3682 3681 0 17:00 pts/2 00:00:00 -bash dmdba 4124 1 0 17:13 ? 00:00:00 /dm8/bin/dmcss dcr_ini=/dm8/data/dmdcr.ini dmdba 4148 1 0 17:13 ? 00:00:00 /dm8/bin/dmasmsvr dcr_ini=/dm8/data/dmdcr.ini dmdba 4177 1 3 17:14 ? 00:00:00 /dm8/bin/dmserver path=/dm8/data/config/rac2/dm.ini dcr_ini=/dm8/data/dmdcr.ini root 4203 3193 0 17:14 pts/1 00:00:00 grep --color=auto dmdba
DSC+單機的DW部署
為DSC叢集配置實時備機(單機),組成資料守護叢集(DW)
配置DSC叢集監視器
任意節點新建監視器配置檔案,執行以下命令:
[dmdba@dm8rac1 data]$ vi dmcssm.ini #和 dmdcr_cfg.ini 中的 DCR_OGUID 保持一致 CSSM_OGUID = 63635 #配置所有 CSS 的連線資訊, #和 dmdcr_cfg.ini 中 CSS 配置項的 DCR_EP_HOST 和 DCR_EP_PORT 保持一致 CSSM_CSS_IP = 10.10.13.201:5240 CSSM_CSS_IP = 10.10.13.202:5240 CSSM_LOG_PATH =/dm8/dmcssm/log #監視器日誌檔案存放路徑 CSSM_LOG_FILE_SIZE = 32 #每個日誌檔案最大 32 MB CSSM_LOG_SPACE_LIMIT = 0 #不限定日誌檔案總佔用空間
啟動監視器,dmdba 使用者執行,
"dmcssm.ini" [New] 9L, 439C written [dmdba@dm8rac1 data]$ dmcssm ini_path=/dm8/data/dmcssm.ini [monitor] 2022-02-25 20:49:03: CSS MONITOR V8 [monitor] 2022-02-25 20:49:03: CSS MONITOR SYSTEM IS READY. [monitor] 2022-02-25 20:49:03: Wait CSS Control Node choosed... [monitor] 2022-02-25 20:49:04: Wait CSS Control Node choosed succeed. show monitor current time:2022-02-25 20:49:08, n_group:3 =================== group[name = GRP_CSS, seq = 0, type = CSS, Control Node = 0] ======================================== [CSS1] auto check = TRUE, global info: [ASM1] auto restart = TRUE [RAC1] auto restart = TRUE [CSS2] auto check = TRUE, global info: [ASM2] auto restart = TRUE [RAC2] auto restart = TRUE ep: css_time inst_name seqno port mode inst_status vtd_status is_ok active guid ts 2022-02-25 20:49:08 CSS1 0 5240 Control Node OPEN WORKING OK TRUE 245896425 245896870 2022-02-25 20:49:08 CSS2 1 5240 Normal Node OPEN WORKING OK TRUE 245897746 245898186 =================== group[name = GRP_ASM, seq = 1, type = ASM, Control Node = 1] ======================================== n_ok_ep = 2 ok_ep_arr(index, seqno): (0, 0) (1, 1) sta = OPEN, sub_sta = STARTUP break ep = NULL recover ep = NULL crash process over flag is TRUE ep: css_time inst_name seqno port mode inst_status vtd_status is_ok active guid ts 2022-02-25 20:49:08 ASM1 0 5241 Normal Node OPEN WORKING OK TRUE 245903152 245901946 2022-02-25 20:49:08 ASM2 1 5241 Control Node OPEN WORKING OK TRUE 245902734 245903157 =================== group[name = GRP_RAC, seq = 2, type = DB, Control Node = 0] ======================================== n_ok_ep = 2 ok_ep_arr(index, seqno): (0, 0) (1, 1) sta = OPEN, sub_sta = STARTUP break ep = NULL recover ep = NULL crash process over flag is TRUE ep: css_time inst_name seqno port mode inst_status vtd_status is_ok active guid ts 2022-02-25 20:49:08 RAC1 0 5236 Control Node OPEN WORKING OK TRUE 80515155 80515546 2022-02-25 20:49:08 RAC2 1 5236 Normal Node OPEN WORKING OK TRUE 80513792 80514195 ==================================================================================================================
離線備份DSC資料庫
在監視器中關閉資料庫例項,執行以下命令
ep stop GRP_RAC [monitor] 2022-02-25 20:52:24: Notify CSS(seqno:0) set ep(RAC1)auto restart off [monitor] 2022-02-25 20:52:25: Notify CSS(seqno:0) set ep(RAC1)auto restart off success [monitor] 2022-02-25 20:52:25: Notify CSS(seqno:1) set ep(RAC2)auto restart off [monitor] 2022-02-25 20:52:25: Notify CSS(seqno:1) set ep(RAC2)auto restart off success [monitor] 2022-02-25 20:52:25: Set CSS auto restart off success [monitor] 2022-02-25 20:52:25: Notify CSS(seqno:0) execute EP STOP(GRP_RAC) [monitor] 2022-02-25 20:52:31: Notify current active CSS to do clear [monitor] 2022-02-25 20:52:32: Clean request of CSS(0) success [monitor] 2022-02-25 20:52:32: Clean request of CSS(1) success [monitor] 2022-02-25 20:52:32: Command EP STOP GRP_RAC execute success show monitor current time:2022-02-25 20:52:39, n_group:3 =================== group[name = GRP_CSS, seq = 0, type = CSS, Control Node = 0] ======================================== [CSS1] auto check = TRUE, global info: [ASM1] auto restart = TRUE [RAC1] auto restart = FALSE [CSS2] auto check = TRUE, global info: [ASM2] auto restart = TRUE [RAC2] auto restart = FALSE ep: css_time inst_name seqno port mode inst_status vtd_status is_ok active guid ts 2022-02-25 20:52:38 CSS1 0 5240 Control Node OPEN WORKING OK TRUE 245896425 245897077 2022-02-25 20:52:38 CSS2 1 5240 Normal Node OPEN WORKING OK TRUE 245897746 245898393 =================== group[name = GRP_ASM, seq = 1, type = ASM, Control Node = 1] ======================================== n_ok_ep = 2 ok_ep_arr(index, seqno): (0, 0) (1, 1) sta = OPEN, sub_sta = STARTUP break ep = NULL recover ep = NULL crash process over flag is TRUE ep: css_time inst_name seqno port mode inst_status vtd_status is_ok active guid ts 2022-02-25 20:52:38 ASM1 0 5241 Normal Node OPEN WORKING OK TRUE 245903152 245902153 2022-02-25 20:52:38 ASM2 1 5241 Control Node OPEN WORKING OK TRUE 245902734 245903364 =================== group[name = GRP_RAC, seq = 2, type = DB, Control Node = 255] ======================================== n_ok_ep = 2 ok_ep_arr(index, seqno): (0, 0) (1, 1) sta = OPEN, sub_sta = STARTUP break ep = NULL recover ep = NULL crash process over flag is FALSE ep: css_time inst_name seqno port mode inst_status vtd_status is_ok active guid ts 2022-02-25 20:52:38 RAC1 0 5236 Normal Node SHUTDOWN SHUTDOWN OK FALSE 80515155 80515746 2022-02-25 20:52:38 RAC2 1 5236 Normal Node SHUTDOWN SHUTDOWN OK FALSE 80513792 80514394 ==================================================================================================================
使用dmrman工具備份資料庫,dmdba使用者執行
註冊DmAP服務(可以不使用dmap,在使用dmrman時使用引數use_ap=2時)
[root@dm8rac1 ~]# /dm8/script/root/dm_service_installer.sh -t dmap Created symlink from /etc/systemd/system/multi-user.target.wants/DmAPService.service to /usr/lib/systemd/system/DmAPService.service. Finished to create the service (DmAPService)
啟動DmAP服務
[root@dm8rac1 ~]# service DmAPService start Redirecting to /bin/systemctl start DmAPService.service [dmdba@dm8rac1 data]$ dmrman use_ap=2 dcr_ini=/dm8/data/dmdcr.ini dmrman V8 RMAN> backup database '/dm8/data/config/rac1/dm.ini' full backupset '/dm8/data/racfullbak'; backup database '/dm8/data/config/rac1/dm.ini' full backupset '/dm8/data/racfullbak'; file dm.key not found, use default license! Database mode = 0, oguid = 0 Normal of FAST Normal of DEFAULT Normal of RECYCLE Normal of KEEP Normal of ROLL EP[0]'s cur_lsn[29267], file_lsn[29267] EP[1]'s cur_lsn[29267] EP[0] adjust cur_lsn from [29267] to [29267] Processing backupset /dm8/data/racfullbak [Percent:100.00%][Speed:0.00M/s][Cost:00:00:01][Remaining:00:00:00] backup successfully! time used: 00:00:08.410
備份完成將備份檔案複製到DSC備庫(10.10.13.227上合適的目錄)
[dmdba@dm8rac1 data]$ scp -r racfullbak 10.10.13.227:/dm8/data/ The authenticity of host '10.10.13.227 (10.10.13.227)' can't be established. ECDSA key fingerprint is SHA256:6O8c9WEeEYPbL4ncdRR1RsrjxxmfzPq9Tkq4/6uLSP4. ECDSA key fingerprint is MD5:e1:73:3e:8d:79:be:5c:82:0f:c7:58:79:45:ad:df:86. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '10.10.13.227' (ECDSA) to the list of known hosts. dmdba@10.10.13.227's password: racfullbak.bak 100% 6262KB 29.3MB/s 00:00 racfullbak.meta 100% 77KB 3.4MB/s 00:00 [dmdba@dm8rac1 data]$
備庫建立例項
備庫上使用 dmdba 使用者執行例項初始化
[dmdba@dm8racst ~]$ dminit path=/dm8/data/ db_name=rac_st initdb V8 db version: 0x7000c file dm.key not found, use default license! License will expire on 2022-10-21 Normal of FAST Normal of DEFAULT Normal of RECYCLE Normal of KEEP Normal of ROLL log file path: /dm8/data/rac_st/rac_st01.log log file path: /dm8/data/rac_st/rac_st02.log write to dir [/dm8/data/rac_st]. create dm database success. 2022-02-25 21:25:01
使用DMDSC庫的備份集還原恢復到單節點備庫
[dmdba@dm8racst ~]$ dmrman use_ap=2 dmrman V8 RMAN> restore database '/dm8/data/rac_st/dm.ini' from backupset '/dm8/data/racfullbak'; restore database '/dm8/data/rac_st/dm.ini' from backupset '/dm8/data/racfullbak'; file dm.key not found, use default license! Normal of FAST Normal of DEFAULT Normal of RECYCLE Normal of KEEP Normal of ROLL [Percent:100.00%][Speed:0.00M/s][Cost:00:00:05][Remaining:00:00:00] restore successfully. time used: 00:00:05.801 RMAN> recover database '/dm8/data/rac_st/dm.ini' from backupset '/dm8/data/racfullbak'; recover database '/dm8/data/rac_st/dm.ini' from backupset '/dm8/data/racfullbak'; Database mode = 0, oguid = 0 Normal of FAST Normal of DEFAULT Normal of RECYCLE Normal of KEEP Normal of ROLL EP[0]'s cur_lsn[29267], file_lsn[29267] no log generates while the backupset [/dm8/data/racfullbak] created recover successfully! time used: 296.715(ms) RMAN> recover database '/dm8/data/rac_st/dm.ini' update db_magic; recover database '/dm8/data/rac_st/dm.ini' update db_magic; Database mode = 0, oguid = 0 Normal of FAST Normal of DEFAULT Normal of RECYCLE Normal of KEEP Normal of ROLL EP[0]'s cur_lsn[29267], file_lsn[29267] recover successfully! time used: 00:00:01.048
修改DSC例項配置檔案
RAC叢集的2個節點都需要修改
rac1上 dmdba使用者執行
vi /dm8/data/config/rac1/dm.ini
修改以下引數值
ALTER_MODE_STATUS = 0 #不允許手工方式修改例項模式/狀態 ENABLE_OFFLINE_TS = 2 #不允許備庫 OFFLINE 表空間 ARCH_INI = 1 #開啟歸檔模式
rac2上 dmdba使用者執行
vi /dm8/data/config/rac2/dm.ini
修改以下引數值
ALTER_MODE_STATUS = 0 #不允許手工方式修改例項模式/狀態 ENABLE_OFFLINE_TS = 2 #不允許備庫 OFFLINE 表空間 ARCH_INI = 1 #開啟歸檔模式
修改DSC MAL系統配置檔案
rac1上 dmdba使用者執行
[dmdba@dm8rac1 data]$ vi /dm8/data/config/rac1/dmmal.ini [mal_inst0] mal_inst_name = RAC1 mal_host = 10.10.13.201 mal_port = 5238 mal_inst_host = 10.10.13.201 mal_inst_port = 5236 mal_dw_port = 5239 mal_inst_dw_port = 5237 [mal_inst1] mal_inst_name = RAC2 mal_host = 10.10.13.202 mal_port = 5238 mal_inst_host = 10.10.13.202 mal_inst_port = 5236 mal_dw_port = 5239 mal_inst_dw_port = 5237 [mal_inst2] mal_inst_name = RAC_ST mal_host = 10.10.13.227 mal_port = 5238 mal_inst_host = 10.10.13.227 mal_inst_port = 5236 mal_dw_port = 5239 mal_inst_dw_port = 5237
rac2上 dmdba使用者執行
[dmdba@dm8rac2 ~]$ vi /dm8/data/config/rac2/dmmal.ini [mal_inst0] mal_inst_name = RAC1 mal_host = 10.10.13.201 mal_port = 5238 mal_inst_host = 10.10.13.201 mal_inst_port = 5236 mal_dw_port = 5239 mal_inst_dw_port = 5237 [mal_inst1] mal_inst_name = RAC2 mal_host = 10.10.13.202 mal_port = 5238 mal_inst_host = 10.10.13.202 mal_inst_port = 5236 mal_dw_port = 5239 mal_inst_dw_port = 5237 [mal_inst2] mal_inst_name = RAC_ST mal_host = 10.10.13.227 mal_port = 5238 mal_inst_host = 10.10.13.227 mal_inst_port = 5236 mal_dw_port = 5239 mal_inst_dw_port = 5237
配置DSC歸檔配置檔案
RAC叢集的2個節點都需要修改
rac1上 dmdba使用者執行
[dmdba@dm8rac1 data]$ vi /dm8/data/config/rac1/dmarch.ini [ARCHIVE_LOCAL1] ARCH_TYPE = LOCAL ARCH_DEST = /dm8/data/arch_local ARCH_FILE_SIZE = 64 ARCH_SPACE_LIMIT = 51200 [ARCHIVE_REMOTE1] ARCH_TYPE = REMOTE ARCH_DEST = RAC2 ARCH_INCOMING_PATH = /dm8/data/arch_remote ARCH_FILE_SIZE = 64 ARCH_SPACE_LIMIT = 51200 [ARCHIVE_REALTIME] ARCH_TYPE = REALTIME ARCH_DEST = RAC_ST
rac2上 dmdba使用者執行
[dmdba@dm8rac2 ~]$ vi /dm8/data/config/rac2/dmarch.ini [ARCHIVE_LOCAL1] ARCH_TYPE = LOCAL ARCH_DEST = /dm8/data/arch_local ARCH_FILE_SIZE = 64 ARCH_SPACE_LIMIT = 51200 [ARCHIVE_REMOTE1] ARCH_TYPE = REMOTE ARCH_DEST = RAC1 ARCH_INCOMING_PATH = /dm8/data/arch_remote ARCH_FILE_SIZE = 64 ARCH_SPACE_LIMIT = 51200 [ARCHIVE_REALTIME] ARCH_TYPE = REALTIME ARCH_DEST = RAC_ST
配置DSC資料守護配置檔案
RAC叢集的2個節點都需要修改
rac1上 dmdba使用者執行
[dmdba@dm8rac1 data]$ vi /dm8/data/config/rac1/dmwatcher.ini [GRP_RAC_DW] DW_TYPE = GLOBAL #全域性守護型別 DW_MODE = MANUAL #手動切換模式 DW_ERROR_TIME = 60 #遠端守護程式故障認定時間 INST_RECOVER_TIME = 60 #主庫守護程式啟動恢復的間隔時間 INST_ERROR_TIME = 35 #本地例項故障認定時間 INST_OGUID = 100001 #守護系統唯一 OGUID 值 INST_INI = /dm8/data/config/rac1/dm.ini #dm.ini 配置檔案路徑 DCR_INI =/dm8/data/dmdcr.ini #dmdcr.ini 配置檔案路徑 INST_AUTO_RESTART = 0 #關閉例項的自動啟動功能
rac2上 dmdba使用者執行
[dmdba@dm8rac2 ~]$ vi /dm8/data/config/rac2/dmwatcher.ini [GRP_RAC_DW] DW_TYPE = GLOBAL #全域性守護型別 DW_MODE = MANUAL #手動切換模式 DW_ERROR_TIME = 60 #遠端守護程式故障認定時間 INST_RECOVER_TIME = 60 #主庫守護程式啟動恢復的間隔時間 INST_ERROR_TIME = 35 #本地例項故障認定時間 INST_OGUID = 100001 #守護系統唯一 OGUID 值 INST_INI = /dm8/data/config/rac2/dm.ini #dm.ini 配置檔案路徑 DCR_INI =/dm8/data/dmdcr.ini #dmdcr.ini 配置檔案路徑 INST_AUTO_RESTART = 0 #關閉例項的自動啟動功能
修改備庫例項配置檔案
vi /dm8/data/rac_st/dm.ini
修改以下引數值
INSTANCE_NAME=RAC_ST #例項名 ALTER_MODE_STATUS = 0 #不允許手工方式修改例項模式/狀態 ENABLE_OFFLINE_TS = 2 #不允許備庫 OFFLINE 表空間 ARCH_INI = 1 #開啟歸檔模式 MAL_INI = 1 #開啟MAL系統
配置備庫歸檔配置檔案
[dmdba@dm8racst rac_st]$ vi /dm8/data/rac_st/dmarch.ini [ARCHIVE_LOCAL1] arch_type =local arch_dest = /dm8/data/arch arch_file_size = 64 arch_space_limit = 51200 [ARCHIVE_REALTIME] arch_type = realtime arch_dest = RAC1/RAC2
[dmdba@dm8racst rac_st]$ vi /dm8/data/rac_st/dmmal.ini
[mal_inst0]
mal_inst_name = RAC1
mal_host = 10.10.13.201
mal_port = 5238
mal_inst_host = 10.10.13.201
mal_inst_port = 5236
mal_dw_port = 5239
mal_inst_dw_port = 5237
[mal_inst1]
mal_inst_name = RAC2
mal_host = 10.10.13.202
mal_port = 5238
mal_inst_host = 10.10.13.202
mal_inst_port = 5236
mal_dw_port = 5239
mal_inst_dw_port = 5237
[mal_inst2]
mal_inst_name = RAC_ST
mal_host = 10.10.13.227
mal_port = 5238
mal_inst_host = 10.10.13.227
mal_inst_port = 5236
mal_dw_port = 5239
mal_inst_dw_port = 5237
配置備庫資料守護配置檔案
[dmdba@dm8racst ~]$ vi /dm8/data/rac_st/dmwatcher.ini [GRP_RAC_DW] DW_TYPE = GLOBAL #全域性守護型別 DW_MODE = MANUAL #手動切換模式 DW_ERROR_TIME = 60 #遠端守護程式故障認定時間 INST_RECOVER_TIME = 60 #主庫守護程式啟動恢復的間隔時間 INST_ERROR_TIME = 35 #本地例項故障認定時間 INST_OGUID = 100001 #守護系統唯一 OGUID 值 INST_INI = /dm8/data/rac_st/dm.ini #dm.ini 配置檔案路徑 INST_AUTO_RESTART = 1 #關閉例項的自動啟動功能 INST_STARTUP_CMD = /dm8/bin/dmserver #命令列方式啟動
啟動所有例項到mount狀態
在rac1上啟動例項,使用dmdba使用者執行
[dmdba@dm8rac1 ~]$ dmserver path=/dm8/data/config/rac1/dm.ini dcr_ini=/dm8/data/dmdcr.ini mount file dm.key not found, use default license! version info: develop DM Database Server x64 V8 1-2-84-21.10.21-149328-10032-ENT startup... Normal of FAST Normal of DEFAULT Normal of RECYCLE Normal of KEEP Normal of ROLL Database mode = 0, oguid = 0 License will expire on 2022-10-21 hlck_sys_init, init g_drm_dest:[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] lbs_sys_init, the length of g_master_map is 1451, fill it use ok_ep_arr:[0, 1], n_ok_ep:2! check CSS cmd: START NOTIFY, cmd_seq: 29 Control Node change from 255 to 254 check CSS cmd: DCR_LOAD, cmd_seq: 30 check CSS cmd: EP START, cmd_seq: 33 Control Node change from 254 to 0 file lsn: 29267 check CSS cmd: EP START2, cmd_seq: 38 ndct db load finished ndct second level fill fast pool finished ndct third level fill fast pool finished ndct fill fast pool finished nsvr_startup end. aud sys init success. aud rt sys init success. systables desc init success. ndct_db_load_info success. SYSTEM IS READY. check CSS cmd: EP OPEN, cmd_seq: 43 iid page's trxid[8020] NEXT TRX ID = 9024. [!!!DSC INFO!!!] DSC crash process over! check CSS cmd: EP REAL OPEN, cmd_seq: 46
在rac2上啟動例項,使用dmdba使用者執行
[dmdba@dm8rac2 ~]$ dmserver path=/dm8/data/config/rac2/dm.ini dcr_ini=/dm8/data/dmdcr.ini mount file dm.key not found, use default license! version info: develop DM Database Server x64 V8 1-2-84-21.10.21-149328-10032-ENT startup... Normal of FAST Normal of DEFAULT Normal of RECYCLE Normal of KEEP Normal of ROLL Database mode = 0, oguid = 0 License will expire on 2022-10-21 hpc_ini_info_pre_check end, code:0 hlck_sys_init, init g_drm_dest:[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] lbs_sys_init, the length of g_master_map is 1451, fill it use ok_ep_arr:[0, 1], n_ok_ep:2! check CSS cmd: DCR_LOAD, cmd_seq: 31 check CSS cmd: EP START, cmd_seq: 35 Control Node change from 255 to 0 mal_tsk_process_g_crash_lsn_bro, ep_seqno(0), crash_lsn(0) mal_tsk_process_g_crash_lsn_bro, ep_seqno(1), crash_lsn(0) check CSS cmd: EP START2, cmd_seq: 40 Control node start status: MOUNT file lsn: 29267 begin redo pwr log collect, last ckpt lsn: 29267 ... redo pwr log collect finished ndct db load finished ndct second level fill fast pool finished ndct third level fill fast pool finished ndct fill fast pool finished nsvr_startup end. aud sys init success. aud rt sys init success. systables desc init success. ndct_db_load_info success. SYSTEM IS READY. check CSS cmd: EP OPEN, cmd_seq: 44 iid page's trxid[8021] NEXT TRX ID = 9025. check CSS cmd: EP REAL OPEN, cmd_seq: 47
在備庫上啟動例項,使用dmdba使用者執行
[dmdba@dm8racst ~]$ dmserver path=/dm8/data/rac_st/dm.ini mount file dm.key not found, use default license! version info: develop DM Database Server x64 V8 1-2-84-21.10.21-149328-10032-ENT startup... Normal of FAST Normal of DEFAULT Normal of RECYCLE Normal of KEEP Normal of ROLL Database mode = 0, oguid = 0 License will expire on 2022-10-21 file lsn: 29267 ndct db load finished ndct second level fill fast pool finished ndct third level fill fast pool finished ndct fill fast pool finished nsvr_startup end. aud sys init success. aud rt sys init success. systables desc init success. ndct_db_load_info success. SYSTEM IS READY.
修改主備庫模式
使用disql工具連線各例項,rac任意節點使用dmdba執行
這裡需要注意的是rac是多例項單庫,設定oguid是針對例項而言,rac兩個例項都需要改,但是這種資料庫為主庫,則只需要選擇一個節點執行即可。
[dmdba@dm8rac1 data]$ disql SYSDBA/SYSDBA@localhost:5236 Server[localhost:5236]:mode is normal, state is mount login used time : 7.071(ms) disql V8 SQL> sp_set_oguid(100001); DMSQL executed successfully used time: 312.734(ms). Execute id is 0. [dmdba@dm8rac2 ~]$ disql SYSDBA/SYSDBA@localhost:5236 Server[localhost:5236]:mode is normal, state is mount login used time : 4.016(ms) disql V8 SQL> sp_set_oguid(100001); DMSQL executed successfully used time: 263.902(ms). Execute id is 0. SQL> alter database primary; executed successfully used time: 270.052(ms). Execute id is 0. [dmdba@dm8racst dm8]$ disql SYSDBA/SYSDBA@localhost:5236 Server[localhost:5236]:mode is normal, state is mount login used time : 2.887(ms) disql V8 SQL> sp_set_oguid(100001); DMSQL executed successfully used time: 65.576(ms). Execute id is 0. SQL> alter database standby; executed successfully used time: 41.479(ms). Execute id is 0.
啟動所有節點守護程式
註冊為系統服務,方便啟動和關閉叢集,以及實現開機自動啟動。
所有節點都需要註冊,使用 root 使用者執行
rac1 執行以下命令: [root@dm8rac1 ~]# /dm8/script/root/dm_service_installer.sh -watcher_ini /dm8/data/config/rac1/dmwatcher.ini -p rac1 -t dmwatcher Created symlink from /etc/systemd/system/multi-user.target.wants/DmWatcherServicerac1.service to /usr/lib/systemd/system/DmWatcherServicerac1.service. Finished to create the service (DmWatcherServicerac1)
rac2 執行以下命令:
[root@dm8rac2 ~]# /dm8/script/root/dm_service_installer.sh -watcher_ini /dm8/data/config/rac2/dmwatcher.ini -p rac2 -t dmwatcher Created symlink from /etc/systemd/system/multi-user.target.wants/DmWatcherServicerac2.service to /usr/lib/systemd/system/DmWatcherServicerac2.service. Finished to create the service (DmWatcherServicerac2)
rac_st 執行以下命令:
[root@dm8racst ~]# /dm8/script/root/dm_service_installer.sh -watcher_ini /dm8/data/rac_st/dmwatcher.ini -p rac_st -t dmwatcher Created symlink from /etc/systemd/system/multi-user.target.wants/DmWatcherServicerac_st.service to /usr/lib/systemd/system/DmWatcherServicerac_st.service. Finished to create the service (DmWatcherServicerac_st)
以服務方式啟動守護程式
rac1 執行以下命令:
[root@dm8rac1 ~]# service DmWatcherServicerac1 start Redirecting to /bin/systemctl start DmWatcherServicerac1.service
rac2 執行以下命令
[root@dm8rac2 ~]# service DmWatcherServicerac2 start Redirecting to /bin/systemctl start DmWatcherServicerac2.service
rac_st 執行以下命令:
[root@dm8racst ~]# service DmWatcherServicerac_st start Redirecting to /bin/systemctl start DmWatcherServicerac_st.service
配置dmmonitor.ini
[dmdba@dm8racst1 data]$ vi dmmonitor.ini MON_LOG_PATH = /dm8/data/log MON_LOG_INTERVAL = 60 MON_LOG_FILE_SIZE = 64 MON_LOG_SPACE_LIMIT = 0 MON_DW_CONFIRM = 0 [GRP_RAC_DW] MON_INST_OGUID = 100001 MON_DW_IP = 10.10.13.201:5239/10.10.13.202:5239 MON_DW_IP = 10.10.13.227:5239
啟動資料守護監視器:
[dmdba@dm8racst1 data]$ dmmonitor path=/dm8/data/dmmonitor.ini [monitor] 2022-02-25 22:30:45: DMMONITOR[4.0] V8 [monitor] 2022-02-25 22:30:46: DMMONITOR[4.0] IS READY. [monitor] 2022-02-25 22:30:46: Received message from(RAC2) WTIME WSTATUS INST_OK INAME ISTATUS IMODE RSTAT N_OPEN FLSN CLSN 2022-02-25 22:30:46 STARTUP OK RAC1 OPEN PRIMARY VALID 3 31768 31768 [monitor] 2022-02-25 22:30:46: Received message from(RAC1) WTIME WSTATUS INST_OK INAME ISTATUS IMODE RSTAT N_OPEN FLSN CLSN 2022-02-25 22:30:46 OPEN OK RAC1 OPEN PRIMARY VALID 3 31768 31768 [monitor] 2022-02-25 22:30:46: Received message from(RAC_ST) WTIME WSTATUS INST_OK INAME ISTATUS IMODE RSTAT N_OPEN FLSN CLSN 2022-02-25 22:30:46 OPEN OK RAC_ST OPEN STANDBY VALID 3 31768 31768 show 2022-02-25 22:31:20 #================================================================================# GROUP OGUID MON_CONFIRM MODE MPP_FLAG GRP_RAC_DW 100001 FALSE MANUAL FALSE < > DW_IP MAL_DW_PORT WTIME WTYPE WCTLSTAT WSTATUS INAME INST_OK N_EP N_OK ISTATUS IMODE DSC_STATUS RTYPE RSTAT 10.10.13.201 5239 2022-02-25 22:31:20 GLOBAL VALID OPEN RAC1 OK 2 2 OPEN PRIMARY DSC_OPEN REALTIME VALID EP INFO: INST_IP INST_PORT INST_OK INAME ISTATUS IMODE DSC_SEQNO DSC_CTL_NODE RTYPE RSTAT FSEQ FLSN CSEQ CLSN DW_STAT_FLAG 10.10.13.201 5236 OK RAC1 OPEN PRIMARY 0 0 REALTIME VALID 4195 31768 4195 31768 NONE 10.10.13.202 5236 OK RAC2 OPEN PRIMARY 1 0 REALTIME VALID 2476 31768 2476 31768 NONE < > DW_IP MAL_DW_PORT WTIME WTYPE WCTLSTAT WSTATUS INAME INST_OK N_EP N_OK ISTATUS IMODE DSC_STATUS RTYPE RSTAT 10.10.13.227 5239 2022-02-25 22:31:20 GLOBAL VALID OPEN RAC_ST OK 1 1 OPEN STANDBY DSC_OPEN REALTIME VALID EP INFO: INST_IP INST_PORT INST_OK INAME ISTATUS IMODE DSC_SEQNO DSC_CTL_NODE RTYPE RSTAT FSEQ FLSN CSEQ CLSN DW_STAT_FLAG 10.10.13.227 5236 OK RAC_ST OPEN STANDBY 0 0 REALTIME VALID 4188 31768 4188 31768 NONE DATABASE(RAC_ST) APPLY INFO FROM (RAC1), REDOS_PARALLEL_NUM (1): DSC_SEQNO[0], (RSEQ, SSEQ, KSEQ)[4195, 4195, 4195], (RLSN, SLSN, KLSN)[31768, 31768, 31768], N_TSK[0], TSK_MEM_USE[0] REDO_LSN_ARR: (31768) DSC_SEQNO[1], (RSEQ, SSEQ, KSEQ)[2476, 2476, 2476], (RLSN, SLSN, KLSN)[31768, 31768, 31768], N_TSK[0], TSK_MEM_USE[0] REDO_LSN_ARR: (31768) #================================================================================#
測試DSC+DW叢集
使用disql工具連線任意rac節點,建立測試表test,並插入資料測試
[dmdba@dm8rac1 data]$ disql SYSDBA/SYSDBA@localhost:5236 Server[localhost:5236]:mode is primary, state is open login used time : 3.518(ms) disql V8 SQL> create table test(id int); executed successfully used time: 140.246(ms). Execute id is 300. SQL> insert into test values (1); affect rows 1 used time: 1.927(ms). Execute id is 301. SQL> commit; executed successfully used time: 12.186(ms). Execute id is 302. SQL> select * from test; LINEID ID ---------- ----------- 1 1 used time: 1.543(ms). Execute id is 303.
備庫查詢
[dmdba@dm8racst dm8]$ disql SYSDBA/SYSDBA@localhost:5236 Server[localhost:5236]:mode is standby, state is open login used time : 3.050(ms) disql V8 SQL> select * from test; LINEID ID ---------- ----------- 1 1 used time: 5.496(ms). Execute id is 200.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26015009/viewspace-2883956/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- DM8搭建2節點DMDSC
- DM8 MPP主備環境搭建
- ElasticSearch(單節點)環境配置Elasticsearch
- DM8 DMDSC動態擴充套件節點套件
- DM8 實時主備環境搭建
- DM8配置MPP主備
- DM8 Linux環境下配置ODBCLinux
- kubernetes環境部署單節點redisRedis
- 11.2.0.4 RAC生產環境刪除故障節點與增加新服務節點
- Windows 11.2.0.4 RAC安裝配置以及RAC新增節點Windows
- ubuntu環境配置備忘Ubuntu
- 基於minikube快速搭建kubernetes單節點環境
- mongodb主從仲裁節點配置MongoDB
- Oracle RAC一鍵部署001(主機環境校驗)Oracle
- DM8配置非同步備庫非同步
- Networker備份oracle單節點Oracle
- Windows單機配置Zookeeper環境Windows
- Oracle RAC新增節點Oracle
- RAC主機配置ssh互信
- Oracle 12cR1 RAC叢集安裝(一)--環境準備Oracle
- app自動化測試環境配置:adb環境配置、monkey環境配置、appium環境配置大全APP
- 2節點RAC安裝
- rac新增節點前之清除節點資訊
- RMAN之環境配置(二)---Backups to a Media Manager備份到介質管理器
- RAC環境修改spfile的位置
- KingbaseES RAC部署案例之---SAN環境構建RAC
- 開發環境的 Ubuntu Desktop 18.04LTS 開發環境配置備忘開發環境Ubuntu
- DM8 資料守護實時主備搭建
- 環境配置
- Oracle資料庫從Linux x86單機遷移到Solaries雙節點RAC叢集經驗分享-生產環境切換Oracle資料庫Linux
- Oracle資料庫從Linux x86單機遷移到Solaries雙節點RAC叢集經驗分享-測試環境驗證Oracle資料庫Linux
- 基於etcd的選主功能實現的主備節點管理
- 手工清理19c RAC環境
- RAC環境下建立物理DATAGUARD(1)
- RAC環境下建立物理DATAGUARD(2)
- RAC和ASM環境下打patchASM
- 主機回來以及,簡單的環境配置(RTX3070+CUDA11.1+CUDNN+TensorRT)DNN
- 配置開發環境、生成環境、測試環境開發環境