1 ███████ ██ ████████ ██ ██ ██ ██ ██ ██ ██
2 ██░░░░░██ ░██ ██░░░░░░ ░██ ░██ ░██░██ ░██ ░██ ░██
3 ██ ░░██ ██████ ██████ █████ ░██ █████ ░██ ░██ █████ ░██ ░██░██ ███████ ██████ ██████ ██████ ░██ ░██
4░██ ░██░░██░░█ ░░░░░░██ ██░░░██ ░██ ██░░░██░█████████░██████ ██░░░██ ░██ ░██░██░░██░░░██ ██░░░░ ░░░██░ ░░░░░░██ ░██ ░██
5░██ ░██ ░██ ░ ███████ ░██ ░░ ░██░███████░░░░░░░░██░██░░░██░███████ ░██ ░██░██ ░██ ░██░░█████ ░██ ███████ ░██ ░██
6░░██ ██ ░██ ██░░░░██ ░██ ██ ░██░██░░░░ ░██░██ ░██░██░░░░ ░██ ░██░██ ░██ ░██ ░░░░░██ ░██ ██░░░░██ ░██ ░██
7 ░░███████ ░███ ░░████████░░█████ ███░░██████ ████████ ░██ ░██░░██████ ███ ███░██ ███ ░██ ██████ ░░██ ░░████████ ███ ███
8 ░░░░░░░ ░░░ ░░░░░░░░ ░░░░░ ░░░ ░░░░░░ ░░░░░░░░ ░░ ░░ ░░░░░░ ░░░ ░░░ ░░ ░░░ ░░ ░░░░░░ ░░ ░░░░░░░░ ░░░ ░░░
9
10
11请选择安装模式 [单机(si)/单机ASM(sa)/集群(rac)] : si
12
13数据库安装模式: single
14
15请选择数据库版本 [11/12/19/21] : 12
16
17数据库版本: 12
18
19#==============================================================#
20配置本地 YUM 源
21#==============================================================#
22
23[BaseOS]
24name=BaseOS
25baseurl=file:///mnt/BaseOS
26enabled=1
27gpgcheck=0
28[AppStream]
29name=AppStream
30baseurl=file:///mnt/AppStream
31enabled=1
32gpgcheck=0
33
34#==============================================================#
35禁用防火墙
36#==============================================================#
37
38● firewalld.service - firewalld - dynamic firewall daemon
39 Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
40 Active: inactive (dead) since Wed 2024-03-27 13:31:31 CST; 76ms ago
41 Docs: man:firewalld(1)
42 Process: 1061 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=0/SUCCESS)
43 Main PID: 1061 (code=exited, status=0/SUCCESS)
44
45Mar 25 11:12:31 anolis8 systemd[1]: Starting firewalld - dynamic firewall daemon...
46Mar 25 11:12:33 anolis8 systemd[1]: Started firewalld - dynamic firewall daemon.
47Mar 25 11:12:33 anolis8 firewalld[1061]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure configuration option. It will be removed in a future release. Please consider disabling it now.
48Mar 27 13:31:30 anolis8 systemd[1]: Stopping firewalld - dynamic firewall daemon...
49Mar 27 13:31:31 anolis8 systemd[1]: firewalld.service: Succeeded.
50Mar 27 13:31:31 anolis8 systemd[1]: Stopped firewalld - dynamic firewall daemon.
51
52#==============================================================#
53禁用 SELinux
54#==============================================================#
55
56SELinux status: disabled
57
58#==============================================================#
59配置 nsysctl.conf
60#==============================================================#
61
62NOZEROCONF=yes
63
64#==============================================================#
65YUM 静默安装依赖包
66#==============================================================#
67
68bc-1.07.1-5.0.1.an8.x86_64
69binutils-2.30-117.0.1.an8.x86_64
70package compat-libcap1 is not installed
71gcc-8.5.0-10.1.0.3.an8.x86_64
72gcc-c++-8.5.0-10.1.0.3.an8.x86_64
73elfutils-libelf-0.187-4.0.1.an8.x86_64
74elfutils-libelf-devel-0.187-4.0.1.an8.x86_64
75glibc-2.28-189.5.0.2.an8_6.x86_64
76glibc-devel-2.28-189.5.0.2.an8_6.x86_64
77libaio-0.3.112-1.0.1.an8.x86_64
78libaio-devel-0.3.112-1.0.1.an8.x86_64
79libgcc-8.5.0-10.1.0.3.an8.x86_64
80libstdc++-8.5.0-10.1.0.3.an8.x86_64
81libstdc++-devel-8.5.0-10.1.0.3.an8.x86_64
82libxcb-1.13.1-1.el8.x86_64
83libX11-1.7.0-7.an8.x86_64
84libXau-1.0.9-8.an8.x86_64
85libXi-1.7.10-1.an8.x86_64
86libXrender-0.9.10-7.el8.x86_64
87make-4.2.1-11.0.1.an8.x86_64
88net-tools-2.0-0.52.20160912git.an8.x86_64
89smartmontools-7.1-1.0.2.an8.x86_64
90sysstat-11.7.3-7.0.1.an8.x86_64
91e2fsprogs-1.46.0-1.0.1.an8.x86_64
92e2fsprogs-libs-1.46.0-1.0.1.an8.x86_64
93unzip-6.0-46.0.1.an8.x86_64
94openssh-clients-8.0p1-13.0.1.an8.x86_64
95readline-7.0-10.0.1.an8.x86_64
96readline-devel-7.0-10.0.1.an8.x86_64
97psmisc-23.1-5.0.1.an8.x86_64
98ksh-20120801-257.0.1.an8.x86_64
99nfs-utils-2.3.3-51.0.3.an8.x86_64
100tar-1.30-6.0.1.an8.x86_64
101device-mapper-multipath-0.8.4-28.0.1.an8_6.2.x86_64
102avahi-0.7-20.an8.x86_64
103package ntp is not installed
104chrony-4.2-1.0.1.an8.x86_64
105libXtst-1.2.3-7.el8.x86_64
106libXrender-devel-0.9.10-7.el8.x86_64
107fontconfig-devel-2.13.1-4.an8.x86_64
108policycoreutils-2.9-20.an8.x86_64
109package policycoreutils-python is not installed
110librdmacm-37.2-1.0.3.an8.x86_64
111package libnsl* is not installed
112libibverbs-37.2-1.0.3.an8.x86_64
113compat-openssl10-1.0.2o-4.0.1.an8_6.x86_64
114policycoreutils-python-utils-2.9-20.an8.noarch
115package elfutils* is not installed
116glibc-2.28-189.5.0.2.an8_6.x86_64
117
118#==============================================================#
119配置主机名
120#==============================================================#
121
122anolis8
123
124#==============================================================#
125配置 /etc/hosts 文件
126#==============================================================#
127
128127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
129::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
130192.168.6.137 anolis8
131
132#==============================================================#
133创建用户和组
134#==============================================================#
135
136oracle 用户:
137
138uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(oper),54324(backupdba),54325(dgdba),54326(kmdba),54330(racdba)
139
140
141#==============================================================#
142配置 Avahi-daemon 服务
143#==============================================================#
144
145● avahi-daemon.service - Avahi mDNS/DNS-SD Stack
146 Loaded: loaded (/usr/lib/systemd/system/avahi-daemon.service; disabled; vendor preset: enabled)
147 Active: inactive (dead)
148
149Mar 27 13:32:48 anolis8 avahi-daemon[910]: Files changed, reloading.
150Mar 27 13:32:48 anolis8 avahi-daemon[910]: No service file found in /etc/avahi/services.
151Mar 27 13:32:49 anolis8 avahi-daemon[910]: Got SIGTERM, quitting.
152Mar 27 13:32:49 anolis8 systemd[1]: Stopping Avahi mDNS/DNS-SD Stack...
153Mar 27 13:32:49 anolis8 avahi-daemon[910]: Leaving mDNS multicast group on interface virbr0.IPv4 with address 192.168.122.1.
154Mar 27 13:32:49 anolis8 avahi-daemon[910]: Leaving mDNS multicast group on interface ens33.IPv6 with address fe80::20c:29ff:fec3:5ee1.
155Mar 27 13:32:49 anolis8 avahi-daemon[910]: Leaving mDNS multicast group on interface ens33.IPv4 with address 192.168.6.137.
156Mar 27 13:32:49 anolis8 avahi-daemon[910]: avahi-daemon 0.7 exiting.
157Mar 27 13:32:49 anolis8 systemd[1]: avahi-daemon.service: Succeeded.
158Mar 27 13:32:49 anolis8 systemd[1]: Stopped Avahi mDNS/DNS-SD Stack.
159
160#==============================================================#
161配置透明大页 && NUMA && 磁盘 IO 调度器
162#==============================================================#
163
164args="ro resume=/dev/mapper/ao-swap rd.lvm.lv=ao/root rd.lvm.lv=ao/swap rhgb quiet $tuned_params cgroup.memory=nokmem crashkernel=0M-2G:0M,2G-8G:192M,8G-:256M numa=off transparent_hugepage=never elevator=deadline"
165-resume=/dev/mapper/ao-swap
166-args="ro
167args="ro resume=/dev/mapper/ao-swap rd.lvm.lv=ao/root rd.lvm.lv=ao/swap rhgb quiet numa=off transparent_hugepage=never elevator=deadline"
168-elevator=deadline"
169-transparent_hugepage=never
170
171#==============================================================#
172配置 sysctl.conf
173#==============================================================#
174
175fs.aio-max-nr = 1048576
176fs.file-max = 6815744
177kernel.shmall = 2097152
178kernel.shmmax = 8126386175
179kernel.shmmni = 4096
180kernel.sem = 250 32000 100 128
181net.ipv4.ip_local_port_range = 9000 65500
182net.core.rmem_default = 262144
183net.core.rmem_max = 4194304
184net.core.wmem_default = 262144
185net.core.wmem_max = 1048576
186vm.min_free_kbytes = 31743
187net.ipv4.conf.ens33.rp_filter = 1
188vm.swappiness = 10
189kernel.panic_on_oops = 1
190kernel.randomize_va_space = 2
191kernel.numa_balancing = 0
192
193#==============================================================#
194配置 RemoveIPC
195#==============================================================#
196
197[Login]
198RemoveIPC=no
199
200#==============================================================#
201配置 /etc/security/limits.conf 和 /etc/pam.d/login
202#==============================================================#
203
204查看 /etc/security/limits.conf:
205
206oracle soft nofile 1024
207oracle hard nofile 65536
208oracle soft stack 10240
209oracle hard stack 32768
210oracle soft nproc 2047
211oracle hard nproc 16384
212oracle hard memlock unlimited
213oracle soft memlock unlimited
214
215查看 /etc/pam.d/login 文件:
216
217auth substack system-auth
218auth include postlogin
219account required pam_nologin.so
220account include system-auth
221password include system-auth
222session required pam_selinux.so close
223session required pam_loginuid.so
224session optional pam_console.so
225session required pam_selinux.so open
226session required pam_namespace.so
227session optional pam_keyinit.so force revoke
228session include system-auth
229session include postlogin
230-session optional pam_ck_connector.so
231session required pam_limits.so
232session required /lib64/security/pam_limits.so
233
234#==============================================================#
235配置 /dev/shm
236#==============================================================#
237
238/dev/mapper/ao-root / xfs defaults 0 0
239UUID=5b4f444b-7f7f-4cf1-9e1b-474e447b8075 /boot xfs defaults 0 0
240/dev/mapper/ao-swap none swap defaults 0 0
241tmpfs /dev/shm tmpfs size=7935924k 0 0
242
243#==============================================================#
244安装 rlwrap 插件
245#==============================================================#
246
247成功安装 rlwrap: rlwrap 0.44
248
249#==============================================================#
250Root 用户环境变量
251#==============================================================#
252
253if [ -f ~/.bashrc ]; then
254 . ~/.bashrc
255fi
256PATH=$PATH:$HOME/bin
257export PATH
258alias so='su - oracle'
259export PS1="[`whoami`@`hostname`:"'$PWD]$ '
260
261#==============================================================#
262Oracle 用户环境变量
263#==============================================================#
264
265if [ -f ~/.bashrc ]; then
266 . ~/.bashrc
267fi
268umask 022
269export TMP=/tmp
270export TMPDIR=$TMP
271export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
272export ORACLE_BASE=/u01/app/oracle
273export ORACLE_HOME=/u01/app/oracle/product/12.2.0/db
274export ORACLE_TERM=xterm
275export TNS_ADMIN=$ORACLE_HOME/network/admin
276export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
277export ORACLE_SID=lucifer
278export PATH=/usr/sbin:$PATH
279export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$ORACLE_HOME/perl/bin:$PATH
280export PERL5LIB=$ORACLE_HOME/perl/lib
281alias sas='sqlplus / as sysdba'
282alias awr='sqlplus / as sysdba @?/rdbms/admin/awrrpt'
283alias ash='sqlplus / as sysdba @?/rdbms/admin/ashrpt'
284alias alert='vi $ORACLE_BASE/diag/rdbms/*/$ORACLE_SID/trace/alert_$ORACLE_SID.log'
285export PS1="[`whoami`@`hostname`:"'$PWD]$ '
286export CV_ASSUME_DISTID=OL7
287alias sqlplus='rlwrap sqlplus'
288alias rman='rlwrap rman'
289alias adrci='rlwrap adrci'
290
291#==============================================================#
292静默解压 Oracle 软件包
293#==============================================================#
294
295正在静默解压缩 Oracle 软件包,请稍等:
296
297.---- -. -. . . . .
298( .',----- - - ' ' ' __
299 \_/ ;--:- __--------------------___ ____=========_||___
300__U__n_^_''__[. ooo___ | |_!_||_!_||_!_||_!_| | |..|_i_|..|_i_|..|
301c(_ ..(_ ..(_ ..( /,,,,,,] | |___||___||___||___| | | |
302,_\___________'_|,L______],|______________________|_i,!________________!_i
303/;_(@)(@)==(@)(@) (o)(o) (o)^(o)--(o)^(o) (o)(o)-(o)(o)
304""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"""~"'""
305
306静默解压 Oracle 软件安装包: /soft/LINUX.X64_122010_db_home.zip
307
308静默解压 Oracle 软件补丁包: /soft/p33587128*.zip
309
310静默解压 OJVM 软件补丁包: /soft/p33561275*.zip
311
312#==============================================================#
313Oracle 安装静默文件
314#==============================================================#
315
316oracle.install.option=INSTALL_DB_SWONLY
317UNIX_GROUP_NAME=oinstall
318INVENTORY_LOCATION=/u01/app/oraInventory
319ORACLE_BASE=/u01/app/oracle
320oracle.install.db.InstallEdition=EE
321oracle.install.db.DBA_GROUP=dba
322oracle.install.db.OPER_GROUP=oper
323oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v12.2.0
324SELECTED_LANGUAGES=en,zh_CN
325ORACLE_HOME=/u01/app/oracle/product/12.2.0/db
326oracle.install.db.OSBACKUPDBA_GROUP=backupdba
327oracle.install.db.OSDGDBA_GROUP=dgdba
328oracle.install.db.OSKMDBA_GROUP=kmdba
329oracle.install.db.OSRACDBA_GROUP=racdba
330
331#==============================================================#
332静默安装数据库软件
333#==============================================================#
334
335Starting Oracle Universal Installer...
336
337Checking Temp space: must be greater than 500 MB. Actual 76481 MB Passed
338Checking swap space: must be greater than 150 MB. Actual 8187 MB Passed
339Preparing to launch Oracle Universal Installer from /tmp/OraInstall2024-03-27_01-34-33PM. Please wait ...You can find the log of this install session at:
340 /u01/app/oraInventory/logs/installActions2024-03-27_01-34-33PM.log
341
342Prepare in progress.
343.................................................. 8% Done.
344
345Prepare successful.
346
347Copy files in progress.
348.................................................. 17% Done.
349.................................................. 22% Done.
350.................................................. 27% Done.
351.................................................. 32% Done.
352.................................................. 40% Done.
353.................................................. 45% Done.
354.................................................. 50% Done.
355.................................................. 55% Done.
356.................................................. 60% Done.
357.................................................. 65% Done.
358.................................................. 70% Done.
359.................................................. 75% Done.
360.................................................. 80% Done.
361....................
362Copy files successful.
363
364Link binaries in progress.
365..........
366Link binaries successful.
367
368Setup files in progress.
369..............................
370Setup files successful.
371
372Setup Inventory in progress.
373
374Setup Inventory successful.
375
376Finish Setup successful.
377The installation of Oracle Database 12c was successful.
378Please check '/u01/app/oraInventory/logs/silentInstall2024-03-27_01-34-33PM.log' for more details.
379
380Setup Oracle Base in progress.
381
382Setup Oracle Base successful.
383.................................................. 95% Done.
384
385As a root user, execute the following script(s):
386 1. /u01/app/oraInventory/orainstRoot.sh
387 2. /u01/app/oracle/product/12.2.0/db/root.sh
388
389
390
391.................................................. 100% Done.
392Successfully Setup Software.
393
394#==============================================================#
395执行 root 脚本
396#==============================================================#
397
398Changing permissions of /u01/app/oraInventory.
399Adding read,write permissions for group.
400Removing read,write,execute permissions for world.
401
402Changing groupname of /u01/app/oraInventory to oinstall.
403The execution of the script is complete.
404Check /u01/app/oracle/product/12.2.0/db/install/root_anolis8_2024-03-27_13-42-38-709700253.log for the output of root script
405
406#==============================================================#
407Oracle 软件安装补丁
408#==============================================================#
409
410Oracle Interim Patch Installer version 12.2.0.1.30
411Copyright (c) 2024, Oracle Corporation. All rights reserved.
412
413PREREQ session
414
415Oracle Home : /u01/app/oracle/product/12.2.0/db
416Central Inventory : /u01/app/oraInventory
417 from : /u01/app/oracle/product/12.2.0/db/oraInst.loc
418OPatch version : 12.2.0.1.30
419OUI version : 12.2.0.1.4
420Log file location : /u01/app/oracle/product/12.2.0/db/cfgtoollogs/opatch/opatch2024-03-27_13-43-23PM_1.log
421
422Invoking prereq "checkconflictagainstohwithdetail"
423
424Prereq "checkConflictAgainstOHWithDetail" passed.
425
426OPatch succeeded.
427Oracle Interim Patch Installer version 12.2.0.1.30
428Copyright (c) 2024, Oracle Corporation. All rights reserved.
429
430
431Oracle Home : /u01/app/oracle/product/12.2.0/db
432Central Inventory : /u01/app/oraInventory
433 from : /u01/app/oracle/product/12.2.0/db/oraInst.loc
434OPatch version : 12.2.0.1.30
435OUI version : 12.2.0.1.4
436Log file location : /u01/app/oracle/product/12.2.0/db/cfgtoollogs/opatch/opatch2024-03-27_13-43-27PM_1.log
437
438Verifying environment and performing prerequisite checks...
439OPatch continues with these patches: 33587128
440
441Do you want to proceed? [y|n]
442Y (auto-answered by -silent)
443User Responded with: Y
444All checks passed.
445
446Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
447(Oracle Home = '/u01/app/oracle/product/12.2.0/db')
448
449
450Is the local system ready for patching? [y|n]
451Y (auto-answered by -silent)
452User Responded with: Y
453Backing up files...
454Applying interim patch '33587128' to OH '/u01/app/oracle/product/12.2.0/db'
455ApplySession: Optional component(s) [ oracle.swd, 12.2.0.1.0 ] , [ oracle.swd.oui, 12.2.0.1.0 ] , [ oracle.network.cman, 12.2.0.1.0 ] , [ oracle.network.gsm, 12.2.0.1.0 ] , [ oracle.rdbms.drdaas, 12.2.0.1.0 ] , [ oracle.ons.cclient, 12.2.0.1.0 ] , [ oracle.ons.daemon, 12.2.0.1.0 ] , [ oracle.ons.eons.bwcompat, 12.2.0.1.0 ] , [ oracle.oid.client, 12.2.0.1.0 ] not present in the Oracle Home or a higher version is found.
456
457Patching component oracle.rdbms.util, 12.2.0.1.0...
458
459Patching component oracle.rdbms, 12.2.0.1.0...
460
461Patching component oracle.network.rsf, 12.2.0.1.0...
462
463Patching component oracle.rdbms.rsf, 12.2.0.1.0...
464
465Patching component oracle.ctx, 12.2.0.1.0...
466
467Patching component oracle.has.common.cvu, 12.2.0.1.0...
468
469Patching component oracle.ldap.owm, 12.2.0.1.0...
470
471Patching component oracle.ldap.rsf, 12.2.0.1.0...
472
473Patching component oracle.nlsrtl.rsf, 12.2.0.1.0...
474
475Patching component oracle.oracore.rsf, 12.2.0.1.0...
476
477Patching component oracle.oraolap, 12.2.0.1.0...
478
479Patching component oracle.rdbms.dbscripts, 12.2.0.1.0...
480
481Patching component oracle.rdbms.deconfig, 12.2.0.1.0...
482
483Patching component oracle.rdbms.rsf.ic, 12.2.0.1.0...
484
485Patching component oracle.sdo, 12.2.0.1.0...
486
487Patching component oracle.sdo.locator, 12.2.0.1.0...
488
489Patching component oracle.sdo.locator.jrf, 12.2.0.1.0...
490
491Patching component oracle.tfa, 12.2.0.1.0...
492
493Patching component oracle.ctx.rsf, 12.2.0.1.0...
494
495Patching component oracle.rdbms.install.plugins, 12.2.0.1.0...
496
497Patching component oracle.rdbms.install.common, 12.2.0.1.0...
498
499Patching component oracle.assistants.deconfig, 12.2.0.1.0...
500
501Patching component oracle.ons.ic, 12.2.0.1.0...
502
503Patching component oracle.rdbms.rman, 12.2.0.1.0...
504
505Patching component oracle.precomp.rsf, 12.2.0.1.0...
506
507Patching component oracle.install.deinstalltool, 12.2.0.1.0...
508
509Patching component oracle.assistants.acf, 12.2.0.1.0...
510
511Patching component oracle.rdbms.oci, 12.2.0.1.0...
512
513Patching component oracle.sqlplus.ic, 12.2.0.1.0...
514
515Patching component oracle.xdk.parser.java, 12.2.0.1.0...
516
517Patching component oracle.dbtoolslistener, 12.2.0.1.0...
518
519Patching component oracle.ldap.rsf.ic, 12.2.0.1.0...
520
521Patching component oracle.rdbms.dv, 12.2.0.1.0...
522
523Patching component oracle.rdbms.lbac, 12.2.0.1.0...
524
525Patching component oracle.ons, 12.2.0.1.0...
526
527Patching component oracle.ldap.client, 12.2.0.1.0...
528
529Patching component oracle.xdk, 12.2.0.1.0...
530
531Patching component oracle.xdk.rsf, 12.2.0.1.0...
532
533Patching component oracle.sqlplus, 12.2.0.1.0...
534
535Patching component oracle.assistants.server, 12.2.0.1.0...
536
537Patching component oracle.rdbms.crs, 12.2.0.1.0...
538
539Patching component oracle.precomp.common, 12.2.0.1.0...
540
541Patching component oracle.precomp.lang, 12.2.0.1.0...
542
543Patching component oracle.jdk, 1.8.0.91.0...
544
545OPatch found the word "error" in the stderr of the make command.
546Please look at this stderr. You can re-run this make command.
547Stderr output:
548chmod: changing permissions of '/u01/app/oracle/product/12.2.0/db/bin/extjobO': Operation not permitted
549make: [ins_rdbms.mk:533: iextjob] Error 1 (ignored)
550
551
552Patch 33587128 successfully applied.
553OPatch Session completed with warnings.
554Log file location: /u01/app/oracle/product/12.2.0/db/cfgtoollogs/opatch/opatch2024-03-27_13-43-27PM_1.log
555
556OPatch completed with warnings.
557
558#==============================================================#
559OJVM 补丁安装
560#==============================================================#
561
562Oracle Interim Patch Installer version 12.2.0.1.30
563Copyright (c) 2024, Oracle Corporation. All rights reserved.
564
565PREREQ session
566
567Oracle Home : /u01/app/oracle/product/12.2.0/db
568Central Inventory : /u01/app/oraInventory
569 from : /u01/app/oracle/product/12.2.0/db/oraInst.loc
570OPatch version : 12.2.0.1.30
571OUI version : 12.2.0.1.4
572Log file location : /u01/app/oracle/product/12.2.0/db/cfgtoollogs/opatch/opatch2024-03-27_13-53-23PM_1.log
573
574Invoking prereq "checkconflictagainstohwithdetail"
575
576Prereq "checkConflictAgainstOHWithDetail" passed.
577
578OPatch succeeded.
579Oracle Interim Patch Installer version 12.2.0.1.30
580Copyright (c) 2024, Oracle Corporation. All rights reserved.
581
582
583Oracle Home : /u01/app/oracle/product/12.2.0/db
584Central Inventory : /u01/app/oraInventory
585 from : /u01/app/oracle/product/12.2.0/db/oraInst.loc
586OPatch version : 12.2.0.1.30
587OUI version : 12.2.0.1.4
588Log file location : /u01/app/oracle/product/12.2.0/db/cfgtoollogs/opatch/opatch2024-03-27_13-53-26PM_1.log
589
590Verifying environment and performing prerequisite checks...
591OPatch continues with these patches: 33561275
592
593Do you want to proceed? [y|n]
594Y (auto-answered by -silent)
595User Responded with: Y
596All checks passed.
597
598Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
599(Oracle Home = '/u01/app/oracle/product/12.2.0/db')
600
601
602Is the local system ready for patching? [y|n]
603Y (auto-answered by -silent)
604User Responded with: Y
605Backing up files...
606Applying interim patch '33561275' to OH '/u01/app/oracle/product/12.2.0/db'
607
608Patching component oracle.javavm.server, 12.2.0.1.0...
609
610Patching component oracle.javavm.server.core, 12.2.0.1.0...
611
612Patching component oracle.rdbms.dbscripts, 12.2.0.1.0...
613
614Patching component oracle.javavm.client, 12.2.0.1.0...
615
616Patching component oracle.rdbms, 12.2.0.1.0...
617
618Patching component oracle.dbjava.jdbc, 12.2.0.1.0...
619
620Patching component oracle.dbjava.ic, 12.2.0.1.0...
621Patch 33561275 successfully applied.
622Log file location: /u01/app/oracle/product/12.2.0/db/cfgtoollogs/opatch/opatch2024-03-27_13-53-26PM_1.log
623
624OPatch succeeded.
625
626#==============================================================#
627Oracle 软件版本
628#==============================================================#
629
630
631SQL*Plus: Release 12.2.0.1.0 Production
632
633
634#==============================================================#
635Oracle 补丁信息
636#==============================================================#
637
63833561275;OJVM RELEASE UPDATE 12.2.0.1.220118 (33561275)
63933587128;Database Jan 2022 Release Update : 12.2.0.1.220118 (33587128)
640
641OPatch succeeded.
642
643
644#==============================================================#
645配置监听
646#==============================================================#
647
648
649Parsing command line arguments:
650 Parameter "silent" = true
651 Parameter "responsefile" = /u01/app/oracle/product/12.2.0/db/assistants/netca/netca.rsp
652Done parsing command line arguments.
653Oracle Net Services Configuration:
654Profile configuration complete.
655Oracle Net Listener Startup:
656 Running Listener Control:
657 /u01/app/oracle/product/12.2.0/db/bin/lsnrctl start LISTENER
658 Listener Control complete.
659 Listener started successfully.
660Listener configuration complete.
661Oracle Net Services configuration successful. The exit code is 0
662
663检查监听状态:
664
665
666LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 27-MAR-2024 13:55:09
667
668Copyright (c) 1991, 2016, Oracle. All rights reserved.
669
670Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=anolis8)(PORT=1521)))
671STATUS of the LISTENER
672------------------------
673Alias LISTENER
674Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
675Start Date 27-MAR-2024 13:54:59
676Uptime 0 days 0 hr. 0 min. 10 sec
677Trace Level off
678Security ON: Local OS Authentication
679SNMP OFF
680Listener Parameter File /u01/app/oracle/product/12.2.0/db/network/admin/listener.ora
681Listener Log File /u01/app/oracle/diag/tnslsnr/anolis8/listener/alert/log.xml
682Listening Endpoints Summary...
683 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=anolis8)(PORT=1521)))
684 (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
685The listener supports no services
686The command completed successfully
687
688#==============================================================#
689静默建库命令
690#==============================================================#
691
692dbca -silent -createDatabase \
693-ignorePrereqFailure \
694-templateName General_Purpose.dbc \
695-responseFile NO_VALUE \
696-gdbName lucifer \
697-sid lucifer \
698-sysPassword oracle \
699-systemPassword oracle \
700-redoLogFileSize 100 \
701-datafileDestination /oradata \
702-storageType FS \
703-enableArchive true \
704-archiveLogDest /oradata \
705-databaseConfigType SINGLE \
706-characterset AL32UTF8 \
707-nationalCharacterSet AL16UTF16 \
708-emConfiguration NONE \
709-automaticMemoryManagement false \
710-totalMemory 3874 \
711-databaseType OLTP \
712-createAsContainerDatabase false
713
714#==============================================================#
715创建数据库
716#==============================================================#
717
718[WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
719 CAUSE:
720a. 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].
721b.The password entered is a keyword that Oracle does not recommend to be used as password
722 ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
723[WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
724 CAUSE:
725a. 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].
726b.The password entered is a keyword that Oracle does not recommend to be used as password
727 ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
728Copying database files
7291% complete
7302% complete
73118% complete
73233% complete
733Creating and starting Oracle instance
73435% complete
73540% complete
73644% complete
73749% complete
73850% complete
73953% complete
74055% complete
741Completing Database Creation
74256% complete
74357% complete
74458% complete
74562% complete
74665% complete
74766% complete
748Executing Post Configuration Actions
749100% complete
750Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/lucifer/lucifer.log" for further details.
751
752#==============================================================#
753配置在线重做日志
754#==============================================================#
755
756数据库在线重做日志文件:
757
758
759 THREAD# GROUP# MEMBER size(M)
760---------- ---------- ------------------------------------------------------------------------------------------------------------------------ ----------
761 1 1 /oradata/lucifer/redo01.log 100
762 1 2 /oradata/lucifer/redo02.log 100
763 1 3 /oradata/lucifer/redo03.log 100
764 1 11 /oradata/LUCIFER/onlinelog/o1_mf_11_m07fynlc_.log 100
765 1 12 /oradata/LUCIFER/onlinelog/o1_mf_12_m07fyo10_.log 100
766 1 13 /oradata/LUCIFER/onlinelog/o1_mf_13_m07fyo4z_.log 100
767 1 14 /oradata/LUCIFER/onlinelog/o1_mf_14_m07fyo8g_.log 100
768 1 15 /oradata/LUCIFER/onlinelog/o1_mf_15_m07fyofd_.log 100
769
770#==============================================================#
771配置 RMAN 备份任务
772#==============================================================#
773
774## OracleBegin
77500 02 * * * /home/oracle/scripts/del_arch.sh
776#00 00 * * 0 /home/oracle/scripts/dbbackup_lv0.sh
777#00 00 * * 1,2,3,4,5,6 /home/oracle/scripts/dbbackup_lv1.sh
778
779#==============================================================#
780配置 glogin.sql
781#==============================================================#
782
783define _editor=vi
784set serveroutput on size 1000000
785set pagesize 9999
786set long 99999
787set trimspool on
788col name format a80
789set termout off
790define gname=idle
791column global_name new_value gname
792select lower(user) || '@' || substr( global_name, 1, decode( dot, 0, length(global_name), dot-1) ) global_name from (select global_name, instr(global_name,'.') dot from global_name );
793ALTER SESSION SET nls_date_format = 'YYYY-MM-DD HH24:MI:SS';
794set sqlprompt '&gname _DATE> '
795set termout on
796
797#==============================================================#
798优化数据库参数
799#==============================================================#
800
801数据库参数:
802
803
804NAME SID SPVALUE VALUE
805-------------------------------------------------- ---------- -------------------------------------------------------------------------------- --------------------------------------------------------------------------------
806_b_tree_bitmap_plans * FALSE FALSE
807_datafile_write_errors_crash_instance * FALSE FALSE
808audit_file_dest * /u01/app/oracle/admin/lucifer/adump /u01/app/oracle/admin/lucifer/adump
809audit_trail * NONE DB
810compatible * 12.2.0 12.2.0
811control_file_record_keep_time * 31 31
812db_block_size * 8192 8192
813db_create_file_dest * /oradata /oradata
814db_file_multiblock_read_count * 128
815db_files * 5000 200
816db_name * lucifer lucifer
817db_writer_processes * 1
818deferred_segment_creation * FALSE FALSE
819diagnostic_dest * /u01/app/oracle /u01/app/oracle
820dispatchers * (PROTOCOL=TCP) (SERVICE=luciferXDB) (PROTOCOL=TCP) (SERVICE=luciferXDB)
821event * 10949 trace name context forever,level 1
822event * 28401 trace name context forever,level 1
823fast_start_parallel_rollback * LOW
824log_archive_dest_1 * location=/oradata/archivelog location=/oradata/archivelog
825log_archive_format * %t_%s_%r.dbf %t_%s_%r.dbf
826max_dump_file_size * unlimited
827max_string_size * STANDARD
828nls_language * AMERICAN AMERICAN
829nls_territory * AMERICA AMERICA
830open_cursors * 1000 300
831optimizer_adaptive_plans * TRUE
832optimizer_adaptive_statistics * FALSE
833optimizer_index_caching * 0
834optimizer_mode * ALL_ROWS
835parallel_force_local * FALSE
836parallel_max_servers * 64 64
837pga_aggregate_target * 1299185664 812646400
838processes * 2000 640
839remote_login_passwordfile * EXCLUSIVE EXCLUSIVE
840session_cached_cursors * 300 50
841sessions * 984
842sga_max_size * 5199888384 3254779904
843sga_target * 5199888384 3254779904
844spfile * /u01/app/oracle/product/12.2.0/db/dbs/spfilelucifer.ora
845statistics_level * TYPICAL
846undo_retention * 10800 900
847
848恭喜!Oracle 单机安装成功,现在是否重启主机:[Y/N] Y