Oracle12.2.0.1升级实战

2022-04-05  本文已影响0人  与狼共舞666
[oracle@lhr:/u01/app/oracle/product/19.3.0/db]$ mv /soft/OPatch .
[oracle@lhr:/u01/app/oracle/product/19.3.0/db]$ ls -ld OPatch
drwxr-x--- 15 oracle oinstall 4096 4月   4 19:38 OPatch
[oracle@lhr:/u01/app/oracle/product/19.3.0/db]$ ls -l
总用量 72
drwxr-xr-x  2 oracle oinstall    84 4月   2 16:04 addnode
drwxr-xr-x  6 oracle oinstall  4096 4月   2 16:03 apex
drwxr-xr-x 10 oracle oinstall   105 4月   2 16:02 assistants
drwxr-xr-x  2 oracle oinstall  8192 4月   2 16:09 bin
drwxr-xr-x  7 oracle oinstall    70 4月   2 16:04 ccr
drwxr-xr-x  3 oracle oinstall    23 4月   2 16:04 cdata
drwxr-xr-x  5 oracle oinstall  4096 4月   2 16:17 cfgtoollogs
drwxr-xr-x  4 oracle oinstall    87 4月   2 16:04 clone
drwxr-xr-x  6 oracle oinstall    55 4月   2 16:02 crs
drwxr-xr-x  6 oracle oinstall    53 4月   2 16:04 css
drwxr-xr-x 11 oracle oinstall   119 4月   2 16:04 ctx
drwxr-xr-x  7 oracle oinstall    71 4月   2 16:02 cv
drwxr-xr-x  3 oracle oinstall    20 4月   2 16:02 data
drwxr-xr-x  7 oracle oinstall   117 1月  27 2017 database
drwxr-xr-x  3 oracle oinstall    19 4月   2 16:02 dbjava
drwxr-xr-x  2 oracle oinstall    94 4月   4 10:47 dbs
drwxr-xr-x  2 oracle oinstall    32 4月   2 16:04 dc_ocm
drwxr-xr-x  5 oracle oinstall   191 4月   2 16:05 deinstall
drwxr-xr-x  3 oracle oinstall    20 4月   2 16:02 demo
drwxr-xr-x  3 oracle oinstall    20 4月   2 16:02 diagnostics
drwxr-xr-x  8 oracle oinstall   179 4月   2 16:03 dmu
drwxr-xr-x  3 oracle oinstall    19 4月   2 16:02 dv
-rw-r--r--  1 oracle oinstall   852 8月  19 2015 env.ora
drwxr-xr-x  3 oracle oinstall    18 4月   2 16:02 has
drwxr-xr-x  5 oracle oinstall    41 4月   2 16:05 hs
drwxr-xr-x  9 oracle oinstall  4096 4月   2 16:10 install
drwxr-xr-x  2 oracle oinstall    29 4月   2 16:03 instantclient
drwxr-x--- 13 oracle oinstall   218 4月   2 16:05 inventory
drwxr-xr-x  8 oracle oinstall    82 4月   2 16:02 javavm
drwxr-xr-x  3 oracle oinstall    35 4月   2 16:03 jdbc
drwxr-xr-x  7 oracle oinstall   246 4月   2 16:04 jdk
drwxr-xr-x  2 oracle oinstall  4096 4月   2 16:04 jlib
drwxr-xr-x 12 oracle oinstall   135 4月   2 16:04 ldap
drwxr-xr-x  3 oracle oinstall 12288 4月   2 16:05 lib
drwxr-xr-x  4 oracle oinstall    29 4月   2 16:10 log
drwxr-xr-x  7 oracle oinstall    75 4月   2 16:02 md
drwxr-xr-x  6 oracle oinstall    53 4月   2 16:04 mgw
drwxr-xr-x 10 oracle oinstall   106 4月   2 16:05 network
drwxr-xr-x  5 oracle oinstall    46 4月   2 16:02 nls
drwxr-xr-x  3 oracle oinstall    18 4月   2 16:05 oc4j
drwxr-xr-x  7 oracle oinstall    64 4月   2 16:02 odbc
drwxr-xr-x  5 oracle oinstall    42 4月   2 16:02 olap
drwxr-x--- 15 oracle oinstall  4096 4月   4 19:38 OPatch
drwxr-xr-x 12 oracle oinstall  4096 4月   2 16:04 OPatch_20220404
drwxr-xr-x  8 oracle oinstall    77 4月   2 16:04 opmn
drwxr-xr-x  4 oracle oinstall    34 4月   2 16:02 oracore
-rw-r-----  1 oracle oinstall    56 4月   2 16:02 oraInst.loc
drwxr-xr-x  7 oracle oinstall    64 4月   2 16:02 ord
drwxr-xr-x  3 oracle oinstall    19 4月   2 16:02 ordim
drwxr-xr-x  4 oracle oinstall    67 4月   2 16:03 ords
drwxr-xr-x  3 oracle oinstall    19 4月   2 16:02 oss
drwxr-xr-x  8 oracle oinstall   197 4月   2 16:05 oui
drwxr-xr-x  4 oracle oinstall    33 4月   2 16:02 owm
drwxr-xr-x  5 oracle oinstall    39 4月   2 16:02 perl
drwxr-xr-x  6 oracle oinstall    78 4月   2 16:02 plsql
drwxr-xr-x  6 oracle oinstall    56 4月   2 16:02 precomp
drwxr-xr-x  2 oracle oinstall    45 4月   2 16:14 QOpatch
drwxr-xr-x  3 oracle oinstall    21 4月   2 16:02 R
drwxr-xr-x  7 oracle oinstall    63 4月   2 16:04 racg
drwxr-xr-x 14 oracle oinstall   152 4月   2 16:05 rdbms
drwxr-xr-x  3 oracle oinstall    21 4月   2 16:02 relnotes
-rwx------  1 oracle oinstall   596 4月   2 16:05 root.sh
-rw-r--r--  1 oracle oinstall  2826 3月   9 2016 schagent.conf
drwxr-xr-x  4 oracle oinstall    31 4月   2 16:02 scheduler
drwxr-xr-x  3 oracle oinstall    18 4月   2 16:02 slax
drwxr-xr-x 22 oracle oinstall  4096 4月   2 16:03 sqldeveloper
drwxr-xr-x  3 oracle oinstall    17 4月   2 16:02 sqlj
drwxr-xr-x  3 oracle oinstall   158 4月   2 16:02 sqlpatch
drwxr-xr-x  7 oracle oinstall    64 4月   2 16:04 sqlplus
drwxr-xr-x  9 oracle oinstall    91 4月   2 16:04 srvm
drwxr-xr-x  5 oracle oinstall    45 4月   2 16:02 suptools
drwxr-xr-x  4 oracle oinstall    33 4月   2 16:02 sysman
drwxr-xr-x  3 oracle oinstall    35 4月   2 16:03 ucp
drwxr-xr-x  4 oracle oinstall    31 4月   2 16:02 usm
drwxr-xr-x  2 oracle oinstall    33 4月   2 16:03 utl
drwxr-xr-x  3 oracle oinstall    19 4月   2 16:02 wwg
drwxr-x---  7 oracle oinstall    69 4月   2 16:02 xdk
[oracle@lhr:/u01/app/oracle/product/19.3.0/db]$ 
[oracle@lhr:/u01/app/oracle/product/19.3.0/db]$ cd OPatch
[oracle@lhr:/u01/app/oracle/product/19.3.0/db/OPatch]$ ./opatch version
OPatch Version: 12.2.0.1.28

