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