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