OPatch succeeded.
[oracle@lhr:/u01/app/oracle/product/19.3.0/db/OPatch]$ cd /soft/
[oracle@lhr:/soft]$ ll
总用量 6960424
drwxr-x--- 8 oracle oinstall        159 4月   4 15:32 33583921
drwxr-xr-x 5 oracle oinstall         81 4月   4 19:16 33587128
-rw-rw-r-- 1 oracle oinstall 3453696911 4月   2 14:50 LINUX.X64_122010_db_home.zip
-rw-r--r-- 1 oracle oinstall  138022072 4月   3 10:47 p33561275_122010_Linux-x86-64.zip
-rw-rw-r-- 1 oracle oinstall 2393137641 4月   2 15:34 p33583921_122010_Linux-x86-64.zip
-rw-rw-r-- 1 oracle oinstall 1020001457 4月   2 15:21 p33587128_122010_Linux-x86-64.zip
-rw-rw-r-- 1 oracle oinstall  122247289 4月   2 15:09 p6880880_122010_Linux-x86-64.zip
-rw-rw-r-- 1 oracle oinstall     357470 1月  18 18:39 PatchSearch.xml
[oracle@lhr:/soft]$ cd 33587128/
[oracle@lhr:/soft/33587128]$ ll
总用量 80
drwxr-x---  3 oracle oinstall    21 12月 28 08:38 custom
drwxr-x---  3 oracle oinstall    20 12月 28 08:41 etc
drwxr-x--- 24 oracle oinstall   291 12月 28 08:38 files
-rw-r--r--  1 oracle oinstall 76160 1月  18 16:31 README.html
-rw-r--r--  1 oracle oinstall    21 12月 28 08:41 README.txt
[oracle@lhr:/soft/33587128]$ opatch version
OPatch Version: 12.2.0.1.28

