1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113
| [root@rac01 soft]# ./OracleShellInstall -n rac `# hostname prefix`\ > -hn rac01,rac02 `# rac node hostname`\ > -cn rac-cls `# cluster_name`\ > -rp oracle `# root password`\ > -gp oracle `# grid password`\ > -op oracle `# oracle password`\ > -lf ens192 `# local ip ifname`\ > -pf ens224 `# rac private ip ifname`\ > -ri 192.168.6.151,192.168.6.152 `# rac node public ip`\ > -vi 192.168.6.153,192.168.6.154 `# rac virtual ip`\ > -si 192.168.6.155 `# rac scan ip`\ > -od /dev/sdb `# rac ocr asm disk`\ > -dd /dev/sdc `# rac data asm disk`\ > -o lucifer `# dbname`\ > -ds AL32UTF8 `# database character`\ > -ns AL16UTF16 `# national character`\ > -dp oracle `# sys/system password`\ > -gpa 35940989 `# grid PSU/RU`\ > -ud Y
███████ ██ ████████ ██ ██ ██ ██ ██ ██ ██ ██░░░░░██ ░██ ██░░░░░░ ░██ ░██ ░██░██ ░██ ░██ ░██ ██ ░░██ ██████ ██████ █████ ░██ █████ ░██ ░██ █████ ░██ ░██░██ ███████ ██████ ██████ ██████ ░██ ░██ ░██ ░██░░██░░█ ░░░░░░██ ██░░░██ ░██ ██░░░██░█████████░██████ ██░░░██ ░██ ░██░██░░██░░░██ ██░░░░ ░░░██░ ░░░░░░██ ░██ ░██ ░██ ░██ ░██ ░ ███████ ░██ ░░ ░██░███████░░░░░░░░██░██░░░██░███████ ░██ ░██░██ ░██ ░██░░█████ ░██ ███████ ░██ ░██ ░░██ ██ ░██ ██░░░░██ ░██ ██ ░██░██░░░░ ░██░██ ░██░██░░░░ ░██ ░██░██ ░██ ░██ ░░░░░██ ░██ ██░░░░██ ░██ ░██ ░░███████ ░███ ░░████████░░█████ ███░░██████ ████████ ░██ ░██░░██████ ███ ███░██ ███ ░██ ██████ ░░██ ░░████████ ███ ███ ░░░░░░░ ░░░ ░░░░░░░░ ░░░░░ ░░░ ░░░░░░ ░░░░░░░░ ░░ ░░ ░░░░░░ ░░░ ░░░ ░░ ░░░ ░░ ░░░░░░ ░░ ░░░░░░░░ ░░░ ░░░
请选择安装模式 [单机(si)/单机ASM(sa)/集群(rac)] : rac
数据库安装模式: rac
请选择数据库版本 [11203/11/12/19/21] : 19
数据库版本: 19
配置本地 YUM 源
[server] name=server baseurl=file:///mnt enabled=1 gpgcheck=0
获取 ASM 磁盘 UUID && 格式化磁盘头
格式化 OCR 磁盘:/dev/sdb
1+0 records in 1+0 records out 1024 bytes (1.0 kB) copied, 0.0471055 s, 21.7 kB/s
OCR磁盘组的磁盘UUID: 2e87e4f535c397171
格式化 DATA 磁盘:/dev/sdc
1+0 records in 1+0 records out 1024 bytes (1.0 kB) copied, 0.0396776 s, 25.8 kB/s
DATA磁盘组的磁盘UUID: 2f218dae15b551c5d
配置 root 用户互信
Generating public/private rsa key pair. Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: SHA256:WWoGD210PXUNrmIMaZZY4Tkh1KeJnjQlEk//8tBpAZw root@rac01 The key's randomart image is: +---[RSA 2048]----+ | .o+o*o.. .o.o| | .o.OEB. o. ..| | .=+&+o .. | | +BoX o . | | o oS O . | | oo * . | | . | | | | | +----[SHA256]-----+
#==============================================================# 禁用防火墙 #==============================================================#
● 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)
Mar 11 14:50:08 rac01 systemd[1]: Starting firewalld - dynamic firewall daemon... Mar 11 14:50:10 rac01 systemd[1]: Started firewalld - dynamic firewall daemon. Mar 11 14:50:11 rac01 firewalld[982]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure configuration option. It will be removed in a future release. Please consider disabling it now. Mar 12 13:38:19 rac01 systemd[1]: Stopping firewalld - dynamic firewall daemon... Mar 12 13:38:20 rac01 systemd[1]: Stopped firewalld - dynamic firewall daemon.
#==============================================================# 禁用 SELinux #==============================================================#
SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted Current mode: permissive Mode from config file: disabled Policy MLS status: enabled Policy deny_unknown status: allowed Max kernel policy version: 31
#==============================================================# YUM 静默安装依赖包 #==============================================================#
bc-1.06.95-13.el7.x86_64 binutils-2.27-44.base.el7.x86_64 compat-libcap1-1.10-7.el7.x86_64 gcc-4.8.5-44.el7.x86_64 gcc-c++-4.8.5-44.el7.x86_64 elfutils-libelf-0.176-5.el7.x86_64 elfutils-libelf-devel-0.176-5.el7.x86_64 glibc-2.17-317.el7.x86_64 glibc-devel-2.17-317.el7.x86_64 libaio-0.3.109-13.el7.x86_64 libaio-devel-0.3.109-13.el7.x86_64 libgcc-4.8.5-44.el7.x86_64 libstdc++-4.8.5-44.el7.x86_64 libstdc++-devel-4.8.5-44.el7.x86_64 libxcb-1.13-1.el7.x86_64 libX11-1.6.7-2.el7.x86_64 libXau-1.0.8-2.1.el7.x86_64 libXi-1.7.9-1.el7.x86_64 libXrender-0.9.10-1.el7.x86_64 make-3.82-24.el7.x86_64 net-tools-2.0-0.25.20131004git.el7.x86_64 smartmontools-7.0-2.el7.x86_64 sysstat-10.1.5-19.el7.x86_64 e2fsprogs-1.42.9-19.el7.x86_64 e2fsprogs-libs-1.42.9-19.el7.x86_64 unzip-6.0-21.el7.x86_64 openssh-clients-7.4p1-21.el7.x86_64 readline-6.2-11.el7.x86_64 readline-devel-6.2-11.el7.x86_64 psmisc-22.20-17.el7.x86_64 ksh-20120801-142.el7.x86_64 nfs-utils-1.3.0-0.68.el7.x86_64 tar-1.26-35.el7.x86_64 device-mapper-multipath-0.4.9-133.el7.x86_64 avahi-0.6.31-20.el7.x86_64 ntp-4.2.6p5-29.el7_8.2.x86_64 chrony-3.4-1.el7.x86_64 libXtst-1.2.3-1.el7.x86_64 libXrender-devel-0.9.10-1.el7.x86_64 fontconfig-devel-2.13.0-4.3.el7.x86_64 policycoreutils-2.5-34.el7.x86_64 policycoreutils-python-2.5-34.el7.x86_64
#==============================================================# 配置主机名 #==============================================================#
rac01
#==============================================================# 配置 /etc/hosts 文件 #==============================================================#
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
## OracleBegin
## RAC1 IP's: rac01
192.168.6.151 rac01
192.168.6.153 rac01-vip
1.1.1.1 rac01-priv
192.168.6.152 rac02
192.168.6.154 rac02-vip
1.1.1.2 rac02-priv
192.168.6.155 rac-scan
创建用户和组
oracle 用户:
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(oper),54324(backupdba),54325(dgdba),54326(kmdba),54330(racdba),54327(asmdba),54328(asmoper),54329(asmadmin)
grid 用户:
uid=11012(grid) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(oper),54324(backupdba),54325(dgdba),54326(kmdba),54330(racdba),54327(asmdba),54328(asmoper),54329(asmadmin)
配置 Avahi-daemon 服务
● avahi-daemon.service - Avahi mDNS/DNS-SD Stack Loaded: loaded (/usr/lib/systemd/system/avahi-daemon.service; disabled; vendor preset: enabled) Active: inactive (dead)
Mar 12 13:33:14 rac01 avahi-daemon[877]: Registering new address record for fe80::f5b9:ca65:dba2:bf0 on ens192.*. Mar 12 13:33:14 rac01 avahi-daemon[877]: Joining mDNS multicast group on interface ens192.IPv4 with address 192.168.6.151. Mar 12 13:33:14 rac01 avahi-daemon[877]: New relevant interface ens192.IPv4 for mDNS. Mar 12 13:33:14 rac01 avahi-daemon[877]: Registering new address record for 192.168.6.151 on ens192.IPv4. Mar 12 13:33:14 rac01 avahi-daemon[877]: Registering new address record for fe80::a8ce:7574:2cec:a98e on ens224.*. Mar 12 13:33:14 rac01 avahi-daemon[877]: Joining mDNS multicast group on interface ens224.IPv4 with address 1.1.1.1. Mar 12 13:33:14 rac01 avahi-daemon[877]: New relevant interface ens224.IPv4 for mDNS. Mar 12 13:33:14 rac01 avahi-daemon[877]: Registering new address record for 1.1.1.1 on ens224.IPv4. Mar 12 13:39:02 rac01 systemd[1]: Stopping Avahi mDNS/DNS-SD Stack... Mar 12 13:39:02 rac01 systemd[1]: Stopped Avahi mDNS/DNS-SD Stack.
配置透明大页 && NUMA && 磁盘 IO 调度器
args="ro rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet LANG=en_US.UTF-8 numa=off transparent_hugepage=never elevator=deadline" -rd.lvm.lv=rhel/root -args="ro args="ro rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet numa=off transparent_hugepage=never elevator=deadline" -elevator=deadline" -transparent_hugepage=never
配置 sysctl.conf
fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmall = 2097152 kernel.shmmax = 8369385471 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.min_free_kbytes = 32692 net.ipv4.conf.ens192.rp_filter = 1 vm.swappiness = 10 kernel.panic_on_oops = 1 kernel.randomize_va_space = 2 kernel.numa_balancing = 0 net.ipv4.conf.ens224.rp_filter = 2
配置 nsysctl.conf
NOZEROCONF=yes
配置 RemoveIPC
[Login] RemoveIPC=no
配置 /etc/security/limits.conf 和 /etc/pam.d/login
查看 /etc/security/limits.conf:
oracle soft nofile 1024 oracle hard nofile 65536 oracle soft stack 10240 oracle hard stack 32768 oracle soft nproc 2047 oracle hard nproc 16384 oracle hard memlock unlimited oracle soft memlock unlimited grid soft nofile 1024 grid hard nofile 65536 grid soft stack 10240 grid hard stack 32768 grid soft nproc 2047 grid hard nproc 16384
查看 /etc/pam.d/login 文件:
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
配置 /dev/shm
/dev/mapper/rhel-root / xfs defaults 0 0 UUID=64fa46ff-7a45-4939-b2bf-f995a20165d1 /boot xfs defaults 0 0 /dev/mapper/rhel-swap swap swap defaults 0 0 tmpfs /dev/shm tmpfs size=8173228k 0 0
安装 rlwrap 插件
成功安装 rlwrap: rlwrap 0.44
Root 用户环境变量
if [ -f ~/.bashrc ]; then . ~/.bashrc fi PATH=$PATH:$HOME/bin export PATH alias so='su - oracle' export PS1="[`whoami`@`hostname`:"'$PWD]$ ' alias sg='su - grid' alias crsctl='/u01/app/19.3.0/grid/bin/crsctl' alias srvctl='/u01/app/19.3.0/grid/bin/srvctl'
Oracle 用户环境变量
if [ -f ~/.bashrc ]; then . ~/.bashrc fi PATH=$PATH:$HOME/.local/bin:$HOME/bin export PATH umask 022 export TMP=/tmp export TMPDIR=$TMP export NLS_LANG=AMERICAN_AMERICA.AL32UTF8 export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=/u01/app/oracle/product/19.3.0/db export ORACLE_TERM=xterm export TNS_ADMIN=$ORACLE_HOME/network/admin export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export ORACLE_SID=lucifer1 export PATH=/usr/sbin:$PATH export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$ORACLE_HOME/perl/bin:$PATH export PERL5LIB=$ORACLE_HOME/perl/lib alias sas='sqlplus / as sysdba' alias awr='sqlplus / as sysdba @?/rdbms/admin/awrrpt' alias ash='sqlplus / as sysdba @?/rdbms/admin/ashrpt' alias alert='vi $ORACLE_BASE/diag/rdbms/*/$ORACLE_SID/trace/alert_$ORACLE_SID.log' export PS1="[`whoami`@`hostname`:"'$PWD]$ ' alias sqlplus='rlwrap sqlplus' alias rman='rlwrap rman' alias adrci='rlwrap adrci'
Grid 用户环境变量
if [ -f ~/.bashrc ]; then . ~/.bashrc fi PATH=$PATH:$HOME/.local/bin:$HOME/bin export PATH umask 022 export TMP=/tmp export TMPDIR=$TMP export NLS_LANG=AMERICAN_AMERICA.AL32UTF8 export ORACLE_BASE=/u01/app/grid export ORACLE_HOME=/u01/app/19.3.0/grid export ORACLE_TERM=xterm export TNS_ADMIN=$ORACLE_HOME/network/admin export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export ORACLE_SID=+ASM1 export PATH=/usr/sbin:$PATH export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH alias sas='sqlplus / as sysasm' export PS1="[`whoami`@`hostname`:"'$PWD]$ ' alias sqlplus='rlwrap sqlplus' alias asmcmd='rlwrap asmcmd' alias adrci='rlwrap adrci'
配置 multipath 多路径
create: asm_ocr_1 (2e87e4f535c397171) undef ROCKET ,IMAGEFILE size=10G features='0' hwhandler='0' wp=undef `-+- policy='service-time 0' prio=1 status=undef `- 33:0:0:0 sdb 8:16 undef ready running create: asm_data_1 (2f218dae15b551c5d) undef ROCKET ,IMAGEFILE size=20G features='0' hwhandler='0' wp=undef `-+- policy='service-time 0' prio=1 status=undef `- 33:0:0:1 sdc 8:32 undef ready running
配置 UDEV 绑盘
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-2e87e4f535c397171",SYMLINK+="asm_ocr_1",OWNER="grid",GROUP="asmadmin",MODE="0660" KERNEL=="dm-*",ENV{DM_UUID}=="mpath-2f218dae15b551c5d",SYMLINK+="asm_data_1",OWNER="grid",GROUP="asmadmin",MODE="0660"
/dev/asm_data_1 /dev/asm_ocr_1
UDEV 配置完成!
配置 RAC 节点:192.168.6.152
正在节点:192.168.6.152 上执行脚本:
███████ ██ ████████ ██ ██ ██ ██ ██ ██ ██ ██░░░░░██ ░██ ██░░░░░░ ░██ ░██ ░██░██ ░██ ░██ ░██ ██ ░░██ ██████ ██████ █████ ░██ █████ ░██ ░██ █████ ░██ ░██░██ ███████ ██████ ██████ ██████ ░██ ░██ ░██ ░██░░██░░█ ░░░░░░██ ██░░░██ ░██ ██░░░██░█████████░██████ ██░░░██ ░██ ░██░██░░██░░░██ ██░░░░ ░░░██░ ░░░░░░██ ░██ ░██ ░██ ░██ ░██ ░ ███████ ░██ ░░ ░██░███████░░░░░░░░██░██░░░██░███████ ░██ ░██░██ ░██ ░██░░█████ ░██ ███████ ░██ ░██ ░░██ ██ ░██ ██░░░░██ ░██ ██ ░██░██░░░░ ░██░██ ░██░██░░░░ ░██ ░██░██ ░██ ░██ ░░░░░██ ░██ ██░░░░██ ░██ ░██ ░░███████ ░███ ░░████████░░█████ ███░░██████ ████████ ░██ ░██░░██████ ███ ███░██ ███ ░██ ██████ ░░██ ░░████████ ███ ███ ░░░░░░░ ░░░ ░░░░░░░░ ░░░░░ ░░░ ░░░░░░ ░░░░░░░░ ░░ ░░ ░░░░░░ ░░░ ░░░ ░░ ░░░ ░░ ░░░░░░ ░░ ░░░░░░░░ ░░░ ░░░
配置本地 YUM 源
[server] name=server baseurl=file:///mnt enabled=1 gpgcheck=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)
Mar 11 14:50:11 rac02 systemd[1]: Starting firewalld - dynamic firewall daemon... Mar 11 14:50:13 rac02 systemd[1]: Started firewalld - dynamic firewall daemon. Mar 11 14:50:13 rac02 firewalld[972]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure configuration option. It will be removed in a future release. Please consider disabling it now. Mar 12 13:39:35 rac02 systemd[1]: Stopping firewalld - dynamic firewall daemon... Mar 12 13:39:36 rac02 systemd[1]: Stopped firewalld - dynamic firewall daemon.
禁用 SELinux
SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted Current mode: permissive Mode from config file: disabled Policy MLS status: enabled Policy deny_unknown status: allowed Max kernel policy version: 31
YUM 静默安装依赖包
bc-1.06.95-13.el7.x86_64 binutils-2.27-44.base.el7.x86_64 compat-libcap1-1.10-7.el7.x86_64 gcc-4.8.5-44.el7.x86_64 gcc-c++-4.8.5-44.el7.x86_64 elfutils-libelf-0.176-5.el7.x86_64 elfutils-libelf-devel-0.176-5.el7.x86_64 glibc-2.17-317.el7.x86_64 glibc-devel-2.17-317.el7.x86_64 libaio-0.3.109-13.el7.x86_64 libaio-devel-0.3.109-13.el7.x86_64 libgcc-4.8.5-44.el7.x86_64 libstdc++-4.8.5-44.el7.x86_64 libstdc++-devel-4.8.5-44.el7.x86_64 libxcb-1.13-1.el7.x86_64 libX11-1.6.7-2.el7.x86_64 libXau-1.0.8-2.1.el7.x86_64 libXi-1.7.9-1.el7.x86_64 libXrender-0.9.10-1.el7.x86_64 make-3.82-24.el7.x86_64 net-tools-2.0-0.25.20131004git.el7.x86_64 smartmontools-7.0-2.el7.x86_64 sysstat-10.1.5-19.el7.x86_64 e2fsprogs-1.42.9-19.el7.x86_64 e2fsprogs-libs-1.42.9-19.el7.x86_64 unzip-6.0-21.el7.x86_64 openssh-clients-7.4p1-21.el7.x86_64 readline-6.2-11.el7.x86_64 readline-devel-6.2-11.el7.x86_64 psmisc-22.20-17.el7.x86_64 ksh-20120801-142.el7.x86_64 nfs-utils-1.3.0-0.68.el7.x86_64 tar-1.26-35.el7.x86_64 device-mapper-multipath-0.4.9-133.el7.x86_64 avahi-0.6.31-20.el7.x86_64 ntp-4.2.6p5-29.el7_8.2.x86_64 chrony-3.4-1.el7.x86_64 libXtst-1.2.3-1.el7.x86_64 libXrender-devel-0.9.10-1.el7.x86_64 fontconfig-devel-2.13.0-4.3.el7.x86_64 policycoreutils-2.5-34.el7.x86_64 policycoreutils-python-2.5-34.el7.x86_64
配置主机名
rac02
配置 /etc/hosts 文件
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.6.151 rac01
192.168.6.153 rac01-vip
1.1.1.1 rac01-priv
192.168.6.152 rac02
192.168.6.154 rac02-vip
1.1.1.2 rac02-priv
192.168.6.155 rac-scan
创建用户和组
oracle 用户:
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(oper),54324(backupdba),54325(dgdba),54326(kmdba),54330(racdba),54327(asmdba),54328(asmoper),54329(asmadmin)
grid 用户:
uid=11012(grid) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(oper),54324(backupdba),54325(dgdba),54326(kmdba),54330(racdba),54327(asmdba),54328(asmoper),54329(asmadmin)
配置 Avahi-daemon 服务
● avahi-daemon.service - Avahi mDNS/DNS-SD Stack Loaded: loaded (/usr/lib/systemd/system/avahi-daemon.service; disabled; vendor preset: enabled) Active: inactive (dead)
Mar 12 13:31:56 rac02 avahi-daemon[909]: Joining mDNS multicast group on interface ens192.IPv4 with address 192.168.6.152. Mar 12 13:31:56 rac02 avahi-daemon[909]: New relevant interface ens192.IPv4 for mDNS. Mar 12 13:31:56 rac02 avahi-daemon[909]: Registering new address record for 192.168.6.152 on ens192.IPv4. Mar 12 13:31:57 rac02 avahi-daemon[909]: Registering new address record for fe80::3044:e992:319f:95a2 on ens224.*. Mar 12 13:31:57 rac02 avahi-daemon[909]: Joining mDNS multicast group on interface ens224.IPv4 with address 1.1.1.2. Mar 12 13:31:57 rac02 avahi-daemon[909]: New relevant interface ens224.IPv4 for mDNS. Mar 12 13:31:57 rac02 avahi-daemon[909]: Registering new address record for 1.1.1.2 on ens224.IPv4. Mar 12 13:40:06 rac02 systemd[1]: Stopping Avahi mDNS/DNS-SD Stack... Mar 12 13:40:06 rac02 avahi-daemon[909]: Got SIGTERM, quitting. Mar 12 13:40:06 rac02 systemd[1]: Stopped Avahi mDNS/DNS-SD Stack.
配置透明大页 && NUMA && 磁盘 IO 调度器
args="ro rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet LANG=en_US.UTF-8 numa=off transparent_hugepage=never elevator=deadline" -rd.lvm.lv=rhel/root -args="ro args="ro rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet numa=off transparent_hugepage=never elevator=deadline" -elevator=deadline" -transparent_hugepage=never
配置 sysctl.conf
fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmall = 2097152 kernel.shmmax = 8369381375 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.min_free_kbytes = 32692 net.ipv4.conf.ens192.rp_filter = 1 vm.swappiness = 10 kernel.panic_on_oops = 1 kernel.randomize_va_space = 2 kernel.numa_balancing = 0 net.ipv4.conf.ens224.rp_filter = 2
配置 nsysctl.conf
NOZEROCONF=yes
配置 RemoveIPC
[Login] RemoveIPC=no
配置 /etc/security/limits.conf 和 /etc/pam.d/login
查看 /etc/security/limits.conf:
oracle soft nofile 1024 oracle hard nofile 65536 oracle soft stack 10240 oracle hard stack 32768 oracle soft nproc 2047 oracle hard nproc 16384 oracle hard memlock unlimited oracle soft memlock unlimited grid soft nofile 1024 grid hard nofile 65536 grid soft stack 10240 grid hard stack 32768 grid soft nproc 2047 grid hard nproc 16384
查看 /etc/pam.d/login 文件:
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
配置 /dev/shm
/dev/mapper/rhel-root / xfs defaults 0 0 UUID=96b8401c-571c-4575-82e9-1ce6b248167b /boot xfs defaults 0 0 /dev/mapper/rhel-swap swap swap defaults 0 0 tmpfs /dev/shm tmpfs size=8173224k 0 0
安装 rlwrap 插件
成功安装 rlwrap: rlwrap 0.44
Root 用户环境变量
if [ -f ~/.bashrc ]; then . ~/.bashrc fi PATH=$PATH:$HOME/bin export PATH alias so='su - oracle' export PS1="[`whoami`@`hostname`:"'$PWD]$ ' alias sg='su - grid' alias crsctl='/u01/app/19.3.0/grid/bin/crsctl' alias srvctl='/u01/app/19.3.0/grid/bin/srvctl'
Oracle 用户环境变量
if [ -f ~/.bashrc ]; then . ~/.bashrc fi PATH=$PATH:$HOME/.local/bin:$HOME/bin export PATH umask 022 export TMP=/tmp export TMPDIR=$TMP export NLS_LANG=AMERICAN_AMERICA.AL32UTF8 export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=/u01/app/oracle/product/19.3.0/db export ORACLE_TERM=xterm export TNS_ADMIN=$ORACLE_HOME/network/admin export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export ORACLE_SID=lucifer2 export PATH=/usr/sbin:$PATH export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$ORACLE_HOME/perl/bin:$PATH export PERL5LIB=$ORACLE_HOME/perl/lib alias sas='sqlplus / as sysdba' alias awr='sqlplus / as sysdba @?/rdbms/admin/awrrpt' alias ash='sqlplus / as sysdba @?/rdbms/admin/ashrpt' alias alert='vi $ORACLE_BASE/diag/rdbms/*/$ORACLE_SID/trace/alert_$ORACLE_SID.log' export PS1="[`whoami`@`hostname`:"'$PWD]$ ' alias sqlplus='rlwrap sqlplus' alias rman='rlwrap rman' alias adrci='rlwrap adrci'
Grid 用户环境变量
if [ -f ~/.bashrc ]; then . ~/.bashrc fi PATH=$PATH:$HOME/.local/bin:$HOME/bin export PATH umask 022 export TMP=/tmp export TMPDIR=$TMP export NLS_LANG=AMERICAN_AMERICA.AL32UTF8 export ORACLE_BASE=/u01/app/grid export ORACLE_HOME=/u01/app/19.3.0/grid export ORACLE_TERM=xterm export TNS_ADMIN=$ORACLE_HOME/network/admin export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export ORACLE_SID=+ASM2 export PATH=/usr/sbin:$PATH export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH alias sas='sqlplus / as sysasm' export PS1="[`whoami`@`hostname`:"'$PWD]$ ' alias sqlplus='rlwrap sqlplus' alias asmcmd='rlwrap asmcmd' alias adrci='rlwrap adrci'
配置 multipath 多路径
create: asm_ocr_1 (2e87e4f535c397171) undef ROCKET ,IMAGEFILE size=10G features='0' hwhandler='0' wp=undef `-+- policy='service-time 0' prio=1 status=undef `- 33:0:0:0 sdb 8:16 undef ready running create: asm_data_1 (2f218dae15b551c5d) undef ROCKET ,IMAGEFILE size=20G features='0' hwhandler='0' wp=undef `-+- policy='service-time 0' prio=1 status=undef `- 33:0:0:1 sdc 8:32 undef ready running
配置 UDEV 绑盘
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-2e87e4f535c397171",SYMLINK+="asm_ocr_1",OWNER="grid",GROUP="asmadmin",MODE="0660" KERNEL=="dm-*",ENV{DM_UUID}=="mpath-2f218dae15b551c5d",SYMLINK+="asm_data_1",OWNER="grid",GROUP="asmadmin",MODE="0660"
/dev/asm_data_1 /dev/asm_ocr_1
UDEV 配置完成!
配置 RAC 节点:192.168.6.152 结束!
配置 GRID 用户 SSH 互信
Generating public/private rsa key pair. Your identification has been saved in /home/grid/.ssh/id_rsa. Your public key has been saved in /home/grid/.ssh/id_rsa.pub. The key fingerprint is: SHA256:Xxy1rYwXHi6ugoU2xinnwvqSPqr7c7xSF6Zkz7remTg grid@rac01 The key's randomart image is: +---[RSA 2048]----+ | . | | . o | | . + .| | o o . * + | | o * +S = * | | + % .. o o | | = O + . . | | * Eooo. . | |==+X*=+ .. | +----[SHA256]-----+
#==============================================================# 配置 ORACLE 用户 SSH 互信 #==============================================================#
Generating public/private rsa key pair. Your identification has been saved in /home/oracle/.ssh/id_rsa. Your public key has been saved in /home/oracle/.ssh/id_rsa.pub. The key fingerprint is: SHA256:WGnj9li/3rs1bK16dc/5xe9oRJCNMZeptDn7L5Xpyac oracle@rac01 The key's randomart image is: +---[RSA 2048]----+ | o=.o | | . =o+ | | = . = | | = . = . | | . S . + o| | . + .. o+=| | . . .ooBX| | o*OB| | .++EBB| +----[SHA256]-----+
静默解压缩 Grid 软件包
正在静默解压缩 Grid 软件包,请稍等:
.---- -. -. . . . . ( .',----- - - ' ' ' __ \_/ ;--:- __--------------------___ ____=========_||___ __U__n_^_''__[. ooo___ | |_!_||_!_||_!_||_!_| | |..|_i_|..|_i_|..| c(_ ..(_ ..(_ ..( /,,,,,,] | |___||___||___||___| | | | ,_\___________'_|,L______],|______________________|_i,!________________!_i /;_(@)(@)==(@)(@) (o)(o) (o)^(o)--(o)^(o) (o)(o)-(o)(o) ""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"'""
静默解压 Grid 软件安装包: /soft/LINUX.X64_193000_grid_home.zip
静默解压 OPatch 软件补丁包: /soft/p6880880_*.zip
静默解压 Grid 软件补丁包: /soft/p35940989*.zip
静默解压 Oracle 软件包
正在静默解压缩 Oracle 软件包,请稍等:
.---- -. -. . . . . ( .',----- - - ' ' ' __ \_/ ;--:- __--------------------___ ____=========_||___ __U__n_^_''__[. ooo___ | |_!_||_!_||_!_||_!_| | |..|_i_|..|_i_|..| c(_ ..(_ ..(_ ..( /,,,,,,] | |___||___||___||___| | | | ,_\___________'_|,L______],|______________________|_i,!________________!_i /;_(@)(@)==(@)(@) (o)(o) (o)^(o)--(o)^(o) (o)(o)-(o)(o) ""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"'""
静默解压 Oracle 软件安装包: /soft/LINUX.X64_193000_db_home.zip
静默解压 OPatch 软件补丁包: /soft/p6880880_*.zip
Grid 安装静默文件
INVENTORY_LOCATION=/u01/app/oraInventory oracle.install.option=CRS_CONFIG ORACLE_BASE=/u01/app/grid oracle.install.asm.OSDBA=asmdba oracle.install.asm.OSOPER=asmoper oracle.install.asm.OSASM=asmadmin oracle.install.crs.config.gpnp.scanName=rac-scan oracle.install.crs.config.gpnp.scanPort=1521 oracle.install.crs.config.clusterName=rac-cls oracle.install.crs.config.gpnp.configureGNS=false oracle.install.crs.config.clusterNodes=rac01:rac01-vip,rac02:rac02-vip oracle.install.crs.config.networkInterfaceList=ens192:192.168.6.0:1,ens224:1.1.1.0:5 oracle.install.crs.config.useIPMI=false oracle.install.asm.SYSASMPassword=oracle oracle.install.asm.diskGroup.name=OCR oracle.install.asm.diskGroup.redundancy=EXTERNAL oracle.install.asm.diskGroup.disks=/dev/asm_ocr_1 oracle.install.asm.diskGroup.diskDiscoveryString=/dev/asm* oracle.install.asm.monitorPassword=oracle oracle.install.crs.config.ClusterConfiguration=STANDALONE oracle.install.crs.config.configureAsExtendedCluster=false oracle.install.crs.configureGIMR=false oracle.install.asm.storageOption=ASM oracle.install.asm.diskGroup.AUSize=4 oracle.install.asm.configureAFD=false oracle.install.crs.config.ignoreDownNodes=false oracle.install.config.managementOption=NONE oracle.install.crs.rootconfig.executeRootScript=false oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v19.0.0 oracle.install.crs.config.scanType=LOCAL_SCAN
静默安装 Grid 软件
Preparing the home to patch... Applying the patch /soft/35940989... Successfully applied the patch. The log can be found at: /tmp/GridSetupActions2024-03-12_01-45-51PM/installerPatchActions_2024-03-12_01-45-51PM.log Launching Oracle Grid Infrastructure Setup Wizard...
[WARNING] [INS-30011] The SYS password entered does not conform to the Oracle recommended standards. CAUSE: Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9]. ACTION: Provide a password that conforms to the Oracle recommended standards. [WARNING] [INS-30011] The ASMSNMP password entered does not conform to the Oracle recommended standards. CAUSE: Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9]. ACTION: Provide a password that conforms to the Oracle recommended standards. The response file for this session can be found at: /u01/app/19.3.0/grid/install/response/grid_2024-03-12_01-45-51PM.rsp
You can find the log of this install session at: /tmp/GridSetupActions2024-03-12_01-45-51PM/gridSetupActions2024-03-12_01-45-51PM.log
As a root user, execute the following script(s): 1. /u01/app/oraInventory/orainstRoot.sh 2. /u01/app/19.3.0/grid/root.sh
Execute /u01/app/oraInventory/orainstRoot.sh on the following nodes: [rac01, rac02] Execute /u01/app/19.3.0/grid/root.sh on the following nodes: [rac01, rac02]
Run the script on the local node first. After successful completion, you can start the script in parallel on all other nodes.
Successfully Setup Software. As install user, execute the following command to complete the configuration. /u01/app/19.3.0/grid/gridSetup.sh -executeConfigTools -responseFile /soft/grid.rsp [-silent]
Moved the install session logs to: /u01/app/oraInventory/logs/GridSetupActions2024-03-12_01-45-51PM
执行 root 脚本
节点 192.168.6.151 :
Changing permissions of /u01/app/oraInventory. Adding read,write permissions for group. Removing read,write,execute permissions for world.
Changing groupname of /u01/app/oraInventory to oinstall. The execution of the script is complete. Check /u01/app/19.3.0/grid/install/root_rac01_2024-03-12_14-11-35-906912822.log for the output of root script
节点 192.168.6.152 :
Changing permissions of /u01/app/oraInventory. Adding read,write permissions for group. Removing read,write,execute permissions for world.
Changing groupname of /u01/app/oraInventory to oinstall. The execution of the script is complete. Check /u01/app/19.3.0/grid/install/root_rac02_2024-03-12_14-20-28-398646190.log for the output of root script
Grid 软件版本
SQL*Plus: Release 19.0.0.0.0 - Production Version 19.22.0.0.0
Grid 补丁信息
36115038;TOMCAT RELEASE UPDATE 19.0.0.0.0 (36115038) 35967489;OCW RELEASE UPDATE 19.22.0.0.0 (35967489) 35956421;ACFS RELEASE UPDATE 19.22.0.0.0 (35956421) 35943157;Database Release Update : 19.22.0.0.240116 (35943157) 33575402;DBWLM RELEASE UPDATE 19.0.0.0.0 (33575402)
OPatch succeeded.
ASM 磁盘组创建
State Type Rebal Sector Logical_Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name MOUNTED EXTERN N 512 512 4096 1048576 20480 20372 0 20372 0 N DATA/ MOUNTED EXTERN N 512 512 4096 4194304 10240 9900 0 9900 0 Y OCR/
Oracle 安装静默文件
oracle.install.option=INSTALL_DB_SWONLY UNIX_GROUP_NAME=oinstall INVENTORY_LOCATION=/u01/app/oraInventory ORACLE_BASE=/u01/app/oracle oracle.install.db.InstallEdition=EE oracle.install.db.DBA_GROUP=dba oracle.install.db.OPER_GROUP=oper oracle.install.db.CLUSTER_NODES=rac01,rac02 oracle.install.db.OSBACKUPDBA_GROUP=backupdba oracle.install.db.OSDGDBA_GROUP=dgdba oracle.install.db.OSKMDBA_GROUP=kmdba oracle.install.db.OSRACDBA_GROUP=racdba oracle.install.db.rootconfig.executeRootScript=false oracle.install.db.rootconfig.configMethod= oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v19.0.0
静默安装数据库软件
Preparing the home to patch... Applying the patch /soft/35940989... Successfully applied the patch. The log can be found at: /u01/app/oraInventory/logs/InstallActions2024-03-12_02-27-24PM/installerPatchActions_2024-03-12_02-27-24PM.log Launching Oracle Database Setup Wizard...
[WARNING] [INS-13013] Target environment does not meet some mandatory requirements. CAUSE: Some of the mandatory prerequisites are not met. See logs for details. /u01/app/oraInventory/logs/InstallActions2024-03-12_02-27-24PM/installActions2024-03-12_02-27-24PM.log ACTION: Identify the list of failed prerequisite checks from the log: /u01/app/oraInventory/logs/InstallActions2024-03-12_02-27-24PM/installActions2024-03-12_02-27-24PM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually. The response file for this session can be found at: /u01/app/oracle/product/19.3.0/db/install/response/db_2024-03-12_02-27-24PM.rsp
You can find the log of this install session at: /u01/app/oraInventory/logs/InstallActions2024-03-12_02-27-24PM/installActions2024-03-12_02-27-24PM.log
As a root user, execute the following script(s): 1. /u01/app/oracle/product/19.3.0/db/root.sh
Execute /u01/app/oracle/product/19.3.0/db/root.sh on the following nodes: [rac01, rac02]
Successfully Setup Software with warning(s).
执行 root 脚本
节点 192.168.6.151 :
Changing permissions of /u01/app/oraInventory. Adding read,write permissions for group. Removing read,write,execute permissions for world.
Changing groupname of /u01/app/oraInventory to oinstall. The execution of the script is complete. Check /u01/app/oracle/product/19.3.0/db/install/root_rac01_2024-03-12_15-08-43-940864602.log for the output of root script
节点 192.168.6.152 :
Changing permissions of /u01/app/oraInventory. Adding read,write permissions for group. Removing read,write,execute permissions for world.
Changing groupname of /u01/app/oraInventory to oinstall. The execution of the script is complete. Check /u01/app/oracle/product/19.3.0/db/install/root_rac02_2024-03-12_15-08-45-122786324.log for the output of root script
Oracle 软件版本
SQL*Plus: Release 19.0.0.0.0 - Production Version 19.22.0.0.0
Oracle 补丁信息
35967489;OCW RELEASE UPDATE 19.22.0.0.0 (35967489) 35943157;Database Release Update : 19.22.0.0.240116 (35943157)
OPatch succeeded.
|