1 Star 0 Fork 42

Thames/DMShellInstall

forked from hnyuanzj/DMShellInstall 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
部署一主两备手动切换数据守护(centos6).txt 211.31 KB
一键复制 编辑 原始数据 按行查看 历史
hnyuanzj 提交于 2022-12-24 17:25 . 修改后缀名
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354
[BEGIN] 2022/12/20 0:38:30
-mp --mem_percent 优化数据库时物理内存占比 [80]
-di --dm_iso_name 达梦数据库安装镜像名称
-kp --key_path 达梦数据库密钥路径
数据守护(DataWatch):
-rp --root_passwd root 用户密码
-dhn --wc_hostname 主机名,以逗号隔开,例如 -dhn dw01,dw02
-dpi --wc_public_ip 业务IP,以逗号隔开,例如 -dpi 10.211.55.101,10.211.55.102
-dmi --wc_mal_ip MAL IP,以逗号隔开,例如 -dmi 1.1.1.1,1.1.1.2
-dmoi --dw_monitor_ip 监视器主机 IP
-dgn --dw_group_name 数据守护组名 [GRP1]
-mpn --mal_port_num MAL 监听端口号 [5336],取值范围:1024~65535
-mdpn --mal_dw_port_num 守护进程端口号 [5436],取值范围:1024~65535
-midpn --mal_inst_dw_port_num 实例监听守护进程端口号 [5536],取值范围:1024~65535
-oi --os_iso 是否需要挂载操作系统 ISO 镜像,脚本自动配置 YUM 源 [Y]
DSC集群(DMDSC):
-rp --root_passwd root 用户密码
-dhn --wc_hostname 主机名,以逗号隔开,例如 -dhn dsc01,dsc02
-dpi --wc_public_ip 业务IP,以逗号隔开,例如 -dpi 10.211.55.101,10.211.55.102
-dmi --wc_mal_ip MAL IP,以逗号隔开,例如 -dmi 1.1.1.1,1.1.1.2
-ddn --dsc_db_name 数据库DB_NAME,默认值:DSC
-den --dsc_ep_name 数据库每个节点的实例名前缀,默认值:DSC
-dcd --dcr_disk dcr磁盘名字:/dev/sdb(多链路聚合的磁盘名字:dmdcr01),只能传入一块磁盘
-vod --vote_disk vote磁盘名字:/dev/sdc(多链路聚合的磁盘名字:dmvote01),只能传入一块磁盘
-lod --log_disk redo日志磁盘名字:/dev/sdd,/dev/sde(多链路聚合的磁盘名字:dmlog01,dmlog02),可以是一块盘,也可以是多块盘,如果没有划分单独的redo磁盘,可以不写
-ard --arch_disk 归档日志磁盘名字:/dev/sdf,/dev/sdg(多链路聚合的磁盘名字:dmarch01,dmarch02),可以是一块盘,也可以是多块盘,如果没有划分单独的arch磁盘,可以不写
-dad --data_disk 数据盘名字:/dev/sdh,/dev/sdi(多链路聚合的磁盘名字:dmdata01,dmdata02),可以是一块盘,也可以是多块盘,盘数必须大于等于 1
-apd --asm_pwd asm实例密码,默认值:Welcome1
-cdp --css_dcr_ep_port css通信端口,默认值:[9341],取值范围:1024~65534
-adp --asm_dcr_ep_port asm通信端口,默认值:[9351],取值范围:1024~65534
-ddp --db_dcr_ep_port db通信端口,默认值:[9741],取值范围:1024~65534
-amp --asvrmal_mal_port mal系统通信端口,默认值:[7236],取值范围:1024~65534
-mtp --multipath 是否需要配置multipath多链路聚合,脚本默认不配置 [N]
-oi --os_iso 是否需要挂载操作系统 ISO 镜像,脚本自动配置 YUM 源 [Y]
注意:本脚本仅用于新服务器上实施部署数据使用,请严禁在已运行数据库的主机上执行,以免发生数据丢失或者损坏,造成不可挽回的损失!!!
[root@centos6 soft]# ls
a.sh dm8_20221121_x86_rh6_64.iso DMShellInstall
[root@centos6 soft]# ./DMShellInstall -di dm8_20221121_x86_rh6_64.iso -d /opt/dmdbms \
> -dhn dw01,dw02,dw03 -rp 123456 \
> -dpi 192.168.2.21,192.168.2.22,192.168.2.23 -dmi 172.16.2.21,172.16.2.22,172.16.2.23 \
> -mpn 12345 -mdpn 12346 -midpn 12347 \
> -oi N
███████ ████ ████ ████████ ██ ██ ██ ██ ██ ██ ██
░██░░░░██ ░██░██ ██░██ ██░░░░░░ ░██ ░██ ░██░██ ░██ ░██ ░██
░██ ░██░██░░██ ██ ░██░██ ░██ █████ ░██ ░██░██ ███████ ██████ ██████ ██████ ░██ ░██
░██ ░██░██ ░░███ ░██░█████████░██████ ██░░░██ ░██ ░██░██░░██░░░██ ██░░░░ ░░░██░ ░░░░░░██ ░██ ░██
░██ ░██░██ ░░█ ░██░░░░░░░░██░██░░░██░███████ ░██ ░██░██ ░██ ░██░░█████ ░██ ███████ ░██ ░██
░██ ██ ░██ ░ ░██ ░██░██ ░██░██░░░░ ░██ ░██░██ ░██ ░██ ░░░░░██ ░██ ██░░░░██ ░██ ░██
░███████ ░██ ░██ ████████ ░██ ░██░░██████ ███ ███░██ ███ ░██ ██████ ░░██ ░░████████ ███ ███
░░░░░░░ ░░ ░░ ░░░░░░░░ ░░ ░░ ░░░░░░ ░░░ ░░░ ░░ ░░░ ░░ ░░░░░░ ░░ ░░░░░░░░ ░░░ ░░░
请选择达梦数据库部署类型:单机[si]/数据守护[dw]/dsc集群[dsc]
dw
达梦数据库安装部署类型: datawatch
校验 192.168.2.21,192.168.2.22,192.168.2.23 地址,请等待!!!
校验 172.16.2.21,172.16.2.22,172.16.2.23 地址,请等待!!!
主库安装 expect 软件用于 root 用户互信:
已加载插件:fastestmirror, security
设置安装进程
Determining fastest mirrors
OS-YUM | 4.0 kB 00:00 ...
解决依赖关系
--> 执行事务检查
---> Package expect.x86_64 0:5.44.1.15-5.el6_4 will be 安装
--> 处理依赖关系 libtcl8.5.so()(64bit),它被软件包 expect-5.44.1.15-5.el6_4.x86_64 需要
--> 执行事务检查
---> Package tcl.x86_64 1:8.5.7-6.el6 will be 安装
--> 完成依赖关系计算
依赖关系解决
=====================================================================================================================================================================================================================
软件包 架构 版本 仓库 大小
=====================================================================================================================================================================================================================
正在安装:
expect x86_64 5.44.1.15-5.el6_4 OS-YUM 256 k
为依赖而安装:
tcl x86_64 1:8.5.7-6.el6 OS-YUM 1.9 M
事务概要
=====================================================================================================================================================================================================================
Install 2 Package(s)
总下载量:2.2 M
Installed size: 4.9 M
下载软件包:
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
总计 10 MB/s | 2.2 MB 00:00
运行 rpm_check_debug
执行事务测试
事务测试成功
执行事务
正在安装 : 1:tcl-8.5.7-6.el6.x86_64 1/2
正在安装 : expect-5.44.1.15-5.el6_4.x86_64 2/2
Verifying : expect-5.44.1.15-5.el6_4.x86_64 1/2
Verifying : 1:tcl-8.5.7-6.el6.x86_64 2/2
已安装:
expect.x86_64 0:5.44.1.15-5.el6_4
作为依赖被安装:
tcl.x86_64 1:8.5.7-6.el6
完毕!
所有节点 root 用户配置互信:
# 192.168.2.21 SSH-2.0-OpenSSH_5.3
no hostkey alg
# 192.168.2.21 SSH-2.0-OpenSSH_5.3
# 192.168.2.21 SSH-2.0-OpenSSH_5.3
# 192.168.2.22 SSH-2.0-OpenSSH_5.3
no hostkey alg
# 192.168.2.22 SSH-2.0-OpenSSH_5.3
# 192.168.2.22 SSH-2.0-OpenSSH_5.3
# 192.168.2.23 SSH-2.0-OpenSSH_5.3
no hostkey alg
# 192.168.2.23 SSH-2.0-OpenSSH_5.3
# 192.168.2.23 SSH-2.0-OpenSSH_5.3
spawn scp -rq /root/.ssh root@192.168.2.21:~
root@192.168.2.21's password:
spawn ssh-copy-id -i root@192.168.2.21
root@192.168.2.21's password:
Now try logging into the machine, with "ssh 'root@192.168.2.21'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
spawn scp -rq /root/.ssh root@192.168.2.22:~
root@192.168.2.22's password:
spawn ssh-copy-id -i root@192.168.2.22
root@192.168.2.22's password:
Now try logging into the machine, with "ssh 'root@192.168.2.22'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
spawn scp -rq /root/.ssh root@192.168.2.23:~
root@192.168.2.23's password:
spawn ssh-copy-id -i root@192.168.2.23
root@192.168.2.23's password:
Now try logging into the machine, with "ssh 'root@192.168.2.23'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
拷贝脚本以及安装包到节点:192.168.2.22
dwnode.sh 100% 435 0.4KB/s 00:00
DMShellInstall 100% 133KB 133.3KB/s 00:00
dm8_20221121_x86_rh6_64.iso 100% 959MB 73.8MB/s 00:13
拷贝脚本以及安装包到节点:192.168.2.23
dwnode.sh 100% 435 0.4KB/s 00:00
DMShellInstall 100% 133KB 133.3KB/s 00:00
dm8_20221121_x86_rh6_64.iso 100% 959MB 73.8MB/s 00:13
达梦数据库开始安装:
#==============================================================#
打印系统信息
#==============================================================#
服务器时间:
2022年 12月 20日 星期二 07:18:33 CST
操作系统版本:
CentOS release 6.10 (Final)
cpu信息:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 1
On-line CPU(s) list: 0
Thread(s) per core: 1
Core(s) per socket: 1
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 142
Model name: Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
Stepping: 12
CPU MHz: 1992.001
BogoMIPS: 3984.00
Hypervisor vendor: VMware
Virtualization type: full
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 8192K
NUMA node0 CPU(s): 0
内存信息:
total used free shared buffers cached
Mem: 2870 1301 1568 0 14 1119
-/+ buffers/cache: 167 2703
Swap: 8191 0 8191
total used free shared buffers cached
Mem: 2.8G 1.3G 1.5G 264K 14M 1.1G
-/+ buffers/cache: 167M 2.6G
Swap: 8.0G 0B 8.0G
挂载信息:
UUID=cec08ef8-7698-4f29-85ed-18b15971b9dd / ext4 defaults 1 1
UUID=bbbb2b30-9dbc-4f48-a37c-fec3926d4423 /boot ext4 defaults 1 2
UUID=84e57345-d09b-44e5-8240-2becf00e7c15 swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/sr0 /mnt/cdrom iso9660 defaults 0 0
目录信息:
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 91G 2.3G 84G 3% /
tmpfs 1.5G 0 1.5G 0% /dev/shm
/dev/sda1 190M 39M 142M 22% /boot
/dev/sr0 3.8G 3.8G 0 100% /mnt/cdrom
.host:/ 200G 108G 93G 54% /mnt/hgfs
#==============================================================#
关闭 SWAP 功能
#==============================================================#
total used free shared buffers cached
Mem: 2939404 1327028 1612376 264 15252 1146580
-/+ buffers/cache: 165196 2774208
Swap: 0 0 0
#UUID=84e57345-d09b-44e5-8240-2becf00e7c15 swap swap defaults 0 0
#==============================================================#
禁用防火墙
#==============================================================#
iptables:将链设置为政策 ACCEPT:filter [确定]
iptables:清除防火墙规则: [确定]
iptables:正在卸载模块: [确定]
ip6tables:将 chains 设置为 ACCEPT 策略:filter [确定]
ip6tables:清除防火墙规则: [确定]
:正在卸载模块: [确定]
iptables:未运行防火墙。
#==============================================================#
禁用 selinux
#==============================================================#
SELINUX=disabled
SELINUXTYPE=targeted
#==============================================================#
配置主机名
#==============================================================#
kernel.hostname = dw01
centos6
#==============================================================#
配置时间同步
#==============================================================#
2022年 12月 20日 星期二 07:18:33 CST
no crontab for root
#==============================================================#
禁用透明大页 & 禁用NUMA & 开启 I/0 schedule
#==============================================================#
index=0
kernel=/vmlinuz-2.6.32-754.el6.x86_64
args="ro rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto LANG=zh_CN.UTF-8 rd_NO_LVM rd_NO_DM rhgb quiet numa=off transparent_hugepage=never elevator=deadline"
#==============================================================#
创建 DMDBA 用户以及安装目录
#==============================================================#
更改用户 dmdba 的密码 。
passwd: 所有的身份验证令牌已经成功更新。
dmdba:x:54321:54321::/home/dmdba:/bin/bash
uid=54321(dmdba) gid=54321(dinstall) 组=54321(dinstall),54322(dmdba)
#==============================================================#
配置系统参数
#==============================================================#
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
fs.aio-max-nr = 1048576
fs.file-max = 6815744
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
error: "vm.numa_stat" is an unknown key
vm.overcommit_memory = 0
#==============================================================#
配置用户限制
#==============================================================#
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
auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
auth include system-auth
account required pam_nologin.so
account include system-auth
password include system-auth
session required pam_selinux.so close
session required pam_loginuid.so
session optional pam_console.so
session required pam_selinux.so open
session required pam_namespace.so
session optional pam_keyinit.so force revoke
session include system-auth
-session optional pam_ck_connector.so
session required pam_limits.so
session required /lib64/security/pam_limits.so
#==============================================================#
配置语言中文
#==============================================================#
export LANG=zh_CN.UTF-8
#==============================================================#
配置用户环境变量
#==============================================================#
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
PATH=$PATH:$HOME/bin
export PATH
export MALLOC_ARENA_MAX=1
export DM_HOME=/opt/dmdbms
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DM_HOME/bin
export PATH=$PATH:$DM_HOME/bin:$DM_HOME/tool
export PS1="[`whoami`@`hostname`:"'\w]$ '
alias ds='disql SYSDBA/SYSDBA:5236 '
alias dsql='disql SYSDBA/SYSDBA:5236 \`'
alias dssql='disql -S SYSDBA/SYSDBA:5236 \`'
alias dmlog='cd $DM_HOME/log'
#==============================================================#
挂载达梦安装镜像
#==============================================================#
总用量 959M
-r-xr-xr-x. 1 root root 2.7M 11月 21 16:25 DM8 Install.pdf
-r-xr-xr-x. 1 root root 957M 11月 21 16:27 DMInstall.bin
#==============================================================#
安装达梦数据库软件
#==============================================================#
解压安装程序.........
2022-12-20 07:19:00
[INFO] 安装达梦数据库...
2022-12-20 07:19:00
[INFO] 安装 基础 模块...
2022-12-20 07:19:04
[INFO] 安装 服务器 模块...
2022-12-20 07:19:05
[INFO] 安装 客户端 模块...
2022-12-20 07:19:08
[INFO] 安装 驱动 模块...
2022-12-20 07:19:09
[INFO] 安装 手册 模块...
2022-12-20 07:19:10
[INFO] 安装 服务 模块...
2022-12-20 07:19:11
[INFO] 移动日志文件。
2022-12-20 07:19:11
[INFO] 更改安装目录权限完成。
2022-12-20 07:19:12
[INFO] 正在启动DmAPService服务...
2022-12-20 07:19:27
[INFO] 启动DmAPService服务成功。
2022-12-20 07:19:27
[INFO] 安装达梦数据库完成。
#==============================================================#
初始化达梦数据库
#==============================================================#
initdb V8
db version: 0x7000c
file dm.key not found, use default license!
License will expire on 2023-11-21
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
log file path: /dmdata/DAMENG/DAMENG01.log
log file path: /dmdata/DAMENG/DAMENG02.log
write to dir [/dmdata/DAMENG].
create dm database success. 2022-12-20 07:19:34
#==============================================================#
注册实例服务
#==============================================================#
移动服务脚本文件(/opt/dmdbms/bin/DmServiceDAMENG 到 /etc/rc.d/init.d/DmServiceDAMENG)
创建服务(DmServiceDAMENG)完成
#==============================================================#
启停数据库
#==============================================================#
后台启动数据库:
Starting DmServiceDAMENG: [ OK ]
DmServiceDAMENG (pid 5687) is running.
查询数据库基础参数信息:
密钥过期时间:2023-11-21
数据库参数项 数据库参数值
------------------------------- -----------------------------------
实例名 GRP1_DW_01
DM Database Server x64 V8 --03134283950-20221121-175072-20024
簇大小 32
页大小 32
大小写敏感 1
字符集 1
varchar是否以字符为单位 0
#==============================================================#
创建归档和备份脚本
#==============================================================#
创建数据库归档脚本:
-rw-r--r--. 1 dmdba dinstall 378 12月 20 07:20 /home/dmdba/scripts/conf_arch.sql
创建数据库备份脚本:
-rw-r--r--. 1 dmdba dinstall 780 12月 20 07:20 /home/dmdba/scripts/conf_fullbackup.sql
-rw-r--r--. 1 dmdba dinstall 1.5K 12月 20 07:20 /home/dmdba/scripts/conf_incrbackup.sql
创建 DMDBA 用户脚本,密码 SYSDBA :
-rw-r--r--. 1 dmdba dinstall 696 12月 20 07:20 /home/dmdba/scripts/ct_dbuser.sql
#==============================================================#
创建达梦数据库优化脚本
#==============================================================#
创建数据库参数配置脚本:
-rw-r--r--. 1 dmdba dinstall 14K 12月 20 07:20 /home/dmdba/scripts/conf_para.sql
创建数据库优化结果查询脚本:
-rw-r--r--. 1 dmdba dinstall 2.2K 12月 20 07:20 /home/dmdba/scripts/query_dm.sql
#==============================================================#
在 192.168.2.21 创建备份
#==============================================================#
密钥过期时间:2023-11-21
NAME DESCRIBE
-------- -------------------------------------------------------------------------------
bak_full 周六全量备份,并删除30天之前的备份。
bak_inc 周日到周五做增量备份,如果失败,清除8天前备份,做全量备份
NAME COMMAND
--------- ---------------------------------------------------------------------------------------------------------
bak_clear CALL SF_BAKSET_BACKUP_DIR_ADD('DISK','/dmbak/DAMENG'); CALL SP_DB_BAKSET_REMOVE_BATCH('DISK',SYSDATE-30);
#==============================================================#
优化数据库基础参数
#==============================================================#
密钥过期时间:2023-11-21
修改cpu相关参数:
SP_SET_PARA_VALUE(2,'WORKER_THREADS',1);
SP_SET_PARA_VALUE(2,'TASK_THREADS',4);
SP_SET_PARA_VALUE(2,'IO_THR_GROUPS',2);
修改内存池相关参数:
SP_SET_PARA_VALUE(2,'MAX_OS_MEMORY',80);
SP_SET_PARA_VALUE(2,'MEMORY_POOL',100);
SP_SET_PARA_VALUE(2,'MEMORY_N_POOLS',1);
SP_SET_PARA_VALUE(2,'MEMORY_TARGET',0);
修改缓冲区相关参数:
SP_SET_PARA_VALUE(2,'BUFFER',1000);
SP_SET_PARA_VALUE(2,'MAX_BUFFER',1000);
SP_SET_PARA_VALUE(2,'BUFFER_POOLS',3);
SP_SET_PARA_VALUE(2,'RECYCLE',80);
SP_SET_PARA_VALUE(2,'RECYCLE_POOLS',2);
修改fast_pool相关参数:
SP_SET_PARA_VALUE(2,'FAST_POOL_PAGES',3000);
SP_SET_PARA_VALUE(2,'FAST_ROLL_PAGES',1000);
修改内存检测参数为1:
SP_SET_PARA_VALUE(2,'MEMORY_MAGIC_CHECK',1);
非DSC环境将ENABLE_FREQROOTS设置为1,注意DM7 V$instance视图没有dsc_role字段,DM7这部分可以删掉:
SP_SET_PARA_VALUE(2,'ENABLE_FREQROOTS',1);
修改HASH相关参数:
SP_SET_PARA_VALUE(1,'HJ_BUF_GLOBAL_SIZE',500);
SP_SET_PARA_VALUE(1,'HJ_BUF_SIZE',50);
SP_SET_PARA_VALUE(1,'HAGR_BUF_GLOBAL_SIZE',500);
SP_SET_PARA_VALUE(1,'HAGR_BUF_SIZE',50);
修改排序相关参数:
SP_SET_PARA_VALUE(2,'SORT_FLAG',0);
SP_SET_PARA_VALUE(2,'SORT_BLK_SIZE',1);
SP_SET_PARA_VALUE(2,'SORT_BUF_SIZE',10);
SP_SET_PARA_VALUE(2,'SORT_BUF_GLOBAL_SIZE',500);
修改其他内存参数:
SP_SET_PARA_VALUE(2,'RLOG_POOL_SIZE',256);
SP_SET_PARA_VALUE(2,'CACHE_POOL_SIZE',200);
SP_SET_PARA_VALUE(2,'DICT_BUF_SIZE',50);
SP_SET_PARA_VALUE(2,'VM_POOL_TARGET',16384);
SP_SET_PARA_VALUE(2,'SESS_POOL_TARGET',16384);
修改实例相关参数:
SP_SET_PARA_VALUE(2,'USE_PLN_POOL',1);
SP_SET_PARA_VALUE(2,'ENABLE_MONITOR',1);
SP_SET_PARA_VALUE(2,'TEMP_SIZE',1024);
SP_SET_PARA_VALUE(2,'TEMP_SPACE_LIMIT',102400);
SP_SET_PARA_VALUE(2,'MAX_SESSIONS',1500);
SP_SET_PARA_VALUE(2,'MAX_SESSION_STATEMENT',20000);
SP_SET_PARA_VALUE(2,'PK_WITH_CLUSTER',0);
SP_SET_PARA_VALUE(2,'ENABLE_ENCRYPT',0);
修改优化器相关参数:
SP_SET_PARA_VALUE(2,'OLAP_FLAG',2);
SP_SET_PARA_VALUE(2,'VIEW_PULLUP_FLAG',1);
SP_SET_PARA_VALUE(2,'OPTIMIZER_MODE',1);
SP_SET_PARA_VALUE(2,'ADAPTIVE_NPLN_FLAG',0);
开启并行PURGE:
SP_SET_PARA_VALUE(2,'PARALLEL_PURGE_FLAG',1);
开启手动并行:
SP_SET_PARA_VALUE(2,'PARALLEL_POLICY',2);
UNDO_RETENTION如果放大,可以适当调大UNDO_EXTENT_NUM。负载高的时候,减少文件系统的申请/释放操作:
SP_SET_PARA_VALUE(2,'UNDO_EXTENT_NUM',16);
开启SQL 注入HINT功能:
SP_SET_PARA_VALUE(2,'ENABLE_INJECT_HINT',1);
开启数据异步追踪:
SP_SET_PARA_VALUE(1,'SVR_LOG',1);
开启操作系统认证:
sp_set_para_value(2,'ENABLE_LOCAL_OSAUTH',1);
重启数据库,优化参数生效
Stopping DmServiceDAMENG: [ OK ]
Starting DmServiceDAMENG: [ OK ]
#==============================================================#
创建DMDBA用户,密码:SYSDBA
#==============================================================#
密钥过期时间:2023-11-21
USERNAME
----------
SYSAUDITOR
SYSSSO
SYSDBA
DMDBA
SYS
#==============================================================#
查询数据库优化结果:
#==============================================================#
密钥过期时间:2023-11-21
PARA_NAME DEFAULT_VALUE PARA_VALUE
--------------------- ------------- ----------
MAX_OS_MEMORY 100 80
MAX_SESSION_STATEMENT 10000 20000
TRX_VIEW_MODE 1 1
MAX_SESSIONS 10000 1500
IO_THR_GROUPS 8 2
ADAPTIVE_NPLN_FLAG 3 0
OPTIMIZER_MODE 1 1
TOP_DIS_HASH_FLAG 1 1
TOP_ORDER_OPT_FLAG 0 0
VIEW_PULLUP_FLAG 0 1
USE_PLN_POOL 1 1
TASK_THREADS 16 4
WORKER_THREADS 16 1
SESS_POOL_TARGET 16384 16384
SESS_POOL_SIZE 64 64
VM_POOL_TARGET 16384 16384
DICT_BUF_SIZE 50 50
HAGR_BUF_SIZE 500 50
HAGR_BUF_GLOBAL_SIZE 5000 1000
HJ_BUF_SIZE 500 50
HJ_BUF_GLOBAL_SIZE 5000 1000
SORT_FLAG 0 0
SORT_BUF_GLOBAL_SIZE 1000 500
SORT_BLK_SIZE 1 1
SORT_BUF_SIZE 20 10
MAX_BUFFER 1000 1000
RECYCLE_POOLS 3 1
RECYCLE 300 80
BUFFER_POOLS 9 3
BUFFER 1000 1000
MEMORY_MAGIC_CHECK 1 1
MEMORY_TARGET 15000 0
MEMORY_N_POOLS 1 1
MEMORY_POOL 500 100
PK_WITH_CLUSTER 0 0
ENABLE_MONITOR 1 1
SVR_LOG 0 1
DATETIME_FMT_MODE 0 0
COMPATIBLE_MODE 0 0
CLOB_LIKE_MAX_LEN 10240 10240
ENABLE_ENCRYPT 0 0
REDOS_PARALLEL_NUM 1 1
RLOG_POOL_SIZE 256 256
CACHE_POOL_SIZE 100 200
TEMP_SPACE_LIMIT 0 102400
TEMP_SIZE 10 1024
OLAP_FLAG 2 2
#==============================================================#
数据守护主库脱机备份
#==============================================================#
正常关闭主数据库:
Stopping DmServiceDAMENG: [ OK ]
主库进行脱机 dmrman 备份:
dmrman V8
BACKUP DATABASE '/dmdata/DAMENG/dm.ini' FULL TO BACKUP_FILE1 BACKUPSET '/dmbak/BACKUP_FILE_01'
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[39191], file_lsn[39191]
Processing backupset /dmbak/BACKUP_FILE_01
[Percent:100.00%][Speed:0.00M/s][Cost:00:00:02][Remaining:00:00:00]
backup successfully!
time used: 00:00:03.227
主库查看脱机备份文件:
总用量 22604
drwxr-xr-x. 2 dmdba dinstall 4096 12月 20 07:20 .
drwxrwxr-x. 4 dmdba dinstall 4096 12月 20 07:20 ..
-rw-r--r--. 1 dmdba dinstall 23042048 12月 20 07:20 BACKUP_FILE_01.bak
-rw-r--r--. 1 dmdba dinstall 91648 12月 20 07:20 BACKUP_FILE_01.meta
#==============================================================#
配置节点:192.168.2.22
#==============================================================#
节点 192.168.2.22 开始执行配置:
███████ ████ ████ ████████ ██ ██ ██ ██ ██ ██ ██
░██░░░░██ ░██░██ ██░██ ██░░░░░░ ░██ ░██ ░██░██ ░██ ░██ ░██
░██ ░██░██░░██ ██ ░██░██ ░██ █████ ░██ ░██░██ ███████ ██████ ██████ ██████ ░██ ░██
░██ ░██░██ ░░███ ░██░█████████░██████ ██░░░██ ░██ ░██░██░░██░░░██ ██░░░░ ░░░██░ ░░░░░░██ ░██ ░██
░██ ░██░██ ░░█ ░██░░░░░░░░██░██░░░██░███████ ░██ ░██░██ ░██ ░██░░█████ ░██ ███████ ░██ ░██
░██ ██ ░██ ░ ░██ ░██░██ ░██░██░░░░ ░██ ░██░██ ░██ ░██ ░░░░░██ ░██ ██░░░░██ ░██ ░██
░███████ ░██ ░██ ████████ ░██ ░██░░██████ ███ ███░██ ███ ░██ ██████ ░░██ ░░████████ ███ ███
░░░░░░░ ░░ ░░ ░░░░░░░░ ░░ ░░ ░░░░░░ ░░░ ░░░ ░░ ░░░ ░░ ░░░░░░ ░░ ░░░░░░░░ ░░░ ░░░
达梦数据库开始安装:
#==============================================================#
打印系统信息
#==============================================================#
服务器时间:
2022年 12月 20日 星期二 07:23:22 CST
操作系统版本:
CentOS release 6.10 (Final)
cpu信息:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 1
On-line CPU(s) list: 0
Thread(s) per core: 1
Core(s) per socket: 1
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 142
Model name: Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
Stepping: 12
CPU MHz: 1992.001
BogoMIPS: 3984.00
Hypervisor vendor: VMware
Virtualization type: full
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 8192K
NUMA node0 CPU(s): 0
内存信息:
total used free shared buffers cached
Mem: 2870 1238 1632 0 9 1038
-/+ buffers/cache: 189 2680
Swap: 8191 0 8191
total used free shared buffers cached
Mem: 2.8G 1.2G 1.6G 260K 9.9M 1.0G
-/+ buffers/cache: 189M 2.6G
Swap: 8.0G 0B 8.0G
挂载信息:
UUID=cec08ef8-7698-4f29-85ed-18b15971b9dd / ext4 defaults 1 1
UUID=bbbb2b30-9dbc-4f48-a37c-fec3926d4423 /boot ext4 defaults 1 2
UUID=84e57345-d09b-44e5-8240-2becf00e7c15 swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/sr0 /mnt/cdrom iso9660 defaults 0 0
目录信息:
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 91G 2.3G 84G 3% /
tmpfs 1.5G 0 1.5G 0% /dev/shm
/dev/sda1 190M 39M 142M 22% /boot
/dev/sr0 3.8G 3.8G 0 100% /mnt/cdrom
.host:/ 200G 108G 93G 54% /mnt/hgfs
#==============================================================#
关闭 SWAP 功能
#==============================================================#
total used free shared buffers cached
Mem: 2939404 1261844 1677560 260 10132 1063796
-/+ buffers/cache: 187916 2751488
Swap: 0 0 0
#UUID=84e57345-d09b-44e5-8240-2becf00e7c15 swap swap defaults 0 0
#==============================================================#
禁用防火墙
#==============================================================#
iptables:将链设置为政策 ACCEPT:filter [确定]
iptables:清除防火墙规则: [确定]
iptables:正在卸载模块: [确定]
ip6tables:将 chains 设置为 ACCEPT 策略:filter [确定]
ip6tables:清除防火墙规则: [确定]
:正在卸载模块: [确定]
iptables:未运行防火墙。
#==============================================================#
禁用 selinux
#==============================================================#
SELINUX=disabled
SELINUXTYPE=targeted
#==============================================================#
配置主机名
#==============================================================#
kernel.hostname = dw02
centos6
#==============================================================#
配置时间同步
#==============================================================#
2022年 12月 20日 星期二 07:23:22 CST
no crontab for root
#==============================================================#
禁用透明大页 & 禁用NUMA & 开启 I/0 schedule
#==============================================================#
index=0
kernel=/vmlinuz-2.6.32-754.el6.x86_64
args="ro rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto LANG=zh_CN.UTF-8 rd_NO_LVM rd_NO_DM rhgb quiet numa=off transparent_hugepage=never elevator=deadline"
#==============================================================#
创建 DMDBA 用户以及安装目录
#==============================================================#
更改用户 dmdba 的密码 。
passwd: 所有的身份验证令牌已经成功更新。
dmdba:x:54321:54321::/home/dmdba:/bin/bash
uid=54321(dmdba) gid=54321(dinstall) 组=54321(dinstall),54322(dmdba)
#==============================================================#
配置系统参数
#==============================================================#
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
fs.aio-max-nr = 1048576
fs.file-max = 6815744
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
error: "vm.numa_stat" is an unknown key
vm.overcommit_memory = 0
#==============================================================#
配置用户限制
#==============================================================#
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
auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
auth include system-auth
account required pam_nologin.so
account include system-auth
password include system-auth
session required pam_selinux.so close
session required pam_loginuid.so
session optional pam_console.so
session required pam_selinux.so open
session required pam_namespace.so
session optional pam_keyinit.so force revoke
session include system-auth
-session optional pam_ck_connector.so
session required pam_limits.so
session required /lib64/security/pam_limits.so
#==============================================================#
配置语言中文
#==============================================================#
export LANG=zh_CN.UTF-8
#==============================================================#
配置用户环境变量
#==============================================================#
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
PATH=$PATH:$HOME/bin
export PATH
export MALLOC_ARENA_MAX=1
export DM_HOME=/opt/dmdbms
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DM_HOME/bin
export PATH=$PATH:$DM_HOME/bin:$DM_HOME/tool
export PS1="[`whoami`@`hostname`:"'\w]$ '
alias ds='disql SYSDBA/SYSDBA:5236 '
alias dsql='disql SYSDBA/SYSDBA:5236 \`'
alias dssql='disql -S SYSDBA/SYSDBA:5236 \`'
alias dmlog='cd $DM_HOME/log'
#==============================================================#
挂载达梦安装镜像
#==============================================================#
总用量 959M
-r-xr-xr-x. 1 root root 2.7M 11月 21 16:25 DM8 Install.pdf
-r-xr-xr-x. 1 root root 957M 11月 21 16:27 DMInstall.bin
#==============================================================#
安装达梦数据库软件
#==============================================================#
解压安装程序.........
2022-12-20 07:23:48
[INFO] 安装达梦数据库...
2022-12-20 07:23:48
[INFO] 安装 基础 模块...
2022-12-20 07:23:53
[INFO] 安装 服务器 模块...
2022-12-20 07:23:53
[INFO] 安装 客户端 模块...
2022-12-20 07:23:56
[INFO] 安装 驱动 模块...
2022-12-20 07:23:58
[INFO] 安装 手册 模块...
2022-12-20 07:23:58
[INFO] 安装 服务 模块...
2022-12-20 07:24:00
[INFO] 移动日志文件。
2022-12-20 07:24:00
[INFO] 更改安装目录权限完成。
2022-12-20 07:24:00
[INFO] 正在启动DmAPService服务...
2022-12-20 07:24:16
[INFO] 启动DmAPService服务成功。
2022-12-20 07:24:16
[INFO] 安装达梦数据库完成。
#==============================================================#
初始化达梦数据库
#==============================================================#
initdb V8
db version: 0x7000c
file dm.key not found, use default license!
License will expire on 2023-11-21
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
log file path: /dmdata/DAMENG/DAMENG01.log
log file path: /dmdata/DAMENG/DAMENG02.log
write to dir [/dmdata/DAMENG].
create dm database success. 2022-12-20 07:24:22
#==============================================================#
注册实例服务
#==============================================================#
移动服务脚本文件(/opt/dmdbms/bin/DmServiceDAMENG 到 /etc/rc.d/init.d/DmServiceDAMENG)
创建服务(DmServiceDAMENG)完成
#==============================================================#
启停数据库
#==============================================================#
后台启动数据库:
Starting DmServiceDAMENG: [ OK ]
DmServiceDAMENG (pid 5502) is running.
查询数据库基础参数信息:
密钥过期时间:2023-11-21
数据库参数项 数据库参数值
------------------------------- -----------------------------------
实例名 GRP1_DW_02
DM Database Server x64 V8 --03134283950-20221121-175072-20024
簇大小 32
页大小 32
大小写敏感 1
字符集 1
varchar是否以字符为单位 0
#==============================================================#
创建归档和备份脚本
#==============================================================#
创建数据库归档脚本:
-rw-r--r--. 1 dmdba dinstall 378 12月 20 07:24 /home/dmdba/scripts/conf_arch.sql
创建数据库备份脚本:
-rw-r--r--. 1 dmdba dinstall 780 12月 20 07:24 /home/dmdba/scripts/conf_fullbackup.sql
-rw-r--r--. 1 dmdba dinstall 1.5K 12月 20 07:24 /home/dmdba/scripts/conf_incrbackup.sql
创建 DMDBA 用户脚本,密码 SYSDBA :
-rw-r--r--. 1 dmdba dinstall 696 12月 20 07:24 /home/dmdba/scripts/ct_dbuser.sql
#==============================================================#
创建达梦数据库优化脚本
#==============================================================#
创建数据库参数配置脚本:
-rw-r--r--. 1 dmdba dinstall 14K 12月 20 07:24 /home/dmdba/scripts/conf_para.sql
创建数据库优化结果查询脚本:
-rw-r--r--. 1 dmdba dinstall 2.2K 12月 20 07:24 /home/dmdba/scripts/query_dm.sql
#==============================================================#
优化数据库基础参数
#==============================================================#
密钥过期时间:2023-11-21
修改cpu相关参数:
SP_SET_PARA_VALUE(2,'WORKER_THREADS',1);
SP_SET_PARA_VALUE(2,'TASK_THREADS',4);
SP_SET_PARA_VALUE(2,'IO_THR_GROUPS',2);
修改内存池相关参数:
SP_SET_PARA_VALUE(2,'MAX_OS_MEMORY',80);
SP_SET_PARA_VALUE(2,'MEMORY_POOL',100);
SP_SET_PARA_VALUE(2,'MEMORY_N_POOLS',1);
SP_SET_PARA_VALUE(2,'MEMORY_TARGET',0);
修改缓冲区相关参数:
SP_SET_PARA_VALUE(2,'BUFFER',1000);
SP_SET_PARA_VALUE(2,'MAX_BUFFER',1000);
SP_SET_PARA_VALUE(2,'BUFFER_POOLS',3);
SP_SET_PARA_VALUE(2,'RECYCLE',80);
SP_SET_PARA_VALUE(2,'RECYCLE_POOLS',2);
修改fast_pool相关参数:
SP_SET_PARA_VALUE(2,'FAST_POOL_PAGES',3000);
SP_SET_PARA_VALUE(2,'FAST_ROLL_PAGES',1000);
修改内存检测参数为1:
SP_SET_PARA_VALUE(2,'MEMORY_MAGIC_CHECK',1);
非DSC环境将ENABLE_FREQROOTS设置为1,注意DM7 V$instance视图没有dsc_role字段,DM7这部分可以删掉:
SP_SET_PARA_VALUE(2,'ENABLE_FREQROOTS',1);
修改HASH相关参数:
SP_SET_PARA_VALUE(1,'HJ_BUF_GLOBAL_SIZE',500);
SP_SET_PARA_VALUE(1,'HJ_BUF_SIZE',50);
SP_SET_PARA_VALUE(1,'HAGR_BUF_GLOBAL_SIZE',500);
SP_SET_PARA_VALUE(1,'HAGR_BUF_SIZE',50);
修改排序相关参数:
SP_SET_PARA_VALUE(2,'SORT_FLAG',0);
SP_SET_PARA_VALUE(2,'SORT_BLK_SIZE',1);
SP_SET_PARA_VALUE(2,'SORT_BUF_SIZE',10);
SP_SET_PARA_VALUE(2,'SORT_BUF_GLOBAL_SIZE',500);
修改其他内存参数:
SP_SET_PARA_VALUE(2,'RLOG_POOL_SIZE',256);
SP_SET_PARA_VALUE(2,'CACHE_POOL_SIZE',200);
SP_SET_PARA_VALUE(2,'DICT_BUF_SIZE',50);
SP_SET_PARA_VALUE(2,'VM_POOL_TARGET',16384);
SP_SET_PARA_VALUE(2,'SESS_POOL_TARGET',16384);
修改实例相关参数:
SP_SET_PARA_VALUE(2,'USE_PLN_POOL',1);
SP_SET_PARA_VALUE(2,'ENABLE_MONITOR',1);
SP_SET_PARA_VALUE(2,'TEMP_SIZE',1024);
SP_SET_PARA_VALUE(2,'TEMP_SPACE_LIMIT',102400);
SP_SET_PARA_VALUE(2,'MAX_SESSIONS',1500);
SP_SET_PARA_VALUE(2,'MAX_SESSION_STATEMENT',20000);
SP_SET_PARA_VALUE(2,'PK_WITH_CLUSTER',0);
SP_SET_PARA_VALUE(2,'ENABLE_ENCRYPT',0);
修改优化器相关参数:
SP_SET_PARA_VALUE(2,'OLAP_FLAG',2);
SP_SET_PARA_VALUE(2,'VIEW_PULLUP_FLAG',1);
SP_SET_PARA_VALUE(2,'OPTIMIZER_MODE',1);
SP_SET_PARA_VALUE(2,'ADAPTIVE_NPLN_FLAG',0);
开启并行PURGE:
SP_SET_PARA_VALUE(2,'PARALLEL_PURGE_FLAG',1);
开启手动并行:
SP_SET_PARA_VALUE(2,'PARALLEL_POLICY',2);
UNDO_RETENTION如果放大,可以适当调大UNDO_EXTENT_NUM。负载高的时候,减少文件系统的申请/释放操作:
SP_SET_PARA_VALUE(2,'UNDO_EXTENT_NUM',16);
开启SQL 注入HINT功能:
SP_SET_PARA_VALUE(2,'ENABLE_INJECT_HINT',1);
开启数据异步追踪:
SP_SET_PARA_VALUE(1,'SVR_LOG',1);
开启操作系统认证:
sp_set_para_value(2,'ENABLE_LOCAL_OSAUTH',1);
重启数据库,优化参数生效
Stopping DmServiceDAMENG: [ OK ]
Starting DmServiceDAMENG: [ OK ]
#==============================================================#
查询数据库优化结果:
#==============================================================#
密钥过期时间:2023-11-21
PARA_NAME DEFAULT_VALUE PARA_VALUE
--------------------- ------------- ----------
MAX_OS_MEMORY 100 80
MAX_SESSION_STATEMENT 10000 20000
TRX_VIEW_MODE 1 1
MAX_SESSIONS 10000 1500
IO_THR_GROUPS 8 2
ADAPTIVE_NPLN_FLAG 3 0
OPTIMIZER_MODE 1 1
TOP_DIS_HASH_FLAG 1 1
TOP_ORDER_OPT_FLAG 0 0
VIEW_PULLUP_FLAG 0 1
USE_PLN_POOL 1 1
TASK_THREADS 16 4
WORKER_THREADS 16 1
SESS_POOL_TARGET 16384 16384
SESS_POOL_SIZE 64 64
VM_POOL_TARGET 16384 16384
DICT_BUF_SIZE 50 50
HAGR_BUF_SIZE 500 50
HAGR_BUF_GLOBAL_SIZE 5000 1000
HJ_BUF_SIZE 500 50
HJ_BUF_GLOBAL_SIZE 5000 1000
SORT_FLAG 0 0
SORT_BUF_GLOBAL_SIZE 1000 500
SORT_BLK_SIZE 1 1
SORT_BUF_SIZE 20 10
MAX_BUFFER 1000 1000
RECYCLE_POOLS 3 1
RECYCLE 300 80
BUFFER_POOLS 9 3
BUFFER 1000 1000
MEMORY_MAGIC_CHECK 1 1
MEMORY_TARGET 15000 0
MEMORY_N_POOLS 1 1
MEMORY_POOL 500 100
PK_WITH_CLUSTER 0 0
ENABLE_MONITOR 1 1
SVR_LOG 0 1
DATETIME_FMT_MODE 0 0
COMPATIBLE_MODE 0 0
CLOB_LIKE_MAX_LEN 10240 10240
ENABLE_ENCRYPT 0 0
REDOS_PARALLEL_NUM 1 1
RLOG_POOL_SIZE 256 256
CACHE_POOL_SIZE 100 200
TEMP_SPACE_LIMIT 0 102400
TEMP_SIZE 10 1024
OLAP_FLAG 2 2
#==============================================================#
数据守护备库脱机恢复
#==============================================================#
正常关闭备数据库:
Stopping DmServiceDAMENG: [ OK ]
拷贝主库的备份文件并授权:
BACKUP_FILE_01.meta 100% 90KB 89.5KB/s 00:00
BACKUP_FILE_01.bak 100% 22MB 22.0MB/s 00:01
备库执行脱机数据库 dmrman 还原:
dmrman V8
RESTORE DATABASE '/dmdata/DAMENG/dm.ini' FROM BACKUPSET '/dmbak/BACKUP_FILE_01'
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:02][Remaining:00:00:00]
restore successfully.
time used: 00:00:02.646
备库执行 dmrman 数据库更新:
dmrman V8
RECOVER DATABASE '/dmdata/DAMENG/dm.ini' UPDATE DB_MAGIC
file dm.key not found, use default license!
Database mode = 2, oguid = 0
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
EP[0]'s cur_lsn[39191], file_lsn[39191]
recover successfully!
time used: 00:00:01.008
#==============================================================#
数据守护主备配置参数文件
#==============================================================#
备库配置 dm.ini 参数:
ALTER_MODE_STATUS = 1 #Whether to permit database user to alter database mode and status by SQLs, 1: yes, 0: no
ENABLE_OFFLINE_TS = 2 #Whether tablespace can be offline
MAL_INI = 1 #dmmal.ini
ARCH_INI = 1 #dmarch.ini
备库配置 dmmal.ini 参数:
MAL_CHECK_INTERVAL = 5
MAL_CONN_FAIL_INTERVAL = 5
[MAL_INST1]
MAL_INST_NAME = GRP1_DW_01
MAL_HOST = 172.16.2.21
MAL_PORT = 12345
MAL_INST_HOST = 192.168.2.21
MAL_INST_PORT = 5236
MAL_DW_PORT = 12346
MAL_INST_DW_PORT = 12347
[MAL_INST2]
MAL_INST_NAME = GRP1_DW_02
MAL_HOST = 172.16.2.22
MAL_PORT = 12345
MAL_INST_HOST = 192.168.2.22
MAL_INST_PORT = 5236
MAL_DW_PORT = 12346
MAL_INST_DW_PORT = 12347
[MAL_INST3]
MAL_INST_NAME = GRP1_DW_03
MAL_HOST = 172.16.2.23
MAL_PORT = 12345
MAL_INST_HOST = 192.168.2.23
MAL_INST_PORT = 5236
MAL_DW_PORT = 12346
MAL_INST_DW_PORT = 12347
备库配置 dmarch.ini 参数:
ARCH_WAIT_APPLY = 1
[ARCHIVE_LOCAL1]
ARCH_TYPE = LOCAL
ARCH_DEST = /dmarch/DAMENG
ARCH_FILE_SIZE = 1024
ARCH_SPACE_LIMIT = 102400
[ARCHIVE_REALTIME1]
ARCH_TYPE = REALTIME
ARCH_DEST = GRP1_DW_01
[ARCHIVE_REALTIME2]
ARCH_TYPE = REALTIME
ARCH_DEST = GRP1_DW_03
备库配置 dmwatcher.ini 参数:
[GRP1]
DW_TYPE = GLOBAL
DW_MODE = MANUAL
DW_ERROR_TIME = 10
INST_ERROR_TIME = 10
INST_OGUID = 496433
INST_INI = /dmdata/DAMENG/dm.ini
INST_AUTO_RESTART = 1
INST_STARTUP_CMD = /opt/dmdbms/bin/DmServiceDAMENG start
备库配置 dmmonitor.ini 参数:
MON_DW_CONFIRM = 0
MON_LOG_PATH = /opt/dmdbms/log
MON_LOG_INTERVAL = 60
MON_LOG_FILE_SIZE = 32
MON_LOG_SPACE_LIMIT = 2048
[GRP1]
MON_INST_OGUID = 496433
MON_DW_IP = 172.16.2.21:12346
MON_DW_IP = 172.16.2.22:12346
MON_DW_IP = 172.16.2.23:12346
备库注册 dmwatcher 服务:
移动服务脚本文件(/opt/dmdbms/bin/DmWatcherServiceGRP1 到 /etc/rc.d/init.d/DmWatcherServiceGRP1)
创建服务(DmWatcherServiceGRP1)完成
备库启动到 mount 状态:
Starting DmServiceDAMENG: [ OK ]
备库修改模式:
密钥过期时间:2023-11-21
备库启动守护进程:
Starting DmWatcherServiceGRP1: [ OK ]
Connection to 192.168.2.22 closed.
节点 192.168.2.22 配置完成!
#==============================================================#
配置节点:192.168.2.23
#==============================================================#
节点 192.168.2.23 开始执行配置:
███████ ████ ████ ████████ ██ ██ ██ ██ ██ ██ ██
░██░░░░██ ░██░██ ██░██ ██░░░░░░ ░██ ░██ ░██░██ ░██ ░██ ░██
░██ ░██░██░░██ ██ ░██░██ ░██ █████ ░██ ░██░██ ███████ ██████ ██████ ██████ ░██ ░██
░██ ░██░██ ░░███ ░██░█████████░██████ ██░░░██ ░██ ░██░██░░██░░░██ ██░░░░ ░░░██░ ░░░░░░██ ░██ ░██
░██ ░██░██ ░░█ ░██░░░░░░░░██░██░░░██░███████ ░██ ░██░██ ░██ ░██░░█████ ░██ ███████ ░██ ░██
░██ ██ ░██ ░ ░██ ░██░██ ░██░██░░░░ ░██ ░██░██ ░██ ░██ ░░░░░██ ░██ ██░░░░██ ░██ ░██
░███████ ░██ ░██ ████████ ░██ ░██░░██████ ███ ███░██ ███ ░██ ██████ ░░██ ░░████████ ███ ███
░░░░░░░ ░░ ░░ ░░░░░░░░ ░░ ░░ ░░░░░░ ░░░ ░░░ ░░ ░░░ ░░ ░░░░░░ ░░ ░░░░░░░░ ░░░ ░░░
达梦数据库开始安装:
#==============================================================#
打印系统信息
#==============================================================#
服务器时间:
2022年 12月 20日 星期二 07:26:17 CST
操作系统版本:
CentOS release 6.10 (Final)
cpu信息:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 1
On-line CPU(s) list: 0
Thread(s) per core: 1
Core(s) per socket: 1
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 142
Model name: Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
Stepping: 12
CPU MHz: 1992.001
BogoMIPS: 3984.00
Hypervisor vendor: VMware
Virtualization type: full
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 8192K
NUMA node0 CPU(s): 0
内存信息:
total used free shared buffers cached
Mem: 2870 1238 1632 0 9 1038
-/+ buffers/cache: 189 2681
Swap: 8191 0 8191
total used free shared buffers cached
Mem: 2.8G 1.2G 1.6G 260K 9.9M 1.0G
-/+ buffers/cache: 189M 2.6G
Swap: 8.0G 0B 8.0G
挂载信息:
UUID=cec08ef8-7698-4f29-85ed-18b15971b9dd / ext4 defaults 1 1
UUID=bbbb2b30-9dbc-4f48-a37c-fec3926d4423 /boot ext4 defaults 1 2
UUID=84e57345-d09b-44e5-8240-2becf00e7c15 swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/sr0 /mnt/cdrom iso9660 defaults 0 0
目录信息:
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 91G 2.3G 84G 3% /
tmpfs 1.5G 0 1.5G 0% /dev/shm
/dev/sda1 190M 39M 142M 22% /boot
/dev/sr0 3.8G 3.8G 0 100% /mnt/cdrom
.host:/ 200G 108G 93G 54% /mnt/hgfs
#==============================================================#
关闭 SWAP 功能
#==============================================================#
total used free shared buffers cached
Mem: 2939404 1261512 1677892 260 10164 1063792
-/+ buffers/cache: 187556 2751848
Swap: 0 0 0
#UUID=84e57345-d09b-44e5-8240-2becf00e7c15 swap swap defaults 0 0
#==============================================================#
禁用防火墙
#==============================================================#
iptables:将链设置为政策 ACCEPT:filter [确定]
iptables:清除防火墙规则: [确定]
iptables:正在卸载模块: [确定]
ip6tables:将 chains 设置为 ACCEPT 策略:filter [确定]
ip6tables:清除防火墙规则: [确定]
:正在卸载模块: [确定]
iptables:未运行防火墙。
#==============================================================#
禁用 selinux
#==============================================================#
SELINUX=disabled
SELINUXTYPE=targeted
#==============================================================#
配置主机名
#==============================================================#
kernel.hostname = dw03
centos6
#==============================================================#
配置时间同步
#==============================================================#
2022年 12月 20日 星期二 07:26:17 CST
no crontab for root
#==============================================================#
禁用透明大页 & 禁用NUMA & 开启 I/0 schedule
#==============================================================#
index=0
kernel=/vmlinuz-2.6.32-754.el6.x86_64
args="ro rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto LANG=zh_CN.UTF-8 rd_NO_LVM rd_NO_DM rhgb quiet numa=off transparent_hugepage=never elevator=deadline"
#==============================================================#
创建 DMDBA 用户以及安装目录
#==============================================================#
更改用户 dmdba 的密码 。
passwd: 所有的身份验证令牌已经成功更新。
dmdba:x:54321:54321::/home/dmdba:/bin/bash
uid=54321(dmdba) gid=54321(dinstall) 组=54321(dinstall),54322(dmdba)
#==============================================================#
配置系统参数
#==============================================================#
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
fs.aio-max-nr = 1048576
fs.file-max = 6815744
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
error: "vm.numa_stat" is an unknown key
vm.overcommit_memory = 0
#==============================================================#
配置用户限制
#==============================================================#
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
auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
auth include system-auth
account required pam_nologin.so
account include system-auth
password include system-auth
session required pam_selinux.so close
session required pam_loginuid.so
session optional pam_console.so
session required pam_selinux.so open
session required pam_namespace.so
session optional pam_keyinit.so force revoke
session include system-auth
-session optional pam_ck_connector.so
session required pam_limits.so
session required /lib64/security/pam_limits.so
#==============================================================#
配置语言中文
#==============================================================#
export LANG=zh_CN.UTF-8
#==============================================================#
配置用户环境变量
#==============================================================#
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
PATH=$PATH:$HOME/bin
export PATH
export MALLOC_ARENA_MAX=1
export DM_HOME=/opt/dmdbms
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DM_HOME/bin
export PATH=$PATH:$DM_HOME/bin:$DM_HOME/tool
export PS1="[`whoami`@`hostname`:"'\w]$ '
alias ds='disql SYSDBA/SYSDBA:5236 '
alias dsql='disql SYSDBA/SYSDBA:5236 \`'
alias dssql='disql -S SYSDBA/SYSDBA:5236 \`'
alias dmlog='cd $DM_HOME/log'
#==============================================================#
挂载达梦安装镜像
#==============================================================#
总用量 959M
-r-xr-xr-x. 1 root root 2.7M 11月 21 16:25 DM8 Install.pdf
-r-xr-xr-x. 1 root root 957M 11月 21 16:27 DMInstall.bin
#==============================================================#
安装达梦数据库软件
#==============================================================#
解压安装程序.........
2022-12-20 07:26:43
[INFO] 安装达梦数据库...
2022-12-20 07:26:44
[INFO] 安装 基础 模块...
2022-12-20 07:26:48
[INFO] 安装 服务器 模块...
2022-12-20 07:26:48
[INFO] 安装 客户端 模块...
2022-12-20 07:26:52
[INFO] 安装 驱动 模块...
2022-12-20 07:26:54
[INFO] 安装 手册 模块...
2022-12-20 07:26:54
[INFO] 安装 服务 模块...
2022-12-20 07:26:56
[INFO] 移动日志文件。
2022-12-20 07:26:56
[INFO] 更改安装目录权限完成。
2022-12-20 07:26:56
[INFO] 正在启动DmAPService服务...
2022-12-20 07:27:12
[INFO] 启动DmAPService服务成功。
2022-12-20 07:27:12
[INFO] 安装达梦数据库完成。
#==============================================================#
初始化达梦数据库
#==============================================================#
initdb V8
db version: 0x7000c
file dm.key not found, use default license!
License will expire on 2023-11-21
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
log file path: /dmdata/DAMENG/DAMENG01.log
log file path: /dmdata/DAMENG/DAMENG02.log
write to dir [/dmdata/DAMENG].
create dm database success. 2022-12-20 07:27:17
#==============================================================#
注册实例服务
#==============================================================#
移动服务脚本文件(/opt/dmdbms/bin/DmServiceDAMENG 到 /etc/rc.d/init.d/DmServiceDAMENG)
创建服务(DmServiceDAMENG)完成
#==============================================================#
启停数据库
#==============================================================#
后台启动数据库:
Starting DmServiceDAMENG: [ OK ]
DmServiceDAMENG (pid 5500) is running.
查询数据库基础参数信息:
密钥过期时间:2023-11-21
数据库参数项 数据库参数值
------------------------------- -----------------------------------
实例名 GRP1_DW_03
DM Database Server x64 V8 --03134283950-20221121-175072-20024
簇大小 32
页大小 32
大小写敏感 1
字符集 1
varchar是否以字符为单位 0
#==============================================================#
创建归档和备份脚本
#==============================================================#
创建数据库归档脚本:
-rw-r--r--. 1 dmdba dinstall 378 12月 20 07:27 /home/dmdba/scripts/conf_arch.sql
创建数据库备份脚本:
-rw-r--r--. 1 dmdba dinstall 780 12月 20 07:27 /home/dmdba/scripts/conf_fullbackup.sql
-rw-r--r--. 1 dmdba dinstall 1.5K 12月 20 07:27 /home/dmdba/scripts/conf_incrbackup.sql
创建 DMDBA 用户脚本,密码 SYSDBA :
-rw-r--r--. 1 dmdba dinstall 696 12月 20 07:27 /home/dmdba/scripts/ct_dbuser.sql
#==============================================================#
创建达梦数据库优化脚本
#==============================================================#
创建数据库参数配置脚本:
-rw-r--r--. 1 dmdba dinstall 14K 12月 20 07:27 /home/dmdba/scripts/conf_para.sql
创建数据库优化结果查询脚本:
-rw-r--r--. 1 dmdba dinstall 2.2K 12月 20 07:27 /home/dmdba/scripts/query_dm.sql
#==============================================================#
优化数据库基础参数
#==============================================================#
密钥过期时间:2023-11-21
修改cpu相关参数:
SP_SET_PARA_VALUE(2,'WORKER_THREADS',1);
SP_SET_PARA_VALUE(2,'TASK_THREADS',4);
SP_SET_PARA_VALUE(2,'IO_THR_GROUPS',2);
修改内存池相关参数:
SP_SET_PARA_VALUE(2,'MAX_OS_MEMORY',80);
SP_SET_PARA_VALUE(2,'MEMORY_POOL',100);
SP_SET_PARA_VALUE(2,'MEMORY_N_POOLS',1);
SP_SET_PARA_VALUE(2,'MEMORY_TARGET',0);
修改缓冲区相关参数:
SP_SET_PARA_VALUE(2,'BUFFER',1000);
SP_SET_PARA_VALUE(2,'MAX_BUFFER',1000);
SP_SET_PARA_VALUE(2,'BUFFER_POOLS',3);
SP_SET_PARA_VALUE(2,'RECYCLE',80);
SP_SET_PARA_VALUE(2,'RECYCLE_POOLS',2);
修改fast_pool相关参数:
SP_SET_PARA_VALUE(2,'FAST_POOL_PAGES',3000);
SP_SET_PARA_VALUE(2,'FAST_ROLL_PAGES',1000);
修改内存检测参数为1:
SP_SET_PARA_VALUE(2,'MEMORY_MAGIC_CHECK',1);
非DSC环境将ENABLE_FREQROOTS设置为1,注意DM7 V$instance视图没有dsc_role字段,DM7这部分可以删掉:
SP_SET_PARA_VALUE(2,'ENABLE_FREQROOTS',1);
修改HASH相关参数:
SP_SET_PARA_VALUE(1,'HJ_BUF_GLOBAL_SIZE',500);
SP_SET_PARA_VALUE(1,'HJ_BUF_SIZE',50);
SP_SET_PARA_VALUE(1,'HAGR_BUF_GLOBAL_SIZE',500);
SP_SET_PARA_VALUE(1,'HAGR_BUF_SIZE',50);
修改排序相关参数:
SP_SET_PARA_VALUE(2,'SORT_FLAG',0);
SP_SET_PARA_VALUE(2,'SORT_BLK_SIZE',1);
SP_SET_PARA_VALUE(2,'SORT_BUF_SIZE',10);
SP_SET_PARA_VALUE(2,'SORT_BUF_GLOBAL_SIZE',500);
修改其他内存参数:
SP_SET_PARA_VALUE(2,'RLOG_POOL_SIZE',256);
SP_SET_PARA_VALUE(2,'CACHE_POOL_SIZE',200);
SP_SET_PARA_VALUE(2,'DICT_BUF_SIZE',50);
SP_SET_PARA_VALUE(2,'VM_POOL_TARGET',16384);
SP_SET_PARA_VALUE(2,'SESS_POOL_TARGET',16384);
修改实例相关参数:
SP_SET_PARA_VALUE(2,'USE_PLN_POOL',1);
SP_SET_PARA_VALUE(2,'ENABLE_MONITOR',1);
SP_SET_PARA_VALUE(2,'TEMP_SIZE',1024);
SP_SET_PARA_VALUE(2,'TEMP_SPACE_LIMIT',102400);
SP_SET_PARA_VALUE(2,'MAX_SESSIONS',1500);
SP_SET_PARA_VALUE(2,'MAX_SESSION_STATEMENT',20000);
SP_SET_PARA_VALUE(2,'PK_WITH_CLUSTER',0);
SP_SET_PARA_VALUE(2,'ENABLE_ENCRYPT',0);
修改优化器相关参数:
SP_SET_PARA_VALUE(2,'OLAP_FLAG',2);
SP_SET_PARA_VALUE(2,'VIEW_PULLUP_FLAG',1);
SP_SET_PARA_VALUE(2,'OPTIMIZER_MODE',1);
SP_SET_PARA_VALUE(2,'ADAPTIVE_NPLN_FLAG',0);
开启并行PURGE:
SP_SET_PARA_VALUE(2,'PARALLEL_PURGE_FLAG',1);
开启手动并行:
SP_SET_PARA_VALUE(2,'PARALLEL_POLICY',2);
UNDO_RETENTION如果放大,可以适当调大UNDO_EXTENT_NUM。负载高的时候,减少文件系统的申请/释放操作:
SP_SET_PARA_VALUE(2,'UNDO_EXTENT_NUM',16);
开启SQL 注入HINT功能:
SP_SET_PARA_VALUE(2,'ENABLE_INJECT_HINT',1);
开启数据异步追踪:
SP_SET_PARA_VALUE(1,'SVR_LOG',1);
开启操作系统认证:
sp_set_para_value(2,'ENABLE_LOCAL_OSAUTH',1);
重启数据库,优化参数生效
Stopping DmServiceDAMENG: [ OK ]
Starting DmServiceDAMENG: [ OK ]
#==============================================================#
查询数据库优化结果:
#==============================================================#
密钥过期时间:2023-11-21
PARA_NAME DEFAULT_VALUE PARA_VALUE
--------------------- ------------- ----------
MAX_OS_MEMORY 100 80
MAX_SESSION_STATEMENT 10000 20000
TRX_VIEW_MODE 1 1
MAX_SESSIONS 10000 1500
IO_THR_GROUPS 8 2
ADAPTIVE_NPLN_FLAG 3 0
OPTIMIZER_MODE 1 1
TOP_DIS_HASH_FLAG 1 1
TOP_ORDER_OPT_FLAG 0 0
VIEW_PULLUP_FLAG 0 1
USE_PLN_POOL 1 1
TASK_THREADS 16 4
WORKER_THREADS 16 1
SESS_POOL_TARGET 16384 16384
SESS_POOL_SIZE 64 64
VM_POOL_TARGET 16384 16384
DICT_BUF_SIZE 50 50
HAGR_BUF_SIZE 500 50
HAGR_BUF_GLOBAL_SIZE 5000 1000
HJ_BUF_SIZE 500 50
HJ_BUF_GLOBAL_SIZE 5000 1000
SORT_FLAG 0 0
SORT_BUF_GLOBAL_SIZE 1000 500
SORT_BLK_SIZE 1 1
SORT_BUF_SIZE 20 10
MAX_BUFFER 1000 1000
RECYCLE_POOLS 3 1
RECYCLE 300 80
BUFFER_POOLS 9 3
BUFFER 1000 1000
MEMORY_MAGIC_CHECK 1 1
MEMORY_TARGET 15000 0
MEMORY_N_POOLS 1 1
MEMORY_POOL 500 100
PK_WITH_CLUSTER 0 0
ENABLE_MONITOR 1 1
SVR_LOG 0 1
DATETIME_FMT_MODE 0 0
COMPATIBLE_MODE 0 0
CLOB_LIKE_MAX_LEN 10240 10240
ENABLE_ENCRYPT 0 0
REDOS_PARALLEL_NUM 1 1
RLOG_POOL_SIZE 256 256
CACHE_POOL_SIZE 100 200
TEMP_SPACE_LIMIT 0 102400
TEMP_SIZE 10 1024
OLAP_FLAG 2 2
#==============================================================#
数据守护备库脱机恢复
#==============================================================#
正常关闭备数据库:
Stopping DmServiceDAMENG: [ OK ]
拷贝主库的备份文件并授权:
BACKUP_FILE_01.meta 100% 90KB 89.5KB/s 00:00
BACKUP_FILE_01.bak 100% 22MB 22.0MB/s 00:01
备库执行脱机数据库 dmrman 还原:
dmrman V8
RESTORE DATABASE '/dmdata/DAMENG/dm.ini' FROM BACKUPSET '/dmbak/BACKUP_FILE_01'
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:02][Remaining:00:00:00]
restore successfully.
time used: 00:00:02.632
备库执行 dmrman 数据库更新:
dmrman V8
RECOVER DATABASE '/dmdata/DAMENG/dm.ini' UPDATE DB_MAGIC
file dm.key not found, use default license!
Database mode = 2, oguid = 0
Normal of FAST
Normal of DEFAULT
Normal of RECYCLE
Normal of KEEP
Normal of ROLL
EP[0]'s cur_lsn[39191], file_lsn[39191]
recover successfully!
time used: 00:00:01.007
#==============================================================#
数据守护主备配置参数文件
#==============================================================#
备库配置 dm.ini 参数:
ALTER_MODE_STATUS = 1 #Whether to permit database user to alter database mode and status by SQLs, 1: yes, 0: no
ENABLE_OFFLINE_TS = 2 #Whether tablespace can be offline
MAL_INI = 1 #dmmal.ini
ARCH_INI = 1 #dmarch.ini
备库配置 dmmal.ini 参数:
MAL_CHECK_INTERVAL = 5
MAL_CONN_FAIL_INTERVAL = 5
[MAL_INST1]
MAL_INST_NAME = GRP1_DW_01
MAL_HOST = 172.16.2.21
MAL_PORT = 12345
MAL_INST_HOST = 192.168.2.21
MAL_INST_PORT = 5236
MAL_DW_PORT = 12346
MAL_INST_DW_PORT = 12347
[MAL_INST2]
MAL_INST_NAME = GRP1_DW_02
MAL_HOST = 172.16.2.22
MAL_PORT = 12345
MAL_INST_HOST = 192.168.2.22
MAL_INST_PORT = 5236
MAL_DW_PORT = 12346
MAL_INST_DW_PORT = 12347
[MAL_INST3]
MAL_INST_NAME = GRP1_DW_03
MAL_HOST = 172.16.2.23
MAL_PORT = 12345
MAL_INST_HOST = 192.168.2.23
MAL_INST_PORT = 5236
MAL_DW_PORT = 12346
MAL_INST_DW_PORT = 12347
备库配置 dmarch.ini 参数:
ARCH_WAIT_APPLY = 1
[ARCHIVE_LOCAL1]
ARCH_TYPE = LOCAL
ARCH_DEST = /dmarch/DAMENG
ARCH_FILE_SIZE = 1024
ARCH_SPACE_LIMIT = 102400
[ARCHIVE_REALTIME1]
ARCH_TYPE = REALTIME
ARCH_DEST = GRP1_DW_01
[ARCHIVE_REALTIME2]
ARCH_TYPE = REALTIME
ARCH_DEST = GRP1_DW_02
备库配置 dmwatcher.ini 参数:
[GRP1]
DW_TYPE = GLOBAL
DW_MODE = MANUAL
DW_ERROR_TIME = 10
INST_ERROR_TIME = 10
INST_OGUID = 496433
INST_INI = /dmdata/DAMENG/dm.ini
INST_AUTO_RESTART = 1
INST_STARTUP_CMD = /opt/dmdbms/bin/DmServiceDAMENG start
备库配置 dmmonitor.ini 参数:
MON_DW_CONFIRM = 0
MON_LOG_PATH = /opt/dmdbms/log
MON_LOG_INTERVAL = 60
MON_LOG_FILE_SIZE = 32
MON_LOG_SPACE_LIMIT = 2048
[GRP1]
MON_INST_OGUID = 496433
MON_DW_IP = 172.16.2.21:12346
MON_DW_IP = 172.16.2.22:12346
MON_DW_IP = 172.16.2.23:12346
备库注册 dmwatcher 服务:
移动服务脚本文件(/opt/dmdbms/bin/DmWatcherServiceGRP1 到 /etc/rc.d/init.d/DmWatcherServiceGRP1)
创建服务(DmWatcherServiceGRP1)完成
备库启动到 mount 状态:
Starting DmServiceDAMENG: [ OK ]
备库修改模式:
密钥过期时间:2023-11-21
备库启动守护进程:
Starting DmWatcherServiceGRP1: [ OK ]
Connection to 192.168.2.23 closed.
节点 192.168.2.23 配置完成!
#==============================================================#
数据守护主备配置参数文件
#==============================================================#
主库配置 dm.ini 参数:
ALTER_MODE_STATUS = 1 #Whether to permit database user to alter database mode and status by SQLs, 1: yes, 0: no
ENABLE_OFFLINE_TS = 2 #Whether tablespace can be offline
MAL_INI = 1 #dmmal.ini
ARCH_INI = 1 #dmarch.ini
主库配置 dmmal.ini 参数:
MAL_CHECK_INTERVAL = 5
MAL_CONN_FAIL_INTERVAL = 5
[MAL_INST1]
MAL_INST_NAME = GRP1_DW_01
MAL_HOST = 172.16.2.21
MAL_PORT = 12345
MAL_INST_HOST = 192.168.2.21
MAL_INST_PORT = 5236
MAL_DW_PORT = 12346
MAL_INST_DW_PORT = 12347
[MAL_INST2]
MAL_INST_NAME = GRP1_DW_02
MAL_HOST = 172.16.2.22
MAL_PORT = 12345
MAL_INST_HOST = 192.168.2.22
MAL_INST_PORT = 5236
MAL_DW_PORT = 12346
MAL_INST_DW_PORT = 12347
[MAL_INST3]
MAL_INST_NAME = GRP1_DW_03
MAL_HOST = 172.16.2.23
MAL_PORT = 12345
MAL_INST_HOST = 192.168.2.23
MAL_INST_PORT = 5236
MAL_DW_PORT = 12346
MAL_INST_DW_PORT = 12347
主库配置 dmarch.ini 参数:
ARCH_WAIT_APPLY = 1
[ARCHIVE_LOCAL1]
ARCH_TYPE = LOCAL
ARCH_DEST = /dmarch/DAMENG
ARCH_FILE_SIZE = 1024
ARCH_SPACE_LIMIT = 102400
[ARCHIVE_REALTIME1]
ARCH_TYPE = REALTIME
ARCH_DEST = GRP1_DW_02
[ARCHIVE_REALTIME2]
ARCH_TYPE = REALTIME
ARCH_DEST = GRP1_DW_03
主库配置 dmwatcher.ini 参数:
[GRP1]
DW_TYPE = GLOBAL
DW_MODE = MANUAL
DW_ERROR_TIME = 10
INST_ERROR_TIME = 10
INST_OGUID = 496433
INST_INI = /dmdata/DAMENG/dm.ini
INST_AUTO_RESTART = 1
INST_STARTUP_CMD = /opt/dmdbms/bin/DmServiceDAMENG start
主库配置 dmmonitor.ini 参数:
MON_DW_CONFIRM = 0
MON_LOG_PATH = /opt/dmdbms/log
MON_LOG_INTERVAL = 60
MON_LOG_FILE_SIZE = 32
MON_LOG_SPACE_LIMIT = 2048
[GRP1]
MON_INST_OGUID = 496433
MON_DW_IP = 172.16.2.21:12346
MON_DW_IP = 172.16.2.22:12346
MON_DW_IP = 172.16.2.23:12346
主库注册 dmwatcher 服务:
移动服务脚本文件(/opt/dmdbms/bin/DmWatcherServiceGRP1 到 /etc/rc.d/init.d/DmWatcherServiceGRP1)
创建服务(DmWatcherServiceGRP1)完成
主库启动到 mount 状态:
Starting DmServiceDAMENG: [ OK ]
主库修改模式:
密钥过期时间:2023-11-21
主库启动守护进程:
Starting DmWatcherServiceGRP1: [ OK ]
恭喜您,达梦数据守护已经安装完成!
[root@centos6 soft]# su - dmdba
[dmdba@dw01:~]$ dmmonitor /dmdata/DAMENG/dmmonitor_GRP1.ini
[monitor] 2022-12-20 07:26:37: DMMONITOR[4.0] V8
[monitor] 2022-12-20 07:26:38: DMMONITOR[4.0] IS READY.
[monitor] 2022-12-20 07:26:38: 收到守护进程(GRP1_DW_01)消息
WTIME WSTATUS INST_OK INAME ISTATUS IMODE RSTAT N_OPEN FLSN CLSN
2022-12-20 07:26:38 OPEN OK GRP1_DW_01 OPEN PRIMARY VALID 4 39353 39353
[monitor] 2022-12-20 07:26:38:
#--------------------------------------------------------------------------------#
GET MONITOR CONNECT INFO FROM DMWATCHER(GRP1_DW_01), THE FIRST LINE IS SELF INFO.
DW_CONN_TIME MON_CONFIRM MID MON_IP MON_VERSION
2022-12-20 07:26:38 FALSE 1349081708 ::ffff:172.16.2.21 DMMONITOR[4.0] V8
#--------------------------------------------------------------------------------#
[monitor] 2022-12-20 07:26:38: 收到守护进程(GRP1_DW_03)消息
WTIME WSTATUS INST_OK INAME ISTATUS IMODE RSTAT N_OPEN FLSN CLSN
2022-12-20 07:29:38 OPEN OK GRP1_DW_03 OPEN STANDBY VALID 4 39352 39352
[monitor] 2022-12-20 07:26:38: 收到守护进程(GRP1_DW_02)消息
WTIME WSTATUS INST_OK INAME ISTATUS IMODE RSTAT N_OPEN FLSN CLSN
2022-12-20 07:29:20 OPEN OK GRP1_DW_02 OPEN STANDBY VALID 4 39352 39352
login
用户名:SYSDBA
密码:
[monitor] 2022-12-20 07:26:51: 登录监视器成功!
switchover GRP1_DW_02
[monitor] 2022-12-20 07:27:04: 开始切换实例GRP1_DW_02
[monitor] 2022-12-20 07:27:04: 通知守护进程GRP1_DW_01切换SWITCHOVER状态
[monitor] 2022-12-20 07:27:05: 守护进程(GRP1_DW_01)状态切换 [OPEN-->SWITCHOVER]
[monitor] 2022-12-20 07:27:05: 切换守护进程GRP1_DW_01为SWITCHOVER状态成功
[monitor] 2022-12-20 07:27:05: 通知守护进程GRP1_DW_02切换SWITCHOVER状态
[monitor] 2022-12-20 07:27:05: 守护进程(GRP1_DW_02)状态切换 [OPEN-->SWITCHOVER]
[monitor] 2022-12-20 07:27:06: 切换守护进程GRP1_DW_02为SWITCHOVER状态成功
[monitor] 2022-12-20 07:27:06: 实例GRP1_DW_01开始执行SP_SET_GLOBAL_DW_STATUS(0, 6)语句
[monitor] 2022-12-20 07:27:06: 实例GRP1_DW_01执行SP_SET_GLOBAL_DW_STATUS(0, 6)语句成功
[monitor] 2022-12-20 07:27:06: 实例GRP1_DW_02开始执行SP_SET_GLOBAL_DW_STATUS(0, 6)语句
[monitor] 2022-12-20 07:27:06: 实例GRP1_DW_02执行SP_SET_GLOBAL_DW_STATUS(0, 6)语句成功
[monitor] 2022-12-20 07:27:06: 实例GRP1_DW_01开始执行ALTER DATABASE MOUNT语句
[monitor] 2022-12-20 07:27:06: 实例GRP1_DW_01执行ALTER DATABASE MOUNT语句成功
[monitor] 2022-12-20 07:27:06: 实例GRP1_DW_02开始执行SP_APPLY_KEEP_PKG()语句
[monitor] 2022-12-20 07:27:06: 实例GRP1_DW_02执行SP_APPLY_KEEP_PKG()语句成功
[monitor] 2022-12-20 07:27:06: 实例GRP1_DW_02开始执行ALTER DATABASE MOUNT语句
[monitor] 2022-12-20 07:27:06: 实例GRP1_DW_02执行ALTER DATABASE MOUNT语句成功
[monitor] 2022-12-20 07:27:06: 实例GRP1_DW_01开始执行ALTER DATABASE STANDBY语句
[monitor] 2022-12-20 07:27:08: 实例GRP1_DW_01执行ALTER DATABASE STANDBY语句成功
[monitor] 2022-12-20 07:27:08: 实例GRP1_DW_02开始执行ALTER DATABASE PRIMARY语句
[monitor] 2022-12-20 07:27:08: 实例GRP1_DW_02执行ALTER DATABASE PRIMARY语句成功
[monitor] 2022-12-20 07:27:08: 通知实例GRP1_DW_02修改所有归档状态无效
[monitor] 2022-12-20 07:27:08: 修改所有实例归档为无效状态成功
[monitor] 2022-12-20 07:27:08: 实例GRP1_DW_01开始执行ALTER DATABASE OPEN FORCE语句
[monitor] 2022-12-20 07:27:09: 实例GRP1_DW_01执行ALTER DATABASE OPEN FORCE语句成功
[monitor] 2022-12-20 07:27:09: 实例GRP1_DW_02开始执行ALTER DATABASE OPEN FORCE语句
[monitor] 2022-12-20 07:27:09: 实例GRP1_DW_02执行ALTER DATABASE OPEN FORCE语句成功
[monitor] 2022-12-20 07:27:09: 实例GRP1_DW_01开始执行SP_SET_GLOBAL_DW_STATUS(6, 0)语句
[monitor] 2022-12-20 07:27:09: 实例GRP1_DW_01执行SP_SET_GLOBAL_DW_STATUS(6, 0)语句成功
[monitor] 2022-12-20 07:27:09: 实例GRP1_DW_02开始执行SP_SET_GLOBAL_DW_STATUS(6, 0)语句
[monitor] 2022-12-20 07:27:09: 实例GRP1_DW_02执行SP_SET_GLOBAL_DW_STATUS(6, 0)语句成功
[monitor] 2022-12-20 07:27:09: 通知守护进程GRP1_DW_01切换OPEN状态
[monitor] 2022-12-20 07:27:09: 守护进程(GRP1_DW_01)状态切换 [SWITCHOVER-->OPEN]
[monitor] 2022-12-20 07:27:10: 切换守护进程GRP1_DW_01为OPEN状态成功
[monitor] 2022-12-20 07:27:10: 通知守护进程GRP1_DW_02切换OPEN状态
[monitor] 2022-12-20 07:27:10: 守护进程(GRP1_DW_02)状态切换 [SWITCHOVER-->OPEN]
[monitor] 2022-12-20 07:27:11: 切换守护进程GRP1_DW_02为OPEN状态成功
[monitor] 2022-12-20 07:27:11: 通知组(GRP1)的守护进程执行清理操作
[monitor] 2022-12-20 07:27:11: 清理守护进程(GRP1_DW_01)请求成功
[monitor] 2022-12-20 07:27:12: 清理守护进程(GRP1_DW_02)请求成功
[monitor] 2022-12-20 07:27:12: 清理守护进程(GRP1_DW_03)请求成功
[monitor] 2022-12-20 07:27:12: 实例GRP1_DW_02切换成功
2022-12-20 07:27:12
#================================================================================#
GROUP OGUID MON_CONFIRM MODE MPP_FLAG
GRP1 496433 FALSE MANUAL FALSE
<<DATABASE GLOBAL INFO:>>
DW_IP MAL_DW_PORT WTIME WTYPE WCTLSTAT WSTATUS INAME INST_OK N_EP N_OK ISTATUS IMODE DSC_STATUS RTYPE RSTAT
172.16.2.22 12346 2022-12-20 07:29:53 GLOBAL VALID OPEN GRP1_DW_02 OK 1 1 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
192.168.2.22 5236 OK GRP1_DW_02 OPEN PRIMARY 0 0 REALTIME VALID 4809 39522 4809 39522 NONE
<<DATABASE GLOBAL INFO:>>
DW_IP MAL_DW_PORT WTIME WTYPE WCTLSTAT WSTATUS INAME INST_OK N_EP N_OK ISTATUS IMODE DSC_STATUS RTYPE RSTAT
172.16.2.21 12346 2022-12-20 07:27:11 GLOBAL VALID OPEN GRP1_DW_01 OK 1 1 OPEN STANDBY DSC_OPEN REALTIME INVALID
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
192.168.2.21 5236 OK GRP1_DW_01 OPEN STANDBY 0 0 REALTIME INVALID 4807 39364 4807 39364 NONE
DATABASE(GRP1_DW_01) APPLY INFO FROM (GRP1_DW_02), REDOS_PARALLEL_NUM (1), WAIT_APPLY[FALSE]:
DSC_SEQNO[0], (RSEQ, SSEQ, KSEQ)[4807, 4807, 4807], (RLSN, SLSN, KLSN)[39364, 39364, 39364], N_TSK[0], TSK_MEM_USE[0]
REDO_LSN_ARR: (39364)
<<DATABASE GLOBAL INFO:>>
DW_IP MAL_DW_PORT WTIME WTYPE WCTLSTAT WSTATUS INAME INST_OK N_EP N_OK ISTATUS IMODE DSC_STATUS RTYPE RSTAT
172.16.2.23 12346 2022-12-20 07:30:11 GLOBAL VALID OPEN GRP1_DW_03 OK 1 1 OPEN STANDBY DSC_OPEN REALTIME INVALID
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
192.168.2.23 5236 OK GRP1_DW_03 OPEN STANDBY 0 0 REALTIME INVALID 4787 39364 4787 39364 NONE
DATABASE(GRP1_DW_03) APPLY INFO FROM (GRP1_DW_01), REDOS_PARALLEL_NUM (1), WAIT_APPLY[FALSE]:
DSC_SEQNO[0], (RSEQ, SSEQ, KSEQ)[4807, 4807, 4807], (RLSN, SLSN, KLSN)[39364, 39364, 39364], N_TSK[0], TSK_MEM_USE[0]
REDO_LSN_ARR: (39364)
#================================================================================#
[monitor] 2022-12-20 07:27:13: 守护进程(GRP1_DW_02)状态切换 [OPEN-->RECOVERY]
WTIME WSTATUS INST_OK INAME ISTATUS IMODE RSTAT N_OPEN FLSN CLSN
2022-12-20 07:29:55 RECOVERY OK GRP1_DW_02 OPEN PRIMARY VALID 5 39522 39523
[monitor] 2022-12-20 07:27:16: 守护进程(GRP1_DW_02)状态切换 [RECOVERY-->OPEN]
WTIME WSTATUS INST_OK INAME ISTATUS IMODE RSTAT N_OPEN FLSN CLSN
2022-12-20 07:29:58 OPEN OK GRP1_DW_02 OPEN PRIMARY VALID 5 39523 39524
exit
[dmdba@dw01:~]$ exit
logout
[root@centos6 soft]# init 0
[root@centos6 soft]# Connection closing...Socket close.
Connection closed by foreign host.
Disconnected from remote host(192.168.2.21) at 00:51:50.
Type `help' to learn how to use Xshell prompt.
[C:\~]$
Connecting to 192.168.2.21:22...
[END] 2022/12/20 0:53:05
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/thameswn/DMShellInstall.git
git@gitee.com:thameswn/DMShellInstall.git
thameswn
DMShellInstall
DMShellInstall
master

搜索帮助