OPatch succeeded.
[oracle@lhr:/soft/33587128]$ 
[oracle@lhr:/soft/33587128]$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle 临时补丁程序安装程序版本 12.2.0.1.28
版权所有 (c) 2022, Oracle Corporation。保留所有权利。

PREREQ session

Oracle 主目录       :/u01/app/oracle/product/19.3.0/db
主产品清单:/u01/app/oraInventory
   来自           :/u01/app/oracle/product/19.3.0/db/oraInst.loc
OPatch 版本    :12.2.0.1.28
OUI 版本       :12.2.0.1.4
日志文件位置:/u01/app/oracle/product/19.3.0/db/cfgtoollogs/opatch/opatch2022-04-04_19-49-27下午_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.
[oracle@lhr:/soft/33587128]$ lsnrctl status

LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 04-APR-2022 19:52:35

Copyright (c) 1991, 2016, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=lhr)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                02-APR-2022 16:10:05
Uptime                    2 days 3 hr. 42 min. 30 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/19.3.0/db/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/lhr/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=lhr)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=lhr)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/admin/orcl/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "dba8834f14b33b5be053f217030a13d3" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orcl" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclpdb" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@lhr:/soft/33587128]$ cd ORACLE_HOME
-bash: cd: ORACLE_HOME: 没有那个文件或目录
[oracle@lhr:/soft/33587128]$ cd $ORACLE_HOME/
[oracle@lhr:/u01/app/oracle/product/19.3.0/db]$ cd network/admin/
[oracle@lhr:/u01/app/oracle/product/19.3.0/db/network/admin]$ ll
总用量 16
-rw-r--r-- 1 oracle oinstall  560 4月   3 10:19 listener.ora
drwxr-xr-x 2 oracle oinstall   64 4月   2 16:02 samples
-rw-r--r-- 1 oracle oinstall 1441 8月  28 2015 shrept.lst
-rw-r--r-- 1 oracle oinstall  189 4月   2 16:10 sqlnet.ora
-rw-r----- 1 oracle oinstall  565 4月   3 10:23 tnsnames.ora
[oracle@lhr:/u01/app/oracle/product/19.3.0/db/network/admin]$ vim listener.ora 
[oracle@lhr:/u01/app/oracle/product/19.3.0/db/network/admin]$ 
[oracle@lhr:/u01/app/oracle/product/19.3.0/db/network/admin]$ lsnrctl stop

LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 04-APR-2022 20:03:34

Copyright (c) 1991, 2016, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=lhr)(PORT=1521)))
The command completed successfully
[oracle@lhr:/u01/app/oracle/product/19.3.0/db/network/admin]$ lsnrctl status

LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 04-APR-2022 20:03:41

Copyright (c) 1991, 2016, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=lhr)(PORT=1521)))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 111: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 2: No such file or directory
[oracle@lhr:/u01/app/oracle/product/19.3.0/db/network/admin]$ 
[oracle@lhr:/u01/app/oracle/product/19.3.0/db/network/admin]$ sas

SQL*Plus: Release 12.2.0.1.0 Production on Mon Apr 4 20:03:50 2022

