1 Star 0 Fork 42

戴明明/DMShellInstall

forked from hnyuanzj/DMShellInstall 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
使用 multipath 部署两节点dsc日志(centos7).txt 176.17 KB
一键复制 编辑 原始数据 按行查看 历史
hnyuanzj 提交于 2022-12-24 17:25 . 修改后缀名
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897
[BEGIN] 2022/12/20 11:25:24
> -mtp Y -oi N
███████ ████ ████ ████████ ██ ██ ██ ██ ██ ██ ██
░██░░░░██ ░██░██ ██░██ ██░░░░░░ ░██ ░██ ░██░██ ░██ ░██ ░██
░██ ░██░██░░██ ██ ░██░██ ░██ █████ ░██ ░██░██ ███████ ██████ ██████ ██████ ░██ ░██
░██ ░██░██ ░░███ ░██░█████████░██████ ██░░░██ ░██ ░██░██░░██░░░██ ██░░░░ ░░░██░ ░░░░░░██ ░██ ░██
░██ ░██░██ ░░█ ░██░░░░░░░░██░██░░░██░███████ ░██ ░██░██ ░██ ░██░░█████ ░██ ███████ ░██ ░██
░██ ██ ░██ ░ ░██ ░██░██ ░██░██░░░░ ░██ ░██░██ ░██ ░██ ░░░░░██ ░██ ██░░░░██ ░██ ░██
░███████ ░██ ░██ ████████ ░██ ░██░░██████ ███ ███░██ ███ ░██ ██████ ░░██ ░░████████ ███ ███
░░░░░░░ ░░ ░░ ░░░░░░░░ ░░ ░░ ░░░░░░ ░░░ ░░░ ░░ ░░░ ░░ ░░░░░░ ░░ ░░░░░░░░ ░░░ ░░░
请选择达梦数据库部署类型:单机[si]/数据守护[dw]/dsc集群[dsc]
dsc
达梦数据库安装部署类型: dsc
校验 192.168.2.31,192.168.2.32 地址,请等待!!!
校验 172.16.2.31,172.16.2.32 地址,请等待!!!
校验 /dev/sdc 磁盘,请等待!!!
校验 /dev/sdd 磁盘,请等待!!!
校验 /dev/sdj,/dev/sdl 磁盘,请等待!!!
校验 /dev/sdg,/dev/sdi 磁盘,请等待!!!
校验 /dev/sdn,/dev/sdo,/dev/sdq 磁盘,请等待!!!
主库安装 expect 软件用于 root 用户互信:
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
OS-YUM | 3.6 kB 00:00:00
正在解决依赖关系
--> 正在检查事务
---> 软件包 expect.x86_64.0.5.45-14.el7_1 将被 安装
--> 正在处理依赖关系 libtcl8.5.so()(64bit),它被软件包 expect-5.45-14.el7_1.x86_64 需要
--> 正在检查事务
---> 软件包 tcl.x86_64.1.8.5.13-8.el7 将被 安装
--> 解决依赖关系完成
依赖关系解决
=====================================================================================================================================================================================================================
Package 架构 版本 源 大小
=====================================================================================================================================================================================================================
正在安装:
expect x86_64 5.45-14.el7_1 OS-YUM 262 k
为依赖而安装:
tcl x86_64 1:8.5.13-8.el7 OS-YUM 1.9 M
事务概要
=====================================================================================================================================================================================================================
安装 1 软件包 (+1 依赖软件包)
总下载量:2.1 M
安装大小:4.9 M
Downloading packages:
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
总计 7.2 MB/s | 2.1 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : 1:tcl-8.5.13-8.el7.x86_64 1/2
正在安装 : expect-5.45-14.el7_1.x86_64 2/2
验证中 : 1:tcl-8.5.13-8.el7.x86_64 1/2
验证中 : expect-5.45-14.el7_1.x86_64 2/2
已安装:
expect.x86_64 0:5.45-14.el7_1
作为依赖被安装:
tcl.x86_64 1:8.5.13-8.el7
完毕!
所有节点 root 用户配置互信:
# 192.168.2.31:22 SSH-2.0-OpenSSH_7.4
# 192.168.2.31:22 SSH-2.0-OpenSSH_7.4
# 192.168.2.31:22 SSH-2.0-OpenSSH_7.4
# 192.168.2.32:22 SSH-2.0-OpenSSH_7.4
# 192.168.2.32:22 SSH-2.0-OpenSSH_7.4
# 192.168.2.32:22 SSH-2.0-OpenSSH_7.4
spawn scp -rq /root/.ssh root@192.168.2.31:~
send: spawn id exp6 not open
while executing
"send "123456\r""
spawn ssh-copy-id -i root@192.168.2.31
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: WARNING: All keys were skipped because they already exist on the remote system.
(if you think this is a mistake, you may want to use -f option)
send: spawn id exp6 not open
while executing
"send "123456\r""
spawn scp -rq /root/.ssh root@192.168.2.32:~
root@192.168.2.32's password:
spawn ssh-copy-id -i root@192.168.2.32
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: WARNING: All keys were skipped because they already exist on the remote system.
(if you think this is a mistake, you may want to use -f option)
send: spawn id exp6 not open
while executing
"send "123456\r""
拷贝脚本以及安装包到节点:192.168.2.32
dwnode.sh 100% 547 129.8KB/s 00:00
DMShellInstall 100% 133KB 22.9MB/s 00:00
dm8_20221121_x86_rh6_64.iso 100% 959MB 83.9MB/s 00:11
达梦数据库开始安装:
#==============================================================#
打印系统信息
#==============================================================#
服务器时间:
2022年 12月 20日 星期二 18:35:57 CST
操作系统版本:
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
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
座: 1
NUMA 节点: 1
厂商 ID: GenuineIntel
CPU 系列: 6
型号: 142
型号名称: Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
步进: 12
CPU MHz: 1992.001
BogoMIPS: 3984.00
超管理器厂商: VMware
虚拟化类型: 完全
L1d 缓存: 32K
L1i 缓存: 32K
L2 缓存: 256K
L3 缓存: 8192K
NUMA 节点0 CPU: 0
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 arat md_clear spec_ctrl intel_stibp flush_l1d arch_capabilities
内存信息:
total used free shared buff/cache available
Mem: 1819 239 361 9 1217 1420
Swap: 8191 0 8191
total used free shared buff/cache available
Mem: 1.8G 239M 361M 9.6M 1.2G 1.4G
Swap: 8.0G 0B 8.0G
挂载信息:
/dev/mapper/centos-root / xfs defaults 0 0
UUID=dc24af02-0269-4d90-88b9-c6fdb8c27470 /boot xfs defaults 0 0
/dev/mapper/centos-swap swap swap defaults 0 0
/dev/sr0 /mnt/cdrom iso9660 defaults 0 0
目录信息:
文件系统 容量 已用 可用 已用% 挂载点
devtmpfs 898M 0 898M 0% /dev
tmpfs 910M 0 910M 0% /dev/shm
tmpfs 910M 9.6M 901M 2% /run
tmpfs 910M 0 910M 0% /sys/fs/cgroup
/dev/mapper/centos-root 91G 2.7G 89G 3% /
/dev/sr0 4.4G 4.4G 0 100% /mnt/cdrom
/dev/sda1 1014M 151M 864M 15% /boot
tmpfs 182M 0 182M 0% /run/user/0
#==============================================================#
关闭 SWAP 功能
#==============================================================#
total used free shared buff/cache available
Mem: 1863004 239148 376728 9812 1247128 1460872
Swap: 0 0 0
#/dev/mapper/centos-swap swap swap defaults 0 0
#==============================================================#
禁用防火墙
#==============================================================#
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)
12月 20 18:31:13 centos7 systemd[1]: Starting firewalld - dynamic firewall daemon...
12月 20 18:31:14 centos7 systemd[1]: Started firewalld - dynamic firewall daemon.
12月 20 18:31:14 centos7 firewalld[723]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure configuration option. It will be removed in a future release. Please consider disabling it now.
12月 20 18:35:57 centos7 systemd[1]: Stopping firewalld - dynamic firewall daemon...
12月 20 18:35:57 centos7 systemd[1]: Stopped firewalld - dynamic firewall daemon.
#==============================================================#
禁用 selinux
#==============================================================#
SELINUX=disabled
SELINUXTYPE=targeted
#==============================================================#
配置主机名
#==============================================================#
Static hostname: dsc01
Icon name: computer-vm
Chassis: vm
Machine ID: f4a41440d98d417dbb5516d46b966467
Boot ID: c376da6f080d4127af8fb5f5d301c07f
Virtualization: vmware
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-1160.el7.x86_64
Architecture: x86-64
#==============================================================#
配置时间同步
#==============================================================#
Removed symlink /etc/systemd/system/multi-user.target.wants/chronyd.service.
● chronyd.service - NTP client/server
Loaded: loaded (/usr/lib/systemd/system/chronyd.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:chronyd(8)
man:chrony.conf(5)
12月 20 18:31:12 centos7 systemd[1]: Starting NTP client/server...
12月 20 18:31:13 centos7 chronyd[692]: chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +SECHASH +IPV6 +DEBUG)
12月 20 18:31:13 centos7 chronyd[692]: Frequency 0.000 +/- 1000000.000 ppm read from /var/lib/chrony/drift
12月 20 18:31:13 centos7 systemd[1]: Started NTP client/server.
12月 20 18:35:57 dsc01 systemd[1]: Stopping NTP client/server...
12月 20 18:35:57 dsc01 systemd[1]: Stopped NTP client/server.
2022年 12月 20日 星期二 18:35:58 CST
no crontab for root
#==============================================================#
禁用透明大页 & 禁用NUMA & 开启 I/0 schedule
#==============================================================#
index=0
kernel=/boot/vmlinuz-3.10.0-1160.el7.x86_64
args="ro crashkernel=auto spectre_v2=retpoline rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet LANG=zh_CN.UTF-8 numa=off transparent_hugepage=never elevator=deadline"
--
index=1
kernel=/boot/vmlinuz-0-rescue-f4a41440d98d417dbb5516d46b966467
args="ro crashkernel=auto spectre_v2=retpoline rd.lvm.lv=centos/root rd.lvm.lv=centos/swap 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)
#==============================================================#
配置系统参数
#==============================================================#
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
sysctl: cannot stat /proc/sys/vm/numa_stat: 没有那个文件或目录
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
[Manager]
DefaultLimitCORE=infinity
DefaultLimitNOFILE=65536
DefaultLimitNPROC=10240
auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
auth substack system-auth
auth include postlogin
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 include postlogin
-session optional pam_ck_connector.so
session required pam_limits.so
session required /lib64/security/pam_limits.so
#==============================================================#
禁用 RemoveIPC
#==============================================================#
[Login]
RemoveIPC=no
#==============================================================#
配置语言中文
#==============================================================#
export LANG=zh_CN.UTF-8
#==============================================================#
配置用户环境变量
#==============================================================#
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
PATH=$PATH:$HOME/.local/bin:$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 18:36:19
[INFO] 安装达梦数据库...
2022-12-20 18:36:20
[INFO] 安装 基础 模块...
2022-12-20 18:36:24
[INFO] 安装 服务器 模块...
2022-12-20 18:36:24
[INFO] 安装 客户端 模块...
2022-12-20 18:36:28
[INFO] 安装 驱动 模块...
2022-12-20 18:36:29
[INFO] 安装 手册 模块...
2022-12-20 18:36:29
[INFO] 安装 服务 模块...
2022-12-20 18:36:31
[INFO] 移动日志文件。
2022-12-20 18:36:31
[INFO] 更改安装目录权限完成。
2022-12-20 18:36:31
[INFO] 正在启动DmAPService服务...
2022-12-20 18:36:32
[INFO] 启动DmAPService服务成功。
2022-12-20 18:36:32
[INFO] 安装达梦数据库完成。
#==============================================================#
创建UDEV规则文件
#==============================================================#
defaults {
polling_interval 30
failback immediate
no_path_retry 5
rr_min_io 100
path_checker tur
user_friendly_names yes
}
blacklist {
devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
devnode "^(hd|xvd|vd)[a-z]*"
}
multipaths {
multipath {
wwid "36001405f5c51be3913d41f58ceb59dd5"
alias dmdcr01
}
multipath {
wwid "36001405c3cbda6d685747b1a5b649ee3"
alias dmvote01
}
multipath {
wwid "36001405d0e3c3a9b2874cc6aad8ef901"
alias dmlog01
}
multipath {
wwid "36001405716c01510c5c448f801989e89"
alias dmlog02
}
multipath {
wwid "36001405b0ccc91e5cdd4c4b9ce6cc7d0"
alias dmarch01
}
multipath {
wwid "3600140500b7852874dc402f8ff46337c"
alias dmarch02
}
multipath {
wwid "360014051b4be89b555d48f58dabde17f"
alias dmdata01
}
multipath {
wwid "360014056995ce6cb1d94084a72064522"
alias dmdata02
}
multipath {
wwid "360014055454318b20a044448d2be00dc"
alias dmdata03
}
}
devices {
device {
path_grouping_policy group_by_prio
prio alua #failover
}
}
KERNEL=="dm-*", ENV{DM_UUID}=="mpath-36001405f5c51be3913d41f58ceb59dd5", SYMLINK+="asmdisk/dmdcr01", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="dm-*", ENV{DM_UUID}=="mpath-36001405c3cbda6d685747b1a5b649ee3", SYMLINK+="asmdisk/dmvote01", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="dm-*", ENV{DM_UUID}=="mpath-36001405d0e3c3a9b2874cc6aad8ef901", SYMLINK+="asmdisk/dmlog01", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="dm-*", ENV{DM_UUID}=="mpath-36001405716c01510c5c448f801989e89", SYMLINK+="asmdisk/dmlog02", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="dm-*", ENV{DM_UUID}=="mpath-36001405b0ccc91e5cdd4c4b9ce6cc7d0", SYMLINK+="asmdisk/dmarch01", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="dm-*", ENV{DM_UUID}=="mpath-3600140500b7852874dc402f8ff46337c", SYMLINK+="asmdisk/dmarch02", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="dm-*", ENV{DM_UUID}=="mpath-360014051b4be89b555d48f58dabde17f", SYMLINK+="asmdisk/dmdata01", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="dm-*", ENV{DM_UUID}=="mpath-360014056995ce6cb1d94084a72064522", SYMLINK+="asmdisk/dmdata02", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="dm-*", ENV{DM_UUID}=="mpath-360014055454318b20a044448d2be00dc", SYMLINK+="asmdisk/dmdata03", OWNER="dmdba", GROUP="dinstall", MODE="0660"
#==============================================================#
查看multipath聚合磁盘
#==============================================================#
create: dmdcr01 (36001405f5c51be3913d41f58ceb59dd5) undef LIO-ORG ,data1
size=1.9G features='1 queue_if_no_path' hwhandler='0' wp=undef
|-+- policy='service-time 0' prio=1 status=undef
| `- 3:0:0:0 sde 8:64 undef ready running
`-+- policy='service-time 0' prio=1 status=undef
`- 4:0:0:0 sdc 8:32 undef ready running
create: dmvote01 (36001405c3cbda6d685747b1a5b649ee3) undef LIO-ORG ,data2
size=1.9G features='1 queue_if_no_path' hwhandler='0' wp=undef
|-+- policy='service-time 0' prio=1 status=undef
| `- 3:0:0:1 sdf 8:80 undef ready running
`-+- policy='service-time 0' prio=1 status=undef
`- 4:0:0:1 sdd 8:48 undef ready running
create: dmarch01 (36001405b0ccc91e5cdd4c4b9ce6cc7d0) undef LIO-ORG ,data3
size=9.3G features='1 queue_if_no_path' hwhandler='0' wp=undef
|-+- policy='service-time 0' prio=1 status=undef
| `- 3:0:0:2 sdg 8:96 undef ready running
`-+- policy='service-time 0' prio=1 status=undef
`- 4:0:0:2 sdh 8:112 undef ready running
create: dmarch02 (3600140500b7852874dc402f8ff46337c) undef LIO-ORG ,data4
size=9.3G features='1 queue_if_no_path' hwhandler='0' wp=undef
|-+- policy='service-time 0' prio=1 status=undef
| `- 3:0:0:3 sdk 8:160 undef ready running
`-+- policy='service-time 0' prio=1 status=undef
`- 4:0:0:3 sdi 8:128 undef ready running
create: dmlog01 (36001405d0e3c3a9b2874cc6aad8ef901) undef LIO-ORG ,data5
size=9.3G features='1 queue_if_no_path' hwhandler='0' wp=undef
|-+- policy='service-time 0' prio=1 status=undef
| `- 3:0:0:4 sdm 8:192 undef ready running
`-+- policy='service-time 0' prio=1 status=undef
`- 4:0:0:4 sdj 8:144 undef ready running
create: dmlog02 (36001405716c01510c5c448f801989e89) undef LIO-ORG ,data6
size=9.3G features='1 queue_if_no_path' hwhandler='0' wp=undef
|-+- policy='service-time 0' prio=1 status=undef
| `- 3:0:0:5 sdp 8:240 undef ready running
`-+- policy='service-time 0' prio=1 status=undef
`- 4:0:0:5 sdl 8:176 undef ready running
create: dmdata01 (360014051b4be89b555d48f58dabde17f) undef LIO-ORG ,data7
size=19G features='1 queue_if_no_path' hwhandler='0' wp=undef
|-+- policy='service-time 0' prio=1 status=undef
| `- 3:0:0:6 sdr 65:16 undef ready running
`-+- policy='service-time 0' prio=1 status=undef
`- 4:0:0:6 sdn 8:208 undef ready running
create: dmdata02 (360014056995ce6cb1d94084a72064522) undef LIO-ORG ,data8
size=19G features='1 queue_if_no_path' hwhandler='0' wp=undef
|-+- policy='service-time 0' prio=1 status=undef
| `- 3:0:0:7 sds 65:32 undef ready running
`-+- policy='service-time 0' prio=1 status=undef
`- 4:0:0:7 sdo 8:224 undef ready running
create: dmdata03 (360014055454318b20a044448d2be00dc) undef LIO-ORG ,data9
size=19G features='1 queue_if_no_path' hwhandler='0' wp=undef
|-+- policy='service-time 0' prio=1 status=undef
| `- 3:0:0:8 sdt 65:48 undef ready running
`-+- policy='service-time 0' prio=1 status=undef
`- 4:0:0:8 sdq 65:0 undef ready running
#==============================================================#
查看udev磁盘
#==============================================================#
ls -lh /dev/asmdisk
总用量 0
lrwxrwxrwx. 1 root root 7 12月 20 18:36 dmarch01 -> ../dm-4
lrwxrwxrwx. 1 root root 7 12月 20 18:36 dmarch02 -> ../dm-5
lrwxrwxrwx. 1 root root 7 12月 20 18:36 dmdata01 -> ../dm-8
lrwxrwxrwx. 1 root root 7 12月 20 18:36 dmdata02 -> ../dm-9
lrwxrwxrwx. 1 root root 8 12月 20 18:36 dmdata03 -> ../dm-10
lrwxrwxrwx. 1 root root 7 12月 20 18:36 dmdcr01 -> ../dm-2
lrwxrwxrwx. 1 root root 7 12月 20 18:36 dmlog01 -> ../dm-6
lrwxrwxrwx. 1 root root 7 12月 20 18:36 dmlog02 -> ../dm-7
lrwxrwxrwx. 1 root root 7 12月 20 18:36 dmvote01 -> ../dm-3
#==============================================================#
创建dsc参数文件
#==============================================================#
ls -lh /dmdata/DMDSC/
总用量 16K
-rw-r--r--. 1 dmdba dinstall 258 12月 20 18:36 dmasvrmal.ini
-rw-r--r--. 1 dmdba dinstall 166 12月 20 18:36 dmcssm.ini
-rw-r--r--. 1 dmdba dinstall 1.1K 12月 20 18:36 dmdcr_cfg.ini
-rw-r--r--. 1 dmdba dinstall 413 12月 20 18:36 dmdcr.ini
#==============================================================#
注册css和asm服务
#==============================================================#
Created symlink from /etc/systemd/system/multi-user.target.wants/DmCSSServiceCss.service to /usr/lib/systemd/system/DmCSSServiceCss.service.
创建服务(DmCSSServiceCss)完成
Created symlink from /etc/systemd/system/multi-user.target.wants/DmASMSvrServiceAsmsvr.service to /usr/lib/systemd/system/DmASMSvrServiceAsmsvr.service.
创建服务(DmASMSvrServiceAsmsvr)完成
#==============================================================#
创建归档和备份脚本
#==============================================================#
创建数据库归档脚本:
-rw-r--r--. 1 dmdba dinstall 338 12月 20 18:36 /home/dmdba/scripts/conf_arch.sql
创建数据库备份脚本:
-rw-r--r--. 1 dmdba dinstall 778 12月 20 18:36 /home/dmdba/scripts/conf_fullbackup.sql
-rw-r--r--. 1 dmdba dinstall 1.5K 12月 20 18:36 /home/dmdba/scripts/conf_incrbackup.sql
创建 DMDBA 用户脚本,密码 SYSDBA :
-rw-r--r--. 1 dmdba dinstall 696 12月 20 18:36 /home/dmdba/scripts/ct_dbuser.sql
#==============================================================#
创建达梦数据库优化脚本
#==============================================================#
创建数据库参数配置脚本:
-rw-r--r--. 1 dmdba dinstall 14K 12月 20 18:36 /home/dmdba/scripts/conf_para.sql
创建数据库优化结果查询脚本:
-rw-r--r--. 1 dmdba dinstall 2.2K 12月 20 18:36 /home/dmdba/scripts/query_dm.sql
#==============================================================#
配置节点:192.168.2.32
#==============================================================#
节点 192.168.2.32 开始执行配置:
███████ ████ ████ ████████ ██ ██ ██ ██ ██ ██ ██
░██░░░░██ ░██░██ ██░██ ██░░░░░░ ░██ ░██ ░██░██ ░██ ░██ ░██
░██ ░██░██░░██ ██ ░██░██ ░██ █████ ░██ ░██░██ ███████ ██████ ██████ ██████ ░██ ░██
░██ ░██░██ ░░███ ░██░█████████░██████ ██░░░██ ░██ ░██░██░░██░░░██ ██░░░░ ░░░██░ ░░░░░░██ ░██ ░██
░██ ░██░██ ░░█ ░██░░░░░░░░██░██░░░██░███████ ░██ ░██░██ ░██ ░██░░█████ ░██ ███████ ░██ ░██
░██ ██ ░██ ░ ░██ ░██░██ ░██░██░░░░ ░██ ░██░██ ░██ ░██ ░░░░░██ ░██ ██░░░░██ ░██ ░██
░███████ ░██ ░██ ████████ ░██ ░██░░██████ ███ ███░██ ███ ░██ ██████ ░░██ ░░████████ ███ ███
░░░░░░░ ░░ ░░ ░░░░░░░░ ░░ ░░ ░░░░░░ ░░░ ░░░ ░░ ░░░ ░░ ░░░░░░ ░░ ░░░░░░░░ ░░░ ░░░
达梦数据库开始安装:
#==============================================================#
打印系统信息
#==============================================================#
服务器时间:
2022年 12月 20日 星期二 18:39:16 CST
操作系统版本:
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
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
座: 1
NUMA 节点: 1
厂商 ID: GenuineIntel
CPU 系列: 6
型号: 142
型号名称: Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
步进: 12
CPU MHz: 1992.001
BogoMIPS: 3984.00
超管理器厂商: VMware
虚拟化类型: 完全
L1d 缓存: 32K
L1i 缓存: 32K
L2 缓存: 256K
L3 缓存: 8192K
NUMA 节点0 CPU: 0
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 arat md_clear spec_ctrl intel_stibp flush_l1d arch_capabilities
内存信息:
total used free shared buff/cache available
Mem: 1819 236 456 9 1126 1413
Swap: 8191 0 8191
total used free shared buff/cache available
Mem: 1.8G 236M 456M 9.6M 1.1G 1.4G
Swap: 8.0G 0B 8.0G
挂载信息:
/dev/mapper/centos-root / xfs defaults 0 0
UUID=dc24af02-0269-4d90-88b9-c6fdb8c27470 /boot xfs defaults 0 0
/dev/mapper/centos-swap swap swap defaults 0 0
/dev/sr0 /mnt/cdrom iso9660 defaults 0 0
目录信息:
文件系统 容量 已用 可用 已用% 挂载点
devtmpfs 898M 0 898M 0% /dev
tmpfs 910M 0 910M 0% /dev/shm
tmpfs 910M 9.6M 901M 2% /run
tmpfs 910M 0 910M 0% /sys/fs/cgroup
/dev/mapper/centos-root 91G 2.7G 89G 3% /
/dev/sr0 4.4G 4.4G 0 100% /mnt/cdrom
/dev/sda1 1014M 151M 864M 15% /boot
tmpfs 182M 0 182M 0% /run/user/0
#==============================================================#
关闭 SWAP 功能
#==============================================================#
total used free shared buff/cache available
Mem: 1863004 235688 473596 9820 1153720 1453324
Swap: 0 0 0
#/dev/mapper/centos-swap swap swap defaults 0 0
#==============================================================#
禁用防火墙
#==============================================================#
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)
12月 20 18:33:51 centos7 systemd[1]: Starting firewalld - dynamic firewall daemon...
12月 20 18:33:52 centos7 systemd[1]: Started firewalld - dynamic firewall daemon.
12月 20 18:33:52 centos7 firewalld[715]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure configuration option. It will be removed in a future release. Please consider disabling it now.
12月 20 18:39:16 centos7 systemd[1]: Stopping firewalld - dynamic firewall daemon...
12月 20 18:39:16 centos7 systemd[1]: Stopped firewalld - dynamic firewall daemon.
#==============================================================#
禁用 selinux
#==============================================================#
SELINUX=disabled
SELINUXTYPE=targeted
#==============================================================#
配置主机名
#==============================================================#
Static hostname: dsc02
Icon name: computer-vm
Chassis: vm
Machine ID: f4a41440d98d417dbb5516d46b966467
Boot ID: 8d978273d91d42c0ae0d827f42dc54f2
Virtualization: vmware
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-1160.el7.x86_64
Architecture: x86-64
#==============================================================#
配置时间同步
#==============================================================#
Removed symlink /etc/systemd/system/multi-user.target.wants/chronyd.service.
● chronyd.service - NTP client/server
Loaded: loaded (/usr/lib/systemd/system/chronyd.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:chronyd(8)
man:chrony.conf(5)
12月 20 18:33:51 centos7 systemd[1]: Starting NTP client/server...
12月 20 18:33:51 centos7 chronyd[686]: chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +SECHASH +IPV6 +DEBUG)
12月 20 18:33:51 centos7 chronyd[686]: Frequency 0.000 +/- 1000000.000 ppm read from /var/lib/chrony/drift
12月 20 18:33:51 centos7 systemd[1]: Started NTP client/server.
12月 20 18:39:17 dsc02 systemd[1]: Stopping NTP client/server...
12月 20 18:39:17 dsc02 systemd[1]: Stopped NTP client/server.
2022年 12月 20日 星期二 18:39:17 CST
no crontab for root
#==============================================================#
禁用透明大页 & 禁用NUMA & 开启 I/0 schedule
#==============================================================#
index=0
kernel=/boot/vmlinuz-3.10.0-1160.el7.x86_64
args="ro crashkernel=auto spectre_v2=retpoline rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet LANG=zh_CN.UTF-8 numa=off transparent_hugepage=never elevator=deadline"
--
index=1
kernel=/boot/vmlinuz-0-rescue-f4a41440d98d417dbb5516d46b966467
args="ro crashkernel=auto spectre_v2=retpoline rd.lvm.lv=centos/root rd.lvm.lv=centos/swap 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)
#==============================================================#
配置系统参数
#==============================================================#
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
sysctl: cannot stat /proc/sys/vm/numa_stat: 没有那个文件或目录
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
[Manager]
DefaultLimitCORE=infinity
DefaultLimitNOFILE=65536
DefaultLimitNPROC=10240
auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
auth substack system-auth
auth include postlogin
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 include postlogin
-session optional pam_ck_connector.so
session required pam_limits.so
session required /lib64/security/pam_limits.so
#==============================================================#
禁用 RemoveIPC
#==============================================================#
[Login]
RemoveIPC=no
#==============================================================#
配置语言中文
#==============================================================#
export LANG=zh_CN.UTF-8
#==============================================================#
配置用户环境变量
#==============================================================#
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
PATH=$PATH:$HOME/.local/bin:$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 18:39:40
[INFO] 安装达梦数据库...
2022-12-20 18:39:40
[INFO] 安装 基础 模块...
2022-12-20 18:39:45
[INFO] 安装 服务器 模块...
2022-12-20 18:39:45
[INFO] 安装 客户端 模块...
2022-12-20 18:39:49
[INFO] 安装 驱动 模块...
2022-12-20 18:39:51
[INFO] 安装 手册 模块...
2022-12-20 18:39:51
[INFO] 安装 服务 模块...
2022-12-20 18:39:53
[INFO] 移动日志文件。
2022-12-20 18:39:53
[INFO] 更改安装目录权限完成。
2022-12-20 18:39:53
[INFO] 正在启动DmAPService服务...
2022-12-20 18:39:54
[INFO] 启动DmAPService服务成功。
2022-12-20 18:39:54
[INFO] 安装达梦数据库完成。
#==============================================================#
拷贝UDEV规则文件
#==============================================================#
defaults {
polling_interval 30
failback immediate
no_path_retry 5
rr_min_io 100
path_checker tur
user_friendly_names yes
}
blacklist {
devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
devnode "^(hd|xvd|vd)[a-z]*"
}
multipaths {
multipath {
wwid "36001405f5c51be3913d41f58ceb59dd5"
alias dmdcr01
}
multipath {
wwid "36001405c3cbda6d685747b1a5b649ee3"
alias dmvote01
}
multipath {
wwid "36001405d0e3c3a9b2874cc6aad8ef901"
alias dmlog01
}
multipath {
wwid "36001405716c01510c5c448f801989e89"
alias dmlog02
}
multipath {
wwid "36001405b0ccc91e5cdd4c4b9ce6cc7d0"
alias dmarch01
}
multipath {
wwid "3600140500b7852874dc402f8ff46337c"
alias dmarch02
}
multipath {
wwid "360014051b4be89b555d48f58dabde17f"
alias dmdata01
}
multipath {
wwid "360014056995ce6cb1d94084a72064522"
alias dmdata02
}
multipath {
wwid "360014055454318b20a044448d2be00dc"
alias dmdata03
}
}
devices {
device {
path_grouping_policy group_by_prio
prio alua #failover
}
}
KERNEL=="dm-*", ENV{DM_UUID}=="mpath-36001405f5c51be3913d41f58ceb59dd5", SYMLINK+="asmdisk/dmdcr01", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="dm-*", ENV{DM_UUID}=="mpath-36001405c3cbda6d685747b1a5b649ee3", SYMLINK+="asmdisk/dmvote01", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="dm-*", ENV{DM_UUID}=="mpath-36001405d0e3c3a9b2874cc6aad8ef901", SYMLINK+="asmdisk/dmlog01", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="dm-*", ENV{DM_UUID}=="mpath-36001405716c01510c5c448f801989e89", SYMLINK+="asmdisk/dmlog02", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="dm-*", ENV{DM_UUID}=="mpath-36001405b0ccc91e5cdd4c4b9ce6cc7d0", SYMLINK+="asmdisk/dmarch01", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="dm-*", ENV{DM_UUID}=="mpath-3600140500b7852874dc402f8ff46337c", SYMLINK+="asmdisk/dmarch02", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="dm-*", ENV{DM_UUID}=="mpath-360014051b4be89b555d48f58dabde17f", SYMLINK+="asmdisk/dmdata01", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="dm-*", ENV{DM_UUID}=="mpath-360014056995ce6cb1d94084a72064522", SYMLINK+="asmdisk/dmdata02", OWNER="dmdba", GROUP="dinstall", MODE="0660"
KERNEL=="dm-*", ENV{DM_UUID}=="mpath-360014055454318b20a044448d2be00dc", SYMLINK+="asmdisk/dmdata03", OWNER="dmdba", GROUP="dinstall", MODE="0660"
#==============================================================#
查看multipath聚合磁盘
#==============================================================#
create: dmdcr01 (36001405f5c51be3913d41f58ceb59dd5) undef LIO-ORG ,data1
size=1.9G features='1 queue_if_no_path' hwhandler='0' wp=undef
|-+- policy='service-time 0' prio=1 status=undef
| `- 3:0:0:0 sde 8:64 undef ready running
`-+- policy='service-time 0' prio=1 status=undef
`- 4:0:0:0 sdc 8:32 undef ready running
create: dmvote01 (36001405c3cbda6d685747b1a5b649ee3) undef LIO-ORG ,data2
size=1.9G features='1 queue_if_no_path' hwhandler='0' wp=undef
|-+- policy='service-time 0' prio=1 status=undef
| `- 3:0:0:1 sdg 8:96 undef ready running
`-+- policy='service-time 0' prio=1 status=undef
`- 4:0:0:1 sdd 8:48 undef ready running
create: dmarch01 (36001405b0ccc91e5cdd4c4b9ce6cc7d0) undef LIO-ORG ,data3
size=9.3G features='1 queue_if_no_path' hwhandler='0' wp=undef
|-+- policy='service-time 0' prio=1 status=undef
| `- 3:0:0:2 sdi 8:128 undef ready running
`-+- policy='service-time 0' prio=1 status=undef
`- 4:0:0:2 sdf 8:80 undef ready running
create: dmarch02 (3600140500b7852874dc402f8ff46337c) undef LIO-ORG ,data4
size=9.3G features='1 queue_if_no_path' hwhandler='0' wp=undef
|-+- policy='service-time 0' prio=1 status=undef
| `- 3:0:0:3 sdj 8:144 undef ready running
`-+- policy='service-time 0' prio=1 status=undef
`- 4:0:0:3 sdh 8:112 undef ready running
create: dmlog01 (36001405d0e3c3a9b2874cc6aad8ef901) undef LIO-ORG ,data5
size=9.3G features='1 queue_if_no_path' hwhandler='0' wp=undef
|-+- policy='service-time 0' prio=1 status=undef
| `- 3:0:0:4 sdl 8:176 undef ready running
`-+- policy='service-time 0' prio=1 status=undef
`- 4:0:0:4 sdk 8:160 undef ready running
create: dmlog02 (36001405716c01510c5c448f801989e89) undef LIO-ORG ,data6
size=9.3G features='1 queue_if_no_path' hwhandler='0' wp=undef
|-+- policy='service-time 0' prio=1 status=undef
| `- 3:0:0:5 sdm 8:192 undef ready running
`-+- policy='service-time 0' prio=1 status=undef
`- 4:0:0:5 sdo 8:224 undef ready running
create: dmdata01 (360014051b4be89b555d48f58dabde17f) undef LIO-ORG ,data7
size=19G features='1 queue_if_no_path' hwhandler='0' wp=undef
|-+- policy='service-time 0' prio=1 status=undef
| `- 3:0:0:6 sdn 8:208 undef ready running
`-+- policy='service-time 0' prio=1 status=undef
`- 4:0:0:6 sdq 65:0 undef ready running
create: dmdata02 (360014056995ce6cb1d94084a72064522) undef LIO-ORG ,data8
size=19G features='1 queue_if_no_path' hwhandler='0' wp=undef
|-+- policy='service-time 0' prio=1 status=undef
| `- 3:0:0:7 sdp 8:240 undef ready running
`-+- policy='service-time 0' prio=1 status=undef
`- 4:0:0:7 sdr 65:16 undef ready running
create: dmdata03 (360014055454318b20a044448d2be00dc) undef LIO-ORG ,data9
size=19G features='1 queue_if_no_path' hwhandler='0' wp=undef
|-+- policy='service-time 0' prio=1 status=undef
| `- 3:0:0:8 sdt 65:48 undef ready running
`-+- policy='service-time 0' prio=1 status=undef
`- 4:0:0:8 sds 65:32 undef ready running
#==============================================================#
查看udev磁盘
#==============================================================#
ls -lh /dev/asmdisk
总用量 0
lrwxrwxrwx. 1 root root 7 12月 20 18:40 dmarch01 -> ../dm-4
lrwxrwxrwx. 1 root root 7 12月 20 18:40 dmarch02 -> ../dm-5
lrwxrwxrwx. 1 root root 7 12月 20 18:40 dmdata01 -> ../dm-8
lrwxrwxrwx. 1 root root 7 12月 20 18:40 dmdata02 -> ../dm-9
lrwxrwxrwx. 1 root root 8 12月 20 18:40 dmdata03 -> ../dm-10
lrwxrwxrwx. 1 root root 7 12月 20 18:40 dmdcr01 -> ../dm-2
lrwxrwxrwx. 1 root root 7 12月 20 18:40 dmlog01 -> ../dm-6
lrwxrwxrwx. 1 root root 7 12月 20 18:40 dmlog02 -> ../dm-7
lrwxrwxrwx. 1 root root 7 12月 20 18:40 dmvote01 -> ../dm-3
#==============================================================#
拷贝dsc参数文件
#==============================================================#
ls -lh /dmdata/DMDSC/
总用量 16K
-rw-r--r--. 1 dmdba dinstall 258 12月 20 18:40 dmasvrmal.ini
-rw-r--r--. 1 dmdba dinstall 166 12月 20 18:40 dmcssm.ini
-rw-r--r--. 1 dmdba dinstall 1.1K 12月 20 18:40 dmdcr_cfg.ini
-rw-r--r--. 1 dmdba dinstall 413 12月 20 18:40 dmdcr.ini
#==============================================================#
注册css和asm服务
#==============================================================#
Created symlink from /etc/systemd/system/multi-user.target.wants/DmCSSServiceCss.service to /usr/lib/systemd/system/DmCSSServiceCss.service.
创建服务(DmCSSServiceCss)完成
Created symlink from /etc/systemd/system/multi-user.target.wants/DmASMSvrServiceAsmsvr.service to /usr/lib/systemd/system/DmASMSvrServiceAsmsvr.service.
创建服务(DmASMSvrServiceAsmsvr)完成
#==============================================================#
创建归档和备份脚本
#==============================================================#
创建数据库归档脚本:
-rw-r--r--. 1 dmdba dinstall 338 12月 20 18:40 /home/dmdba/scripts/conf_arch.sql
创建数据库备份脚本:
-rw-r--r--. 1 dmdba dinstall 778 12月 20 18:40 /home/dmdba/scripts/conf_fullbackup.sql
-rw-r--r--. 1 dmdba dinstall 1.5K 12月 20 18:40 /home/dmdba/scripts/conf_incrbackup.sql
创建 DMDBA 用户脚本,密码 SYSDBA :
-rw-r--r--. 1 dmdba dinstall 696 12月 20 18:40 /home/dmdba/scripts/ct_dbuser.sql
#==============================================================#
创建达梦数据库优化脚本
#==============================================================#
创建数据库参数配置脚本:
-rw-r--r--. 1 dmdba dinstall 14K 12月 20 18:40 /home/dmdba/scripts/conf_para.sql
创建数据库优化结果查询脚本:
-rw-r--r--. 1 dmdba dinstall 2.2K 12月 20 18:40 /home/dmdba/scripts/query_dm.sql
Connection to 192.168.2.32 closed.
节点 192.168.2.32 配置完成!
#==============================================================#
初始化asm磁盘
#==============================================================#
DMASMCMD V8
ASM>create dcrdisk '/dev/asmdisk/dmdcr01' 'dmdcr01'
[Trace]The ASM initialize dcrdisk /dev/asmdisk/dmdcr01 to name DMASMdmdcr01
Used time: 23.531(ms).
ASM>create votedisk '/dev/asmdisk/dmvote01' 'dmvote01'
[Trace]The ASM initialize votedisk /dev/asmdisk/dmvote01 to name DMASMdmvote01
Used time: 10.533(ms).
ASM>create asmdisk '/dev/asmdisk/dmlog01' 'dmlog01'
[Trace]The ASM initialize asmdisk /dev/asmdisk/dmlog01 to name DMASMdmlog01
Used time: 11.395(ms).
ASM>create asmdisk '/dev/asmdisk/dmlog02' 'dmlog02'
[Trace]The ASM initialize asmdisk /dev/asmdisk/dmlog02 to name DMASMdmlog02
Used time: 12.519(ms).
ASM>create asmdisk '/dev/asmdisk/dmarch01' 'dmarch01'
[Trace]The ASM initialize asmdisk /dev/asmdisk/dmarch01 to name DMASMdmarch01
Used time: 9.605(ms).
ASM>create asmdisk '/dev/asmdisk/dmarch02' 'dmarch02'
[Trace]The ASM initialize asmdisk /dev/asmdisk/dmarch02 to name DMASMdmarch02
Used time: 9.289(ms).
ASM>create asmdisk '/dev/asmdisk/dmdata01' 'dmdata01'
[Trace]The ASM initialize asmdisk /dev/asmdisk/dmdata01 to name DMASMdmdata01
Used time: 11.621(ms).
ASM>create asmdisk '/dev/asmdisk/dmdata02' 'dmdata02'
[Trace]The ASM initialize asmdisk /dev/asmdisk/dmdata02 to name DMASMdmdata02
Used time: 12.373(ms).
ASM>create asmdisk '/dev/asmdisk/dmdata03' 'dmdata03'
[Trace]The ASM initialize asmdisk /dev/asmdisk/dmdata03 to name DMASMdmdata03
Used time: 16.502(ms).
ASM>init dcrdisk '/dev/asmdisk/dmdcr01' from '/dmdata/DMDSC/dmdcr_cfg.ini'identified by 'Welcome1'
[Trace]DG 126 alloc one extent for inodes, addr(disk_id, disk_auno, extent_no):(0,0,1).
[Trace]DG 126 allocate 4 extents for file 0xfe000002.
[Trace]DG 126 alloc 4 extents for 0xfe000002, addr(disk_id, disk_auno, extent_no):(0, 0, 2)->(0, 0, 5), need_init = 1.
Used time: 372.426(ms).
ASM>init votedisk '/dev/asmdisk/dmvote01' from '/dmdata/DMDSC/dmdcr_cfg.ini'
[Trace]DG 125 alloc one extent for inodes, addr(disk_id, disk_auno, extent_no):(0,0,1).
[Trace]DG 125 allocate 4 extents for file 0xfd000002.
[Trace]DG 125 alloc 4 extents for 0xfd000002, addr(disk_id, disk_auno, extent_no):(0, 0, 2)->(0, 0, 5), need_init = 1.
Used time: 172.535(ms).
#==============================================================#
启动css和asm服务
#==============================================================#
Starting DmCSSServiceCss: [ OK ]
节点 192.168.2.31 启动成功
Starting DmCSSServiceCss: [ OK ]
节点 192.168.2.32 启动成功
Starting DmASMSvrServiceAsmsvr: [ OK ]
节点 192.168.2.31 启动成功
Starting DmASMSvrServiceAsmsvr: [ OK ]
节点 192.168.2.32 启动成功
#==============================================================#
创建ASM磁盘组
#==============================================================#
DMASMTOOL V8
Used time: 196.538(ms).
ASM>ASM>DMASMTOOL V8
Used time: 120.033(ms).
ASM>ASM>DMASMTOOL V8
Used time: 170.628(ms).
ASM>ASM>DMASMTOOL V8
Used time: 72.326(ms).
ASM>ASM>DMASMTOOL V8
Used time: 247.186(ms).
ASM>ASM>DMASMTOOL V8
Used time: 110.695(ms).
ASM>ASM>DMASMTOOL V8
Used time: 97.387(ms).
ASM>ASM>
#==============================================================#
初始化达梦数据库
#==============================================================#
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: +DMLOG/log/dmdsc0_log01.log
log file path: +DMLOG/log/dmdsc0_log02.log
log file path: +DMLOG/log/dmdsc1_log01.log
log file path: +DMLOG/log/dmdsc1_log02.log
write to dir [+DMDATA/data/DMDSC].
create dm database success. 2022-12-20 18:39:51
数据库初始化完成
#==============================================================#
注册服务并启动数据库
#==============================================================#
Created symlink from /etc/systemd/system/multi-user.target.wants/DmServiceDMDSC.service to /usr/lib/systemd/system/DmServiceDMDSC.service.
创建服务(DmServiceDMDSC)完成
Starting DmServiceDMDSC: connnect dmasmtool successfully.
[ OK ]
节点 192.168.2.31 启动成功
Created symlink from /etc/systemd/system/multi-user.target.wants/DmServiceDMDSC.service to /usr/lib/systemd/system/DmServiceDMDSC.service.
创建服务(DmServiceDMDSC)完成
Starting DmServiceDMDSC: connnect dmasmtool successfully.
[ OK ]
节点 192.168.2.32 启动成功
#==============================================================#
创建数据库归档
#==============================================================#
在节点 192.168.2.31 创建归档
密钥过期时间:2023-11-21
操作已执行
已用时间: 2.591(毫秒). 执行号:0.
操作已执行
已用时间: 130.867(毫秒). 执行号:0.
操作已执行
已用时间: 102.286(毫秒). 执行号:0.
操作已执行
已用时间: 204.352(毫秒). 执行号:0.
操作已执行
已用时间: 9.093(毫秒). 执行号:0.
在节点 192.168.2.32 创建归档
密钥过期时间:2023-11-21
操作已执行
已用时间: 3.543(毫秒). 执行号:0.
操作已执行
已用时间: 95.084(毫秒). 执行号:0.
操作已执行
已用时间: 123.505(毫秒). 执行号:0.
操作已执行
已用时间: 249.956(毫秒). 执行号:0.
操作已执行
已用时间: 34.477(毫秒). 执行号:0.
#==============================================================#
在 192.168.2.32 创建备份
#==============================================================#
密钥过期时间:2023-11-21
NAME DESCRIBE
-------- -------------------------------------------------------------------------------
bak_full 周六全量备份,并删除30天之前的备份。
bak_inc 周日到周五做增量备份,如果失败,清除8天前备份,做全量备份
NAME COMMAND
--------- --------------------------------------------------------------------------------------------------------
bak_clear CALL SF_BAKSET_BACKUP_DIR_ADD('DISK','/dmbak/DMDSC'); CALL SP_DB_BAKSET_REMOVE_BATCH('DISK',SYSDATE-30);
#==============================================================#
优化数据库基础参数
#==============================================================#
密钥过期时间:2023-11-21
DECLARE
mem_per INT := 80; --默认所有的内存归达梦数据库使用,如实际不能100%可用,可以调整此参数
v_mem_mb INT;
v_cpus INT;
memory_pool INT;
memory_n_pools INT;
memory_target INT;
buffer INT;
max_buffer INT;
recycle INT;
cache_pool_size INT;
buffer_pools INT;
recycle_pools INT;
sort_buf_size INT;
sort_buf_global_size INT;
dict_buf_size INT;
hj_buf_size INT;
hagr_buf_size INT;
hj_buf_global_size INT;
hagr_buf_global_size INT;
sort_flag INT;
sort_blk_size INT;
rlog_pool_size INT;
task_threads INT;
io_thr_groups INT;
fast_pool_pages INT := 3000;
fast_roll_pages INT := 1000;
cnt INT;
BEGIN
cnt := 0;
SELECT top 1 n_cpu,
total_phy_size / 1024 / 1024
INTO v_cpus,
v_mem_mb
FROM v$systeminfo;
v_mem_mb := v_mem_mb * (mem_per / 100.0);
v_mem_mb = round(v_mem_mb,-3);
IF v_mem_mb <= 999 THEN
GOTO return_999;
END IF;
IF v_mem_mb > 512000 THEN
v_mem_mb := v_mem_mb * 0.8;
END IF;
memory_target = round(CAST(v_mem_mb * 0.12 AS INT),-3);
task_threads := 4;
io_thr_groups := 4;
IF v_cpus < 8 THEN
task_threads := 4;
io_thr_groups := 2;
END IF;
IF v_cpus >= 64 THEN
v_cpus := 64;
task_threads := 16;
io_thr_groups := 8;
END IF;
buffer := round(CAST(v_mem_mb * 0.4 AS INT),
-3);
max_buffer := buffer;
recycle := CAST(v_mem_mb * 0.04 AS INT);
IF v_mem_mb < 70000 THEN
WITH t AS
(SELECT rownum rn
FROM dual
CONNECT BY LEVEL <= 100),
t1 AS
(SELECT *
FROM t
WHERE rn > 1
MINUS
SELECT ta.rn * tb.rn
FROM t ta,
t tb
WHERE ta.rn <= tb.rn
AND ta.rn > 1
AND tb.rn > 1)
SELECT top 1 rn
INTO buffer_pools
FROM t1
WHERE rn > v_mem_mb / 800
ORDER BY 1;
--设置根据内存情况RECYCLE_POOLS参数
WITH t AS
(SELECT rownum rn
FROM dual
CONNECT BY LEVEL <= 100),
t1 AS
(SELECT *
FROM t
WHERE rn > 1
MINUS
SELECT ta.rn * tb.rn
FROM t ta,
t tb
WHERE ta.rn <= tb.rn
AND ta.rn > 1
AND tb.rn > 1)
SELECT top 1 rn
INTO recycle_pools
FROM t1
WHERE rn > v_mem_mb / 800 / 3
ORDER BY 1;
ELSE
buffer_pools := 101;
recycle_pools := 41;
END IF;
--修改内存池
IF v_mem_mb >= 16000 THEN
IF v_mem_mb = 16000 THEN
memory_pool := 1500;
sort_buf_global_size := 1000;
memory_n_pools := 3;
cache_pool_size := 512;
ELSE
memory_pool := 2000;
sort_buf_global_size := 2000;
memory_n_pools := 11;
cache_pool_size := 1024;
END IF;
fast_pool_pages := 9999;
sort_flag = 0;
sort_blk_size = 1;
sort_buf_size := 10;
rlog_pool_size := 1024;
hj_buf_global_size := least(CAST(v_mem_mb * 0.0625 AS INT),10000);
hagr_buf_global_size := least(CAST(v_mem_mb * 0.0625 AS INT),10000);
hj_buf_size := 250;
hagr_buf_size := 250;
recycle := round(recycle,-3);
IF v_mem_mb >= 64000 THEN
fast_pool_pages := 99999;
fast_roll_pages := 9999;
buffer := buffer - 3000;
max_buffer := buffer;
cache_pool_size := 2048;
rlog_pool_size := 2048;
sort_flag = 1;
sort_blk_size = 1;
sort_buf_size = 50;
sort_buf_global_size = CAST(v_mem_mb * 0.02 AS INT);
hj_buf_global_size := CAST(v_mem_mb * 0.15625 AS INT);
hagr_buf_global_size := CAST(v_mem_mb * 0.04 AS INT);
hj_buf_size := 512;
hagr_buf_size := 512;
memory_n_pools := 59;
END IF;
dict_buf_size := 50;
hj_buf_global_size := round(hj_buf_global_size,-3);
hagr_buf_global_size := round(hagr_buf_global_size,-3);
sort_buf_global_size := round(sort_buf_global_size,-3);
recycle := round(recycle,-3);
ELSE
memory_pool := great(CAST(v_mem_mb * 0.0625 AS INT), 100);
memory_pool := round(memory_pool,-2);
memory_n_pools := 1;
cache_pool_size := 200;
rlog_pool_size := 256;
sort_buf_size := 10;
sort_buf_global_size := 500;
dict_buf_size := 50;
sort_flag = 0;
sort_blk_size = 1;
hj_buf_global_size := great(CAST(v_mem_mb * 0.0625 AS INT),500);
hagr_buf_global_size := great(CAST(v_mem_mb * 0.0625 AS INT),500);
hj_buf_size := great(CAST(v_mem_mb * 0.00625 AS INT),50);
hagr_buf_size := great(CAST(v_mem_mb * 0.00625 AS INT),50);
END IF;
IF NOT EXISTS (select 1 from dba_tables where table_name ='BAK_DMINI_INI') THEN
EXECUTE IMMEDIATE 'CREATE TABLE BAK_DMINI_INI as select *,sysdate uptime from v$dm_ini';
END IF;
--修改cpu相关参数
sp_set_para_value(2,'WORKER_THREADS',v_cpus);
sp_set_para_value(2,'TASK_THREADS',task_threads);
sp_set_para_value(2,'IO_THR_GROUPS',io_thr_groups);
--修改内存池相关参数
sp_set_para_value(2,'MAX_OS_MEMORY',mem_per);
sp_set_para_value(2,'MEMORY_POOL',memory_pool);
sp_set_para_value(2,'MEMORY_N_POOLS',memory_n_pools);
sp_set_para_value(2,'MEMORY_TARGET',memory_target);
--修改内存检测参数为1
sp_set_para_value(2,'MEMORY_MAGIC_CHECK',1);
--非DSC环境将ENABLE_FREQROOTS设置为1,注意DM7 V$instance视图没有dsc_role字段,DM7这部分可以删掉
IF EXISTS (SELECT 1
FROM v$instance
WHERE dsc_role = 'NULL') THEN
sp_set_para_value(2,'ENABLE_FREQROOTS',1);
END IF;
--修改缓冲区相关参数
sp_set_para_value(2,'BUFFER',buffer);
sp_set_para_value(2,'MAX_BUFFER',max_buffer);
sp_set_para_value(2,'BUFFER_POOLS',buffer_pools);
sp_set_para_value(2,'RECYCLE',recycle);
sp_set_para_value(2,'RECYCLE_POOLS',recycle_pools);
--修改fast_pool相关参数
sp_set_para_value(2,'FAST_POOL_PAGES',fast_pool_pages);
sp_set_para_value(2,'FAST_ROLL_PAGES',fast_roll_pages);
--修改HASH相关参数
sp_set_para_value(1,'HJ_BUF_GLOBAL_SIZE',hj_buf_global_size);
sp_set_para_value(1,'HJ_BUF_SIZE',hj_buf_size);
sp_set_para_value(1,'HAGR_BUF_GLOBAL_SIZE',hagr_buf_global_size);
sp_set_para_value(1,'HAGR_BUF_SIZE',hagr_buf_size);
--修改排序相关参数
sp_set_para_value(2,'SORT_FLAG',sort_flag);
sp_set_para_value(2,'SORT_BLK_SIZE',sort_blk_size);
sp_set_para_value(2,'SORT_BUF_SIZE',sort_buf_size);
sp_set_para_value(2,'SORT_BUF_GLOBAL_SIZE',sort_buf_global_size);
--修改其他内存参数
sp_set_para_value(2,'RLOG_POOL_SIZE',rlog_pool_size);
sp_set_para_value(2,'CACHE_POOL_SIZE',cache_pool_size);
sp_set_para_value(2,'DICT_BUF_SIZE',dict_buf_size);
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);
-- 打印出来优化的参数
print ' ';
print '修改cpu相关参数: ';
print ' ';
print 'SP_SET_PARA_VALUE(2,''WORKER_THREADS'','||v_cpus||');';
print 'SP_SET_PARA_VALUE(2,''TASK_THREADS'','||task_threads||');';
print 'SP_SET_PARA_VALUE(2,''IO_THR_GROUPS'','||io_thr_groups||');';
print ' ';
print '修改内存池相关参数: ';
print ' ';
print 'SP_SET_PARA_VALUE(2,''MAX_OS_MEMORY'','||mem_per||');';
print 'SP_SET_PARA_VALUE(2,''MEMORY_POOL'','||memory_pool||');';
print 'SP_SET_PARA_VALUE(2,''MEMORY_N_POOLS'','||memory_n_pools||');';
print 'SP_SET_PARA_VALUE(2,''MEMORY_TARGET'','||memory_target||');';
print ' ';
print '修改缓冲区相关参数: ';
print ' ';
print 'SP_SET_PARA_VALUE(2,''BUFFER'','||buffer||');';
print 'SP_SET_PARA_VALUE(2,''MAX_BUFFER'','||max_buffer||');';
print 'SP_SET_PARA_VALUE(2,''BUFFER_POOLS'','||buffer_pools||');';
print 'SP_SET_PARA_VALUE(2,''RECYCLE'',' ||recycle||');';
print 'SP_SET_PARA_VALUE(2,''RECYCLE_POOLS'','||recycle_pools||');';
print ' ';
print '修改fast_pool相关参数: ';
print ' ';
print 'SP_SET_PARA_VALUE(2,''FAST_POOL_PAGES'','||fast_pool_pages||');';
print 'SP_SET_PARA_VALUE(2,''FAST_ROLL_PAGES'','||fast_roll_pages||');';
print ' ';
print '修改内存检测参数为1: ';
print ' ';
print 'SP_SET_PARA_VALUE(2,''MEMORY_MAGIC_CHECK'',1);';
print ' ';
print '非DSC环境将ENABLE_FREQROOTS设置为1,注意DM7 V$instance视图没有dsc_role字段,DM7这部分可以删掉: ';
print ' ';
IF EXISTS (SELECT 1
FROM v$instance
WHERE dsc_role = 'NULL') THEN
print 'SP_SET_PARA_VALUE(2,''ENABLE_FREQROOTS'',1);';
END IF;
print ' ';
print '修改HASH相关参数: ';
print ' ';
print 'SP_SET_PARA_VALUE(1,''HJ_BUF_GLOBAL_SIZE'','||hj_buf_global_size||');';
print 'SP_SET_PARA_VALUE(1,''HJ_BUF_SIZE'','||hj_buf_size||');';
print 'SP_SET_PARA_VALUE(1,''HAGR_BUF_GLOBAL_SIZE'','||hagr_buf_global_size||');';
print 'SP_SET_PARA_VALUE(1,''HAGR_BUF_SIZE'','|| hagr_buf_size||');';
print ' ';
print '修改排序相关参数: ';
print ' ';
print 'SP_SET_PARA_VALUE(2,''SORT_FLAG'','||sort_flag||');';
print 'SP_SET_PARA_VALUE(2,''SORT_BLK_SIZE'','||sort_blk_size||');';
print 'SP_SET_PARA_VALUE(2,''SORT_BUF_SIZE'','||sort_buf_size||');';
print 'SP_SET_PARA_VALUE(2,''SORT_BUF_GLOBAL_SIZE'','||sort_buf_global_size||');';
print ' ';
print '修改其他内存参数: ';
print ' ';
print 'SP_SET_PARA_VALUE(2,''RLOG_POOL_SIZE'','||rlog_pool_size||');';
print 'SP_SET_PARA_VALUE(2,''CACHE_POOL_SIZE'','||cache_pool_size||');';
print 'SP_SET_PARA_VALUE(2,''DICT_BUF_SIZE'','||dict_buf_size||');';
print 'SP_SET_PARA_VALUE(2,''VM_POOL_TARGET'',16384);';
print 'SP_SET_PARA_VALUE(2,''SESS_POOL_TARGET'',16384);';
print ' ';
print '修改实例相关参数: ';
print ' ';
print 'SP_SET_PARA_VALUE(2,''USE_PLN_POOL'',1);';
print 'SP_SET_PARA_VALUE(2,''ENABLE_MONITOR'',1);';
print 'SP_SET_PARA_VALUE(2,''TEMP_SIZE'',1024);';
print 'SP_SET_PARA_VALUE(2,''TEMP_SPACE_LIMIT'',102400);';
print 'SP_SET_PARA_VALUE(2,''MAX_SESSIONS'',1500);';
print 'SP_SET_PARA_VALUE(2,''MAX_SESSION_STATEMENT'',20000);';
print 'SP_SET_PARA_VALUE(2,''PK_WITH_CLUSTER'',0);';
print 'SP_SET_PARA_VALUE(2,''ENABLE_ENCRYPT'',0);';
print ' ';
print '修改优化器相关参数: ';
print ' ';
print 'SP_SET_PARA_VALUE(2,''OLAP_FLAG'',2);';
print 'SP_SET_PARA_VALUE(2,''VIEW_PULLUP_FLAG'',1);';
print 'SP_SET_PARA_VALUE(2,''OPTIMIZER_MODE'',1);';
print 'SP_SET_PARA_VALUE(2,''ADAPTIVE_NPLN_FLAG'',0);';
print ' ';
print '开启并行PURGE: ';
print ' ';
print 'SP_SET_PARA_VALUE(2,''PARALLEL_PURGE_FLAG'',1);';
print ' ';
print '开启手动并行: ';
print ' ';
print 'SP_SET_PARA_VALUE(2,''PARALLEL_POLICY'',2);';
print ' ';
print 'UNDO_RETENTION如果放大,可以适当调大UNDO_EXTENT_NUM。负载高的时候,减少文件系统的申请/释放操作: ';
print ' ';
print 'SP_SET_PARA_VALUE(2,''UNDO_EXTENT_NUM'',16);';
print ' ';
print '开启SQL 注入HINT功能: ';
print ' ';
print 'SP_SET_PARA_VALUE(2,''ENABLE_INJECT_HINT'',1);';
print ' ';
print '开启数据异步追踪: ';
print ' ';
print 'SP_SET_PARA_VALUE(1,''SVR_LOG'',1);';
print ' ';
print '开启操作系统认证: ';
print ' ';
print 'sp_set_para_value(2,''ENABLE_LOCAL_OSAUTH'',1);';
print ' ';
EXCEPTION
WHEN OTHERS THEN
raise_application_error(-20001,substr(' 执行失败, ' || SQLCODE || ' ' || SQLERRM || ' ' || dbms_utility.format_error_backtrace,1,400));
<<return_999>>
NULL;
END;
[-20001]: 执行失败, -838 非法的配置参数值 -838: anonymous block line 188
.
重启数据库,优化参数生效
关闭数据库
[monitor] 2022-12-20 18:40:49: CSS MONITOR V8
[monitor] 2022-12-20 18:40:49: CSS MONITOR SYSTEM IS READY.
[monitor] 2022-12-20 18:40:49: Wait CSS Control Node choosed...
[monitor] 2022-12-20 18:40:50: Wait CSS Control Node choosed succeed.
[monitor] 2022-12-20 18:40:50: 组(GRP_DMDSC)中节点对应的CSS自动拉起标记已经处于关闭状态
[monitor] 2022-12-20 18:40:50: 通知CSS(seqno:0)执行EP STOP(GRP_DMDSC)
[monitor] 2022-12-20 18:40:59: 通知当前活动的CSS执行清理操作
[monitor] 2022-12-20 18:41:00: 清理CSS(0)请求成功
[monitor] 2022-12-20 18:41:00: 清理CSS(1)请求成功
[monitor] 2022-12-20 18:41:00: 命令EP STOP GRP_DMDSC执行成功
启动数据库
[monitor] 2022-12-20 18:41:06: CSS MONITOR V8
[monitor] 2022-12-20 18:41:06: CSS MONITOR SYSTEM IS READY.
[monitor] 2022-12-20 18:41:06: Wait CSS Control Node choosed...
[monitor] 2022-12-20 18:41:07: Wait CSS Control Node choosed succeed.
[monitor] 2022-12-20 18:41:07: 通知CSS(seqno:0)执行EP STARTUP(DMDSC0)
[monitor] 2022-12-20 18:41:15: 通知CSS(seqno:0)执行EP STARTUP(DMDSC0)成功
[monitor] 2022-12-20 18:41:15: 通知CSS(seqno:1)执行EP STARTUP(DMDSC1)
[monitor] 2022-12-20 18:41:25: 通知CSS(seqno:1)执行EP STARTUP(DMDSC1)成功
[monitor] 2022-12-20 18:41:25: 通知CSS(seqno:0)打开节点(DMDSC0)的自动拉起功能
[monitor] 2022-12-20 18:41:25: 通知CSS(seqno:0)打开节点(DMDSC0)的自动拉起功能成功
[monitor] 2022-12-20 18:41:25: 通知CSS(seqno:1)打开节点(DMDSC1)的自动拉起功能
[monitor] 2022-12-20 18:41:25: 通知CSS(seqno:1)打开节点(DMDSC1)的自动拉起功能成功
[monitor] 2022-12-20 18:41:25: 打开CSS自动拉起功能成功
[monitor] 2022-12-20 18:41:25: 通知当前活动的CSS执行清理操作
[monitor] 2022-12-20 18:41:25: 清理CSS(0)请求成功
[monitor] 2022-12-20 18:41:26: 清理CSS(1)请求成功
[monitor] 2022-12-20 18:41:26: 命令EP STARTUP GRP_DMDSC执行成功
#==============================================================#
创建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 10000
TRX_VIEW_MODE 1 1
MAX_SESSIONS 10000 10000
IO_THR_GROUPS 8 2
ADAPTIVE_NPLN_FLAG 3 3
OPTIMIZER_MODE 1 1
TOP_DIS_HASH_FLAG 1 1
TOP_ORDER_OPT_FLAG 0 0
VIEW_PULLUP_FLAG 0 0
USE_PLN_POOL 1 1
TASK_THREADS 16 16
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 500
HAGR_BUF_GLOBAL_SIZE 5000 5000
HJ_BUF_SIZE 500 500
HJ_BUF_GLOBAL_SIZE 5000 5000
SORT_FLAG 0 0
SORT_BUF_GLOBAL_SIZE 1000 1000
SORT_BLK_SIZE 1 1
SORT_BUF_SIZE 20 20
MAX_BUFFER 1000 1000
RECYCLE_POOLS 3 3
RECYCLE 300 300
BUFFER_POOLS 9 9
BUFFER 1000 1000
MEMORY_MAGIC_CHECK 1 1
MEMORY_TARGET 15000 0
MEMORY_N_POOLS 1 1
MEMORY_POOL 500 200
PK_WITH_CLUSTER 0 0
ENABLE_MONITOR 1 1
SVR_LOG 0 0
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 100
TEMP_SPACE_LIMIT 0 0
TEMP_SIZE 10 10
OLAP_FLAG 2 2
恭喜您,达梦数据库DMDSC已经安装完成!
[root@centos7 soft]# su - dmdba
[dmdba@dsc01:~]$ dmcssm /dmdata/DMDSC/dmcssm.ini
[monitor] 2022-12-20 18:41:54: CSS MONITOR V8
[monitor] 2022-12-20 18:41:54: CSS MONITOR SYSTEM IS READY.
[monitor] 2022-12-20 18:41:54: Wait CSS Control Node choosed...
[monitor] 2022-12-20 18:41:55: Wait CSS Control Node choosed succeed.
show
monitor current time:2022-12-20 18:41:56, n_group:3
=================== group[name = GRP_CSS, seq = 0, type = CSS, Control Node = 0] ========================================
[CSS0] auto check = TRUE, global info:
[ASM0] auto restart = FALSE
[DMDSC0] auto restart = TRUE
[CSS1] auto check = TRUE, global info:
[ASM1] auto restart = FALSE
[DMDSC1] auto restart = TRUE
ep: css_time inst_name seqno port mode inst_status vtd_status is_ok active guid ts
2022-12-20 18:41:56 CSS0 0 12345 Control Node OPEN WORKING OK TRUE 133674 133921
2022-12-20 18:41:56 CSS1 1 12345 Normal Node OPEN WORKING OK TRUE 138058 138285
=================== group[name = GRP_ASM, seq = 1, type = ASM, Control Node = 0] ========================================
n_ok_ep = 2
ok_ep_arr(index, seqno):
(0, 0)
(1, 1)
sta = OPEN, sub_sta = STARTUP
break ep = NULL
recover ep = NULL
crash process over flag is TRUE
ep: css_time inst_name seqno port mode inst_status vtd_status is_ok active guid ts
2022-12-20 18:41:56 ASM0 0 12346 Control Node OPEN WORKING OK TRUE 148200 148403
2022-12-20 18:41:56 ASM1 1 12346 Normal Node OPEN WORKING OK TRUE 152590 152773
=================== group[name = GRP_DMDSC, seq = 2, type = DB, Control Node = 0] ========================================
n_ok_ep = 2
ok_ep_arr(index, seqno):
(0, 0)
(1, 1)
sta = OPEN, sub_sta = STARTUP
break ep = NULL
recover ep = NULL
crash process over flag is TRUE
ep: css_time inst_name seqno port mode inst_status vtd_status is_ok active guid ts
2022-12-20 18:41:56 DMDSC0 0 5236 Control Node OPEN WORKING OK TRUE 429454 429494
2022-12-20 18:41:56 DMDSC1 1 5236 Normal Node OPEN WORKING OK TRUE 430166 430197
==================================================================================================================
exit
[dmdba@dsc01:~]$ exit
登出
[END] 2022/12/20 11:32:40
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/cndba/DMShellInstall.git
git@gitee.com:cndba/DMShellInstall.git
cndba
DMShellInstall
DMShellInstall
master

搜索帮助