1 Star 0 Fork 42

戴明明/DMShellInstall

forked from hnyuanzj/DMShellInstall 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
部署一主两备自动切换数据守护(centos6).txt 235.64 KB
一键复制 编辑 原始数据 按行查看 历史
hnyuanzj 提交于 2023-01-06 17:23 . 更新日志
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637
[BEGIN] 2022/12/20 10:03:03
[root@centos6 soft]# ./DMShellInstall -di dm8_20221121_x86_rh6_64.iso -d /opt/dmdbms \
> -hn dw -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 -dmoi 192.168.2.24 \
> -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
下载软件包:
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
总计 9.9 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
# 192.168.2.24 SSH-2.0-OpenSSH_5.3
# 192.168.2.24 SSH-2.0-OpenSSH_5.3
# 192.168.2.24 SSH-2.0-OpenSSH_5.3
no hostkey alg
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.
spawn scp -rq /root/.ssh root@192.168.2.24:~
root@192.168.2.24's password:
spawn ssh-copy-id -i root@192.168.2.24
root@192.168.2.24's password:
Now try logging into the machine, with "ssh 'root@192.168.2.24'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
拷贝脚本以及安装包到监视器节点 192.168.2.24
dwmonitor_node.sh 100% 279 0.3KB/s 00:00
DMShellInstall 100% 133KB 133.3KB/s 00:00
dm8_20221121_x86_rh6_64.iso 100% 959MB 68.5MB/s 00:14
拷贝脚本以及安装包到节点:192.168.2.22
dwnode.sh 100% 454 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% 454 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日 星期二 16:39:58 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 1569 0 14 1119
-/+ buffers/cache: 166 2703
Swap: 8191 0 8191
total used free shared buffers cached
Mem: 2.8G 1.3G 1.5G 264K 14M 1.1G
-/+ buffers/cache: 166M 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 1326384 1613020 264 15280 1146596
-/+ buffers/cache: 164508 2774896
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日 星期二 16:39:58 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 16:40:36
[INFO] 安装达梦数据库...
2022-12-20 16:40:36
[INFO] 安装 基础 模块...
2022-12-20 16:40:40
[INFO] 安装 服务器 模块...
2022-12-20 16:40:40
[INFO] 安装 客户端 模块...
2022-12-20 16:40:43
[INFO] 安装 驱动 模块...
2022-12-20 16:40:45
[INFO] 安装 手册 模块...
2022-12-20 16:40:45
[INFO] 安装 服务 模块...
2022-12-20 16:40:47
[INFO] 移动日志文件。
2022-12-20 16:40:47
[INFO] 更改安装目录权限完成。
2022-12-20 16:40:47
[INFO] 正在启动DmAPService服务...
2022-12-20 16:41:03
[INFO] 启动DmAPService服务成功。
2022-12-20 16:41:03
[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 16:41:10
#==============================================================#
注册实例服务
#==============================================================#
移动服务脚本文件(/opt/dmdbms/bin/DmServiceDAMENG 到 /etc/rc.d/init.d/DmServiceDAMENG)
创建服务(DmServiceDAMENG)完成
#==============================================================#
启停数据库
#==============================================================#
后台启动数据库:
Starting DmServiceDAMENG: [ OK ]
DmServiceDAMENG (pid 5750) 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 16:41 /home/dmdba/scripts/conf_arch.sql
创建数据库备份脚本:
-rw-r--r--. 1 dmdba dinstall 780 12月 20 16:41 /home/dmdba/scripts/conf_fullbackup.sql
-rw-r--r--. 1 dmdba dinstall 1.5K 12月 20 16:41 /home/dmdba/scripts/conf_incrbackup.sql
创建 DMDBA 用户脚本,密码 SYSDBA :
-rw-r--r--. 1 dmdba dinstall 696 12月 20 16:41 /home/dmdba/scripts/ct_dbuser.sql
#==============================================================#
创建达梦数据库优化脚本
#==============================================================#
创建数据库参数配置脚本:
-rw-r--r--. 1 dmdba dinstall 14K 12月 20 16:41 /home/dmdba/scripts/conf_para.sql
创建数据库优化结果查询脚本:
-rw-r--r--. 1 dmdba dinstall 2.2K 12月 20 16:41 /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.244
主库查看脱机备份文件:
总用量 22604
drwxr-xr-x. 2 dmdba dinstall 4096 12月 20 16:42 .
drwxrwxr-x. 4 dmdba dinstall 4096 12月 20 16:42 ..
-rw-r--r--. 1 dmdba dinstall 23042048 12月 20 16:42 BACKUP_FILE_01.bak
-rw-r--r--. 1 dmdba dinstall 91648 12月 20 16:42 BACKUP_FILE_01.meta
#==============================================================#
配置节点:192.168.2.22
#==============================================================#
节点 192.168.2.22 开始执行配置:
███████ ████ ████ ████████ ██ ██ ██ ██ ██ ██ ██
░██░░░░██ ░██░██ ██░██ ██░░░░░░ ░██ ░██ ░██░██ ░██ ░██ ░██
░██ ░██░██░░██ ██ ░██░██ ░██ █████ ░██ ░██░██ ███████ ██████ ██████ ██████ ░██ ░██
░██ ░██░██ ░░███ ░██░█████████░██████ ██░░░██ ░██ ░██░██░░██░░░██ ██░░░░ ░░░██░ ░░░░░░██ ░██ ░██
░██ ░██░██ ░░█ ░██░░░░░░░░██░██░░░██░███████ ░██ ░██░██ ░██ ░██░░█████ ░██ ███████ ░██ ░██
░██ ██ ░██ ░ ░██ ░██░██ ░██░██░░░░ ░██ ░██░██ ░██ ░██ ░░░░░██ ░██ ██░░░░██ ░██ ░██
░███████ ░██ ░██ ████████ ░██ ░██░░██████ ███ ███░██ ███ ░██ ██████ ░░██ ░░████████ ███ ███
░░░░░░░ ░░ ░░ ░░░░░░░░ ░░ ░░ ░░░░░░ ░░░ ░░░ ░░ ░░░ ░░ ░░░░░░ ░░ ░░░░░░░░ ░░░ ░░░
达梦数据库开始安装:
#==============================================================#
打印系统信息
#==============================================================#
服务器时间:
2022年 12月 20日 星期二 16:44:58 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 1237 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 1261504 1677900 260 10108 1063768
-/+ buffers/cache: 187628 2751776
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日 星期二 16:44:59 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 16:45:25
[INFO] 安装达梦数据库...
2022-12-20 16:45:25
[INFO] 安装 基础 模块...
2022-12-20 16:45:29
[INFO] 安装 服务器 模块...
2022-12-20 16:45:29
[INFO] 安装 客户端 模块...
2022-12-20 16:45:33
[INFO] 安装 驱动 模块...
2022-12-20 16:45:34
[INFO] 安装 手册 模块...
2022-12-20 16:45:35
[INFO] 安装 服务 模块...
2022-12-20 16:45:36
[INFO] 移动日志文件。
2022-12-20 16:45:36
[INFO] 更改安装目录权限完成。
2022-12-20 16:45:37
[INFO] 正在启动DmAPService服务...
2022-12-20 16:45:52
[INFO] 启动DmAPService服务成功。
2022-12-20 16:45:52
[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 16:45:59
#==============================================================#
注册实例服务
#==============================================================#
移动服务脚本文件(/opt/dmdbms/bin/DmServiceDAMENG 到 /etc/rc.d/init.d/DmServiceDAMENG)
创建服务(DmServiceDAMENG)完成
#==============================================================#
启停数据库
#==============================================================#
后台启动数据库:
Starting DmServiceDAMENG: [ OK ]
DmServiceDAMENG (pid 5496) 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 16:46 /home/dmdba/scripts/conf_arch.sql
创建数据库备份脚本:
-rw-r--r--. 1 dmdba dinstall 780 12月 20 16:46 /home/dmdba/scripts/conf_fullbackup.sql
-rw-r--r--. 1 dmdba dinstall 1.5K 12月 20 16:46 /home/dmdba/scripts/conf_incrbackup.sql
创建 DMDBA 用户脚本,密码 SYSDBA :
-rw-r--r--. 1 dmdba dinstall 696 12月 20 16:46 /home/dmdba/scripts/ct_dbuser.sql
#==============================================================#
创建达梦数据库优化脚本
#==============================================================#
创建数据库参数配置脚本:
-rw-r--r--. 1 dmdba dinstall 14K 12月 20 16:46 /home/dmdba/scripts/conf_para.sql
创建数据库优化结果查询脚本:
-rw-r--r--. 1 dmdba dinstall 2.2K 12月 20 16:46 /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:00
备库执行脱机数据库 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.650
备库执行 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.006
#==============================================================#
数据守护主备配置参数文件
#==============================================================#
备库配置 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 = AUTO
DW_ERROR_TIME = 10
INST_ERROR_TIME = 10
INST_OGUID = 406513
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 = 406513
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日 星期二 16:47:55 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 264K 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 1261464 1677940 264 10124 1063772
-/+ buffers/cache: 187568 2751836
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日 星期二 16:47:55 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 16:48:22
[INFO] 安装达梦数据库...
2022-12-20 16:48:22
[INFO] 安装 基础 模块...
2022-12-20 16:48:26
[INFO] 安装 服务器 模块...
2022-12-20 16:48:27
[INFO] 安装 客户端 模块...
2022-12-20 16:48:31
[INFO] 安装 驱动 模块...
2022-12-20 16:48:33
[INFO] 安装 手册 模块...
2022-12-20 16:48:33
[INFO] 安装 服务 模块...
2022-12-20 16:48:35
[INFO] 移动日志文件。
2022-12-20 16:48:35
[INFO] 更改安装目录权限完成。
2022-12-20 16:48:35
[INFO] 正在启动DmAPService服务...
2022-12-20 16:48:51
[INFO] 启动DmAPService服务成功。
2022-12-20 16:48:51
[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 16:48:56
#==============================================================#
注册实例服务
#==============================================================#
移动服务脚本文件(/opt/dmdbms/bin/DmServiceDAMENG 到 /etc/rc.d/init.d/DmServiceDAMENG)
创建服务(DmServiceDAMENG)完成
#==============================================================#
启停数据库
#==============================================================#
后台启动数据库:
Starting DmServiceDAMENG: [ OK ]
DmServiceDAMENG (pid 5495) 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 16:49 /home/dmdba/scripts/conf_arch.sql
创建数据库备份脚本:
-rw-r--r--. 1 dmdba dinstall 780 12月 20 16:49 /home/dmdba/scripts/conf_fullbackup.sql
-rw-r--r--. 1 dmdba dinstall 1.5K 12月 20 16:49 /home/dmdba/scripts/conf_incrbackup.sql
创建 DMDBA 用户脚本,密码 SYSDBA :
-rw-r--r--. 1 dmdba dinstall 696 12月 20 16:49 /home/dmdba/scripts/ct_dbuser.sql
#==============================================================#
创建达梦数据库优化脚本
#==============================================================#
创建数据库参数配置脚本:
-rw-r--r--. 1 dmdba dinstall 14K 12月 20 16:49 /home/dmdba/scripts/conf_para.sql
创建数据库优化结果查询脚本:
-rw-r--r--. 1 dmdba dinstall 2.2K 12月 20 16:49 /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:00
备库执行脱机数据库 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.621
备库执行 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.018
#==============================================================#
数据守护主备配置参数文件
#==============================================================#
备库配置 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 = AUTO
DW_ERROR_TIME = 10
INST_ERROR_TIME = 10
INST_OGUID = 406513
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 = 406513
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 配置完成!
#==============================================================#
配置监视器主机
#==============================================================#
监视器主机开始执行配置:
███████ ████ ████ ████████ ██ ██ ██ ██ ██ ██ ██
░██░░░░██ ░██░██ ██░██ ██░░░░░░ ░██ ░██ ░██░██ ░██ ░██ ░██
░██ ░██░██░░██ ██ ░██░██ ░██ █████ ░██ ░██░██ ███████ ██████ ██████ ██████ ░██ ░██
░██ ░██░██ ░░███ ░██░█████████░██████ ██░░░██ ░██ ░██░██░░██░░░██ ██░░░░ ░░░██░ ░░░░░░██ ░██ ░██
░██ ░██░██ ░░█ ░██░░░░░░░░██░██░░░██░███████ ░██ ░██░██ ░██ ░██░░█████ ░██ ███████ ░██ ░██
░██ ██ ░██ ░ ░██ ░██░██ ░██░██░░░░ ░██ ░██░██ ░██ ░██ ░░░░░██ ░██ ██░░░░██ ░██ ░██
░███████ ░██ ░██ ████████ ░██ ░██░░██████ ███ ███░██ ███ ░██ ██████ ░░██ ░░████████ ███ ███
░░░░░░░ ░░ ░░ ░░░░░░░░ ░░ ░░ ░░░░░░ ░░░ ░░░ ░░ ░░░ ░░ ░░░░░░ ░░ ░░░░░░░░ ░░░ ░░░
达梦数据库开始安装:
#==============================================================#
打印系统信息
#==============================================================#
服务器时间:
2022年 12月 20日 星期二 17:31:37 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 1236 1634 0 9 1038
-/+ buffers/cache: 187 2682
Swap: 8191 0 8191
total used free shared buffers cached
Mem: 2.8G 1.2G 1.6G 228K 9.9M 1.0G
-/+ buffers/cache: 187M 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 1259820 1679584 228 10164 1063740
-/+ buffers/cache: 185916 2753488
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
#==============================================================#
配置时间同步
#==============================================================#
2022年 12月 20日 星期二 17:31:37 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 17:32:11
[INFO] 安装达梦数据库...
2022-12-20 17:32:11
[INFO] 安装 基础 模块...
2022-12-20 17:32:15
[INFO] 安装 服务器 模块...
2022-12-20 17:32:16
[INFO] 安装 客户端 模块...
2022-12-20 17:32:20
[INFO] 安装 驱动 模块...
2022-12-20 17:32:21
[INFO] 安装 手册 模块...
2022-12-20 17:32:22
[INFO] 安装 服务 模块...
2022-12-20 17:32:23
[INFO] 移动日志文件。
2022-12-20 17:32:24
[INFO] 更改安装目录权限完成。
2022-12-20 17:32:24
[INFO] 正在启动DmAPService服务...
2022-12-20 17:32:39
[INFO] 启动DmAPService服务成功。
2022-12-20 17:32:39
[INFO] 安装达梦数据库完成。
#==============================================================#
数据守护主备配置参数文件
#==============================================================#
监视器主机配置 dmmonitor.ini 参数:
MON_DW_CONFIRM = 1
MON_LOG_PATH = /opt/dmdbms/log
MON_LOG_INTERVAL = 60
MON_LOG_FILE_SIZE = 32
MON_LOG_SPACE_LIMIT = 2048
[GRP1]
MON_INST_OGUID = 406513
MON_DW_IP = 172.16.2.21:12346
MON_DW_IP = 172.16.2.22:12346
MON_DW_IP = 172.16.2.23:12346
监视主机注册监视器服务:
移动服务脚本文件(/opt/dmdbms/bin/DmMonitorServiceGRP1 到 /etc/rc.d/init.d/DmMonitorServiceGRP1)
创建服务(DmMonitorServiceGRP1)完成
监视主机启动监视进程:
Starting DmMonitorServiceGRP1: [ OK ]
Connection to 192.168.2.24 closed.
监视器主机配置完成!
#==============================================================#
数据守护主备配置参数文件
#==============================================================#
主库配置 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 = AUTO
DW_ERROR_TIME = 10
INST_ERROR_TIME = 10
INST_OGUID = 406513
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 = 406513
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 16:50:46: DMMONITOR[4.0] V8
[monitor] 2022-12-20 16:50:47: DMMONITOR[4.0] IS READY.
[monitor] 2022-12-20 16:50:47: 收到守护进程(GRP1_DW_01)消息
WTIME WSTATUS INST_OK INAME ISTATUS IMODE RSTAT N_OPEN FLSN CLSN
2022-12-20 16:50:47 OPEN OK GRP1_DW_01 OPEN PRIMARY VALID 4 39374 39375
[monitor] 2022-12-20 16:50:47:
#--------------------------------------------------------------------------------#
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 16:50:47 FALSE 897943072 ::ffff:172.16.2.21 DMMONITOR[4.0] V8
2022-12-20 16:49:07 TRUE 1958258882 ::ffff:172.16.2.24 DMMONITOR[4.0] V8
#--------------------------------------------------------------------------------#
[monitor] 2022-12-20 16:50:47: 收到守护进程(GRP1_DW_03)消息
WTIME WSTATUS INST_OK INAME ISTATUS IMODE RSTAT N_OPEN FLSN CLSN
2022-12-20 16:53:49 OPEN OK GRP1_DW_03 OPEN STANDBY VALID 4 39374 39374
[monitor] 2022-12-20 16:50:47: 收到守护进程(GRP1_DW_02)消息
WTIME WSTATUS INST_OK INAME ISTATUS IMODE RSTAT N_OPEN FLSN CLSN
2022-12-20 16:53:30 OPEN OK GRP1_DW_02 OPEN STANDBY VALID 4 39374 39374
login
用户名:SYSDBA
密码:
[monitor] 2022-12-20 16:50:56: 登录监视器成功!
switchover GRP1_DW_02
[monitor] 2022-12-20 16:51:10: 开始切换实例GRP1_DW_02
[monitor] 2022-12-20 16:51:10: 通知守护进程GRP1_DW_01切换SWITCHOVER状态
[monitor] 2022-12-20 16:51:10: 守护进程(GRP1_DW_01)状态切换 [OPEN-->SWITCHOVER]
[monitor] 2022-12-20 16:51:11: 切换守护进程GRP1_DW_01为SWITCHOVER状态成功
[monitor] 2022-12-20 16:51:11: 通知守护进程GRP1_DW_02切换SWITCHOVER状态
[monitor] 2022-12-20 16:51:11: 守护进程(GRP1_DW_02)状态切换 [OPEN-->SWITCHOVER]
[monitor] 2022-12-20 16:51:12: 切换守护进程GRP1_DW_02为SWITCHOVER状态成功
[monitor] 2022-12-20 16:51:12: 实例GRP1_DW_01开始执行SP_SET_GLOBAL_DW_STATUS(0, 6)语句
[monitor] 2022-12-20 16:51:12: 实例GRP1_DW_01执行SP_SET_GLOBAL_DW_STATUS(0, 6)语句成功
[monitor] 2022-12-20 16:51:12: 实例GRP1_DW_02开始执行SP_SET_GLOBAL_DW_STATUS(0, 6)语句
[monitor] 2022-12-20 16:51:12: 实例GRP1_DW_02执行SP_SET_GLOBAL_DW_STATUS(0, 6)语句成功
[monitor] 2022-12-20 16:51:12: 实例GRP1_DW_01开始执行ALTER DATABASE MOUNT语句
[monitor] 2022-12-20 16:51:12: 实例GRP1_DW_01执行ALTER DATABASE MOUNT语句成功
[monitor] 2022-12-20 16:51:12: 实例GRP1_DW_02开始执行SP_APPLY_KEEP_PKG()语句
[monitor] 2022-12-20 16:51:12: 实例GRP1_DW_02执行SP_APPLY_KEEP_PKG()语句成功
[monitor] 2022-12-20 16:51:12: 实例GRP1_DW_02开始执行ALTER DATABASE MOUNT语句
[monitor] 2022-12-20 16:51:12: 实例GRP1_DW_02执行ALTER DATABASE MOUNT语句成功
[monitor] 2022-12-20 16:51:12: 实例GRP1_DW_01开始执行ALTER DATABASE STANDBY语句
[monitor] 2022-12-20 16:51:14: 实例GRP1_DW_01执行ALTER DATABASE STANDBY语句成功
[monitor] 2022-12-20 16:51:14: 实例GRP1_DW_02开始执行ALTER DATABASE PRIMARY语句
[monitor] 2022-12-20 16:51:14: 实例GRP1_DW_02执行ALTER DATABASE PRIMARY语句成功
[monitor] 2022-12-20 16:51:14: 通知实例GRP1_DW_02修改所有归档状态无效
[monitor] 2022-12-20 16:51:14: 修改所有实例归档为无效状态成功
[monitor] 2022-12-20 16:51:14: 实例GRP1_DW_01开始执行ALTER DATABASE OPEN FORCE语句
[monitor] 2022-12-20 16:51:15: 实例GRP1_DW_01执行ALTER DATABASE OPEN FORCE语句成功
[monitor] 2022-12-20 16:51:15: 实例GRP1_DW_02开始执行ALTER DATABASE OPEN FORCE语句
[monitor] 2022-12-20 16:51:15: 实例GRP1_DW_02执行ALTER DATABASE OPEN FORCE语句成功
[monitor] 2022-12-20 16:51:15: 实例GRP1_DW_01开始执行SP_SET_GLOBAL_DW_STATUS(6, 0)语句
[monitor] 2022-12-20 16:51:15: 实例GRP1_DW_01执行SP_SET_GLOBAL_DW_STATUS(6, 0)语句成功
[monitor] 2022-12-20 16:51:15: 实例GRP1_DW_02开始执行SP_SET_GLOBAL_DW_STATUS(6, 0)语句
[monitor] 2022-12-20 16:51:15: 实例GRP1_DW_02执行SP_SET_GLOBAL_DW_STATUS(6, 0)语句成功
[monitor] 2022-12-20 16:51:15: 通知守护进程GRP1_DW_01切换OPEN状态
[monitor] 2022-12-20 16:51:15: 守护进程(GRP1_DW_01)状态切换 [SWITCHOVER-->OPEN]
[monitor] 2022-12-20 16:51:15: 切换守护进程GRP1_DW_01为OPEN状态成功
[monitor] 2022-12-20 16:51:15: 通知守护进程GRP1_DW_02切换OPEN状态
[monitor] 2022-12-20 16:51:17: 守护进程(GRP1_DW_02)状态切换 [SWITCHOVER-->OPEN]
[monitor] 2022-12-20 16:51:17: 切换守护进程GRP1_DW_02为OPEN状态成功
[monitor] 2022-12-20 16:51:17: 通知组(GRP1)的守护进程执行清理操作
[monitor] 2022-12-20 16:51:17: 清理守护进程(GRP1_DW_01)请求成功
[monitor] 2022-12-20 16:51:17: 清理守护进程(GRP1_DW_02)请求成功
[monitor] 2022-12-20 16:51:17: 清理守护进程(GRP1_DW_03)请求成功
[monitor] 2022-12-20 16:51:17: 实例GRP1_DW_02切换成功
2022-12-20 16:51:17
#================================================================================#
GROUP OGUID MON_CONFIRM MODE MPP_FLAG
GRP1 406513 FALSE AUTO 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 16:54:00 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 4829 39542 4829 39543 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 16:51:17 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 4828 39385 4828 39385 NONE
DATABASE(GRP1_DW_01) APPLY INFO FROM (GRP1_DW_02), REDOS_PARALLEL_NUM (1), WAIT_APPLY[TRUE]:
DSC_SEQNO[0], (RSEQ, SSEQ, KSEQ)[4828, 4828, 4828], (RLSN, SLSN, KLSN)[39385, 39385, 39385], N_TSK[0], TSK_MEM_USE[0]
REDO_LSN_ARR: (39385)
<<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 16:54:19 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 39385 4787 39385 NONE
DATABASE(GRP1_DW_03) APPLY INFO FROM (GRP1_DW_01), REDOS_PARALLEL_NUM (1), WAIT_APPLY[TRUE]:
DSC_SEQNO[0], (RSEQ, SSEQ, KSEQ)[4828, 4828, 4828], (RLSN, SLSN, KLSN)[39385, 39385, 39385], N_TSK[0], TSK_MEM_USE[0]
REDO_LSN_ARR: (39385)
#================================================================================#
[monitor] 2022-12-20 16:51:18: 守护进程(GRP1_DW_02)状态切换 [OPEN-->RECOVERY]
WTIME WSTATUS INST_OK INAME ISTATUS IMODE RSTAT N_OPEN FLSN CLSN
2022-12-20 16:54:01 RECOVERY OK GRP1_DW_02 OPEN PRIMARY VALID 5 39543 39543
[monitor] 2022-12-20 16:51:21: 守护进程(GRP1_DW_02)状态切换 [RECOVERY-->OPEN]
WTIME WSTATUS INST_OK INAME ISTATUS IMODE RSTAT N_OPEN FLSN CLSN
2022-12-20 16:54:04 OPEN OK GRP1_DW_02 OPEN PRIMARY VALID 5 39544 39544
exit
[dmdba@dw01:~]$ exit
logout
[root@centos6 soft]#
[END] 2022/12/20 10:17:13
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/cndba/DMShellInstall.git
git@gitee.com:cndba/DMShellInstall.git
cndba
DMShellInstall
DMShellInstall
master

搜索帮助