Copyright (c) 1982, 2016, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> select status from v$instance;

STATUS
------------------------------------
OPEN

SQL> show con_name;

CON_NAME
------------------------------
CDB$ROOT
SQL> show pdbs

    CON_ID CON_NAME           OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
     2 PDB$SEED           READ ONLY  NO
     3 ORCLPDB            READ WRITE NO
SQL> alter session set container=ORCLPDB;

Session altered.

SQL> show con_name;

CON_NAME
------------------------------
ORCLPDB
SQL> select name,open_mode from v$pds;
select name,open_mode from v$pds
                           *
ERROR at line 1:
ORA-00942: table or view does not exist


SQL> select name,open_mode from dba_pdbs;
select name,open_mode from dba_pdbs
            *
ERROR at line 1:
ORA-00904: "OPEN_MODE": invalid identifier


SQL> select name,open_mode from v$pdbs;

NAME                                                                           OPEN_MODE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------
ORCLPDB                                                                        READ WRITE

SQL> alter pluggable database ORCLPDB close;

Pluggable database altered.

SQL> select name,open_mode from v$pdbs;

NAME                                                                           OPEN_MODE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------
ORCLPDB                                                                        MOUNTED

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
[oracle@lhr:/u01/app/oracle/product/19.3.0/db/network/admin]$ sas

SQL*Plus: Release 12.2.0.1.0 Production on Mon Apr 4 20:06:38 2022

Copyright (c) 1982, 2016, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> show con_name;

CON_NAME
------------------------------
CDB$ROOT
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
[oracle@lhr:/u01/app/oracle/product/19.3.0/db/network/admin]$ lsnrctl status

LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 04-APR-2022 20:07:30

Copyright (c) 1991, 2016, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=lhr)(PORT=1521)))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 111: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 2: No such file or directory
[oracle@lhr:/u01/app/oracle/product/19.3.0/db/network/admin]$ ps -ef| grep pmon
oracle   21726 16067  0 20:07 pts/0    00:00:00 grep --color=auto pmon
[oracle@lhr:/u01/app/oracle/product/19.3.0/db/network/admin]$ 
[oracle@lhr:/u01/app/oracle/product/19.3.0/db/network/admin]$ cd /soft/
[oracle@lhr:/soft]$ ll
总用量 6960424
drwxr-x--- 8 oracle oinstall        159 4月   4 15:32 33583921
drwxr-xr-x 5 oracle oinstall         81 4月   4 19:16 33587128
-rw-rw-r-- 1 oracle oinstall 3453696911 4月   2 14:50 LINUX.X64_122010_db_home.zip
-rw-r--r-- 1 oracle oinstall  138022072 4月   3 10:47 p33561275_122010_Linux-x86-64.zip
-rw-rw-r-- 1 oracle oinstall 2393137641 4月   2 15:34 p33583921_122010_Linux-x86-64.zip
-rw-rw-r-- 1 oracle oinstall 1020001457 4月   2 15:21 p33587128_122010_Linux-x86-64.zip
-rw-rw-r-- 1 oracle oinstall  122247289 4月   2 15:09 p6880880_122010_Linux-x86-64.zip
-rw-rw-r-- 1 oracle oinstall     357470 1月  18 18:39 PatchSearch.xml
[oracle@lhr:/soft]$ cd 33587128/
[oracle@lhr:/soft/33587128]$ ll
总用量 80
drwxr-x---  3 oracle oinstall    21 12月 28 08:38 custom
drwxr-x---  3 oracle oinstall    20 12月 28 08:41 etc
drwxr-x--- 24 oracle oinstall   291 12月 28 08:38 files
-rw-r--r--  1 oracle oinstall 76160 1月  18 16:31 README.html
-rw-r--r--  1 oracle oinstall    21 12月 28 08:41 README.txt
[oracle@lhr:/soft/33587128]$ opatch apply
Oracle 临时补丁程序安装程序版本 12.2.0.1.28
版权所有 (c) 2022, Oracle Corporation。保留所有权利。


Oracle 主目录       :/u01/app/oracle/product/19.3.0/db
主产品清单:/u01/app/oraInventory
   来自           :/u01/app/oracle/product/19.3.0/db/oraInst.loc
OPatch 版本    :12.2.0.1.28
OUI 版本       :12.2.0.1.4
日志文件位置:/u01/app/oracle/product/19.3.0/db/cfgtoollogs/opatch/opatch2022-04-04_20-09-26下午_1.log

Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   33587128  

是否继续? [y|n]
y
User Responded with: Y
All checks passed.

请关闭本地系统上在此 ORACLE_HOME 之外运行的 Oracle 实例。
(Oracle 主目录 = '/u01/app/oracle/product/19.3.0/db')


本地系统是否已准备打补丁? [y|n]
y
User Responded with: Y
Backing up files...
正在将临时补丁程序 '33587128' 应用于 OH '/u01/app/oracle/product/19.3.0/db'
ApplySession: Oracle 主目录中不存在可选组件 [ 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 ] , 或找到更高版本。

正在为组件 oracle.rdbms.util, 12.2.0.1.0 打补丁...

正在为组件 oracle.rdbms, 12.2.0.1.0 打补丁...

正在为组件 oracle.network.rsf, 12.2.0.1.0 打补丁...

正在为组件 oracle.rdbms.rsf, 12.2.0.1.0 打补丁...

正在为组件 oracle.ctx, 12.2.0.1.0 打补丁...

正在为组件 oracle.has.common.cvu, 12.2.0.1.0 打补丁...

正在为组件 oracle.ldap.owm, 12.2.0.1.0 打补丁...

正在为组件 oracle.ldap.rsf, 12.2.0.1.0 打补丁...

正在为组件 oracle.nlsrtl.rsf, 12.2.0.1.0 打补丁...

正在为组件 oracle.oracore.rsf, 12.2.0.1.0 打补丁...

正在为组件 oracle.oraolap, 12.2.0.1.0 打补丁...

正在为组件 oracle.rdbms.dbscripts, 12.2.0.1.0 打补丁...

正在为组件 oracle.rdbms.deconfig, 12.2.0.1.0 打补丁...

正在为组件 oracle.rdbms.rsf.ic, 12.2.0.1.0 打补丁...

正在为组件 oracle.sdo, 12.2.0.1.0 打补丁...

正在为组件 oracle.sdo.locator, 12.2.0.1.0 打补丁...

正在为组件 oracle.sdo.locator.jrf, 12.2.0.1.0 打补丁...

正在为组件 oracle.tfa, 12.2.0.1.0 打补丁...

正在为组件 oracle.ctx.rsf, 12.2.0.1.0 打补丁...

正在为组件 oracle.rdbms.install.plugins, 12.2.0.1.0 打补丁...

正在为组件 oracle.rdbms.install.common, 12.2.0.1.0 打补丁...

正在为组件 oracle.assistants.deconfig, 12.2.0.1.0 打补丁...

正在为组件 oracle.ons.ic, 12.2.0.1.0 打补丁...

正在为组件 oracle.rdbms.rman, 12.2.0.1.0 打补丁...

正在为组件 oracle.precomp.rsf, 12.2.0.1.0 打补丁...

正在为组件 oracle.install.deinstalltool, 12.2.0.1.0 打补丁...

正在为组件 oracle.assistants.acf, 12.2.0.1.0 打补丁...

正在为组件 oracle.rdbms.oci, 12.2.0.1.0 打补丁...

正在为组件 oracle.sqlplus.ic, 12.2.0.1.0 打补丁...

正在为组件 oracle.xdk.parser.java, 12.2.0.1.0 打补丁...

正在为组件 oracle.dbtoolslistener, 12.2.0.1.0 打补丁...

正在为组件 oracle.ldap.rsf.ic, 12.2.0.1.0 打补丁...

正在为组件 oracle.rdbms.dv, 12.2.0.1.0 打补丁...

正在为组件 oracle.rdbms.lbac, 12.2.0.1.0 打补丁...

正在为组件 oracle.ons, 12.2.0.1.0 打补丁...

正在为组件 oracle.ldap.client, 12.2.0.1.0 打补丁...

正在为组件 oracle.xdk, 12.2.0.1.0 打补丁...

正在为组件 oracle.xdk.rsf, 12.2.0.1.0 打补丁...

正在为组件 oracle.sqlplus, 12.2.0.1.0 打补丁...

正在为组件 oracle.assistants.server, 12.2.0.1.0 打补丁...

正在为组件 oracle.rdbms.crs, 12.2.0.1.0 打补丁...

正在为组件 oracle.precomp.common, 12.2.0.1.0 打补丁...

正在为组件 oracle.precomp.lang, 12.2.0.1.0 打补丁...

正在为组件 oracle.jdk, 1.8.0.91.0 打补丁...
Patch 33587128 successfully applied.
Log file location: /u01/app/oracle/product/19.3.0/db/cfgtoollogs/opatch/opatch2022-04-04_20-09-26下午_1.log

OPatch succeeded.
[oracle@lhr:/soft/33587128]$ sas

SQL*Plus: Release 12.2.0.1.0 Production on Mon Apr 4 20:28:17 2022

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 3137339392 bytes
Fixed Size          8797680 bytes
Variable Size         771752464 bytes
Database Buffers     2348810240 bytes
Redo Buffers            7979008 bytes
Database mounted.
Database opened.
SQL> alter pluggable database all open;

Pluggable database altered.

SQL> quit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
[oracle@lhr:/soft/33587128]$ cd $ORACLE_HOME/
[oracle@lhr:/u01/app/oracle/product/19.3.0/db]$ cd OPatch
[oracle@lhr:/u01/app/oracle/product/19.3.0/db/OPatch]$ ./datapatch -verbose
SQL Patching tool version 12.2.0.1.0 Production on Mon Apr  4 20:32:08 2022
Copyright (c) 2012, 2021, Oracle.  All rights reserved.

Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_28854_2022_04_04_20_32_08/sqlpatch_invocation.log

Connecting to database...OK
Note:  Datapatch will only apply or rollback SQL fixes for PDBs
       that are in an open state, no patches will be applied to closed PDBs.
       Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation
       (Doc ID 1585822.1)
Bootstrapping registry and package to current versions...done
Determining current state...done

Current state of SQL patches:
Bundle series DBRU:
  ID 220118 in the binary registry and not installed in any PDB

Adding patches to installation queue and performing prereq checks...
Installation queue:
  For the following PDBs: CDB$ROOT PDB$SEED ORCLPDB
    Nothing to roll back
    The following patches will be applied:
      33587128 (DATABASE JAN 2022 RELEASE UPDATE 12.2.0.1.220118)

Installing patches...
Patch installation complete.  Total patches installed: 3

Validating logfiles...
Patch 33587128 apply (pdb CDB$ROOT): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33587128/24566093/33587128_apply_ORCL_CDBROOT_2022Apr04_20_32_23.log (no errors)
Patch 33587128 apply (pdb PDB$SEED): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33587128/24566093/33587128_apply_ORCL_PDBSEED_2022Apr04_20_34_32.log (no errors)
Patch 33587128 apply (pdb ORCLPDB): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33587128/24566093/33587128_apply_ORCL_ORCLPDB_2022Apr04_20_34_32.log (no errors)
SQL Patching tool complete on Mon Apr  4 20:36:31 2022
[oracle@lhr:/u01/app/oracle/product/19.3.0/db/OPatch]$ cd ../rdbms/admin/
[oracle@lhr:/u01/app/oracle/product/19.3.0/db/rdbms/admin]$ rlwrap sqlplus /nolog

SQL*Plus: Release 12.2.0.1.0 Production on Mon Apr 4 20:39:18 2022

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

SQL> CONNECT / AS SYSDBA
Connected.
SQL> @utlrp.sql

TIMESTAMP
------------------------------
COMP_TIMESTAMP UTLRP_BGN          2022-04-04 20:39:55

DOC>   The following PL/SQL block invokes UTL_RECOMP to recompile invalid
DOC>   objects in the database. Recompilation time is proportional to the
DOC>   number of invalid objects in the database, so this command may take
DOC>   a long time to execute on a database with a large number of invalid
DOC>   objects.
DOC>
DOC>   Use the following queries to track recompilation progress:
DOC>
DOC>   1. Query returning the number of invalid objects remaining. This
DOC>      number should decrease with time.
DOC>         SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);
DOC>
DOC>   2. Query returning the number of objects compiled so far. This number
DOC>      should increase with time.
DOC>         SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;
DOC>
DOC>   This script automatically chooses serial or parallel recompilation
DOC>   based on the number of CPUs available (parameter cpu_count) multiplied
DOC>   by the number of threads per CPU (parameter parallel_threads_per_cpu).
DOC>   On RAC, this number is added across all RAC nodes.
DOC>
DOC>   UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallel
DOC>   recompilation. Jobs are created without instance affinity so that they
DOC>   can migrate across RAC nodes. Use the following queries to verify
DOC>   whether UTL_RECOMP jobs are being created and run correctly:
DOC>
DOC>   1. Query showing jobs created by UTL_RECOMP
DOC>         SELECT job_name FROM dba_scheduler_jobs
DOC>        WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>
DOC>   2. Query showing UTL_RECOMP jobs that are running
DOC>         SELECT job_name FROM dba_scheduler_running_jobs
DOC>        WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>#

PL/SQL procedure successfully completed.


TIMESTAMP
------------------------------
COMP_TIMESTAMP UTLRP_END          2022-04-04 20:39:57

DOC> The following query reports the number of invalid objects.
DOC>
DOC> If the number is higher than expected, please examine the error
DOC> messages reported with each object (using SHOW ERRORS) to see if they
DOC> point to system misconfiguration or resource constraints that must be
DOC> fixed before attempting to recompile these objects.
DOC>#

OBJECTS WITH ERRORS
-------------------
          0

DOC> The following query reports the number of exceptions caught during
DOC> recompilation. If this number is non-zero, please query the error
DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors
DOC> are due to misconfiguration or resource constraints that must be
DOC> fixed before objects can compile successfully.
DOC> Note: Typical compilation errors (due to coding errors) are not
DOC>       logged into this table: they go into DBA_ERRORS instead.
DOC>#

ERRORS DURING RECOMPILATION
---------------------------
              0


Function created.


PL/SQL procedure successfully completed.


Function dropped.


PL/SQL procedure successfully completed.

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
[oracle@lhr:/u01/app/oracle/product/19.3.0/db/rdbms/admin]$ which rman
/u01/app/oracle/product/19.3.0/db/bin/rman
[oracle@lhr:/u01/app/oracle/product/19.3.0/db/rdbms/admin]$ cd
[oracle@lhr:/home/oracle]$ sas

SQL*Plus: Release 12.2.0.1.0 Production on Mon Apr 4 20:49:20 2022

Copyright (c) 1982, 2016, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> select * from v$dba_registry_sqlpatch;
select * from v$dba_registry_sqlpatch
              *
ERROR at line 1:
ORA-00942: table or view does not exist


SQL> select * from dba_registry_sqlpatch;

  PATCH_ID  PATCH_UID VERSION                              FLAGS              ACTION              STATUS                                        INSTALL_ID ACTION_TIME                           DESCRIPTION                                                                      BUNDLE_SERIES                                         BUNDLE_ID BUNDLE_DATA                        PATCH_DESCRIPTOR                                                                 PATCH_DIRECTORY                                                                      POST_LOGFILE                                                                         LOGFILE
------------------------------------------------------------------------------
  33587128   24566093 12.2.0.1                             NB                 APPLY               SUCCESS                                        1 04-APR-22 08.36.19.445788 PM                      DATABASE JAN 2022 RELEASE UPDATE 12.2.0.1.220118                                                 DBRU                                                 220118 <?xml version="1.0" encoding="UTF-8"?>         <?xml version="1.0" encoding="UTF-8"?>                                                   504B0304140000000800B0069C538513678D5A050000003C00000C00000033333538373132382E786D6CC55B5B739B38147EEFAF6078DEB5C51D666C7792DABBB33B699C89D34EF72923108949B9C808                                                                      /u01/app/oracle/cfgtoollogs/sqlpatch/33587128/24566093/33587128_apply_ORCL_CDBROOT_2022Apr04_20_32_23.log
                                                                                <bundledata version="12.2.0.1.170516" ser                                                            <sqlPatch ID="33587128" uniquePatchID="24


SQL> 

上一篇下一篇

猜你喜欢

热点阅读