반응형
■ [2025-07-10] Oracle Restart Single 12cR2 to 19c noncdb to cdb Upgrade

 

Oracle Restart 12cR2 noncdb 서버를 19c cdb 서버로 업그레이드 할 것임

12cR2 noncdb 서버 자체를 업그레이드 하지 않고 19c에 cdb를 생성 후 12cR2 noncdb를 19c cdb내의 pdb로 plugin 방식으로 진행할 것임

 

1. 테스트 환경 정보

 

--테스트 환경 정보를 출력하는 쉘을 생성

[CDB1:oracle@tdb01t][/home/oracle]$
cat > make_all_orainfo.sh <<'EOF'
#!/bin/bash

# 공통 정보
echo "========================================"
echo "        Oracle/Grid OS Info Summary"
echo "========================================"
echo -n "Hostname     : "; hostname
echo -n "IP Address   : "; hostname -i
echo -n "OS Name      : "; grep -i pretty_name /etc/os-release | cut -d= -f2 | tr -d '"'
echo -n "Kernel Ver   : "; uname -r
echo "========================================"

# Grid Home 정보
if [[ -n "$GRID_HOME" ]]; then
  echo "[GRID_HOME: $GRID_HOME]"
  echo -n "GRID Version : "
  $GRID_HOME/bin/sqlplus -S / as sysdba <<EOQ | head -1
SET TIMING OFF
SET PAGESIZE 0
SET FEEDBACK OFF
SET VERIFY OFF
SET HEADING OFF
SET ECHO OFF
SELECT banner FROM v\$version WHERE rownum=1;
EXIT
EOQ
  echo "<GRID Patch Info>"
  su - grid -c "$GRID_HOME/OPatch/opatch lspatches"
  echo "----------------------------------------"
else
  echo "[GRID_HOME not set, skip grid info]"
fi

# Oracle Home 정보
if [[ -n "$DB_HOME" ]]; then
  echo "[DB_HOME: $DB_HOME]"
  echo -n "DB Version   : "
  $DB_HOME/bin/sqlplus -S / as sysdba <<EOQ | head -1
SET TIMING OFF
SET PAGESIZE 0
SET FEEDBACK OFF
SET VERIFY OFF
SET HEADING OFF
SET ECHO OFF
SELECT banner FROM v\$version WHERE rownum=1;
EXIT
EOQ
  echo "<DB Patch Info>"
  su - oracle -c "$DB_HOME/OPatch/opatch lspatches"
  echo "----------------------------------------"
else
  echo "[DB_HOME not set, skip DB info]"
fi

echo "========================================"
EOF

 

[PTDB:oracle@tdb01p][/home/oracle]$ sh make_all_orainfo.sh

========================================
        Oracle/Grid OS Info Summary
========================================
Hostname     : tdb01p
IP Address   : 192.168.0.41
OS Name      : Oracle Linux Server 7.9
Kernel Ver   : 5.4.17-2102.201.3.el7uek.x86_64
========================================
[GRID_HOME: /u01/app/12c/grid]
GRID Version : Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
<GRID Patch Info>
Password:
33587128;Database Jan 2022 Release Update : 12.2.0.1.220118 (33587128)
33116894;ACFS JUL 2021 RELEASE UPDATE 12.2.0.1.210720 (33116894)
26839277;DBWLM RELEASE UPDATE 12.2.0.1.0(ID:170913) (26839277)
33610989;TOMCAT RELEASE UPDATE 12.2.0.1.0(ID:RELEASE) (33610989)
33678030;OCW JAN 2022 RELEASE UPDATE 12.2.0.1.220118 (33678030)

OPatch succeeded.
----------------------------------------
[DB_HOME: /u01/app/oracle/product/12c/db_1]
DB Version   : Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
<DB Patch Info>
Password:
33561275;OJVM RELEASE UPDATE 12.2.0.1.220118 (33561275)
33678030;OCW JAN 2022 RELEASE UPDATE 12.2.0.1.220118 (33678030)
33587128;Database Jan 2022 Release Update : 12.2.0.1.220118 (33587128)

OPatch succeeded.
----------------------------------------
========================================

 

2. Grid Upgrade

 

2-1. Grid Upgrade 전 grid 엔진 관련 파일 모두 백업

 

[root@tdb01p][/root]$ mkdir -pv /tmp/backup_before_upgrade
mkdir: created directory ‘/tmp/backup_before_upgrade’
[root@tdb01p][/root]$ chmod 777 /tmp/backup_before_upgrade/

--OLR 파일 위치 확인

[+ASM:grid@tdb01p][/home/grid]$ ls -l $GRID_HOME/cdata/localhost
total 1900
-rw-r-----. 1 grid oinstall 503484416 Feb  9 18:29 local.ocr
-rw-------. 1 grid oinstall 503484416 Jul 13 09:54 tdb01p.olr

 

--olr 파일을 추출해서 저장해 놓음

[root@tdb01p][/root]$ ocrconfig -local -export /tmp/backup_before_upgrade/ocr_local_backup_20250712
PROTL-58: successfully exported the Oracle Local Registry contents to file '/tmp/backup_before_upgrade/ocr_local_backup_20250712'

[root@tdb01p][/root]$ ls -l /tmp/backup_before_upgrade/ocr_local_backup_20250712
-rw-------. 1 root root 139264 Jul 13 10:04 /tmp/backup_before_upgrade/ocr_local_backup_20250712

--> 추출 완료 확인

 

--OLR 수동 백업

[root@tdb01p][/root]$ ocrconfig -local -manualbackup

tdb01p     2025/07/13 10:13:02     /u01/app/12c/grid/cdata/tdb01p/backup_20250713_101302.olr     3975995681

tdb01p     2025/02/09 18:30:28     /u01/app/12c/grid/cdata/tdb01p/backup_20250209_183028.olr     3975995681

 

--OLR 수동 백업본도 복사해둠

[root@tdb01p][/root]$ cp /u01/app/12c/grid/cdata/tdb01p/backup_20250713_101302.olr /tmp/backup_before_upgrade

 

--grid 엔진 백업

[root@tdb01p][/root]$ tar -cvzf /tmp/backup_before_upgrade/grid_engine_backup.tar.gz $GRID_HOME

 

--asm pfile 백업 및 asm 디스크그룹 상태 확인해둠

[+ASM:grid@tdb01p][/home/grid]$ alias sa
alias sa='rlwrap sqlplus "/as sysasm"'

[+ASM:grid@tdb01p][/home/grid]$ sa

SQL*Plus: Release 12.2.0.1.0 Production on Sun Jul 13 10:19:25 2025

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


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

[2025-07-13:10:19:25][tdb01p]<SYS@+ASM> create pfile='/tmp/backup_before_upgrade/asm_pfile.ora' from spfile;

File created.

Elapsed: 00:00:00.10
[2025-07-13:10:19:25][tdb01p]<
SYS@+ASM> col name for a20
[2025-07-13:10:19:25][tdb01p]<
SYS@+ASM> select name, state, type, total_mb, free_mb from v$asm_diskgroup;

NAME                 STATE                             TYPE                 TOTAL_MB    FREE_MB
-------------------- --------------------------------- ------------------ ---------- ----------
DATA1                MOUNTED                           EXTERN                 393208     228828
FRA1                 MOUNTED                           EXTERN                 196604     193540

2 rows selected.

Elapsed: 00:00:00.05

 

[+ASM:grid@tdb01p][/home/grid]$ cat /tmp/backup_before_upgrade/asm_pfile.ora
+ASM.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from in memory value
*._enable_shared_pool_durations=FALSE
+ASM.asm_diskgroups='FRA1'#Manual Mount
*.asm_diskstring='/dev/oracleasm/disks'
*.asm_power_limit=1
*.audit_sys_operations=FALSE
*.large_pool_size=12M
*.memory_max_target=4294967296
*.memory_target=1610612736
*.remote_login_passwordfile='EXCLUSIVE'


[+ASM:grid@tdb01p][/home/grid]$ asmcmd lsdg
State    Type    Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512             512   4096  4194304    393208   228828                0          228828              0             N  DATA1/
MOUNTED  EXTERN  N         512             512   4096  4194304    196604   193540                0          193540              0             N  FRA1/

 

--/etc/rc.d/init.d 내에서 필요한 중요 파일 백업

[root@tdb01p][/root]$ ls -l /etc/rc.d/init.d
total 84
-rw-r--r--. 1 root root 18281 May 22  2020 functions
-rwxr-x---. 1 root root 15336 Feb  9 18:30 init.ohasd
-rwxr-xr-x. 1 root root  4569 May 22  2020 netconsole
-rwxr-xr-x. 1 root root  9198 Oct  2  2020 network
-rwxr-x---. 1 root root  7283 Feb  9 18:30 ohasd
-rwxr-xr-x. 1 root root  4954 Feb  4  2018 oracleasm
-rwx------. 1 root root  1308 Jun 25  2019 oracle-database-server-12cR2-preinstall-firstboot
-rw-r--r--. 1 root root  1160 Oct  2  2020 README
-rwxr-xr-x. 1 root root  2437 Feb  6  2018 rhnsd

 

[root@tdb01p][/root]$ tar czvf /tmp/backup_before_upgrade/etc_rc.d_init.d.tar.gz -C /etc/rc.d init.d
init.d/
init.d/README
init.d/functions
init.d/netconsole
init.d/network
init.d/rhnsd
init.d/oracle-database-server-12cR2-preinstall-firstboot
init.d/oracleasm
init.d/init.ohasd
init.d/ohasd

 

[root@tdb01p][/root]$ tar tzvf /tmp/backup_before_upgrade/etc_rc.d_init.d.tar.gz
drwxr-xr-x root/root         0 2025-02-09 18:30 init.d/
-rw-r--r-- root/root      1160 2020-10-02 22:09 init.d/README
-rw-r--r-- root/root     18281 2020-05-22 19:44 init.d/functions
-rwxr-xr-x root/root      4569 2020-05-22 19:44 init.d/netconsole
-rwxr-xr-x root/root      9198 2020-10-02 00:53 init.d/network
-rwxr-xr-x root/root      2437 2018-02-06 14:47 init.d/rhnsd
-rwx------ root/root      1308 2019-06-25 17:50 init.d/oracle-database-server-12cR2-preinstall-firstboot
-rwxr-xr-x root/root      4954 2018-02-04 01:15 init.d/oracleasm
-rwxr-x--- root/root     15336 2025-02-09 18:30 init.d/init.ohasd
-rwxr-x--- root/root      7283 2025-02-09 18:30 init.d/ohasd


--만약 복구한다고 가정 시

tar xpvzf /tmp/backup_before_upgrade/etc_rc.d_init.d.tar.gz -C /etc/rc.d

 

[root@tdb01p][/root]$ tar cvzf /tmp/backup_before_upgrade/opt_oracle.tar.gz -C /opt/ oracle
oracle/
oracle/extapi/
oracle/extapi/64/
oracle/extapi/64/asm/
oracle/extapi/64/asm/orcl/
oracle/extapi/64/asm/orcl/1/
oracle/extapi/64/asm/orcl/1/libasm.so

 

[root@tdb01p][/root]$ tar cvzf /tmp/backup_before_upgrade/opt_ORCLfmap.tar.gz -C /opt/ ORCLfmap
ORCLfmap/
ORCLfmap/prot1_64/
ORCLfmap/prot1_64/bin/
ORCLfmap/prot1_64/bin/fmputl
ORCLfmap/prot1_64/bin/fmputlhp
ORCLfmap/prot1_64/etc/
ORCLfmap/prot1_64/etc/filemap.ora
ORCLfmap/prot1_64/log/

 

[root@tdb01p][/root]$ cat /etc/oraInst.loc
inventory_loc=/u01/app/oraInventory
inst_group=oinstall

 

[root@tdb01p][/root]$ cp -rp /u01/app/oraInventory /tmp/backup_before_upgrade/u01_app_oraInventory

 

[root@tdb01p][/tmp/backup_before_upgrade]$ mkdir /tmp/backup_before_upgrade/etc_oratab
[root@tdb01p][/tmp/backup_before_upgrade]$ cp -p /etc/oratab /tmp/backup_before_upgrade/etc_oratab/oratab

 

[root@tdb01p][/etc/oracle]$ tar cvzf /tmp/backup_before_upgrade/etc_oracle.tar.gz -C /etc/ oracle
oracle/
oracle/lastgasp/
oracle/oprocd/
oracle/oprocd/check/
oracle/oprocd/stop/
oracle/oprocd/fatal/
oracle/scls_scr/
oracle/scls_scr/tdb01p/
oracle/scls_scr/tdb01p/grid/
oracle/scls_scr/tdb01p/grid/cssfatal
oracle/scls_scr/tdb01p/grid/ohasdrun
oracle/scls_scr/tdb01p/grid/ohasdinitpid
oracle/scls_scr/tdb01p/grid/ohasdstr
oracle/scls_scr/tdb01p/root/
oracle/scls_scr/tdb01p/root/crsstart
oracle/maps/
oracle/setasmgid
oracle/olr.loc
oracle/olr.loc.orig
oracle/ocr.loc
oracle/ocr.loc.orig

 

[root@tdb01p][/etc/oracle]$ tar tvzf /tmp/backup_before_upgrade/etc_oracle.tar.gz
drwxr-x--- root/oinstall     0 2025-02-09 18:29 oracle/
drwxrwx--- grid/oinstall     0 2025-02-09 18:29 oracle/lastgasp/
drwxrwx--- root/oinstall     0 2025-02-09 18:29 oracle/oprocd/
drwxrwx--- root/oinstall     0 2025-02-09 18:29 oracle/oprocd/check/
drwxrwx--- root/oinstall     0 2025-02-09 18:29 oracle/oprocd/stop/
drwxrwx--- root/oinstall     0 2025-02-09 18:29 oracle/oprocd/fatal/
drwxr-x--- root/oinstall     0 2025-02-09 18:29 oracle/scls_scr/
drwxr-x--- root/oinstall     0 2025-02-09 18:29 oracle/scls_scr/tdb01p/
drwxr-xr-x grid/root         0 2025-02-09 18:30 oracle/scls_scr/tdb01p/grid/
-rw-r--r-- grid/root         8 2025-02-09 18:29 oracle/scls_scr/tdb01p/grid/cssfatal
-rw-r----- grid/oinstall     8 2025-07-13 09:26 oracle/scls_scr/tdb01p/grid/ohasdrun
-rw-r--r-- root/root         5 2025-07-13 09:26 oracle/scls_scr/tdb01p/grid/ohasdinitpid
-rw-r----- grid/oinstall     7 2025-02-09 18:30 oracle/scls_scr/tdb01p/grid/ohasdstr
drwxr-xr-x root/root         0 2025-02-09 18:29 oracle/scls_scr/tdb01p/root/
-rw-r--r-- root/root         7 2025-02-09 18:29 oracle/scls_scr/tdb01p/root/crsstart
drwxrwx--- root/oinstall     0 2025-02-09 18:29 oracle/maps/
-rws--x--- root/oinstall 3594456 2025-02-09 18:29 oracle/setasmgid
-rw-r----- root/oinstall      86 2025-02-09 18:29 oracle/olr.loc
-rw-r--r-- root/root           0 2025-02-09 18:29 oracle/olr.loc.orig
-rw-r----- grid/oinstall      74 2025-02-09 18:29 oracle/ocr.loc
-rw-r--r-- root/root          16 2025-02-09 18:29 oracle/ocr.loc.orig

2-2. 19c Upgrade를 위한 필수 패치가 존재하는지 확인

 

Patches to apply before upgrading Oracle GI and DB to 19c or downgrading to previous release (Doc ID 2539751.1)

 

Linux x86-64

GI Upgrade to 19c

From Release

Bug#(s)

Patch

Description

Additional comments

18c

28553832 28553832

LNX-191-EXA:CSSD PROCESS CANNOT GET REAL-TIME PRIORITY

p28553832_183000OCWRU_<platform>.zip

12.2.0.1.0

28553832 28553832 LNX-191-EXA:CSSD PROCESS CANNOT GET REAL-TIME PRIORITY p28553832_12201190115OCWJAN2019RU_<platform>.zip

12.1.0.2

 

21255373

 

 

Fix included in GI 12.1.0.2.190115 and latest

Recommended to install latest 12.1.0.2 GI PSU

28553832

28553832 LNX-191-EXA:CSSD PROCESS CANNOT GET REAL-TIME PRIORITY

p28553832_12102190115forOCW_<platform>.zip

11.2.0.4

17617807

21255373

GI PSU 22646198

11.2.0.4.160419 (Apr 2016) Grid Infrastructure Patch Set Update (GI PSU)

Recommended to install latest* 11.2.0.4 GI PSU

28553832

28553832

LNX-191-EXA:CSSD PROCESS CANNOT GET REAL-TIME PRIORITY p28553832_11204190115forOCW_<platform>.zip

 

[+ASM:grid@tdb01p][/home/grid]$ opatch lsinventory | grep 28553832
     28553832, 28558622, 28562244, 28567875, 28578962, 28588574, 28593407
--> 28553832 가 존재하는 상황임

 

DB Upgrades to 19c

Note: following patches needed if you have GI Setup

From Release

Bug#(s)

Patch

Description

Additional comments

18c

28553832 28553832

LNX-191-EXA:CSSD PROCESS CANNOT GET REAL-TIME PRIORITY

p28553832_183000OCWRU_<platform>.zip

12.2.0.1.0

28553832 28553832 LNX-191-EXA:CSSD PROCESS CANNOT GET REAL-TIME PRIORITY p28553832_12201190115OCWJAN2019RU_<platform>.zip

12.1.0.2

 

21255373

 

 

Fix included in GI 12.1.0.2.190115 and latest

Recommended to install latest 12.1.0.2 GI PSU

28553832

28553832 LNX-191-EXA:CSSD PROCESS CANNOT GET REAL-TIME PRIORITY

p28553832_12102190115forOCW_<platform>.zip

11.2.0.4

17617807

21255373

GI PSU 22646198

11.2.0.4.160419 (Apr 2016) Grid Infrastructure Patch Set Update (GI PSU)

Recommended to install latest* 11.2.0.4 GI PSU

28553832

28553832

LNX-191-EXA:CSSD PROCESS CANNOT GET REAL-TIME PRIORITY p28553832_11204190115forOCW_<platform>.zip

 

[PTDB:oracle@tdb01p][/home/oracle]$ opatch lsinventory | grep 28553832
     28553832, 28558622, 28562244, 28567875, 28578962, 28588574, 28593407
--> 28553832 가 존재하는 상황임

 

2-3. 19c Grid/Oracle 엔진 및 최신 RU 다운로드 및 업로드

 

https://www.oracle.com/kr/database/technologies/oracle19c-linux-downloads.html
How To Download And Install The Latest OPatch(6880880) Version (Doc ID 274526.1)
Assistant: Download Reference for Oracle Database/GI Update, Revision, PSU, SPU(CPU), Bundle Patches, Patchsets and Base Releases (Doc ID 2118136.2)
--> 오라클 엔진 파일도 이 단계에서 다운로드 및 업로드 시킴


[+ASM:grid@tdb01p][/home/grid]$ mkdir -p /tmp/19.27
[+ASM:grid@tdb01p][/home/grid]$ chmod 777 /tmp/19.27

 

[+ASM:grid@tdb01p][/home/grid]$ ls -l /tmp/19.27
total 9748716
-rw-r--r--. 1 grid oinstall 3059705302 Jul 13 11:56 LINUX.X64_193000_db_home.zip
-rw-r--r--. 1 grid oinstall 2889184573 Jul 13 11:57 LINUX.X64_193000_grid_home.zip
-rw-r--r--. 1 grid oinstall 3961245851 Jul 13 11:58 p37641958_190000_Linux-x86-64.zip
-rw-r--r--. 1 grid oinstall   72539776 Jul 13 11:58 p6880880_190000_Linux-x86-64.zip

--> 업로드 완료


[+ASM:grid@tdb01p][/home/grid]$ chmod -R 777 /tmp/19.27
[+ASM:grid@tdb01p][/home/grid]$ ls -l /tmp/19.27
total 9748716
-rwxrwxrwx. 1 grid oinstall 3059705302 Jul 13 11:56 LINUX.X64_193000_db_home.zip
-rwxrwxrwx. 1 grid oinstall 2889184573 Jul 13 11:57 LINUX.X64_193000_grid_home.zip
-rwxrwxrwx. 1 grid oinstall 3961245851 Jul 13 11:58 p37641958_190000_Linux-x86-64.zip
-rwxrwxrwx. 1 grid oinstall   72539776 Jul 13 11:58 p6880880_190000_Linux-x86-64.zip

 

2-3. 19c 설치를 위한 필수 요구 사항 확인

 

Oracle Database (RDBMS) on Unix AIX,HP-UX,Linux,Solaris and MS Windows Operating Systems Installation and Configuration Requirements Quick Reference (12.1/12.2/18c/19c) (Doc ID 1587357.1)

 

Oracle Linux 7

Oracle Linux 7
OS Version Patches/Packages Kernel settings

Oracle Linux 7.4 with the Unbreakable Enterprise Kernel 4: 4.1.12-124.19.2.el7uek.x86_64 or later
Oracle Linux 7.4 with the Unbreakable Enterprise Kernel 5: 4.14.35-1818.1.6.el7uek.x86_64 or later
Oracle Linux 7.5 with the Red Hat Compatible kernel: 3.10.0-862.11.6.el7.x86_64 or later

Reference: 2551169.1

 

bc
binutils
compat-libcap1
compat-libstdc++
elfutils-libelf
elfutils-libelf-devel
fontconfig-devel
glibc
glibc-devel
ksh
libaio
libaio-devel
libXrender
libXrender-devel
libX11
libXau
libXi
libXtst
libgcc
libstdc++
libstdc++-devel
libxcb
make
net-tools (for Oracle RAC and Oracle Clusterware)
nfs-utils (for Oracle ACFS)
python (for Oracle ACFS Remote)
python-configshell (for Oracle ACFS Remote)
python-rtslib (for Oracle ACFS Remote)
python-six (for Oracle ACFS Remote)
targetcli (for Oracle ACFS Remote)
smartmontools
sysstat

Note:If you intend to use 32-bit client applications to access 64-bit servers, then you must also install (where available) the latest 32-bit versions of the packages listed in this table.

Ensure that OpenSSH is installed on your servers. OpenSSH is the required SSH software.

Kernel-based virtual machine (KVM), also known as KVM virtualization, is certified on Oracle Database 19c for all supported Oracle Linux 7 distributions. For more information on supported virtualization technologies for Oracle Database, refer to the virtualization matrix:

https://www.oracle.com/database/technologies/virtualization-matrix.html

For Oracle C++, Pro*C/C++, Oracle C++ Call Interface, Oracle XML Developer's Kit (XDK)
- Intel C/C++ Compiler 17.0.2.174 or later, or the GNU C and C++ compilers listed in this table.
- Oracle C++ Call Interface (OCCI) applications can be built with g++ and Intel C++ Compiler 17.0.2.174 used with the standard template libraries of the gcc compilers
- Install the latest released versions of the gcc packages listed here.
gcc, gcc-c++, gcc-info, gcc-locale, gcc48, gcc48-info, gcc48-locale, gcc48-c++
- Oracle XML Developer's Kit is supported with the same compilers as OCCI.

For Pro*COBOL
Micro Focus Visual COBOL for Eclipse 2.3 - Update 2

Java Database Connectivity (JDBC) / JDBC Oracle Call Interface (JDBC OCI)

JDK 8 (Java SE Development Kit) with the JNDI extension with Oracle Java Database Connectivity.

semmsl 250
semmns 32000
semopm 100
semmni 128
shmall Greater than or equal to the value of shmmax, in pages.
shmmax Half the size of physical memory in bytes
shmmni 4096
panic_on_oops 1
file-max 6815744
aio-max-nr 1048576
ip_local_port_range Minimum: 9000 Maximum: 65500
rmem_default 262144
rmem_max 4194304
wmem_default 262144
wmem_max 1048576


Set values in /etc/sysctl.d/97-oracle-database-sysctl.conf

fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576


To change the current values of the kernel parameters:

# /sbin/sysctl --system

Note:

  • Unless otherwise specified, the kernel parameter and shell limit values shown in the following table are minimum values only. For production database systems, Oracle recommends that you tune these values to optimize the performance of the system. See the operating system documentation for more information about tuning kernel parameters.

  • If the current value for any parameter is greater than the value listed in this table, then the Fixup scripts do not change the value of that parameter.

  • Oracle recommends that you disable Transparent HugePages before you start installation.

    Transparent HugePages memory differs from standard HugePages memory because the kernel khugepaged thread allocates memory dynamically during runtime. Standard HugePages memory is pre-allocated at startup, and does not change during runtime.

 




 

 

 

[+ASM:grid@tdb01p][/home/grid]$ uname -r
5.4.17-2102.201.3.el7uek.x86_64

 

[root@tdb01p][/root]$ vi check_pakage.sh
[root@tdb01p][/root]$ chmod 775 /root/check_pakage.sh
[root@tdb01p][/root]$ cat /root/check_pakage.sh
rpm -q bc
rpm -q binutils
rpm -q compat-libcap1
rpm -q compat-libstdc++
rpm -q elfutils-libelf
rpm -q elfutils-libelf-devel
rpm -q fontconfig-devel
rpm -q glibc
rpm -q glibc-devel
rpm -q ksh
rpm -q libaio
rpm -q libaio-devel
rpm -q libXrender
rpm -q libXrender-devel
rpm -q libX11
rpm -q libXau
rpm -q libXi
rpm -q libXtst
rpm -q libgcc
rpm -q libstdc++
rpm -q libstdc++-devel
rpm -q libxcb
rpm -q make
rpm -q net-tools
rpm -q nfs-utils
rpm -q python
rpm -q python-configshell
rpm -q python-rtslib
rpm -q python-six
rpm -q targetcli
rpm -q smartmontools
rpm -q sysstat

[root@tdb01p][/root]$ sh /root/check_pakage.sh | grep -i "not installed"
package compat-libstdc++ is not installed
package elfutils-libelf-devel is not installed
package fontconfig-devel is not installed
package libXrender-devel is not installed
package python-configshell is not installed
package python-rtslib is not installed
package python-six is not installed
package targetcli is not installed

 

[root@tdb01p][/root]$ yum install -y compat-libstdc++ elfutils-libelf-devel fontconfig-devel libXrender-devel python-configshell python-rtslib python-six targetcli

[root@tdb01p][/root]$ sh /root/check_pakage.sh | grep -i "not installed"
package compat-libstdc++ is not installed

 

[root@tdb01p][/root]$ sh /root/check_pakage.sh | grep -i "not installed"
package compat-libstdc++ is not installed

 

[root@tdb01p][/root]$ yum list installed | grep compat-libstdc++
compat-libstdc++-33.x86_64           3.2.3-72.el7                  @ol7_latest

--> 이미 설치되어 있는 상황임

 

[root@tdb01p][/root]$ sysctl -p
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 2097152
kernel.shmmax = 8589934592
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
kernel.pid_max = 10239
vm.min_free_kbytes = 524288
vm.swappiness = 1
kernel.randomize_va_space = 0
kernel.sysrq = 1
vm.nr_hugepages = 2642

 

2-4. 19c Grid 엔진 패치 설치 (applyRU)

 

--19c grid 엔진 디렉토리 생성

[+ASM:grid@tdb01p][/home/grid]$ mkdir -pv /u01/app/19c/grid
mkdir: created directory ‘/u01/app/19c’
mkdir: created directory ‘/u01/app/19c/grid’

 

--19.3 base release 압축 해제

[+ASM:grid@tdb01p][/home/grid]$ unzip /tmp/19.27/LINUX.X64_193000_grid_home.zip -d /u01/app/19c/grid

 

--19.27 RU Patch 압축 해제

[+ASM:grid@tdb01p][/home/grid]$ unzip /tmp/19.27/p37641958_190000_Linux-x86-64.zip -d /tmp/19.27

 

--opatch 설치

[+ASM:grid@tdb01p][/home/grid]$ mv /u01/app/19c/grid/OPatch /u01/app/19c/grid/OPatch.bak.20250712

[+ASM:grid@tdb01p][/home/grid]$ unzip /tmp/19.27/p6880880_190000_Linux-x86-64.zip -d /u01/app/19c/grid/
[+ASM:grid@tdb01p][/home/grid]$ /u01/app/19c/grid/OPatch/opatch version
OPatch Version: 12.2.0.1.46

 

--> 19.27 RU Patch readme 파일 확인

Patch Number | Description                             | Applicable Homes
-------------|-----------------------------------------|--------------------------------------------------------------------------------------------------
37642901     | Database Release Update 19.27.0.0.250415| Only Oracle home for non-Oracle RAC setup. Both Oracle home and Grid home for Oracle RAC setup.
37654975     | OCW Release Update 19.27.0.0.250415     | Both Oracle home and Grid home.
37643161     | ACFS Release Update 19.27.0.0.250415    | Only Grid home.
37762426     | Tomcat Release Update 19.0.0.0.0        | Only Grid home.
36758186     | DBWLM Release Update 19.0.0.0.0         | Only Grid home.

 

[+ASM:grid@tdb01p][/home/grid]$ /u01/app/19c/grid/gridSetup.sh \
-applyRU /tmp/19.27/37641958/37654975 \
-applyOneOffs /tmp/19.27/37641958/37642901,/tmp/19.27/37641958/37643161,/tmp/19.27/37641958/37762426,/tmp/19.27/37641958/36758186
--> applyRU 자리에 37654975(OCW Release Update 19.27.0.0.250415)를 넣어줌

--> 패치가 완료되고 설치 GUI 화면이 뜬다면 종료 시킴

 

2-5. 19c grid 설치 전 설치 가능 검증

 

--runcluvfy.sh 실행
[+ASM:grid@tdb01p][/home/grid]$ /u01/app/19c/grid/runcluvfy.sh stage -pre hacfg -fixupnoexec -verbose
...
Package: policycoreutils-python-2.5-17 ...FAILED
tdb01p: PRVF-7532 : Package "policycoreutils-python" is missing on node "tdb01p"
--> FAILED 발생

 

--root os user로 접속
[root@tdb01p][/root]$ yum list | grep policycoreutils-python
policycoreutils-python.x86_64         2.5-34.0.1.el7               ol7_latest

[root@tdb01p][/root]$ yum install -y policycoreutils-python.x86_64

 

--다시 확인
[+ASM:grid@tdb01p][/home/grid]$ /u01/app/19c/grid/runcluvfy.sh stage -pre hacfg -fixupnoexec -verbose
...
Pre-check for Oracle Restart configuration was successful.

CVU operation performed:      stage -pre hacfg
Date:                         Jul 12, 2025 1:35:37 AM
CVU version:                  Standalone 19.27.0.0.0 (041025x8664)
CVU home:                     /u01/app/19c/grid
Grid home:                    /u01/app/12c/grid
User:                         grid
Operating system:             Linux5.4.17-2102.201.3.el7uek.x86_64

 

2-6. grid Upgrade

 

 

[+ASM:grid@tdb01p][/home/grid]$ alias csrt
alias csrt='crsctl stat res -t'

 

[+ASM:grid@tdb01p][/home/grid]$ csrt
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA1.dg
               ONLINE  ONLINE       tdb01p                   STABLE
ora.FRA1.dg
               ONLINE  ONLINE       tdb01p                   STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       tdb01p                   STABLE
ora.asm
               ONLINE  ONLINE       tdb01p                   Started,STABLE
ora.ons
               OFFLINE OFFLINE      tdb01p                   STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       tdb01p                   STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.evmd
      1        ONLINE  ONLINE       tdb01p                   STABLE
ora.ptdb.db
      1        ONLINE  ONLINE       tdb01p                   Open,HOME=/u01/app/o
                                                             racle/product/12c/db
                                                             _1,STABLE
--------------------------------------------------------------------------------

 

[+ASM:grid@tdb01p][/home/grid]$ srvctl stop database -db ptdb

 

[+ASM:grid@tdb01p][/home/grid]$ csrt
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA1.dg
               ONLINE  ONLINE       tdb01p                   STABLE
ora.FRA1.dg
               ONLINE  ONLINE       tdb01p                   STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       tdb01p                   STABLE
ora.asm
               ONLINE  ONLINE       tdb01p                   Started,STABLE
ora.ons
               OFFLINE OFFLINE      tdb01p                   STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       tdb01p                   STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.evmd
      1        ONLINE  ONLINE       tdb01p                   STABLE
ora.ptdb.db
      1        OFFLINE OFFLINE                               Instance Shutdown,ST
                                                             ABLE
--------------------------------------------------------------------------------

 

[+ASM:grid@tdb01p][/home/grid]$ unset ORACLE_BASE
[+ASM:grid@tdb01p][/home/grid]$ unset ORACLE_HOME
[+ASM:grid@tdb01p][/home/grid]$ unset ORACLE_SID


[:grid@tdb01p][/home/grid]$ echo $ORACLE_BASE

[:grid@tdb01p][/home/grid]$ echo $ORACLE_HOME

[:grid@tdb01p][/home/grid]$ echo $ORACLE_SID

 

[:grid@tdb01p][/home/grid]$ echo $GRID_HOME
/u01/app/12c/grid

 

--gui를 통해서 reponse 파일을 생성한다면 response file 생성 후 아래의 명령으로 사용한 response 파일 생성

awk -F= 'NF && $1 !~ /^#/ && $2!=""' /home/grid/grid_19c.rsp > /home/grid/grid_19c_new.rsp

 

[:grid@tdb01p][/home/grid]$ vi /home/grid/grid_19c_new.rsp
[:grid@tdb01p][/home/grid]$ cat /home/grid/grid_19c_new.rsp

oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v19.0.0
INVENTORY_LOCATION=/u01/app/oraInventory
oracle.install.option=UPGRADE
ORACLE_BASE=/u01/app/oracle
oracle.install.crs.config.scanType=LOCAL_SCAN
oracle.install.crs.config.ClusterConfiguration=STANDALONE
oracle.install.crs.config.configureAsExtendedCluster=false
oracle.install.crs.config.gpnp.configureGNS=false
oracle.install.crs.config.autoConfigureClusterNodeVIP=false
oracle.install.crs.config.gpnp.gnsOption=CREATE_NEW_GNS
oracle.install.crs.configureGIMR=false
oracle.install.asm.configureGIMRDataDG=false
oracle.install.crs.config.sharedFileSystemStorage.ocrLocations=
oracle.install.crs.config.useIPMI=false
oracle.install.asm.diskGroup.AUSize=1
oracle.install.asm.gimrDG.AUSize=1
oracle.install.asm.configureAFD=false
oracle.install.crs.configureRHPS=false
oracle.install.crs.config.ignoreDownNodes=false
oracle.install.config.managementOption=NONE
oracle.install.config.omsPort=0
oracle.install.crs.rootconfig.executeRootScript=false


[:grid@tdb01p][/home/grid]$ /u01/app/19c/grid/gridSetup.sh -silent -ignorePrereqFailure -responseFile /home/grid/grid_19c_new.rsp
Launching Oracle Grid Infrastructure Setup Wizard...

The response file for this session can be found at:
 /u01/app/19c/grid/install/response/grid_2025-07-13_12-36-47PM.rsp

You can find the log of this install session at:
 /u01/app/oraInventory/logs/GridSetupActions2025-07-13_12-36-47PM/gridSetupActions2025-07-13_12-36-47PM.log

As a root user, execute the following script(s):
        1. /u01/app/19c/grid/rootupgrade.sh

Execute /u01/app/19c/grid/rootupgrade.sh on the following nodes:
[tdb01p]

 

Successfully Setup Software.
As install user, execute the following command to complete the configuration.
        /u01/app/19c/grid/gridSetup.sh -executeConfigTools -responseFile /home/grid/grid_19c_new.rsp [-silent]

 

--로그 모니터링

/u01/app/oraInventory/logs/GridSetupActions2025-07-13_12-36-47PM/gridSetupActions2025-07-13_12-36-47PM.log

 

--root os user 로 접속하여 업그레이드 스크립트 실행

[root@tdb01p][/root]$ /u01/app/19c/grid/rootupgrade.sh
Check /u01/app/19c/grid/install/root_tdb01p_2025-07-13_12-39-08-998360357.log for the output of root script

 

--로그 모니터링

[root@tdb01p][/root]$ tail -f /u01/app/19c/grid/install/root_tdb01p_2025-07-13_12-39-08-998360357.log

 

--grid os user에서 아래의 스크립트 실행

[:grid@tdb01p][/home/grid]$ /u01/app/19c/grid/gridSetup.sh -executeConfigTools -responseFile /home/grid/grid_19c_new.rsp -silent
Launching Oracle Grid Infrastructure Setup Wizard...

You can find the logs of this session at:
/u01/app/oraInventory/logs/GridSetupActions2025-07-13_12-43-03PM

You can find the log of this install session at:
 /u01/app/oraInventory/logs/UpdateNodeList2025-07-13_12-43-03PM.log
You can find the log of this install session at:
 /u01/app/oraInventory/logs/UpdateNodeList2025-07-13_12-43-03PM.log
Successfully Configured Software.

[root@tdb01p][/root]$ vi ~grid/.bash_profile
[root@tdb01p][/root]$ cat ~grid/.bash_profile | grep -i GRID_HOME
#export GRID_HOME=/u01/app/12c/grid
export GRID_HOME=/u01/app/19c/grid
export ORACLE_HOME=$GRID_HOME
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$GRID_HOME/bin:$BASE_PATH

 

[root@tdb01p][/root]$ vi ~oracle/.bash_profile
[root@tdb01p][/root]$ cat ~oracle/.bash_profile | grep -i GRID_HOME
#export GRID_HOME=/u01/app/12c/grid
export GRID_HOME=/u01/app/19c/grid
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$GRID_HOME/bin:$BASE_PATH

 

[root@tdb01p][/root]$ vi ~root/.bash_profile
[root@tdb01p][/root]$ cat ~root/.bash_profile | grep -i GRID_HOME
#export GRID_HOME=/u01/app/12c/grid
export GRID_HOME=/u01/app/19c/grid
export PATH=$GRID_HOME/bin:$BASE_PATH

 

--grid 업그레이드 후 버전 확인 (grid os user로 새로운 세션으로 접속)

[+ASM:grid@tdb01p][/home/grid]$ alias sa
alias sa='rlwrap sqlplus "/as sysasm"'


[+ASM:grid@tdb01p][/home/grid]$ sa

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Jul 12 03:03:43 2025
Version 19.27.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.27.0.0.0

 

SQL> select banner_full from v$version;

BANNER_FULL
------------------------------------------------------------------------------------------
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.27.0.0.0

 

[+ASM:grid@tdb01p][/home/grid]$ crsctl query has releaseversion
Oracle High Availability Services release version on the local node is [19.0.0.0.0]

 

[+ASM:grid@tdb01p][/home/grid]$ crsctl query has softwareversion
Oracle High Availability Services version on the local node is [19.0.0.0.0]

 

[+ASM:grid@tdb01p][/home/grid]$ crsctl query has releasepatch
Oracle Clusterware release patch level is [2119256259] and the complete list of patches [36758186 37642901 37643161 37654975 37762426 ] have been applied on the local node. The release patch string is [19.27.0.0.0].

 

[+ASM:grid@tdb01p][/home/grid]$ crsctl query has softwarepatch
Oracle Clusterware patch level on node tdb01p is [2119256259].

 

[root@tdb01p][/root]$ ps -ef | grep grid | grep 19c
grid      4679     1  1 12:42 ?        00:00:08 /u01/app/19c/grid/bin/ohasd.bin reboot
grid      4904     1  0 12:42 ?        00:00:02 /u01/app/19c/grid/bin/cssdagent
grid      4912     1  1 12:42 ?        00:00:06 /u01/app/19c/grid/bin/oraagent.bin
grid      4969     1  0 12:42 ?        00:00:03 /u01/app/19c/grid/bin/ocssd.bin
grid      4975     1  0 12:42 ?        00:00:02 /u01/app/19c/grid/bin/evmd.bin
grid      4979     1  0 12:42 ?        00:00:00 /u01/app/19c/grid/bin/tnslsnr LISTENER -no_crs_notify -inherit
grid      5048  4975  0 12:42 ?        00:00:02 /u01/app/19c/grid/bin/evmlogger.bin -o /u01/app/19c/grid/log/[HOSTNAME]/evmd/evmlogger.info -l /u01/app/19c/grid/log/[HOSTNAME]/evmd/evmlogger.log

 

 

[+ASM:grid@tdb01p][/home/grid]$ lsnrctl status

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 13-JUL-2025 12:50:05

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=tdb01p)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                13-JUL-2025 12:42:22
Uptime                    0 days 0 hr. 7 min. 42 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/19c/grid/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/tdb01p/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=tdb01p)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM", status READY, has 1 handler(s) for this service...
Service "+ASM_DATA1" has 1 instance(s).
  Instance "+ASM", status READY, has 1 handler(s) for this service...
Service "+ASM_FRA1" has 1 instance(s).
  Instance "+ASM", status READY, has 1 handler(s) for this service...
The command completed successfully

 

[root@tdb01p][/root]$ grep 19c /etc/init.d/init.ohasd
ORA_CRS_HOME=/u01/app/19c/grid

 

[root@tdb01p][/root]$ grep 19c /etc/init.d/ohasd
ORA_CRS_HOME=/u01/app/19c/grid

 

2-7. 19c grid에서 12cR2 Oracle DB가 잘 올라오는지 확인

 

[PTDB:oracle@tdb01p][/home/oracle]$ which srvctl
/u01/app/oracle/product/12c/db_1/bin/srvctl
[PTDB:oracle@tdb01p][/home/oracle]$ srvctl start database -db ptdb

 

[PTDB:oracle@tdb01p][/home/oracle]$ alias csrt
alias csrt='crsctl stat res -t'

[PTDB:oracle@tdb01p][/home/oracle]$ which crsctl
/u01/app/19c/grid/bin/crsctl
[PTDB:oracle@tdb01p][/home/oracle]$ csrt
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA1.dg
               ONLINE  ONLINE       tdb01p                   STABLE
ora.FRA1.dg
               ONLINE  ONLINE       tdb01p                   STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       tdb01p                   STABLE
ora.asm
               ONLINE  ONLINE       tdb01p                   Started,STABLE
ora.ons
               OFFLINE OFFLINE      tdb01p                   STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       tdb01p                   STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.evmd
      1        ONLINE  ONLINE       tdb01p                   STABLE
ora.ptdb.db
      1        ONLINE  ONLINE       tdb01p                   Open,HOME=/u01/app/o
                                                             racle/product/12c/db
                                                             _1,STABLE
--------------------------------------------------------------------------------

 

[PTDB:oracle@tdb01p][/home/oracle]$ srvctl config database -db ptdb
Database unique name: ptdb
Database name: ptdb
Oracle home: /u01/app/oracle/product/12c/db_1
Oracle user: grid
Spfile: +DATA1/PTDB/PARAMETERFILE/spfile.273.1192667301
Password file:
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Disk Groups: DATA1
Services:
OSDBA group:
OSOPER group:
Database instance: PTDB

--> 현재 19c grid 엔진 위에서 12cR2 DB가 구동되고 있는 상태임

 

3. Oracle 19c 엔진 설치 및 DB 업그레이드

 

 

3-1. DB 백업

 

[PTDB:oracle@tdb01p][/home/oracle]$ mkdir -pv /tmp/backup_before_upgrade/rman_full_backup/autobackup
mkdir: created directory ‘/tmp/backup_before_upgrade/rman_full_backup’
mkdir: created directory ‘/tmp/backup_before_upgrade/rman_full_backup/autobackup’

[PTDB:oracle@tdb01p][/home/oracle]$ alias rt
alias rt='rman target /'

[PTDB:oracle@tdb01p][/home/oracle]$ rt

Recovery Manager: Release 12.2.0.1.0 - Production on Sun Jul 13 13:27:50 2025

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.

connected to target database: PTDB (DBID=1887725823)

 

run {
CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
CONFIGURE BACKUP OPTIMIZATION OFF;
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/tmp/backup_before_upgrade/rman_full_backup/autobackup/%F';
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/tmp/backup_before_upgrade/rman_full_backup/snapcf_CA.f';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;
CONFIGURE RMAN OUTPUT TO KEEP FOR 7 DAYS;
CONFIGURE MAXSETSIZE TO UNLIMITED;
CONFIGURE ENCRYPTION FOR DATABASE OFF;
CONFIGURE ENCRYPTION ALGORITHM 'AES128';
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE;
}

 

RUN {

ALLOCATE CHANNEL c1 TYPE DISK;
ALLOCATE CHANNEL c2 TYPE DISK;
ALLOCATE CHANNEL c3 TYPE DISK;

ALLOCATE CHANNEL c4 TYPE DISK;

crosscheck backupset;
crosscheck backup;
crosscheck copy;
crosscheck archivelog all;
sql 'alter system archive log current';
sql 'alter system checkpoint';
BACKUP AS COMPRESSED BACKUPSET DATABASE FORMAT '/tmp/backup_before_upgrade/rman_full_backup/full_%d_%T_%U.bkp';

delete noprompt obsolete;
delete noprompt expired backup;

RELEASE CHANNEL c1;
RELEASE CHANNEL c2;
RELEASE CHANNEL c3;

RELEASE CHANNEL c4;
}

 

run {
backup archivelog all format '/tmp/backup_before_upgrade/rman_full_backup/%d_ARCHIVE_%T_%u_s%s_p%p' delete input;
}

 

[PTDB:oracle@tdb01p][/home/oracle]$ ls -alR /tmp/backup_before_upgrade/rman_full_backup/
/tmp/backup_before_upgrade/rman_full_backup/:
total 9172068
drwxr-xr-x. 3 oracle oinstall       4096 Jul 13 13:38 .
drwxrwxrwx. 5 root   root           4096 Jul 13 13:39 ..
drwxr-xr-x. 2 oracle oinstall         70 Jul 13 13:38 autobackup
-rw-r-----. 1 oracle asmadmin  228581376 Jul 13 13:29 full_PTDB_20250713_f83ufb4j_1_1.bkp
-rw-r-----. 1 oracle asmadmin  294789120 Jul 13 13:29 full_PTDB_20250713_f93ufb4j_1_1.bkp
-rw-r-----. 1 oracle asmadmin 2455273472 Jul 13 13:32 full_PTDB_20250713_fa3ufb4j_1_1.bkp
-rw-r-----. 1 oracle asmadmin 6402088960 Jul 13 13:36 full_PTDB_20250713_fb3ufb4j_1_1.bkp
-rw-r-----. 1 oracle asmadmin     535040 Jul 13 13:38 PTDB_ARCHIVE_20250713_fd3ufbmq_s493_p1
-rw-r-----. 1 oracle asmadmin   10895360 Jul 13 13:38 snapcf_CA.f

/tmp/backup_before_upgrade/rman_full_backup/autobackup:
total 21476
drwxr-xr-x. 2 oracle oinstall       70 Jul 13 13:38 .
drwxr-xr-x. 3 oracle oinstall     4096 Jul 13 13:38 ..
-rw-r-----. 1 oracle asmadmin 10993664 Jul 13 13:36 c-1887725823-20250713-04
-rw-r-----. 1 oracle asmadmin 10993664 Jul 13 13:38 c-1887725823-20250713-05


3-2. Oracle 엔진 백업

 

[root@tdb01p][/root]$ echo $DB_HOME
/u01/app/oracle/product/12c/db_1
[root@tdb01p][/root]$ tar -cvzf /tmp/backup_before_upgrade/oracle_engine_backup.tar.gz $DB_HOME

 

3-3. db parameter file 백업

 

[PTDB:oracle@tdb01p][/home/oracle]$ alias ss
alias ss='rlwrap sqlplus "/as sysdba"'

[PTDB:oracle@tdb01p][/home/oracle]$ ss

SQL*Plus: Release 12.2.0.1.0 Production on Sun Jul 13 13:43:41 2025

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


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

[2025-07-13:13:43:41][tdb01p]<SYS@PTDB> create pfile='/tmp/backup_before_upgrade/pfile_PTDB.ora' from spfile;

File created.

Elapsed: 00:00:00.01

 

3-5. Oracle 19c 엔진 설치

 

--오라클 엔진 압축 해제

[PTDB:oracle@tdb01p][/home/oracle]$ mkdir -pv /u01/app/oracle/product/19c/db_1
mkdir: created directory ‘/u01/app/oracle/product/19c’
mkdir: created directory ‘/u01/app/oracle/product/19c/db_1’
[PTDB:oracle@tdb01p][/home/oracle]$ unzip /tmp/19.27/LINUX.X64_193000_db_home.zip -d /u01/app/oracle/product/19c/db_1

 

--opatch 설치

[PTDB:oracle@tdb01p][/home/oracle]$ mv /u01/app/oracle/product/19c/db_1/OPatch /u01/app/oracle/product/19c/db_1/OPatch.bak.20250712
[PTDB:oracle@tdb01p][/home/oracle]$ unzip /tmp/19.27/p6880880_190000_Linux-x86-64.zip -d /u01/app/oracle/product/19c/db_1/
[PTDB:oracle@tdb01p][/home/oracle]$ /u01/app/oracle/product/19c/db_1/OPatch/opatch version
OPatch Version: 12.2.0.1.46

OPatch succeeded.

 

--오라클 19c 엔진 패치 적용

--> 19.27 RU Patch readme 파일 확인

Patch Number | Description                             | Applicable Homes
-------------|-----------------------------------------|--------------------------------------------------------------------------------------------------
37642901     | Database Release Update 19.27.0.0.250415| Only Oracle home for non-Oracle RAC setup. Both Oracle home and Grid home for Oracle RAC setup.
37654975     | OCW Release Update 19.27.0.0.250415     | Both Oracle home and Grid home.
37643161     | ACFS Release Update 19.27.0.0.250415    | Only Grid home.
37762426     | Tomcat Release Update 19.0.0.0.0        | Only Grid home.
36758186     | DBWLM Release Update 19.0.0.0.0         | Only Grid home.

 

[PTDB:oracle@tdb01p][/home/oracle]$ /u01/app/oracle/product/19c/db_1/runInstaller -applyRU /tmp/19.27/37641958/37642901 \
-applyOneOffs /tmp/19.27/37641958/37654975

--> applyRU 자리에는 37642901(Database Release Update 19.27.0.0.250415)가 위치함

--> 패치가 완료되고 설치 GUI 화면이 뜬다면 종료 시킴

 

--gui를 통해서 reponse 파일을 생성한다면 response file 생성 후 아래의 명령으로 사용한 response 파일 생성

awk -F= 'NF && $1 !~ /^#/ && $2!=""' /home/oracle/db_19c.rsp > /home/oracle/db_19c_new.rsp

 

[PTDB:oracle@tdb01p][/home/oracle]$ vi /home/oracle/db_19c_new.rsp
[PTDB:oracle@tdb01p][/home/oracle]$ cat /home/oracle/db_19c_new.rsp

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v19.0.0
oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=oper
oracle.install.db.OSBACKUPDBA_GROUP=backupdba
oracle.install.db.OSDGDBA_GROUP=dgdba
oracle.install.db.OSKMDBA_GROUP=kmdba
oracle.install.db.OSRACDBA_GROUP=racdba
oracle.install.db.rootconfig.executeRootScript=false
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.ConfigureAsContainerDB=false
oracle.install.db.config.starterdb.memoryOption=false
oracle.install.db.config.starterdb.installExampleSchemas=false
oracle.install.db.config.starterdb.managementOption=DEFAULT
oracle.install.db.config.starterdb.omsPort=0
oracle.install.db.config.starterdb.enableRecovery=false

 

--> 설치가 제대로 될지 확인

[PTDB:oracle@tdb01p][/home/oracle]$ /u01/app/oracle/product/19c/db_1/runInstaller \
  -executePrereqs \
  -responseFile /home/oracle/db_19c_new.rsp \
  -silent

 

--19c oracle 엔진 설치

[PTDB:oracle@tdb01p][/home/oracle]$ /u01/app/oracle/product/19c/db_1/runInstaller -ignorePrereqFailure -waitforcompletion -silent \
     -responseFile /home/oracle/db_19c_new.rsp

You can find the log of this install session at:
 /u01/app/oraInventory/logs/InstallActions2025-07-13_02-15-08PM/installActions2025-07-13_02-15-08PM.log

As a root user, execute the following script(s):
        1. /u01/app/oracle/product/19c/db_1/root.sh

Execute /u01/app/oracle/product/19c/db_1/root.sh on the following nodes:
[tdb01p]


Successfully Setup Software.

 

--로그 모니터링

tail -f /u01/app/oraInventory/logs/InstallActions2025-07-13_02-15-08PM/installActions2025-07-13_02-15-08PM.log

 

[root@tdb01p][/root]$ /u01/app/oracle/product/19c/db_1/root.sh
Check /u01/app/oracle/product/19c/db_1/install/root_tdb01p_2025-07-13_14-17-16-709739135.log for the output of root script

 

[root@tdb01p][/root]$ cat /u01/app/oracle/product/19c/db_1/install/root_tdb01p_2025-07-13_14-17-16-709739135.log
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/19c/db_1
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.

 

3-5. Oracle DB를 19c로 업그레이드 전 사전 점검

 

3-5-1. Invalid Object 확인

 

[2025-07-13:13:43:41][tdb01p]<SYS@PTDB> SELECT COUNT(*) AS CNT FROM DBA_OBJECTS WHERE STATUS <> 'VALID';

       CNT
----------
         0

1 row selected.

Elapsed: 00:00:00.05

 

--INVALID 한 OBJECT가 있다면 아래의 SQL문 참고하면 도움이 될 것임

SELECT *
 FROM
 (
        SELECT OBJECT_NAME
             , STATUS
             , OBJECT_TYPE
             , LAST_DDL_TIME
             , 'ALTER ' || OBJECT_TYPE || ' ' || OWNER || '.' || '"'|| OBJECT_NAME  || '"' || ' COMPILE;' AS DDL
          FROM DBA_OBJECTS
         WHERE 1=1
           AND OBJECT_TYPE IN ('PACKAGE')
         AND STATUS = 'INVALID'
 )
 UNION ALL
 SELECT *
 FROM
 (
        SELECT OBJECT_NAME
             , STATUS
             , OBJECT_TYPE
             , LAST_DDL_TIME
             , 'ALTER PACKAGE'|| ' ' || OWNER || '.' || '"'|| OBJECT_NAME  || '"' || ' COMPILE BODY;' AS DDL
          FROM DBA_OBJECTS
         WHERE 1=1
           AND OBJECT_TYPE IN ('PACKAGE BODY')
         AND STATUS = 'INVALID'
 )
UNION ALL
SELECT *
  FROM
     (
         SELECT OBJECT_NAME
              , STATUS
              , OBJECT_TYPE
              , LAST_DDL_TIME
              , 'ALTER PUBLIC ' ||  OBJECT_TYPE || ' ' || '"' ||  OBJECT_NAME || '"' || ' COMPILE;' AS DDL
          FROM DBA_OBJECTS
          WHERE 1=1
            AND OBJECT_TYPE IN ('SYNONYM') AND OWNER = 'PUBLIC'
            AND STATUS = 'INVALID'
 )
 UNION ALL
 SELECT *
 FROM
 (
        SELECT OBJECT_NAME
             , STATUS
             , OBJECT_TYPE
             , LAST_DDL_TIME
             , 'ALTER ' || OBJECT_TYPE || ' ' || OWNER || '.' || '"'|| OBJECT_NAME  || '"' || ' COMPILE;' AS DDL
          FROM DBA_OBJECTS
         WHERE 1=1
           AND OBJECT_TYPE IN ('TYPE')
         AND STATUS = 'INVALID'
 )
 UNION ALL
 SELECT *
 FROM
 (
        SELECT OBJECT_NAME
             , STATUS
             , OBJECT_TYPE
             , LAST_DDL_TIME
             , 'ALTER TYPE'  || ' ' || OWNER || '.' || '"'|| OBJECT_NAME  || '"' || ' COMPILE BODY;' AS DDL
          FROM DBA_OBJECTS
         WHERE 1=1
           AND OBJECT_TYPE IN ('TYPE BODY')
         AND STATUS = 'INVALID'
 )
 UNION ALL
 SELECT *
 FROM
 (
        SELECT OBJECT_NAME
             , STATUS
             , OBJECT_TYPE
             , LAST_DDL_TIME
             , 'ALTER ' || OBJECT_TYPE || ' ' || OWNER || '.' || '"'|| OBJECT_NAME  || '"' || ' COMPILE;' AS DDL
          FROM DBA_OBJECTS
         WHERE 1=1
           AND OBJECT_TYPE IN ('VIEW')
         AND STATUS = 'INVALID'
 )
 UNION ALL
 SELECT *
 FROM
 (
        SELECT OBJECT_NAME
             , STATUS
             , OBJECT_TYPE
             , LAST_DDL_TIME
             , 'ALTER ' || OBJECT_TYPE || ' ' || OWNER || '.' || '"'|| OBJECT_NAME  || '"' || ' COMPILE;' AS DDL
          FROM DBA_OBJECTS
         WHERE 1=1
           AND OBJECT_TYPE IN ('PROCEDURE')
         AND STATUS = 'INVALID'
 )
 UNION ALL
 SELECT *
 FROM
 (
        SELECT OBJECT_NAME
             , STATUS
             , OBJECT_TYPE
             , LAST_DDL_TIME
             , 'ALTER ' || OBJECT_TYPE || ' ' || OWNER || '.' || '"'|| OBJECT_NAME  || '"' || ' COMPILE;' AS DDL
          FROM DBA_OBJECTS
         WHERE 1=1
           AND OBJECT_TYPE IN ('TRIGGER')
         AND STATUS = 'INVALID'
 )
 ORDER BY 3
 ;

 

----------------------------------컴파일 도중 아래와 같은 트러블 슈팅을 함 (START)----------------------------------

--> INVALID한 것 중 동일한 객체인데 VALID한 것이 존재하는 것을 확인
--> INVALID한 상태인데 동일 객체 기준 VALID 한것이 존재하지 않는다면 재컴파일 대상임
SELECT A.OBJECT_ID
     , A.OWNER
     , A.OBJECT_NAME
     , A.OBJECT_TYPE
     , A.STATUS
  FROM DBA_OBJECTS A
WHERE 1=1
  AND A.STATUS IN ('INVALID')
  AND NOT EXISTS (SELECT 1
                    FROM DBA_OBJECTS K
                   WHERE K.OWNER = A.OWNER
                     AND K.OBJECT_TYPE = A.OBJECT_TYPE
                     AND K.OBJECT_NAME = A.OBJECT_NAME
      AND K.STATUS = 'VALID'
     )
;

 

Duplicate Invalid Types That Won''t Compile (Doc ID 748109.1)

--컴파일 중 문제 발생 시 아래와 같은 방식으로 진행
ALTER SYSTEM SET "_system_trig_enabled" = FALSE;
@$ORACLE_HOME/rdbms/admin/utlrp.sql
ALTER SYSTEM SET "_system_trig_enabled" = TRUE;

 

--그 외 아래와 같은 조치도 고려함 
GRANT EXECUTE ON UTL_HTTP TO PUBLIC;

----------------------------------컴파일 도중 아래와 같은 트러블 슈팅을 함 (END)----------------------------------

 

3-5-2. gloin.sql 비활성화

 

[PTDB:oracle@tdb01p][/home/oracle]$ mv /u01/app/oracle/product/12c/db_1/sqlplus/admin/glogin.sql /u01/app/oracle/product/12c/db_1/sqlplus/admin/glogin.sql.bak

3-5-3. preupgrade.jar 실행

 

[PTDB:oracle@tdb01p][/home/oracle]$ /u01/app/oracle/product/12c/db_1/jdk/bin/java -jar /u01/app/oracle/product/19c/db_1/rdbms/admin/preupgrade.jar TERMINAL TEXT

Report generated by Oracle Database Pre-Upgrade Information Tool Version
19.0.0.0.0 Build: 13 on 2025-07-13T14:21:00

Upgrade-To version: 19.0.0.0.0

=======================================
Status of the database prior to upgrade
=======================================
      Database Name:  PTDB
     Container Name:  PTDB
       Container ID:  0
            Version:  12.2.0.1.0
     DB Patch Level:  DATABASE JAN 2022 RELEASE UPDATE 12.2.0.1.220118
         Compatible:  12.2.0
          Blocksize:  8192
           Platform:  Linux x86 64-bit
      Timezone File:  26
  Database log mode:  ARCHIVELOG
           Readonly:  FALSE
            Edition:  EE

  Oracle Component                       Upgrade Action    Current Status
  ----------------                       --------------    --------------
  Oracle Server                          [to be upgraded]  VALID
  JServer JAVA Virtual Machine           [to be upgraded]  VALID
  Oracle XDK for Java                    [to be upgraded]  VALID
  Real Application Clusters              [to be upgraded]  OPTION OFF
  Oracle Workspace Manager               [to be upgraded]  VALID
  OLAP Analytic Workspace                [to be upgraded]  VALID
  Oracle Label Security                  [to be upgraded]  VALID
  Oracle Database Vault                  [to be upgraded]  VALID
  Oracle Text                            [to be upgraded]  VALID
  Oracle XML Database                    [to be upgraded]  VALID
  Oracle Java Packages                   [to be upgraded]  VALID
  Oracle Multimedia                      [to be upgraded]  VALID
  Oracle Spatial                         [to be upgraded]  VALID
  Oracle OLAP API                        [to be upgraded]  VALID

==============
BEFORE UPGRADE
==============

  REQUIRED ACTIONS
  ================
  None

  RECOMMENDED ACTIONS
  ===================
  1.  (AUTOFIXUP) Load the Unified Audit records from OS spillover audit files
      to database audit table using DBMS_AUDIT_MGMT.LOAD_UNIFIED_AUDIT_FILES
      api before upgrade.

      There are Unified Audit records present in the OS spillover audit files.

      Oracle Unified Audit records present in the OS spillover audit files must
      be loaded to the database audit table before database upgrade to ensure
      they can be read after upgrade. For more information, refer to
      "LOAD_UNIFIED_AUDIT_FILES Procedure" in Database PL/SQL Packages and
      Types Reference.

  2.  Review and remove any unnecessary HIDDEN/UNDERSCORE parameters.

      The database contains the following initialization parameters whose name
      begins with an underscore:

      _disable_system_state
      _enable_shared_pool_durations
      _high_priority_processes
      _highest_priority_processes
      _os_sched_high_priority
      _os_sched_highest_priority
      _dlm_stats_collect
      _memory_imm_mode_without_autosga
      _buddy_instance
      _fatalprocess_redo_dump_time_limit
      _nonfatalprocess_redo_dump_time_limit
      _use_single_log_writer
      _verify_fg_log_checksum
      _use_adaptive_log_file_sync
      _in_memory_undo
      _cleanup_rollback_entries
      _rollback_segment_count
      _undo_autotune
      _partition_large_extents
      _index_partition_large_extents
      _securefiles_concurrency_estimate
      _drop_stat_segment
      _sys_logon_delay
      _clusterwide_global_transactions
      _cursor_obsolete_threshold
      _cursor_reload_failure_threshold
      _kks_obsolete_dump_threshold
      _kks_parse_error_warning
      _PX_use_large_pool
      _optimizer_null_aware_antijoin
      _optimizer_extended_cursor_sharing
      _optimizer_extended_cursor_sharing_rel
      _optimizer_adaptive_cursor_sharing
      _optim_peek_user_binds
      _pga_max_size
      _optimizer_connect_by_cost_based
      _bloom_filter_enabled
      _gby_hash_aggregation_enabled
      _add_col_optim_enabled
      _optimizer_aggr_groupby_elim
      _optimizer_use_feedback
      _sql_plan_directive_mgmt_control
      _optimizer_gather_stats_on_load
      _rowsets_enabled
      _emon_send_timeout
      _client_enable_auto_unregister
      _report_capture_cycle_time

      Remove hidden parameters before database upgrade unless your application
      vendors and/or Oracle Support state differently.  Changes will need to be
      made in the pfile/spfile.

  3.  (AUTOFIXUP) Gather stale data dictionary statistics prior to database
      upgrade in off-peak time using:

        EXECUTE DBMS_STATS.GATHER_DICTIONARY_STATS;

      Dictionary statistics do not exist or are stale (not up-to-date).

      Dictionary statistics help the Oracle optimizer find efficient SQL
      execution plans and are essential for proper upgrade timing. Oracle
      recommends gathering dictionary statistics in the last 24 hours before
      database upgrade.

      For information on managing optimizer statistics, refer to the 12.2.0.1
      Oracle Database SQL Tuning Guide.

  INFORMATION ONLY
  ================
  4.  Here are ALL the components in this database registry:

      Component Current     Current     Original    Previous    Component
      CID       Version     Status      Version     Version     Schema
      --------- ----------- ----------- ----------- ----------- -----------
      APS       12.2.0.1.0  VALID                               SYS
      CATALOG   12.2.0.1.0  VALID                               SYS
      CATJAVA   12.2.0.1.0  VALID                               SYS
      CATPROC   12.2.0.1.0  VALID                               SYS
      CONTEXT   12.2.0.1.0  VALID                               CTXSYS
      DV        12.2.0.1.0  VALID                               DVSYS
      JAVAVM    12.2.0.1.0  VALID                               SYS
      OLS       12.2.0.1.0  VALID                               LBACSYS
      ORDIM     12.2.0.1.0  VALID                               ORDSYS
      OWM       12.2.0.1.0  VALID                               WMSYS
      RAC       12.2.0.1.0  OPTION OFF                          SYS
      SDO       12.2.0.1.0  VALID                               MDSYS
      XDB       12.2.0.1.0  VALID                               XDB
      XML       12.2.0.1.0  VALID                               SYS
      XOQ       12.2.0.1.0  VALID                               OLAPSYS

      Review the information before upgrading.

  5.  Ensure there is additional disk space in LOG_ARCHIVE_DEST_1 for at least
      4618 MB of archived logs.  Check alert log during the upgrade that there
      is no write error to the destination due to lack of disk space.

      Archiving cannot proceed if the archive log destination is full during
      upgrade.

      Archive Log Destination:
       Parameter    :  LOG_ARCHIVE_DEST_1
       Destination  :  +FRA1

      The database has archiving enabled.  The upgrade process will need free
      disk space in the archive log destination(s) to generate archived logs to.

  6.  Check the Oracle Backup and Recovery User's Guide for information on how
      to manage an RMAN recovery catalog schema.

      If you are using a version of the recovery catalog schema that is older
      than that required by the RMAN client version, then you must upgrade the
      catalog schema.

      It is good practice to have the catalog schema the same or higher version
      than the RMAN client version you are using.

  7.  Here is a count of invalid objects by Oracle-maintained users:

      Oracle-Maintained User Name                 Number of INVALID Objects
      ---------------------------                 -------------------------
      None                                        None

      Review the information before upgrading.

  8.  Here is a count of invalid objects by Application users:

      Application User Name                       Number of INVALID Objects
      ---------------------------                 -------------------------
      None                                        None

      Review the information before upgrading.

  ORACLE GENERATED FIXUP SCRIPT
  =============================
  All of the issues in database PTDB
  which are identified above as BEFORE UPGRADE "(AUTOFIXUP)" can be resolved by
  executing the following

    SQL>@/u01/app/oracle/cfgtoollogs/PTDB/preupgrade/preupgrade_fixups.sql

=============
AFTER UPGRADE
=============

  REQUIRED ACTIONS
  ================
  None

  RECOMMENDED ACTIONS
  ===================
  9.  Upgrade the database time zone file using the DBMS_DST package.

      The database is using time zone file version 26 and the target 19 release
      ships with time zone file version 32.

      Oracle recommends upgrading to the desired (latest) version of the time
      zone file.  For more information, refer to "Upgrading the Time Zone File
      and Timestamp with Time Zone Data" in the 19 Oracle Database
      Globalization Support Guide.

  10. Recreate directory objects to remove any symbolic links from directory
      paths.  To identify paths that contain symbolic links before upgrading,
      use OS commands like UNIX file or WINDOWS dir.  After upgrading, run
      $ORACLE_HOME/rdbms/admin/utldirsymlink.sql to identify directory objects
      with symbolic links in the path.

      Found 3 user directory objects to be checked: DATAPUMP,
      DBMS_OPTIM_ADMINDIR, DBMS_OPTIM_LOGDIR.

      Starting in Release 18c, symbolic links are not allowed in directory
      object paths used with BFILE data types, the UTL_FILE package, or
      external tables.

  11. (AUTOFIXUP) Gather dictionary statistics after the upgrade using the
      command:

        EXECUTE DBMS_STATS.GATHER_DICTIONARY_STATS;

      Oracle recommends gathering dictionary statistics after upgrade.

      Dictionary statistics provide essential information to the Oracle
      optimizer to help it find efficient SQL execution plans. After a database
      upgrade, statistics need to be re-gathered as there can now be tables
      that have significantly changed during the upgrade or new tables that do
      not have statistics gathered yet.

  12. Gather statistics on fixed objects after the upgrade and when there is a
      representative workload on the system using the command:

        EXECUTE DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;

      This recommendation is given for all preupgrade runs.

      Fixed object statistics provide essential information to the Oracle
      optimizer to help it find efficient SQL execution plans.  Those
      statistics are specific to the Oracle Database release that generates
      them, and can be stale upon database upgrade.

      For information on managing optimizer statistics, refer to the 12.2.0.1
      Oracle Database SQL Tuning Guide.

  ORACLE GENERATED FIXUP SCRIPT
  =============================
  All of the issues in database PTDB
  which are identified above as AFTER UPGRADE "(AUTOFIXUP)" can be resolved by
  executing the following

    SQL>@/u01/app/oracle/cfgtoollogs/PTDB/preupgrade/postupgrade_fixups.sql


==================
PREUPGRADE SUMMARY
==================
  /u01/app/oracle/cfgtoollogs/PTDB/preupgrade/preupgrade.log
  /u01/app/oracle/cfgtoollogs/PTDB/preupgrade/preupgrade_fixups.sql
  /u01/app/oracle/cfgtoollogs/PTDB/preupgrade/postupgrade_fixups.sql

Execute fixup scripts as indicated below:

Before upgrade:

Log into the database and execute the preupgrade fixups
@/u01/app/oracle/cfgtoollogs/PTDB/preupgrade/preupgrade_fixups.sql

After the upgrade:

Log into the database and execute the postupgrade fixups
@/u01/app/oracle/cfgtoollogs/PTDB/preupgrade/postupgrade_fixups.sql

Preupgrade complete: 2025-07-13T14:21:00

 

 

[PTDB:oracle@tdb01p][/home/oracle]$ alias ss
alias ss='rlwrap sqlplus "/as sysdba"'

[PTDB:oracle@tdb01p][/home/oracle]$ ss

SQL*Plus: Release 12.2.0.1.0 Production on Sun Jul 13 14:23:25 2025

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


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

SQL> @/u01/app/oracle/cfgtoollogs/PTDB/preupgrade/preupgrade_fixups.sql
Executing Oracle PRE-Upgrade Fixup Script

Auto-Generated by:       Oracle Preupgrade Script
                         Version: 19.0.0.0.0 Build: 13
Generated on:            2025-07-13 14:20:59

For Source Database:     PTDB
Source Database Version: 12.2.0.1.0
For Upgrade to Version:  19.0.0.0.0

Preup                             Preupgrade
Action                            Issue Is
Number  Preupgrade Check Name     Remedied    Further DBA Action
------  ------------------------  ----------  --------------------------------
    1.  uniaud_records_in_file    YES         None.
    2.  hidden_params             NO          Informational only.
                                              Further action is optional.
    3.  dictionary_stats          YES         None.
    4.  component_info            NO          Informational only.
                                              Further action is optional.
    5.  min_archive_dest_size     NO          Informational only.
                                              Further action is optional.
    6.  rman_recovery_version     NO          Informational only.
                                              Further action is optional.
    7.  invalid_ora_obj_info      NO          Informational only.
                                              Further action is optional.
    8.  invalid_app_obj_info      NO          Informational only.
                                              Further action is optional.

The fixup scripts have been run and resolved what they can. However,
there are still issues originally identified by the preupgrade that
have not been remedied and are still present in the database.
Depending on the severity of the specific issue, and the nature of
the issue itself, that could mean that your database is not ready
for upgrade.  To resolve the outstanding issues, start by reviewing
the preupgrade_fixups.sql and searching it for the name of
the failed CHECK NAME or Preupgrade Action Number listed above.
There you will find the original corresponding diagnostic message
from the preupgrade which explains in more detail what still needs
to be done.

PL/SQL procedure successfully completed.

 

3-5-4. 업그레이드 전 필수 사전 작업

 

SQL>

set line 1000
set pages 5000
col tablespace_name for a30
col file_name for a80
col free_space for 9999999
compute sum of total_space on report
compute sum of free_space on report
compute sum of MAX_SPACE on report
break on tablespace_name on report nodup

SELECT C.TABLESPACE_NAME
     , A.AUTOEXTENSIBLE
     , A.FILE_NAME
     , A.TOTAL_SPACE
     , B.FREE_SPACE
     , ROUND(B.FREE_SPACE/A.TOTAL_SPACE *100,2) "FREE%"
     , A.MAX_SPACE
  FROM (SELECT FILE_ID
             , FILE_NAME
             , SUM(BYTES)/1024/1024 TOTAL_SPACE
             , SUM(MAXBYTES)/1024/1024/1024 MAX_SPACE
             , AUTOEXTENSIBLE
          FROM DBA_DATA_FILES
         GROUP BY FILE_ID,FILE_NAME,AUTOEXTENSIBLE) A
     ,(SELECT  FILE_ID
             , NVL(SUM(BYTES)/1024/1024,0) FREE_SPACE
          FROM DBA_FREE_SPACE
         GROUP BY FILE_ID) B
     , (SELECT TABLESPACE_NAME
             , FILE_ID
          FROM DBA_DATA_FILES) C
 WHERE A.FILE_ID=B.FILE_ID(+)
   AND A.FILE_ID=C.FILE_ID
 ORDER BY TABLESPACE_NAME;

TABLESPACE_NAME                AUTOEXTEN FILE_NAME                                                                        TOTAL_SPACE FREE_SPACE      FREE%  MAX_SPACE
------------------------------ --------- -------------------------------------------------------------------------------- ----------- ---------- ---------- ----------
SYSAUX                         YES       +DATA1/PTDB/DATAFILE/sysaux.258.1192648395                                             32767      31988      97.62 31.9999847
SYSTEM                         YES       +DATA1/PTDB/DATAFILE/system.257.1192648371                                             32767      31925      97.43 31.9999847
TUNER_DATA1                    YES       +DATA1/PTDB/DATAFILE/tuner_data1.268.1192650909                                        24576       4644       18.9 31.9999847
TUNER_DEV_DATA1                YES       +DATA1/PTDB/DATAFILE/tuner_dev_data1.340.1204232159                                     4096       4095      99.98 31.9999847
TUNER_DEV_IDX1                 YES       +DATA1/PTDB/DATAFILE/tuner_dev_idx1.339.1204232175                                      1024       1023       99.9 31.9999847
TUNER_IDX1                     YES       +DATA1/PTDB/DATAFILE/tuner_idx1.269.1192650957                                         19456       1978      10.16 31.9999847
UNDOTBS1                       YES       +DATA1/PTDB/DATAFILE/undotbs1.259.1192648411                                           10240      10006      97.71 31.9999847
USERS                          YES       +DATA1/PTDB/DATAFILE/users.260.1192648411                                               97.5          8       8.53 31.9999847
******************************                                                                                            ----------- ----------            ----------
sum                                                                                                                          125023.5      85668            255.999878

--> Autoextend ON이고 MAX_SPACE가 있는지 확인

 

SQL> EXECUTE DBMS_STATS.GATHER_DICTIONARY_STATS;

PL/SQL procedure successfully completed.

 

SQL> EXECUTE DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;

PL/SQL procedure successfully completed.

 

SQL> SELECT o.name FROM sys.obj$ o, sys.user$ u, sys.sum$ s WHERE o.type# = 42 AND bitand(s.mflags, 8) =8;

no rows selected

 

SQL>

declare
list_failures integer(3) :=0;
begin
DBMS_MVIEW.REFRESH_ALL_MVIEWS(list_failures,'C','', TRUE, FALSE);
end;
/

 

PL/SQL procedure successfully completed.

 

--플래시백 활성화

(이번에 수행하는 업그레이드 작업은 기존 noncdb를 cdb의 pdb로 copy해와서 진행할 것이기 때문에 플래시백 활성화를 반드시 할 필요는 없음)

 

[+ASM:grid@tdb01p][/home/grid]$ asmcmd lsdg
State    Type    Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512             512   4096  4194304    393208   228828                0          228828              0             N  DATA1/
MOUNTED  EXTERN  N         512             512   4096  4194304    196604   193540                0          193540              0             N  FRA1/
--> FRA1 영역에 193540 MB를 사용 가능

 

[PTDB:oracle@tdb01p][/home/oracle]$ echo $ORACLE_HOME
/u01/app/oracle/product/12c/db_1
[PTDB:oracle@tdb01p][/home/oracle]$ echo $ORACLE_SID
PTDB
[PTDB:oracle@tdb01p][/home/oracle]$ alias ss
alias ss='rlwrap sqlplus "/as sysdba"'
[PTDB:oracle@tdb01p][/home/oracle]$ ss

SQL*Plus: Release 12.2.0.1.0 Production on Sun Jul 13 14:35:24 2025

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


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

SQL>

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            +FRA1
Oldest online log sequence     398
Next log sequence to archive   400
Current log sequence           400

--> 아카이브 로그는 활성화 된 상태인것을 확인

 

SQL> select flashback_on from v$database;

FLASHBACK_ON
------------------------------------------------------
NO

--> 플래시백 데이터베이스는 비활성화 상태임

 

SQL> set linesize 250
SQL> show parameter recovery

NAME                                 TYPE                              VALUE
------------------------------------ --------------------------------- ------------------------------
db_recovery_file_dest                string
db_recovery_file_dest_size           big integer                       0
recovery_parallelism                 integer                           0
remote_recovery_file_dest            string

 

SQL> alter system set db_recovery_file_dest='+FRA1' scope=spfile;

System altered.

SQL> alter system set db_recovery_file_dest_size=32G scope=both;

System altered.

 

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

 

SQL> startup mount
ORACLE instance started.

Total System Global Area 5184159744 bytes
Fixed Size                  8631432 bytes
Variable Size            1946159992 bytes
Database Buffers         3221225472 bytes
Redo Buffers                8142848 bytes
Database mounted.

 

SQL> alter database flashback on;

Database altered.

 

SQL> alter database open;

Database altered.

 

SQL> select flashback_on from v$database;

FLASHBACK_ON
------------------------------------------------------
YES

 

SQL> show parameter flashback

NAME                                 TYPE                              VALUE
------------------------------------ --------------------------------- ------------------------------
db_flashback_retention_target        integer                           1440

 

SQL> select * from V$restore_point;

no rows selected

 

SQL> create restore point pre_upgrade guarantee flashback database;

Restore point created.

 

SQL>
col name for a20
col GUARANTEE_FLASHBACK_DATABASE for a10
col TIME for a60
set lines 190
select NAME,GUARANTEE_FLASHBACK_DATABASE,TIME from V$restore_point;

NAME                 GUARANTEE_ TIME
-------------------- ---------- ------------------------------------------------------------
PRE_UPGRADE          YES        25/07/13 14:43:13.000000000

 

3-6. Oracle 19c DB에서 신규 CDB 생성

 

[PTDB:oracle@tdb01p][/u01/app/oracle/product/19c/db_1]$ /u01/app/oracle/product/19c/db_1/bin/dbca
--> dbca UI 방식으로 db를 생성하지 않고 reponsefile 만 생성할 것임
Create a database -> Next
Advanced configuration -> Next
Oracle Single Instance database -> General Purpose or Transcation Processing -> Next
Global database name : CPTDB
SID : CPTDB
Create as Container database 체크

    Use Local Undo Tablespace for PDBs 체크

    Create an empty Container database 선택 -> Next

Use following for the database storage attributes
Database files storage type : Automatice Storage Management (ASM)
Database files location : +DATA1/{DB_UNIQUE_NAME}
Use Oracle-managed Files(OMF) 체크 -> Next
Multiplex redo logs and control files 로 들어간 후 +DATA1 및 +FRA1 추가 -> OK -> Next
Specify Fast Recovery Area 체크
Recovery files storage type : Automatice Storage Management (ASM)
Fast Recovery Area : FRA1
Fast Recovery Area Size : 10240 MB
Enable Archiving 체크 -> Edit archive mode parameters -> +FRA1 -> OK -> Next
기존 LISTENER 체크 > Next
Configure Oracle Database Valult 및 Configure Oracle Label Securiy 모두 체크 해제 -> Next
Memory : Use Automatice Shared Memory Management에서 SGA 는 1536 MB, PGA는 512 MB로 설정
Sizing : Processes 는 320 으로 설정
Character sets 
    Use Unicode (AL32UTF8)
    National character set : AL16UTF16 - Unicode UTF-16 Universal character set
    Default language : American
    Default territory : korea
Conncetion mode : Dedicated server mode
EM 관련 체크 해제 -> Next
Use the same administrative password for all accounts : oracle 로 비밀번호 설정 -> Next (경고창 나오면 무시하고 YES)
Create database 체크
Generate database creation scripts 체크 후 값은 {ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/scripts 로 설정
Customize Storage Locations 클릭
    Contorol Files 에서 Maximum Datafiles 는 1024로 설정 -> apply -> NEXT  
Save Response File : /home/oracle/dbca_19c.rsp -> save -> Cancel 로 빠져나옴

 

[PTDB:oracle@tdb01p][/home/oracle]$ awk -F= 'NF && $1 !~ /^#/ && $2!=""' /home/oracle/dbca_19c.rsp > /home/oracle/dbca_19c_new.rsp
[PTDB:oracle@tdb01p][/home/oracle]$ cat /home/oracle/dbca_19c_new.rsp
responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v12.2.0
gdbName=CPTDB
sid=CPTDB
databaseConfigType=SI
policyManaged=false
createServerPool=false
force=false
createAsContainerDatabase=true
numberOfPDBs=0
useLocalUndoForPDBs=true
templateName=/u01/app/oracle/product/19c/db_1/assistants/dbca/templates/General_Purpose.dbc
systemPassword=
emExpressPort=5500
runCVUChecks=FALSE
omsPort=0
dvConfiguration=false
olsConfiguration=false
datafileJarLocation={ORACLE_HOME}/assistants/dbca/templates/
datafileDestination=+DATA1/{DB_UNIQUE_NAME}/
recoveryAreaDestination=+FRA1
storageType=ASM
diskGroupName=+DATA1/{DB_UNIQUE_NAME}/
recoveryGroupName=+FRA1
characterSet=AL32UTF8
nationalCharacterSet=AL16UTF16
registerWithDirService=false
listeners=LISTENER
skipListenerRegistration=false
variables=ORACLE_BASE_HOME=/u01/app/oracle/product/19c/db_1,DB_UNIQUE_NAME=CPTDB,ORACLE_BASE=/u01/app/oracle,PDB_NAME=,DB_NAME=CPTDB,ORACLE_HOME=/u01/app/oracle/product/19c/db_1,SID=CPTDB
initParams=undo_tablespace=UNDOTBS1,sga_target=1536MB,db_block_size=8192BYTES,log_archive_dest_1='LOCATION=+FRA1',nls_language=AMERICAN,dispatchers=(PROTOCOL=TCP) (SERVICE=CPTDBXDB),diagnostic_dest={ORACLE_BASE},remote_login_passwordfile=EXCLUSIVE,db_create_file_dest=+DATA1/{DB_UNIQUE_NAME}/,db_create_online_log_dest_2=+FRA1,db_create_online_log_dest_1=+DATA1,audit_file_dest={ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/adump,processes=320,pga_aggregate_target=512MB,nls_territory=KOREA,local_listener=LISTENER_CPTDB,db_recovery_file_dest_size=10240MB,open_cursors=300,log_archive_format=%t_%s_%r.dbf,compatible=19.0.0,db_name=CPTDB,db_recovery_file_dest=+FRA1,audit_trail=db
sampleSchema=false
memoryPercentage=40
databaseType=MULTIPURPOSE
automaticMemoryManagement=false
totalMemory=0

 

[PTDB:oracle@tdb01p][/home/oracle]$ /u01/app/oracle/product/19c/db_1/bin/dbca -silent -ignorePrereqFailure -createDatabase -responseFile /home/oracle/dbca_19c_new.rsp

--> 비밀번호 모두 oracle, oracle로 입력함

--아래 위치에 가면 dbca 진행 사항 로그를 확인 가능

--dbca

/u01/app/oracle/cfgtoollogs/dbca/CPTDB

--datapatch

/u01/app/oracle/cfgtoollogs/sqlpatch

--> 로그를 모니터링하면서 진행사항을 확인할 것

 

Enter SYS user password:

Enter SYSTEM user password:

[WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
   CAUSE:
a. 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].
b.The password entered is a keyword that Oracle does not recommend to be used as password
   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
   CAUSE:
a. 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].
b.The password entered is a keyword that Oracle does not recommend to be used as password
   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[WARNING] [DBT-06801] Specified Fast Recovery Area size (10,240 MB) is less than the recommended value.
   CAUSE: Fast Recovery Area size should at least be three times the database size (3,498 MB).
   ACTION: Specify Fast Recovery Area Size to be at least three times the database size.
Prepare for db operation
10% complete
Registering database with Oracle Restart
14% complete
Copying database files
43% complete
Creating and starting Oracle instance
45% complete
49% complete
54% complete
58% complete
62% complete
Completing Database Creation
68% complete
70% complete
71% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
 /u01/app/oracle/cfgtoollogs/dbca/CPTDB.
Database Information:
Global Database Name:CPTDB
System Identifier(SID):CPTDB
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/CPTDB/CPTDB1.log" for further details.

 

--만약 방금 만든 db를 지운다면

[CPTDB:oracle@tdb01p][/home/oracle]$ /u01/app/oracle/product/19c/db_1/bin/dbca -silent -deleteDatabase -sourceDB CPTDB -sid CPTDB -sysDBAUserName sys -sysDBAPassword oracle

--> 정말 지울꺼 아니면 돌리면 안됨 (예시로 정리해 놓은 것임)

 

--자동으로 grid 에도 등록됨

[PTDB:oracle@tdb01p][/home/oracle]$ csrt
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA1.dg
               ONLINE  ONLINE       tdb01p                   STABLE
ora.FRA1.dg
               ONLINE  ONLINE       tdb01p                   STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       tdb01p                   STABLE
ora.asm
               ONLINE  ONLINE       tdb01p                   Started,STABLE
ora.ons
               OFFLINE OFFLINE      tdb01p                   STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cptdb.db
      1        ONLINE  ONLINE       tdb01p                   Open,HOME=/u01/app/o
                                                             racle/product/19c/db
                                                             _1,STABLE
ora.cssd
      1        ONLINE  ONLINE       tdb01p                   STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.evmd
      1        ONLINE  ONLINE       tdb01p                   STABLE
ora.ptdb.db
      1        ONLINE  ONLINE       tdb01p                   Open,HOME=/u01/app/o
                                                             racle/product/12c/db
                                                             _1,STABLE
--------------------------------------------------------------------------------

 

3-7. 기존 12cR2 noncdb의 메타 데이터 생성 (xml 파일 생성)

 

[PTDB:oracle@tdb01p][/home/oracle]$ echo $ORACLE_HOME
/u01/app/oracle/product/12c/db_1
[PTDB:oracle@tdb01p][/home/oracle]$ echo $ORACLE_SID
PTDB
[PTDB:oracle@tdb01p][/home/oracle]$ which srvctl
/u01/app/oracle/product/12c/db_1/bin/srvctl
[PTDB:oracle@tdb01p][/home/oracle]$ srvctl stop database -db ptdb

 

[PTDB:oracle@tdb01p][/home/oracle]$ srvctl start database -db ptdb -startoption "READ ONLY"


[PTDB:oracle@tdb01p][/home/oracle]$ alias ss
alias ss='rlwrap sqlplus "/as sysdba"'
[PTDB:oracle@tdb01p][/home/oracle]$ which sqlplus
/u01/app/oracle/product/12c/db_1/bin/sqlplus
[PTDB:oracle@tdb01p][/home/oracle]$ ss

SQL*Plus: Release 12.2.0.1.0 Production on Sun Jul 13 22:58:35 2025

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 open_mode from v$database;

OPEN_MODE
------------------------------------------------------------
READ ONLY

 

SQL>

BEGIN
  DBMS_PDB.DESCRIBE(pdb_descr_file => '/tmp/PTDB_12cR2_noncdb.xml');
END;
/

 

 

SQL> quit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
[PTDB:oracle@tdb01p][/home/oracle]$ cat /tmp/PTDB_12cR2_noncdb.xml
<?xml version="1.0" encoding="UTF-8"?>
<PDB>
  <xmlversion>1</xmlversion>
  <pdbname>PTDB</pdbname>
  <cid>0</cid>
  <byteorder>1</byteorder>
  <vsn>203424000</vsn>
  <vsns>
    <vsnnum>12.2.0.1.0</vsnnum>
    <cdbcompt>12.2.0.0.0</cdbcompt>
    <pdbcompt>12.2.0.0.0</pdbcompt>
    <vsnlibnum>0.0.0.0.24</vsnlibnum>
    <vsnsql>24</vsnsql>
    <vsnbsv>8.0.0.0.0</vsnbsv>
  </vsns>
  <dbid>1887725823</dbid>
  <ncdb2pdb>1</ncdb2pdb>
  <cdbid>1887725823</cdbid>
  <guid>2DB3DB58AAF1039BE0631500A8C01EBD</guid>
  <uscnbas>6723515</uscnbas>
  <uscnwrp>0</uscnwrp>
  <undoscn>7</undoscn>
  <rdba>4194824</rdba>
  <tablespace>
    <name>SYSTEM</name>
    <type>0</type>
    <tsn>0</tsn>
    <status>1</status>
    <issft>0</issft>
    <isnft>0</isnft>
    <encts>0</encts>
    <flags>0</flags>
    <bmunitsize>8</bmunitsize>
    <file>
      <path>+DATA1/PTDB/DATAFILE/system.257.1192648371</path>
      <afn>1</afn>
      <rfn>1</rfn>
      <createscnbas>7</createscnbas>
      <createscnwrp>0</createscnwrp>
      <status>1</status>
      <fileblocks>4194176</fileblocks>
      <blocksize>8192</blocksize>
      <vsn>203423744</vsn>
      <fdbid>1887725823</fdbid>
      <fcpsb>6723514</fcpsb>
      <fcpsw>0</fcpsw>
      <frlsb>1787394</frlsb>
      <frlsw>0</frlsw>
      <frlt>1192667233</frlt>
      <autoext>1</autoext>
      <maxsize>4194302</maxsize>
      <incsize>1280</incsize>
      <plugscn>0</plugscn>
      <plugafn>0</plugafn>
      <plugdbid>0</plugdbid>
    </file>
  </tablespace>
  <tablespace>
    <name>SYSAUX</name>
    <type>0</type>
    <tsn>1</tsn>
    <status>1</status>
    <issft>0</issft>
    <isnft>0</isnft>
    <encts>0</encts>
    <flags>0</flags>
    <bmunitsize>8</bmunitsize>
    <file>
      <path>+DATA1/PTDB/DATAFILE/sysaux.258.1192648395</path>
      <afn>3</afn>
      <rfn>3</rfn>
      <createscnbas>4665</createscnbas>
      <createscnwrp>0</createscnwrp>
      <status>1</status>
      <fileblocks>4194176</fileblocks>
      <blocksize>8192</blocksize>
      <vsn>203423744</vsn>
      <fdbid>1887725823</fdbid>
      <fcpsb>6723514</fcpsb>
      <fcpsw>0</fcpsw>
      <frlsb>1787394</frlsb>
      <frlsw>0</frlsw>
      <frlt>1192667233</frlt>
      <autoext>1</autoext>
      <maxsize>4194302</maxsize>
      <incsize>1280</incsize>
      <plugscn>0</plugscn>
      <plugafn>0</plugafn>
      <plugdbid>0</plugdbid>
    </file>
  </tablespace>
  <tablespace>
    <name>UNDOTBS1</name>
    <type>2</type>
    <tsn>2</tsn>
    <status>1</status>
    <issft>0</issft>
    <isnft>0</isnft>
    <encts>0</encts>
    <flags>0</flags>
    <bmunitsize>8</bmunitsize>
    <file>
      <path>+DATA1/PTDB/DATAFILE/undotbs1.259.1192648411</path>
      <afn>4</afn>
      <rfn>4</rfn>
      <createscnbas>1406609</createscnbas>
      <createscnwrp>0</createscnwrp>
      <status>1</status>
      <fileblocks>1310720</fileblocks>
      <blocksize>8192</blocksize>
      <vsn>203423744</vsn>
      <fdbid>1887725823</fdbid>
      <fcpsb>6723514</fcpsb>
      <fcpsw>0</fcpsw>
      <frlsb>1787394</frlsb>
      <frlsw>0</frlsw>
      <frlt>1192667233</frlt>
      <autoext>1</autoext>
      <maxsize>4194302</maxsize>
      <incsize>640</incsize>
      <plugscn>0</plugscn>
      <plugafn>0</plugafn>
      <plugdbid>0</plugdbid>
    </file>
  </tablespace>
  <tablespace>
    <name>TEMP</name>
    <type>1</type>
    <tsn>3</tsn>
    <status>1</status>
    <issft>0</issft>
    <isnft>0</isnft>
    <encts>0</encts>
    <flags>0</flags>
    <bmunitsize>128</bmunitsize>
    <file>
      <path>+DATA1/PTDB/TEMPFILE/temp.265.1192648469</path>
      <afn>1</afn>
      <rfn>1</rfn>
      <createscnbas>1408668</createscnbas>
      <createscnwrp>0</createscnwrp>
      <status>1</status>
      <fileblocks>4194176</fileblocks>
      <blocksize>8192</blocksize>
      <vsn>203423744</vsn>
      <autoext>1</autoext>
      <maxsize>4194302</maxsize>
      <incsize>80</incsize>
      <plugscn>0</plugscn>
      <plugafn>0</plugafn>
      <plugdbid>0</plugdbid>
    </file>
  </tablespace>
  <tablespace>
    <name>USERS</name>
    <type>0</type>
    <tsn>4</tsn>
    <status>1</status>
    <issft>0</issft>
    <isnft>0</isnft>
    <encts>0</encts>
    <flags>0</flags>
    <bmunitsize>8</bmunitsize>
    <file>
      <path>+DATA1/PTDB/DATAFILE/users.260.1192648411</path>
      <afn>7</afn>
      <rfn>7</rfn>
      <createscnbas>29999</createscnbas>
      <createscnwrp>0</createscnwrp>
      <status>1</status>
      <fileblocks>12480</fileblocks>
      <blocksize>8192</blocksize>
      <vsn>203423744</vsn>
      <fdbid>1887725823</fdbid>
      <fcpsb>6723514</fcpsb>
      <fcpsw>0</fcpsw>
      <frlsb>1787394</frlsb>
      <frlsw>0</frlsw>
      <frlt>1192667233</frlt>
      <autoext>1</autoext>
      <maxsize>4194302</maxsize>
      <incsize>160</incsize>
      <plugscn>0</plugscn>
      <plugafn>0</plugafn>
      <plugdbid>0</plugdbid>
    </file>
  </tablespace>
  <tablespace>
    <name>TUNER_DATA1</name>
    <type>0</type>
    <tsn>6</tsn>
    <status>1</status>
    <issft>0</issft>
    <isnft>0</isnft>
    <encts>0</encts>
    <flags>0</flags>
    <bmunitsize>8</bmunitsize>
    <file>
      <path>+DATA1/PTDB/DATAFILE/tuner_data1.268.1192650909</path>
      <afn>5</afn>
      <rfn>5</rfn>
      <createscnbas>1520206</createscnbas>
      <createscnwrp>0</createscnwrp>
      <status>1</status>
      <fileblocks>3145728</fileblocks>
      <blocksize>8192</blocksize>
      <vsn>203423744</vsn>
      <fdbid>1887725823</fdbid>
      <fcpsb>6723514</fcpsb>
      <fcpsw>0</fcpsw>
      <frlsb>1787394</frlsb>
      <frlsw>0</frlsw>
      <frlt>1192667233</frlt>
      <autoext>1</autoext>
      <maxsize>4194302</maxsize>
      <incsize>65536</incsize>
      <plugscn>0</plugscn>
      <plugafn>0</plugafn>
      <plugdbid>0</plugdbid>
    </file>
  </tablespace>
  <tablespace>
    <name>TUNER_IDX1</name>
    <type>0</type>
    <tsn>7</tsn>
    <status>1</status>
    <issft>0</issft>
    <isnft>0</isnft>
    <encts>0</encts>
    <flags>0</flags>
    <bmunitsize>8</bmunitsize>
    <file>
      <path>+DATA1/PTDB/DATAFILE/tuner_idx1.269.1192650957</path>
      <afn>2</afn>
      <rfn>2</rfn>
      <createscnbas>1520372</createscnbas>
      <createscnwrp>0</createscnwrp>
      <status>1</status>
      <fileblocks>2490368</fileblocks>
      <blocksize>8192</blocksize>
      <vsn>203423744</vsn>
      <fdbid>1887725823</fdbid>
      <fcpsb>6723514</fcpsb>
      <fcpsw>0</fcpsw>
      <frlsb>1787394</frlsb>
      <frlsw>0</frlsw>
      <frlt>1192667233</frlt>
      <autoext>1</autoext>
      <maxsize>4194302</maxsize>
      <incsize>65536</incsize>
      <plugscn>0</plugscn>
      <plugafn>0</plugafn>
      <plugdbid>0</plugdbid>
    </file>
  </tablespace>
  <tablespace>
    <name>TUNER_TEMP</name>
    <type>1</type>
    <tsn>8</tsn>
    <status>1</status>
    <issft>0</issft>
    <isnft>0</isnft>
    <encts>0</encts>
    <flags>0</flags>
    <bmunitsize>128</bmunitsize>
    <file>
      <path>+DATA1/PTDB/TEMPFILE/tuner_temp.270.1192651021</path>
      <afn>2</afn>
      <rfn>1</rfn>
      <createscnbas>1520398</createscnbas>
      <createscnwrp>0</createscnwrp>
      <status>1</status>
      <fileblocks>524288</fileblocks>
      <blocksize>8192</blocksize>
      <vsn>203423744</vsn>
      <autoext>1</autoext>
      <maxsize>4194302</maxsize>
      <incsize>12800</incsize>
      <plugscn>0</plugscn>
      <plugafn>0</plugafn>
      <plugdbid>0</plugdbid>
    </file>
  </tablespace>
  <tablespace>
    <name>TUNER_DEV_DATA1</name>
    <type>0</type>
    <tsn>9</tsn>
    <status>1</status>
    <issft>0</issft>
    <isnft>0</isnft>
    <encts>0</encts>
    <flags>0</flags>
    <bmunitsize>8</bmunitsize>
    <file>
      <path>+DATA1/PTDB/DATAFILE/tuner_dev_data1.340.1204232159</path>
      <afn>8</afn>
      <rfn>8</rfn>
      <createscnbas>5657148</createscnbas>
      <createscnwrp>0</createscnwrp>
      <status>1</status>
      <fileblocks>524288</fileblocks>
      <blocksize>8192</blocksize>
      <vsn>203423744</vsn>
      <fdbid>1887725823</fdbid>
      <fcpsb>6723514</fcpsb>
      <fcpsw>0</fcpsw>
      <frlsb>1787394</frlsb>
      <frlsw>0</frlsw>
      <frlt>1192667233</frlt>
      <autoext>1</autoext>
      <maxsize>4194302</maxsize>
      <incsize>65536</incsize>
      <plugscn>0</plugscn>
      <plugafn>0</plugafn>
      <plugdbid>0</plugdbid>
    </file>
  </tablespace>
  <tablespace>
    <name>TUNER_DEV_IDX1</name>
    <type>0</type>
    <tsn>10</tsn>
    <status>1</status>
    <issft>0</issft>
    <isnft>0</isnft>
    <encts>0</encts>
    <flags>0</flags>
    <bmunitsize>8</bmunitsize>
    <file>
      <path>+DATA1/PTDB/DATAFILE/tuner_dev_idx1.339.1204232175</path>
      <afn>9</afn>
      <rfn>9</rfn>
      <createscnbas>5657187</createscnbas>
      <createscnwrp>0</createscnwrp>
      <status>1</status>
      <fileblocks>131072</fileblocks>
      <blocksize>8192</blocksize>
      <vsn>203423744</vsn>
      <fdbid>1887725823</fdbid>
      <fcpsb>6723514</fcpsb>
      <fcpsw>0</fcpsw>
      <frlsb>1787394</frlsb>
      <frlsw>0</frlsw>
      <frlt>1192667233</frlt>
      <autoext>1</autoext>
      <maxsize>4194302</maxsize>
      <incsize>65536</incsize>
      <plugscn>0</plugscn>
      <plugafn>0</plugafn>
      <plugdbid>0</plugdbid>
    </file>
  </tablespace>
  <tablespace>
    <name>TUNER_DEV_TEMP</name>
    <type>1</type>
    <tsn>11</tsn>
    <status>1</status>
    <issft>0</issft>
    <isnft>0</isnft>
    <encts>0</encts>
    <flags>0</flags>
    <bmunitsize>128</bmunitsize>
    <file>
      <path>+DATA1/PTDB/TEMPFILE/tuner_dev_temp.330.1204232179</path>
      <afn>3</afn>
      <rfn>1</rfn>
      <createscnbas>5657209</createscnbas>
      <createscnwrp>0</createscnwrp>
      <status>1</status>
      <fileblocks>207872</fileblocks>
      <blocksize>8192</blocksize>
      <vsn>203423744</vsn>
      <autoext>1</autoext>
      <maxsize>4194302</maxsize>
      <incsize>12800</incsize>
      <plugscn>0</plugscn>
      <plugafn>0</plugafn>
      <plugdbid>0</plugdbid>
    </file>
  </tablespace>
  <recover>0</recover>
  <optional>
    <ncdb2pdb>1</ncdb2pdb>
    <csid>846</csid>
    <ncsid>2000</ncsid>
    <options>
      <option>APS=12.2.0.1.0</option>
      <option>CATALOG=12.2.0.1.0</option>
      <option>CATJAVA=12.2.0.1.0</option>
      <option>CATPROC=12.2.0.1.0</option>
      <option>CONTEXT=12.2.0.1.0</option>
      <option>DV=12.2.0.1.0</option>
      <option>JAVAVM=12.2.0.1.0</option>
      <option>OLS=12.2.0.1.0</option>
      <option>ORDIM=12.2.0.1.0</option>
      <option>OWM=12.2.0.1.0</option>
      <option>SDO=12.2.0.1.0</option>
      <option>XDB=12.2.0.1.0</option>
      <option>XML=12.2.0.1.0</option>
      <option>XOQ=12.2.0.1.0</option>
    </options>
    <olsoid>0</olsoid>
    <dv>0</dv>
    <APEX>NULL</APEX>
    <parameters>
      <parameter>processes=1432</parameter>
      <parameter>resource_limit=TRUE</parameter>
      <parameter>_disable_system_state=0</parameter>
      <parameter>sga_max_size=5184159744</parameter>
      <parameter>_enable_shared_pool_durations=FALSE</parameter>
      <parameter>use_large_pages='ONLY'</parameter>
      <parameter>shared_pool_size=1073741824</parameter>
      <parameter>large_pool_size=536870912</parameter>
      <parameter>java_pool_size=167772160</parameter>
      <parameter>streams_pool_size=167772160</parameter>
      <parameter>pga_aggregate_limit=0</parameter>
      <parameter>_high_priority_processes='LMS*|LM1*|LM2*|LM3*|LM4*|LM5*|LM6*|LM7*|LM8*|LM9*'</parameter>
      <parameter>_highest_priority_processes='VKTM|LG*|LMS*'</parameter>
      <parameter>_os_sched_high_priority=1</parameter>
      <parameter>_os_sched_highest_priority=1</parameter>
      <parameter>uniform_log_timestamp_format=FALSE</parameter>
      <parameter>nls_language='AMERICAN'</parameter>
      <parameter>nls_territory='KOREA'</parameter>
      <parameter>disk_asynch_io=TRUE</parameter>
      <parameter>filesystemio_options='SETALL'</parameter>
      <parameter>resource_manager_plan='FORCE:'</parameter>
      <parameter>_dlm_stats_collect=0</parameter>
      <parameter>sga_target=0</parameter>
      <parameter>memory_target=0</parameter>
      <parameter>_memory_imm_mode_without_autosga=TRUE</parameter>
      <parameter>db_block_size=8192</parameter>
      <parameter>db_cache_size=3221225472</parameter>
      <parameter>compatible='12.2.0'</parameter>
      <parameter>_buddy_instance=0</parameter>
      <parameter>_fatalprocess_redo_dump_time_limit=0</parameter>
      <parameter>_nonfatalprocess_redo_dump_time_limit=0</parameter>
      <parameter>_use_single_log_writer='TRUE'</parameter>
      <parameter>_verify_fg_log_checksum=FALSE</parameter>
      <parameter>_use_adaptive_log_file_sync='FALSE'</parameter>
      <parameter>db_files=1000</parameter>
      <parameter>temp_undo_enabled=FALSE</parameter>
      <parameter>_in_memory_undo=FALSE</parameter>
      <parameter>_cleanup_rollback_entries=2000</parameter>
      <parameter>_rollback_segment_count=1000</parameter>
      <parameter>_undo_autotune=FALSE</parameter>
      <parameter>_partition_large_extents='FALSE'</parameter>
      <parameter>_index_partition_large_extents='FALSE'</parameter>
      <parameter>_securefiles_concurrency_estimate=50</parameter>
      <parameter>heat_map='OFF'</parameter>
      <parameter>_drop_stat_segment=1</parameter>
      <parameter>_sys_logon_delay=0</parameter>
      <parameter>_clusterwide_global_transactions=FALSE</parameter>
      <parameter>session_cached_cursors=100</parameter>
      <parameter>_cursor_obsolete_threshold=1024</parameter>
      <parameter>_cursor_reload_failure_threshold=5</parameter>
      <parameter>_kks_obsolete_dump_threshold=0</parameter>
      <parameter>_kks_parse_error_warning=0</parameter>
      <parameter>_px_use_large_pool=TRUE</parameter>
      <parameter>result_cache_max_size=0</parameter>
      <parameter>open_cursors=300</parameter>
      <parameter>_optimizer_null_aware_antijoin=FALSE</parameter>
      <parameter>star_transformation_enabled='FALSE'</parameter>
      <parameter>_optimizer_extended_cursor_sharing='NONE'</parameter>
      <parameter>_optimizer_extended_cursor_sharing_rel='NONE'</parameter>
      <parameter>_optimizer_adaptive_cursor_sharing=FALSE</parameter>
      <parameter>_optim_peek_user_binds=FALSE</parameter>
      <parameter>pga_aggregate_target=1717986918</parameter>
      <parameter>_pga_max_size=1073741824</parameter>
      <parameter>optimizer_dynamic_sampling=0</parameter>
      <parameter>_optimizer_connect_by_cost_based=FALSE</parameter>
      <parameter>_bloom_filter_enabled=FALSE</parameter>
      <parameter>_gby_hash_aggregation_enabled=FALSE</parameter>
      <parameter>optimizer_secure_view_merging=FALSE</parameter>
      <parameter>_add_col_optim_enabled=FALSE</parameter>
      <parameter>deferred_segment_creation=FALSE</parameter>
      <parameter>_optimizer_aggr_groupby_elim=FALSE</parameter>
      <parameter>parallel_force_local=TRUE</parameter>
      <parameter>_optimizer_use_feedback=FALSE</parameter>
      <parameter>max_string_size='EXTENDED'</parameter>
      <parameter>_sql_plan_directive_mgmt_control=0</parameter>
      <parameter>_optimizer_gather_stats_on_load=FALSE</parameter>
      <parameter>optimizer_adaptive_reporting_only=TRUE</parameter>
      <parameter>optimizer_adaptive_plans=FALSE</parameter>
      <parameter>_rowsets_enabled=FALSE</parameter>
      <parameter>optimizer_adaptive_statistics=FALSE</parameter>
      <parameter>enable_ddl_logging=FALSE</parameter>
      <parameter>_emon_send_timeout=10000</parameter>
      <parameter>_client_enable_auto_unregister=TRUE</parameter>
      <parameter>_report_capture_cycle_time=0</parameter>
      <parameter>enable_pluggable_database=FALSE</parameter>
    </parameters>
    <sqlpatches>
      <sqlpatch>DBRU bundle patch 220118 (DATABASE JAN 2022 RELEASE UPDATE 12.2.0.1.220118): APPLY SUCCESS</sqlpatch>
      <sqlpatch>SQL patch ID/UID 33561275/24539585 (OJVM RELEASE UPDATE 12.2.0.1.220118): APPLY SUCCESS</sqlpatch>
    </sqlpatches>
    <tzvers>
      <tzver>primary version:26</tzver>
      <tzver>secondary version:0</tzver>
    </tzvers>
    <walletkey>0</walletkey>
    <services>
      <service>SYS$BACKGROUND,</service>
      <service>SYS$USERS,</service>
      <service>PTDB2XDB,PTDB2XDB</service>
      <service>PTDB2,PTDB2</service>
      <service>PTDBXDB,PTDBXDB</service>
      <service>PTDB,PTDB</service>
    </services>
    <opatches/>
    <hasclob>1</hasclob>
    <awr/>
    <hardvsnchk>0</hardvsnchk>
    <localundo>1</localundo>
    <apps/>
    <dbedition>8</dbedition>
  </optional>
</PDB>

 

 

3-8. 12cR2에서 추출한 xml 파일로 12cR2 noncdb를 19c cdb 내에 PDB로 plug-in 시킴

 

[PTDB:oracle@tdb01p][/home/oracle]$ which srvctl
/u01/app/oracle/product/12c/db_1/bin/srvctl
[PTDB:oracle@tdb01p][/home/oracle]$ echo $ORACLE_HOME
/u01/app/oracle/product/12c/db_1
[PTDB:oracle@tdb01p][/home/oracle]$ echo $ORACLE_SID
PTDB
[PTDB:oracle@tdb01p][/home/oracle]$ srvctl stop database -db ptdb

 

[PTDB:oracle@tdb01p][/home/oracle]$ export ORACLE_HOME=/u01/app/oracle/product/19c/db_1
[PTDB:oracle@tdb01p][/home/oracle]$ export ORACLE_SID=CPTDB

 

[CPTDB:oracle@tdb01p][/home/oracle]$ alias ss
alias ss='rlwrap sqlplus "/as sysdba"'
[CPTDB:oracle@tdb01p][/home/oracle]$ ss

SQL*Plus: Release 12.2.0.1.0 Production on Tue Jul 15 22:46:11 2025

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

 

SQL>

SET SERVEROUTPUT ON
DECLARE
  compatible CONSTANT VARCHAR2(3) :=
    CASE DBMS_PDB.CHECK_PLUG_COMPATIBILITY('/tmp/PTDB_12cR2_noncdb.xml')
    WHEN TRUE THEN 'YES'
    ELSE 'NO'
  END;
BEGIN
  DBMS_OUTPUT.PUT_LINE('Is Compatible? => ' || compatible);
END;
/
Is Compatible? => NO

PL/SQL procedure successfully completed.

 

SQL>

CREATE PLUGGABLE DATABASE PTDB
USING '/tmp/PTDB_12cR2_noncdb.xml'
COPY
;

 

--여기서 새로운 ssh 창 하나 더 열어서 : 시작

[PTDB:oracle@tdb01p][/home/oracle]$ export ORACLE_UNQNAME_LOWER=cptdb

[PTDB:oracle@tdb01p][/home/oracle]$ export ORACLE_SID=CPTDB

[CPTDB:oracle@tdb01p][/home/oracle]$ alias alog
alias alog='tail -f $ORACLE_BASE/diag/rdbms/$ORACLE_UNQNAME_LOWER/$ORACLE_SID/trace/alert_$ORACLE_SID.log'
[CPTDB:oracle@tdb01p][/home/oracle]$ alog
  Current log# 1 seq# 16 mem# 0: +DATA1/CPTDB/ONLINELOG/group_1.335.1206401771
  Current log# 1 seq# 16 mem# 1: +FRA1/CPTDB/ONLINELOG/group_1.406.1206401773
2025-07-15T22:00:11.946793+09:00
Thread 1 advanced to log sequence 17 (LGWR switch),  current SCN: 2550596
  Current log# 2 seq# 17 mem# 0: +DATA1/CPTDB/ONLINELOG/group_2.337.1206401771
  Current log# 2 seq# 17 mem# 1: +FRA1/CPTDB/ONLINELOG/group_2.445.1206401773
2025-07-15T22:48:25.584781+09:00
CREATE PLUGGABLE DATABASE PTDB
USING '/tmp/PTDB_12cR2_noncdb.xml'
COPY

2025-07-15T23:05:58.687967+09:00
PTDB(3):Endian type of dictionary set to little
2025-07-15T23:06:00.243973+09:00
****************************************************************
Pluggable Database PTDB with pdb id - 3 is created as UNUSABLE.
If any errors are encountered before the pdb is marked as NEW,
then the pdb must be dropped
local undo-1, localundoscn-0x0000000000000007
****************************************************************
PTDB(3):Pluggable database PTDB pseudo opening
PTDB(3):SUPLOG: Initialize PDB SUPLOG SGA, old value 0x0, new value 0x18
PTDB(3):Autotune of undo retention is turned off.
PTDB(3):Undo initialization recovery: Parallel FPTR complete: start:222008138 end:222008148 diff:10 ms (0.0 seconds)
PTDB(3):Undo initialization recovery: err:0 start: 222008137 end: 222008148 diff: 11 ms (0.0 seconds)
2025-07-15T23:06:07.379138+09:00
TABLE SYS.WRP$_REPORTS: ADDED INTERVAL PARTITION SYS_P281 (5675) VALUES LESS THAN (TO_DATE(' 2025-07-16 01:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
TABLE SYS.WRP$_REPORTS_DETAILS: ADDED INTERVAL PARTITION SYS_P282 (5675) VALUES LESS THAN (TO_DATE(' 2025-07-16 01:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
TABLE SYS.WRP$_REPORTS_TIME_BANDS: ADDED INTERVAL PARTITION SYS_P285 (5674) VALUES LESS THAN (TO_DATE(' 2025-07-15 01:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
2025-07-15T23:06:07.804106+09:00
PTDB(3):[8348] Successfully onlined Undo Tablespace 2.
PTDB(3):Undo initialization online undo segments: err:0 start: 222008148 end: 222015225 diff: 7077 ms (7.1 seconds)
PTDB(3):Undo initialization finished serial:0 start:222008137 end:222015233 diff:7096 ms (7.1 seconds)
PTDB(3):Pluggable database PTDB pseudo closing
PTDB(3):JIT: pid 8348 requesting stop
PTDB(3):Closing sequence subsystem (222015365148).
PTDB(3):Buffer Cache flush started: 3
PTDB(3):Buffer Cache flush finished: 3
2025-07-15T23:06:08.972628+09:00
Completed: CREATE PLUGGABLE DATABASE PTDB
USING '/tmp/PTDB_12cR2_noncdb.xml'
COPY
2025-07-15T23:06:38.392414+09:00
Resize operation completed for file# 3, fname +DATA1/CPTDB/DATAFILE/sysaux.336.1206401697, old size 993280K, new size 1003520K

--> alert log 모니터링

--여기서 새로운 ssh 창 하나 더 열어서 : 종료

 

--cptdb에 접속해서 pdb 플러그인 상황 확인

SELECT A.NAME, A.MESSAGE, A.STATUS, A.*
  FROM PDB_PLUG_IN_VIOLATIONS A
ORDER BY A.NAME, A.LINE;


 

3-9. plug-in 시킨 PDB를 19c로 업그레이드

 

[PTDB:oracle@tdb01p][/home/oracle]$ export ORACLE_HOME=/u01/app/oracle/product/19c/db_1
[PTDB:oracle@tdb01p][/home/oracle]$ export ORACLE_SID=CPTDB
[CPTDB:oracle@tdb01p][/home/oracle]$ alias ss
alias ss='rlwrap sqlplus "/as sysdba"'

[CPTDB:oracle@tdb01p][/home/oracle]$ which sqlplus
/u01/app/oracle/product/12c/db_1/bin/sqlplus
[CPTDB:oracle@tdb01p][/home/oracle]$ /u01/app/oracle/product/19c/db_1/bin/sqlplus "/as sysdba"

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Jul 15 23:15:03 2025
Version 19.27.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.27.0.0.0

SQL>

SQL> show pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PTDB                           MOUNTED
SQL> alter pluggable database ptdb open upgrade;

Pluggable database altered.

SQL> ALTER SESSION SET container = PTDB;

Session altered.

 

SQL> show pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PTDB                           MIGRATE    YES

 


 

[CPTDB:oracle@tdb01p][/home/oracle]$ echo $ORACLE_HOME
/u01/app/oracle/product/19c/db_1
[CPTDB:oracle@tdb01p][/home/oracle]$ $ORACLE_HOME/perl/bin/perl $ORACLE_HOME/rdbms/admin/catctl.pl -c 'PTDB' -l /tmp -n 4 $ORACLE_HOME/rdbms/admin/catupgrd.sql

--> PDB로 플러그인한 PTDB를 병렬도 4로 업그레이드함

 


--여기서 새로운 ssh 창 하나 더 열어서 : 시작

[PTDB:oracle@tdb01p][/home/oracle]$ export ORACLE_UNQNAME_LOWER=cptdb

[PTDB:oracle@tdb01p][/home/oracle]$ export ORACLE_SID=CPTDB

[CPTDB:oracle@tdb01p][/home/oracle]$ alias alog

--여기서 새로운 ssh 창 하나 더 열어서 : 종료

 

Argument list for [/u01/app/oracle/product/19c/db_1/rdbms/admin/catctl.pl]
For Oracle internal use only A = 0
Run in                       c = PTDB
Do not run in                C = 0
Input Directory              d = 0
Echo OFF                     e = 1
Simulate                     E = 0
Forced cleanup               F = 0
Log Id                       i = 0
Child Process                I = 0
Log Dir                      l = /tmp
Priority List Name           L = 0
Upgrade Mode active          M = 0
SQL Process Count            n = 4
SQL PDB Process Count        N = 0
Open Mode Normal             o = 0
Start Phase                  p = 0
End Phase                    P = 0
Reverse Order                r = 0
AutoUpgrade Resume           R = 0
Script                       s = 0
Serial Run                   S = 0
RO User Tablespaces          T = 0
Display Phases               y = 0
Debug catcon.pm              z = 0
Debug catctl.pl              Z = 0

catctl.pl VERSION: [19.0.0.0.0]
           STATUS: [Production]
            BUILD: [RDBMS_19.27.0.0.0DBRU_LINUX.X64_250405]


/u01/app/oracle/product/19c/db_1/rdbms/admin/orahome = [/u01/app/oracle/product/19c/db_1]
/u01/app/oracle/product/19c/db_1/bin/orabasehome = [/u01/app/oracle/product/19c/db_1]
catctlGetOraBaseLogDir = [/u01/app/oracle/product/19c/db_1]

Analyzing file /u01/app/oracle/product/19c/db_1/rdbms/admin/catupgrd.sql

Log file directory = [/tmp]

catcon::set_log_file_base_path: ALL catcon-related output will be written to [/tmp/catupgrd_catcon_2167.lst]

catcon::set_log_file_base_path: catcon: See [/tmp/catupgrd*.log] files for output generated by scripts

catcon::set_log_file_base_path: catcon: See [/tmp/catupgrd_*.lst] files for spool files, if any


Number of Cpus        = 4
Database Name         = CPTDB
DataBase Version      = 19.0.0.0.0
Parallel SQL Process Count (PDB)      = 2
Parallel SQL Process Count (CDB$ROOT) = 4
Concurrent PDB Upgrades               = 2
Generated PDB Inclusion:[PTDB]
CDB$ROOT  Open Mode = [OPEN]
Concurrent PDB Upgrades Reset           = 1
DataBase Version      = 19.0.0.0.0

Start processing of PDBs (PTDB)
[/u01/app/oracle/product/19c/db_1/perl/bin/perl /u01/app/oracle/product/19c/db_1/rdbms/admin/catctl.pl -c 'PTDB' -l /tmp -n 2 -I -i ptdb /u01/app/oracle/product/19c/db_1/rdbms/admin/catupgrd.sql]

Argument list for [/u01/app/oracle/product/19c/db_1/rdbms/admin/catctl.pl]
For Oracle internal use only A = 0
Run in                       c = PTDB
Do not run in                C = 0
Input Directory              d = 0
Echo OFF                     e = 1
Simulate                     E = 0
Forced cleanup               F = 0
Log Id                       i = ptdb
Child Process                I = 1
Log Dir                      l = /tmp
Priority List Name           L = 0
Upgrade Mode active          M = 0
SQL Process Count            n = 2
SQL PDB Process Count        N = 0
Open Mode Normal             o = 0
Start Phase                  p = 0
End Phase                    P = 0
Reverse Order                r = 0
AutoUpgrade Resume           R = 0
Script                       s = 0
Serial Run                   S = 0
RO User Tablespaces          T = 0
Display Phases               y = 0
Debug catcon.pm              z = 0
Debug catctl.pl              Z = 0

catctl.pl VERSION: [19.0.0.0.0]
           STATUS: [Production]
            BUILD: [RDBMS_19.27.0.0.0DBRU_LINUX.X64_250405]


/u01/app/oracle/product/19c/db_1/rdbms/admin/orahome = [/u01/app/oracle/product/19c/db_1]
/u01/app/oracle/product/19c/db_1/bin/orabasehome = [/u01/app/oracle/product/19c/db_1]
catctlGetOraBaseLogDir = [/u01/app/oracle/product/19c/db_1]

Analyzing file /u01/app/oracle/product/19c/db_1/rdbms/admin/catupgrd.sql

Log file directory = [/tmp]

catcon::set_log_file_base_path: ALL catcon-related output will be written to [/tmp/catupgrdptdb_catcon_2335.lst]

catcon::set_log_file_base_path: catcon: See [/tmp/catupgrdptdb*.log] files for output generated by scripts

catcon::set_log_file_base_path: catcon: See [/tmp/catupgrdptdb_*.lst] files for spool files, if any


Number of Cpus        = 4
Database Name         = CPTDB
DataBase Version      = 19.0.0.0.0
PTDB Open Mode = [MIGRATE]
Generated PDB Inclusion:[PTDB]
CDB$ROOT  Open Mode = [OPEN]
Components in [PTDB]
    Installed [APS CATALOG CATJAVA CATPROC CONTEXT DV JAVAVM OLS ORDIM OWM SDO XDB XML XOQ]
Not Installed [APEX EM MGW ODM RAC WK]
DataBase Version      = 19.0.0.0.0

------------------------------------------------------
Phases [0-107]         Start Time:[2025_07_15 23:17:30]
Container Lists Inclusion:[PTDB] Exclusion:[NONE]
------------------------------------------------------
***********   Executing Change Scripts   ***********
Serial   Phase #:0    [PTDB] Files:1    Time: 52s
***************   Catalog Core SQL   ***************
Serial   Phase #:1    [PTDB] Files:5    Time: 97s
Restart  Phase #:2    [PTDB] Files:1    Time: 0s
***********   Catalog Tables and Views   ***********
Parallel Phase #:3    [PTDB] Files:19   Time: 49s
Restart  Phase #:4    [PTDB] Files:1    Time: 0s
*************   Catalog Final Scripts   ************
Serial   Phase #:5    [PTDB] Files:7    Time: 18s
*****************   Catproc Start   ****************
Serial   Phase #:6    [PTDB] Files:1    Time: 8s
*****************   Catproc Types   ****************
Serial   Phase #:7    [PTDB] Files:2    Time: 13s
Restart  Phase #:8    [PTDB] Files:1    Time: 0s
****************   Catproc Tables   ****************
Parallel Phase #:9    [PTDB] Files:72   Time: 32s
Restart  Phase #:10   [PTDB] Files:1    Time: 0s
*************   Catproc Package Specs   ************
Serial   Phase #:11   [PTDB] Files:1    Time: 76s
Restart  Phase #:12   [PTDB] Files:1    Time: 0s
**************   Catproc Procedures   **************
Parallel Phase #:13   [PTDB] Files:95   Time: 7s
Restart  Phase #:14   [PTDB] Files:1    Time: 0s
Parallel Phase #:15   [PTDB] Files:122  Time: 14s
Restart  Phase #:16   [PTDB] Files:1    Time: 0s
Serial   Phase #:17   [PTDB] Files:29   Time: 4s
Restart  Phase #:18   [PTDB] Files:1    Time: 0s
*****************   Catproc Views   ****************
Parallel Phase #:19   [PTDB] Files:31   Time: 32s
Restart  Phase #:20   [PTDB] Files:1    Time: 0s
Serial   Phase #:21   [PTDB] Files:3    Time: 13s
Restart  Phase #:22   [PTDB] Files:1    Time: 0s
Parallel Phase #:23   [PTDB] Files:25   Time: 104s
Restart  Phase #:24   [PTDB] Files:1    Time: 0s
Parallel Phase #:25   [PTDB] Files:12   Time: 67s
Restart  Phase #:26   [PTDB] Files:1    Time: 0s
Serial   Phase #:27   [PTDB] Files:1    Time: 0s
Serial   Phase #:28   [PTDB] Files:8    Time: 2s
Serial   Phase #:29   [PTDB] Files:1    Time: 0s
Restart  Phase #:30   [PTDB] Files:1    Time: 1s
***************   Catproc CDB Views   **************
Serial   Phase #:31   [PTDB] Files:1    Time: 0s
Restart  Phase #:32   [PTDB] Files:1    Time: 0s
Serial   Phase #:34   [PTDB] Files:1    Time: 0s
*****************   Catproc PLBs   *****************
Serial   Phase #:35   [PTDB] Files:300  Time: 16s
Serial   Phase #:36   [PTDB] Files:1    Time: 0s
Restart  Phase #:37   [PTDB] Files:1    Time: 0s
Serial   Phase #:38   [PTDB] Files:10   Time: 2s
Restart  Phase #:39   [PTDB] Files:1    Time: 0s
***************   Catproc DataPump   ***************
Serial   Phase #:40   [PTDB] Files:3    Time: 33s
Restart  Phase #:41   [PTDB] Files:1    Time: 0s
******************   Catproc SQL   *****************
Parallel Phase #:42   [PTDB] Files:13   Time: 65s
Restart  Phase #:43   [PTDB] Files:1    Time: 0s
Parallel Phase #:44   [PTDB] Files:11   Time: 4s
Restart  Phase #:45   [PTDB] Files:1    Time: 0s
Parallel Phase #:46   [PTDB] Files:3    Time: 0s
Restart  Phase #:47   [PTDB] Files:1    Time: 1s
*************   Final Catproc scripts   ************
Serial   Phase #:48   [PTDB] Files:1    Time: 11s
Restart  Phase #:49   [PTDB] Files:1    Time: 0s
**************   Final RDBMS scripts   *************
Serial   Phase #:50   [PTDB] Files:1    Time: 11s
************   Upgrade Component Start   ***********
Serial   Phase #:51   [PTDB] Files:1    Time: 0s
Restart  Phase #:52   [PTDB] Files:1    Time: 0s
**********   Upgrading Java and non-Java   *********
Serial   Phase #:53   [PTDB] Files:2    Time: 396s
*****************   Upgrading XDB   ****************
Restart  Phase #:54   [PTDB] Files:1    Time: 0s
Serial   Phase #:56   [PTDB] Files:3    Time: 6s
Serial   Phase #:57   [PTDB] Files:3    Time: 2s
Parallel Phase #:58   [PTDB] Files:10   Time: 2s
Parallel Phase #:59   [PTDB] Files:25   Time: 9s
Serial   Phase #:60   [PTDB] Files:4    Time: 12s
Serial   Phase #:61   [PTDB] Files:1    Time: 0s
Serial   Phase #:62   [PTDB] Files:32   Time: 7s
Serial   Phase #:63   [PTDB] Files:1    Time: 0s
Parallel Phase #:64   [PTDB] Files:6    Time: 6s
Serial   Phase #:65   [PTDB] Files:2    Time: 11s
Serial   Phase #:66   [PTDB] Files:3    Time: 26s
****************   Upgrading ORDIM   ***************
Restart  Phase #:67   [PTDB] Files:1    Time: 0s
Serial   Phase #:69   [PTDB] Files:1    Time: 2s
Parallel Phase #:70   [PTDB] Files:2    Time: 169s
Restart  Phase #:71   [PTDB] Files:1    Time: 0s
Parallel Phase #:72   [PTDB] Files:2    Time: 1s
Serial   Phase #:73   [PTDB] Files:2    Time: 0s
*****************   Upgrading SDO   ****************
Restart  Phase #:74   [PTDB] Files:1    Time: 1s
Serial   Phase #:76   [PTDB] Files:1    Time: 35s
Serial   Phase #:77   [PTDB] Files:2    Time: 2s
Restart  Phase #:78   [PTDB] Files:1    Time: 0s
Serial   Phase #:79   [PTDB] Files:1    Time: 26s
Restart  Phase #:80   [PTDB] Files:1    Time: 0s
Parallel Phase #:81   [PTDB] Files:3    Time: 152s
Restart  Phase #:82   [PTDB] Files:1    Time: 0s
Serial   Phase #:83   [PTDB] Files:1    Time: 5s
Restart  Phase #:84   [PTDB] Files:1    Time: 1s
Serial   Phase #:85   [PTDB] Files:1    Time: 9s
Restart  Phase #:86   [PTDB] Files:1    Time: 0s
Parallel Phase #:87   [PTDB] Files:4    Time: 171s
Restart  Phase #:88   [PTDB] Files:1    Time: 0s
Serial   Phase #:89   [PTDB] Files:1    Time: 1s
Restart  Phase #:90   [PTDB] Files:1    Time: 0s
Serial   Phase #:91   [PTDB] Files:2    Time: 69s
Restart  Phase #:92   [PTDB] Files:1    Time: 0s
Serial   Phase #:93   [PTDB] Files:1    Time: 1s
Restart  Phase #:94   [PTDB] Files:1    Time: 0s
*******   Upgrading ODM, WK, EXF, RUL, XOQ   *******
Serial   Phase #:95   [PTDB] Files:1    Time: 29s
Restart  Phase #:96   [PTDB] Files:1    Time: 0s
***********   Final Component scripts    ***********
Serial   Phase #:97   [PTDB] Files:1    Time: 2s
*************   Final Upgrade scripts   ************
Serial   Phase #:98   [PTDB] Files:1    Time: 36s
*******************   Migration   ******************
Serial   Phase #:99   [PTDB] Files:1    Time: 1s
***   End PDB Application Upgrade Pre-Shutdown   ***
Serial   Phase #:100  [PTDB] Files:1    Time: 0s
Serial   Phase #:101  [PTDB] Files:1    Time: 5s
Serial   Phase #:102  [PTDB] Files:1    Time: 6s
*****************   Post Upgrade   *****************
Serial   Phase #:103  [PTDB] Files:1    Time: 3s
****************   Summary report   ****************
Serial   Phase #:104  [PTDB] Files:1    Time: 1s
***   End PDB Application Upgrade Post-Shutdown   **
Serial   Phase #:105  [PTDB] Files:1    Time: 1s
Serial   Phase #:106  [PTDB] Files:1    Time: 1s
Serial   Phase #:107  [PTDB] Files:1     Time: 0s

------------------------------------------------------
Phases [0-107]         End Time:[2025_07_15 23:49:49]
Container Lists Inclusion:[PTDB] Exclusion:[NONE]
------------------------------------------------------

Grand Total Time: 1939s [PTDB]

 LOG FILES: (/tmp/catupgrdptdb*.log)

Upgrade Summary Report Located in:
/tmp/upg_summary.log

     Time: 1945s For PDB(s)

Grand Total Time: 1945s

 LOG FILES: (/tmp/catupgrd*.log)


Grand Total Upgrade Time:    [0d:0h:32m:25s]

 

 

3-10. plug-in 시킨 PDB에서 noncdb_to_pdb.sql 스크립트를 실행

 

 

[PTDB:oracle@tdb01p][/home/oracle]$ export ORACLE_HOME=/u01/app/oracle/product/19c/db_1
[PTDB:oracle@tdb01p][/home/oracle]$ export ORACLE_SID=CPTDB
[CPTDB:oracle@tdb01p][/home/oracle]$ alias ss
alias ss='rlwrap sqlplus "/as sysdba"'

[CPTDB:oracle@tdb01p][/home/oracle]$ which sqlplus
/u01/app/oracle/product/12c/db_1/bin/sqlplus
[CPTDB:oracle@tdb01p][/home/oracle]$ /u01/app/oracle/product/19c/db_1/bin/sqlplus "/as sysdba"

 

SQL> show pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PTDB                           MOUNTED

 

SQL> ALTER SESSION SET container=PTDB;


SQL> @?/rdbms/admin/noncdb_to_pdb.sql

...생략

SQL>
SQL> -- leave the PDB in the same state it was when we started
SQL> BEGIN
  2    execute immediate '&open_sql &restricted_state';
  3  EXCEPTION
  4    WHEN OTHERS THEN
  5    BEGIN
  6      IF (sqlcode <> -900) THEN
  7        RAISE;
  8      END IF;
  9    END;
 10  END;
 11  /

PL/SQL procedure successfully completed.

 

--> 해당 세션은 그대로 두고 새로운 세션을 하나 열어서 cptdb 로 접속 - 시작

[PTDB:oracle@tdb01p][/home/oracle]$ export ORACLE_SID=CPTDB
[CPTDB:oracle@tdb01p][/home/oracle]$ export ORACLE_HOME=/u01/app/oracle/product/19c/db_1
[CPTDB:oracle@tdb01p][/home/oracle]$ ss

SQL*Plus: Release 12.2.0.1.0 Production on Wed Jul 16 15:26:50 2025

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production


set linesize 300
col name for a10
col message for a150
col status for a10
SELECT A.NAME, A.MESSAGE, A.STATUS
--, A.*
  FROM PDB_PLUG_IN_VIOLATIONS A
ORDER BY A.NAME, A.LINE;

--> pbd plugin 작업의 상태를 파악 할 수 있음

NAME       MESSAGE                                                                                                                                                STATUS
---------- ------------------------------------------------------------------------------------------------------------------------------------------------------ ----------
PDB$SEED   '19.27.0.0.0 Release_Update 2504061311' is installed in the CDB but no release updates are installed in the PDB                                        RESOLVED
PTDB       Database option APS mismatch: PDB installed version 12.2.0.1.0. CDB installed version 19.0.0.0.0.                                                      RESOLVED
PTDB       CDB parameter processes mismatch: Previous 1432 Current 320                                                                                            RESOLVED
PTDB       PDB's version does not match CDB's version: PDB's version 12.2.0.1.0. CDB's version 19.0.0.0.0.                                                        RESOLVED
PTDB       Character set mismatch: PDB character set KO16MSWIN949. CDB character set AL32UTF8.                                                                    RESOLVED
PTDB       PDB plugged in is a non-CDB, requires noncdb_to_pdb.sql be run.                                                                                        PENDING
PTDB       Database option CATALOG mismatch: PDB installed version 12.2.0.1.0. CDB installed version 19.0.0.0.0.                                                  RESOLVED
PTDB       CDB parameter _disable_system_state mismatch: Previous 0 Current 4294967294                                                                            RESOLVED
PTDB       Database option CATJAVA mismatch: PDB installed version 12.2.0.1.0. CDB installed version 19.0.0.0.0.                                                  RESOLVED
PTDB       CDB parameter sga_max_size mismatch: Previous 4944M Current 1536M                                                                                      RESOLVED
PTDB       Database option CATPROC mismatch: PDB installed version 12.2.0.1.0. CDB installed version 19.0.0.0.0.                                                  RESOLVED

NAME       MESSAGE                                                                                                                                                STATUS
---------- ------------------------------------------------------------------------------------------------------------------------------------------------------ ----------
PTDB       CDB parameter _enable_shared_pool_durations mismatch: Previous FALSE Current TRUE                                                                      RESOLVED
PTDB       Database option CONTEXT mismatch: PDB installed version 12.2.0.1.0. CDB installed version 19.0.0.0.0.                                                  RESOLVED
PTDB       CDB parameter use_large_pages mismatch: Previous 'ONLY' Current 'TRUE'                                                                                 RESOLVED
PTDB       Database option DV mismatch: PDB installed version 12.2.0.1.0. CDB installed version 19.0.0.0.0.                                                       RESOLVED
PTDB       CDB parameter shared_pool_size mismatch: Previous 1G Current 0                                                                                         RESOLVED
PTDB       Database option JAVAVM mismatch: PDB installed version 12.2.0.1.0. CDB installed version 19.0.0.0.0.                                                   RESOLVED
PTDB       CDB parameter large_pool_size mismatch: Previous 512M Current 0                                                                                        RESOLVED
PTDB       Database option OLS mismatch: PDB installed version 12.2.0.1.0. CDB installed version 19.0.0.0.0.                                                      RESOLVED
PTDB       CDB parameter java_pool_size mismatch: Previous 160M Current 0                                                                                         RESOLVED
PTDB       Database option ORDIM mismatch: PDB installed version 12.2.0.1.0. CDB installed version 19.0.0.0.0.                                                    RESOLVED
PTDB       CDB parameter streams_pool_size mismatch: Previous 160M Current 0                                                                                      RESOLVED

NAME       MESSAGE                                                                                                                                                STATUS
---------- ------------------------------------------------------------------------------------------------------------------------------------------------------ ----------
PTDB       Database option OWM mismatch: PDB installed version 12.2.0.1.0. CDB installed version 19.0.0.0.0.                                                      RESOLVED
PTDB       CDB parameter pga_aggregate_limit mismatch: Previous 0 Current 2G                                                                                      RESOLVED
PTDB       Database option SDO mismatch: PDB installed version 12.2.0.1.0. CDB installed version 19.0.0.0.0.                                                      RESOLVED
PTDB       CDB parameter _highest_priority_processes mismatch: Previous 'VKTM|LG*|LMS*' Current 'VKTM|CTWR'                                                       RESOLVED
PTDB       Database option XDB mismatch: PDB installed version 12.2.0.1.0. CDB installed version 19.0.0.0.0.                                                      RESOLVED
PTDB       CDB parameter uniform_log_timestamp_format mismatch: Previous FALSE Current TRUE                                                                       RESOLVED
PTDB       Database option XML mismatch: PDB installed version 12.2.0.1.0. CDB installed version 19.0.0.0.0.                                                      RESOLVED
PTDB       CDB parameter filesystemio_options mismatch: Previous 'SETALL' Current 'none'                                                                          RESOLVED
PTDB       Database option XOQ mismatch: PDB installed version 12.2.0.1.0. CDB installed version 19.0.0.0.0.                                                      RESOLVED
PTDB       CDB parameter resource_manager_plan mismatch: Previous 'FORCE:' Current 'SCHEDULER[0x4D53]:DEFAULT_MAINTENANCE_PLAN'                                   RESOLVED
PTDB       CDB parameter _dlm_stats_collect mismatch: Previous 0 Current 1                                                                                        RESOLVED

NAME       MESSAGE                                                                                                                                                STATUS
---------- ------------------------------------------------------------------------------------------------------------------------------------------------------ ----------
PTDB       Database option RAC mismatch: PDB installed version 19.0.0.0.0. CDB installed version NULL.                                                            RESOLVED
PTDB       CDB parameter sga_target mismatch: Previous 0 Current 1536M                                                                                            RESOLVED
PTDB       CDB parameter db_cache_size mismatch: Previous 3G Current 0                                                                                            RESOLVED
PTDB       CDB parameter compatible mismatch: Previous '12.2.0' Current '19.0.0'                                                                                  RESOLVED
PTDB       CDB parameter _buddy_instance mismatch: Previous 0 Current 1                                                                                           RESOLVED
PTDB       CDB parameter _nonfatalprocess_redo_dump_time_limit mismatch: Previous 0 Current 3600                                                                  RESOLVED
PTDB       CDB parameter _use_single_log_writer mismatch: Previous 'TRUE' Current 'ADAPTIVE'                                                                      RESOLVED
PTDB       CDB parameter _use_adaptive_log_file_sync mismatch: Previous 'FALSE' Current 'TRUE'                                                                    RESOLVED
PTDB       CDB parameter db_files mismatch: Previous 1000 Current 200                                                                                             RESOLVED
PTDB       CDB parameter _in_memory_undo mismatch: Previous FALSE Current TRUE                                                                                    RESOLVED
PTDB       CDB parameter _cleanup_rollback_entries mismatch: Previous 2000 Current 100                                                                            RESOLVED

NAME       MESSAGE                                                                                                                                                STATUS
---------- ------------------------------------------------------------------------------------------------------------------------------------------------------ ----------
PTDB       CDB parameter _rollback_segment_count mismatch: Previous 1000 Current 0                                                                                RESOLVED
PTDB       CDB parameter _undo_autotune mismatch: Previous FALSE Current TRUE                                                                                     RESOLVED
PTDB       CDB parameter _partition_large_extents mismatch: Previous 'FALSE' Current 'TRUE'                                                                       RESOLVED
PTDB       CDB parameter _securefiles_concurrency_estimate mismatch: Previous 50 Current 12                                                                       RESOLVED
PTDB       CDB parameter _drop_stat_segment mismatch: Previous 1 Current 0                                                                                        RESOLVED
PTDB       CDB parameter _sys_logon_delay mismatch: Previous 0 Current 1                                                                                          RESOLVED
PTDB       CDB parameter _clusterwide_global_transactions mismatch: Previous FALSE Current TRUE                                                                   RESOLVED
PTDB       CDB parameter session_cached_cursors mismatch: Previous 100 Current 50                                                                                 RESOLVED
PTDB       CDB parameter _cursor_obsolete_threshold mismatch: Previous 1024 Current 8192                                                                          RESOLVED
PTDB       CDB parameter _cursor_reload_failure_threshold mismatch: Previous 5 Current 20                                                                         RESOLVED
PTDB       CDB parameter _kks_obsolete_dump_threshold mismatch: Previous 0 Current 1                                                                              RESOLVED

NAME       MESSAGE                                                                                                                                                STATUS
---------- ------------------------------------------------------------------------------------------------------------------------------------------------------ ----------
PTDB       CDB parameter _kks_parse_error_warning mismatch: Previous 0 Current 100                                                                                RESOLVED
PTDB       CDB parameter _px_use_large_pool mismatch: Previous TRUE Current FALSE                                                                                 RESOLVED
PTDB       CDB parameter result_cache_max_size mismatch: Previous 0 Current 7872K                                                                                 RESOLVED
PTDB       CDB parameter _optimizer_null_aware_antijoin mismatch: Previous FALSE Current TRUE                                                                     RESOLVED
PTDB       CDB parameter _optimizer_extended_cursor_sharing mismatch: Previous 'NONE' Current 'UDO'                                                               RESOLVED
PTDB       CDB parameter _optimizer_extended_cursor_sharing_rel mismatch: Previous 'NONE' Current 'SIMPLE'                                                        RESOLVED
PTDB       CDB parameter _optimizer_adaptive_cursor_sharing mismatch: Previous FALSE Current TRUE                                                                 RESOLVED
PTDB       CDB parameter _optim_peek_user_binds mismatch: Previous FALSE Current TRUE                                                                             RESOLVED
PTDB       CDB parameter pga_aggregate_target mismatch: Previous 1717986918 Current 512M                                                                          RESOLVED
PTDB       CDB parameter _pga_max_size mismatch: Previous 1G Current 200M                                                                                         RESOLVED
PTDB       CDB parameter optimizer_dynamic_sampling mismatch: Previous 0 Current 2                                                                                RESOLVED

NAME       MESSAGE                                                                                                                                                STATUS
---------- ------------------------------------------------------------------------------------------------------------------------------------------------------ ----------
PTDB       CDB parameter _optimizer_connect_by_cost_based mismatch: Previous FALSE Current TRUE                                                                   RESOLVED
PTDB       CDB parameter _bloom_filter_enabled mismatch: Previous FALSE Current TRUE                                                                              RESOLVED
PTDB       CDB parameter _gby_hash_aggregation_enabled mismatch: Previous FALSE Current TRUE                                                                      RESOLVED
PTDB       CDB parameter optimizer_secure_view_merging mismatch: Previous FALSE Current TRUE                                                                      RESOLVED
PTDB       CDB parameter _add_col_optim_enabled mismatch: Previous FALSE Current TRUE                                                                             RESOLVED
PTDB       CDB parameter deferred_segment_creation mismatch: Previous FALSE Current TRUE                                                                          RESOLVED
PTDB       CDB parameter _optimizer_aggr_groupby_elim mismatch: Previous FALSE Current TRUE                                                                       RESOLVED
PTDB       CDB parameter parallel_force_local mismatch: Previous TRUE Current FALSE                                                                               RESOLVED
PTDB       CDB parameter _optimizer_use_feedback mismatch: Previous FALSE Current TRUE                                                                            RESOLVED
PTDB       CDB parameter max_string_size mismatch: Previous 'EXTENDED' Current 'STANDARD'                                                                         RESOLVED
PTDB       CDB parameter _sql_plan_directive_mgmt_control mismatch: Previous 0 Current 67                                                                         RESOLVED

NAME       MESSAGE                                                                                                                                                STATUS
---------- ------------------------------------------------------------------------------------------------------------------------------------------------------ ----------
PTDB       CDB parameter _optimizer_gather_stats_on_load mismatch: Previous FALSE Current TRUE                                                                    RESOLVED
PTDB       CDB parameter optimizer_adaptive_reporting_only mismatch: Previous TRUE Current FALSE                                                                  RESOLVED
PTDB       CDB parameter optimizer_adaptive_plans mismatch: Previous FALSE Current TRUE                                                                           RESOLVED
PTDB       CDB parameter _rowsets_enabled mismatch: Previous FALSE Current TRUE                                                                                   RESOLVED
PTDB       CDB parameter _emon_send_timeout mismatch: Previous 10000 Current 7200000                                                                              RESOLVED
PTDB       CDB parameter _client_enable_auto_unregister mismatch: Previous TRUE Current FALSE                                                                     RESOLVED
PTDB       CDB parameter _report_capture_cycle_time mismatch: Previous 0 Current 60                                                                               RESOLVED
PTDB       CDB parameter enable_pluggable_database mismatch: Previous FALSE Current TRUE                                                                          RESOLVED

85 rows selected.

 

--> 해당 세션은 그대로 두고 새로운 세션을 하나 열어서 cptdb 로 접속 - 시작

--위에서 noncdb_to_pdb.sql 스크립트를 수행 시킨 ssh 접속 쉘로 돌아가서 아래의 명령을 수행

SQL> shoW con_name

CON_NAME
------------------------------
PTDB

SQL> show pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         3 PTDB                           MOUNTED
SQL> alter pluggable database ptdb open;

Pluggable database altered.

SQL> show pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         3 PTDB                           READ WRITE NO

 

set linesize 300
col name for a10
col message for a150
col status for a10
SELECT A.NAME, A.MESSAGE, A.STATUS
--, A.*
  FROM PDB_PLUG_IN_VIOLATIONS A
where status <> 'RESOLVED'
ORDER BY A.NAME, A.LINE;

NAME       MESSAGE                                                                                                                                                STATUS
---------- ------------------------------------------------------------------------------------------------------------------------------------------------------ ----------
PTDB       Character set mismatch: PDB character set KO16MSWIN949. CDB character set AL32UTF8.                                                                    PENDING

1 row selected.

SQL>

 

3-11. DB 업그레이드 후 후속 작업

 

[PTDB:oracle@tdb01p][/home/oracle]$ export ORACLE_SID=CPTDB
[CPTDB:oracle@tdb01p][/home/oracle]$ export ORACLE_HOME=/u01/app/oracle/product/19c/db_1
[CPTDB:oracle@tdb01p][/home/oracle]$ which sqlplus
/u01/app/oracle/product/12c/db_1/bin/sqlplus

[CPTDB:oracle@tdb01p][/home/oracle]$ $ORACLE_HOME/bin/sqlplus "/as sysdba"

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Jul 16 15:48:06 2025
Version 19.27.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.27.0.0.0

 

SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT

 

SQL> alter session set container=PTDB;

 

 

SQL> select count(*) as cnt from dba_objects where status = 'INVALID';

       CNT
----------
         4

 

SQL>

col object_name for a20
col ddl for a50
col object_type for a20
SELECT *
 FROM
 (
        SELECT OBJECT_NAME
             , STATUS
             , OBJECT_TYPE
             , LAST_DDL_TIME
             , 'ALTER ' || OBJECT_TYPE || ' ' || OWNER || '.' || '"'|| OBJECT_NAME  || '"' || ' COMPILE;' AS DDL
          FROM DBA_OBJECTS
         WHERE 1=1
           AND OBJECT_TYPE IN ('PACKAGE')
         AND STATUS = 'INVALID'
 )
 UNION ALL
 SELECT *
 FROM
 (
        SELECT OBJECT_NAME
             , STATUS
             , OBJECT_TYPE
             , LAST_DDL_TIME
             , 'ALTER PACKAGE'|| ' ' || OWNER || '.' || '"'|| OBJECT_NAME  || '"' || ' COMPILE BODY;' AS DDL
          FROM DBA_OBJECTS
         WHERE 1=1
           AND OBJECT_TYPE IN ('PACKAGE BODY')
         AND STATUS = 'INVALID'
 )
UNION ALL
SELECT *
  FROM
     (
         SELECT OBJECT_NAME
              , STATUS
              , OBJECT_TYPE
              , LAST_DDL_TIME
              , 'ALTER PUBLIC ' ||  OBJECT_TYPE || ' ' || '"' ||  OBJECT_NAME || '"' || ' COMPILE;' AS DDL
          FROM DBA_OBJECTS
          WHERE 1=1
            AND OBJECT_TYPE IN ('SYNONYM') AND OWNER = 'PUBLIC'
            AND STATUS = 'INVALID'
 )
 UNION ALL
 SELECT *
 FROM
 (
        SELECT OBJECT_NAME
             , STATUS
             , OBJECT_TYPE
             , LAST_DDL_TIME
             , 'ALTER ' || OBJECT_TYPE || ' ' || OWNER || '.' || '"'|| OBJECT_NAME  || '"' || ' COMPILE;' AS DDL
          FROM DBA_OBJECTS
         WHERE 1=1
           AND OBJECT_TYPE IN ('TYPE')
         AND STATUS = 'INVALID'
 )
 UNION ALL
 SELECT *
 FROM
 (
        SELECT OBJECT_NAME
             , STATUS
             , OBJECT_TYPE
             , LAST_DDL_TIME
             , 'ALTER TYPE'  || ' ' || OWNER || '.' || '"'|| OBJECT_NAME  || '"' || ' COMPILE BODY;' AS DDL
          FROM DBA_OBJECTS
         WHERE 1=1
           AND OBJECT_TYPE IN ('TYPE BODY')
         AND STATUS = 'INVALID'
 )
 UNION ALL
 SELECT *
 FROM
 (
        SELECT OBJECT_NAME
             , STATUS
             , OBJECT_TYPE
             , LAST_DDL_TIME
             , 'ALTER ' || OBJECT_TYPE || ' ' || OWNER || '.' || '"'|| OBJECT_NAME  || '"' || ' COMPILE;' AS DDL
          FROM DBA_OBJECTS
         WHERE 1=1
           AND OBJECT_TYPE IN ('VIEW')
         AND STATUS = 'INVALID'
 )
 UNION ALL
 SELECT *
 FROM
 (
        SELECT OBJECT_NAME
             , STATUS
             , OBJECT_TYPE
             , LAST_DDL_TIME
             , 'ALTER ' || OBJECT_TYPE || ' ' || OWNER || '.' || '"'|| OBJECT_NAME  || '"' || ' COMPILE;' AS DDL
          FROM DBA_OBJECTS
         WHERE 1=1
           AND OBJECT_TYPE IN ('PROCEDURE')
         AND STATUS = 'INVALID'
 )
 UNION ALL
 SELECT *
 FROM
 (
        SELECT OBJECT_NAME
             , STATUS
             , OBJECT_TYPE
             , LAST_DDL_TIME
             , 'ALTER ' || OBJECT_TYPE || ' ' || OWNER || '.' || '"'|| OBJECT_NAME  || '"' || ' COMPILE;' AS DDL
          FROM DBA_OBJECTS
         WHERE 1=1
           AND OBJECT_TYPE IN ('TRIGGER')
         AND STATUS = 'INVALID'
 )
 ORDER BY 3

;

OBJECT_NAME          STATUS     OBJECT_TYPE          LAST_DDL DDL
-------------------- ---------- -------------------- -------- --------------------------------------------------
SECURE_DML           INVALID    PROCEDURE            25/02/09 ALTER PROCEDURE HR."SECURE_DML" COMPILE;
ADD_JOB_HISTORY      INVALID    PROCEDURE            25/02/09 ALTER PROCEDURE HR."ADD_JOB_HISTORY" COMPILE;
SECURE_EMPLOYEES     INVALID    TRIGGER              25/02/09 ALTER TRIGGER HR."SECURE_EMPLOYEES" COMPILE;
UPDATE_JOB_HISTORY   INVALID    TRIGGER              25/02/09 ALTER TRIGGER HR."UPDATE_JOB_HISTORY" COMPILE;

 

 

SQL> ALTER PROCEDURE HR."SECURE_DML" COMPILE;

Procedure altered.

SQL> ALTER PROCEDURE HR."ADD_JOB_HISTORY" COMPILE;

Procedure altered.

SQL> ALTER TRIGGER HR."SECURE_EMPLOYEES" COMPILE;

Trigger altered.

SQL> ALTER TRIGGER HR."UPDATE_JOB_HISTORY" COMPILE;

Trigger altered.

 

 

SQL> select count(*) as cnt from dba_objects where status = 'INVALID';

       CNT
----------
         0

 

 

 

SQL> @/u01/app/oracle/cfgtoollogs/PTDB/preupgrade/postupgrade_fixups.sql

Session altered.


PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.


Package created.

No errors.

Package body created.


PL/SQL procedure successfully completed.

No errors.

 

 

Package created.

No errors.

Package body created.

No errors.
WARNING - This script was generated for database PTDB.
Executing Oracle POST-Upgrade Fixup Script

Auto-Generated by:       Oracle Preupgrade Script
                         Version: 19.0.0.0.0 Build: 13
Generated on:            2025-07-13 14:21:00

For Source Database:     PTDB
Source Database Version: 12.2.0.1.0
For Upgrade to Version:  19.0.0.0.0

Preup                             Preupgrade
Action                            Issue Is
Number  Preupgrade Check Name     Remedied    Further DBA Action
------  ------------------------  ----------  --------------------------------
    9.  old_time_zones_exist      NO          Manual fixup recommended.
   10.  dir_symlinks              YES         None.
   11.  post_dictionary           YES         None.
   12.  post_fixed_objects        NO          Informational only.
                                              Further action is optional.

The fixup scripts have been run and resolved what they can. However,
there are still issues originally identified by the preupgrade that
have not been remedied and are still present in the database.
Depending on the severity of the specific issue, and the nature of
the issue itself, that could mean that your database upgrade is not
fully complete.  To resolve the outstanding issues, start by reviewing
the postupgrade_fixups.sql and searching it for the name of
the failed CHECK NAME or Preupgrade Action Number listed above.
There you will find the original corresponding diagnostic message
from the preupgrade which explains in more detail what still needs
to be done.

PL/SQL procedure successfully completed.


Session altered.

 

 

SQL> EXEC DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;

SQL> exec dbms_stats.gather_dictionary_stats;

SQL> quit

 

[PTDB:oracle@tdb01p][/home/oracle]$ export ORACLE_SID=CPTDB
[CPTDB:oracle@tdb01p][/home/oracle]$ export ORACLE_HOME=/u01/app/oracle/product/19c/db_1
[CPTDB:oracle@tdb01p][/home/oracle]$ alias ss

alias ss='rlwrap sqlplus "/as sysdba"'
[CPTDB:oracle@tdb01p][/home/oracle]$ ss

SQL*Plus: Release 12.2.0.1.0 Production on Wed Jul 16 21:17:39 2025

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

 

SQL> show con_name;

CON_NAME
------------------------------
CDB$ROOT

SQL> set linesize 300
SQL> SELECT * FROM v$timezone_file;

FILENAME                VERSION     CON_ID
-------------------- ---------- ----------
timezlrg_32.dat              32          0

 

SQL> show pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PTDB                           READ WRITE NO

SQL> alter session set container=ptdb;

Session altered.

SQL> SELECT * FROM v$timezone_file;

FILENAME                                                        VERSION     CON_ID
------------------------------------------------------------ ---------- ----------
timezlrg_32.dat                                                      32          0

 

SQL> alter session set container=cdb$root;

Session altered.

SQL> SELECT DBMS_DST.get_latest_timezone_version FROM dual;

GET_LATEST_TIMEZONE_VERSION
---------------------------
                         44

 

DECLARE
  l_tz_version PLS_INTEGER;
BEGIN
  l_tz_version := DBMS_DST.get_latest_timezone_version;
  5
  DBMS_OUTPUT.put_line('l_tz_version=' || l_tz_version);
  DBMS_DST.begin_prepare(l_tz_version);
END;
/

PL/SQL procedure successfully completed.

 

 

COLUMN property_name FORMAT A30
COLUMN property_value FORMAT A20
SQL>
SELECT property_name, property_value
FROM   database_properties
WHERE  property_name LIKE 'DST_%'
ORDER BY property_name;

PROPERTY_NAME                  PROPERTY_VALUE
------------------------------ --------------------
DST_PRIMARY_TT_VERSION         32
DST_SECONDARY_TT_VERSION       44
DST_UPGRADE_STATE              PREPARE

 

SQL> TRUNCATE TABLE sys.dst$affected_tables;

Table truncated.

SQL> TRUNCATE TABLE sys.dst$error_table;

Table truncated.

 

 

SQL> EXEC DBMS_DST.find_affected_tables;

PL/SQL procedure successfully completed.

 

SQL> SELECT * FROM sys.dst$affected_tables;

no rows selected

SQL> SELECT * FROM sys.dst$error_table;

no rows selected

 


 

SQL> EXEC DBMS_DST.end_prepare;

PL/SQL procedure successfully completed.

 

SQL> quit

 

 

[CPTDB:oracle@tdb01p][/home/oracle]$ vi /tmp/upgrade_tzf.sql
[CPTDB:oracle@tdb01p][/home/oracle]$ cat /tmp/upgrade_tzf.sql

SHUTDOWN IMMEDIATE;
STARTUP UPGRADE;

SET SERVEROUTPUT ON
DECLARE
  l_tz_version PLS_INTEGER;
BEGIN
  SELECT DBMS_DST.get_latest_timezone_version
  INTO   l_tz_version
  FROM   dual;

  DBMS_OUTPUT.put_line('l_tz_version=' || l_tz_version);
  DBMS_DST.begin_upgrade(l_tz_version);
END;
/

SHUTDOWN IMMEDIATE;
STARTUP;

SET SERVEROUTPUT ON
DECLARE
  l_failures   PLS_INTEGER;
BEGIN
  DBMS_DST.upgrade_database(l_failures);
  DBMS_OUTPUT.put_line('DBMS_DST.upgrade_database : l_failures=' || l_failures);
  DBMS_DST.end_upgrade(l_failures);
  DBMS_OUTPUT.put_line('DBMS_DST.end_upgrade : l_failures=' || l_failures);
END;
/


[CPTDB:oracle@tdb01p][/home/oracle]$ echo $ORACLE_HOME
/u01/app/oracle/product/19c/db_1

 

[CPTDB:oracle@tdb01p][/home/oracle]$ ss

SQL*Plus: Release 12.2.0.1.0 Production on Wed Jul 16 21:51:07 2025

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production


SQL> show pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PTDB                           MOUNTED

SQL> alter pluggable database ptdb open;

 

SQL> show pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PTDB                           READ WRITE NO


[CPTDB:oracle@tdb01p][/home/oracle]$ echo $ORACLE_HOME
/u01/app/oracle/product/19c/db_1


[CPTDB:oracle@tdb01p][/home/oracle]$

$ORACLE_HOME/perl/bin/perl \
    -I$ORACLE_HOME/perl/lib \
    -I$ORACLE_HOME/rdbms/admin \
    $ORACLE_HOME/rdbms/admin/catcon.pl \
    -l /tmp/ \
    -b upgrade_tzf \
    -c 'CDB$ROOT' \
    /tmp/upgrade_tzf.sql

 

 

$ORACLE_HOME/perl/bin/perl \
    -I$ORACLE_HOME/perl/lib \
    -I$ORACLE_HOME/rdbms/admin \
    $ORACLE_HOME/rdbms/admin/catcon.pl \
    -l /tmp/ \
    -b upgrade_tzf \
    -C 'CDB$ROOT' \
    /tmp/upgrade_tzf.sql

catcon::set_log_file_base_path: ALL catcon-related output will be written to [/tmp/upgrade_tzf_catcon_9402.lst]

catcon::set_log_file_base_path: catcon: See [/tmp/upgrade_tzf*.log] files for output generated by scripts

catcon::set_log_file_base_path: catcon: See [/tmp/upgrade_tzf_*.lst] files for spool files, if any

 

catcon.pl: completed successfully

 


 

[CPTDB:oracle@tdb01p][/home/oracle]$ ss

SQL*Plus: Release 12.2.0.1.0 Production on Wed Jul 16 22:30:37 2025

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT

 

SQL> SELECT * FROM v$timezone_file;

FILENAME                VERSION     CON_ID
-------------------- ---------- ----------
timezlrg_44.dat              44          0

 

 

SQL> show pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         3 PTDB                           MOUNTED

SQL> alter pluggable database ptdb open;


SQL> alter session set container=PTDB;

Session altered.

SQL> SELECT * FROM v$timezone_file;

FILENAME                VERSION     CON_ID
-------------------- ---------- ----------
timezlrg_44.dat              44          0

 

 

SQL> alter session set container=PTDB;

SQL> @/u01/app/oracle/cfgtoollogs/PTDB/preupgrade/postupgrade_fixups.sql

Session altered.


PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.


Package created.

No errors.

Package body created.


PL/SQL procedure successfully completed.

No errors.

 

 

Package created.

No errors.

Package body created.

No errors.
WARNING - This script was generated for database PTDB.
Executing Oracle POST-Upgrade Fixup Script

Auto-Generated by:       Oracle Preupgrade Script
                         Version: 19.0.0.0.0 Build: 13
Generated on:            2025-07-13 14:21:00

For Source Database:     PTDB
Source Database Version: 12.2.0.1.0
For Upgrade to Version:  19.0.0.0.0

Preup                             Preupgrade
Action                            Issue Is
Number  Preupgrade Check Name     Remedied    Further DBA Action
------  ------------------------  ----------  --------------------------------
    9.  old_time_zones_exist      YES         None.
   10.  dir_symlinks              YES         None.
   11.  post_dictionary           YES         None.
   12.  post_fixed_objects        NO          Informational only.
                                              Further action is optional.

The fixup scripts have been run and resolved what they can. However,
there are still issues originally identified by the preupgrade that
have not been remedied and are still present in the database.
Depending on the severity of the specific issue, and the nature of
the issue itself, that could mean that your database upgrade is not
fully complete.  To resolve the outstanding issues, start by reviewing
the postupgrade_fixups.sql and searching it for the name of
the failed CHECK NAME or Preupgrade Action Number listed above.
There you will find the original corresponding diagnostic message
from the preupgrade which explains in more detail what still needs
to be done.

PL/SQL procedure successfully completed.


Session altered.

 

SQL> alter session set container=PTDB;

SQL> @/u01/app/oracle/product/19c/db_1/rdbms/admin/utlusts.sql TEXT

Oracle Database Release 19 Post-Upgrade Status Tool    07-16-2025 22:43:3
Container Database: CPTDB
[CON_ID: 3 => PTDB]

Component                               Current         Full     Elapsed Time
Name                                    Status          Version  HH:MM:SS

Oracle Server                             VALID     19.27.0.0.0  00:12:10
JServer JAVA Virtual Machine              VALID     19.27.0.0.0  00:01:59
Oracle XDK                                VALID     19.27.0.0.0  00:01:39
Oracle Database Java Packages             VALID     19.27.0.0.0  00:00:22
OLAP Analytic Workspace                   VALID     19.27.0.0.0  00:00:09
Oracle Label Security                     VALID     19.27.0.0.0  00:00:17
Oracle Database Vault                     VALID     19.27.0.0.0  00:00:47
Oracle Text                               VALID     19.27.0.0.0  00:00:45
Oracle Workspace Manager                  VALID     19.27.0.0.0  00:00:31
Oracle Real Application Clusters     OPTION OFF     19.27.0.0.0  00:00:01
Oracle XML Database                       VALID     19.27.0.0.0  00:01:19
Oracle Multimedia                         VALID     19.27.0.0.0  00:02:51
Spatial                                   VALID     19.27.0.0.0  00:07:51
Oracle OLAP API                           VALID     19.27.0.0.0  00:00:28
Datapatch                                                        00:00:26
Final Actions                                                    00:00:36
Post Upgrade                                                     00:00:01
Post Compile                                                     00:04:47

Total Upgrade Time: 00:36:49 [CON_ID: 3 => PTDB]

Database time zone version is 44. It meets current release needs.

 

SQL> alter session set container=PTDB;

SQL> @/u01/app/oracle/product/19c/db_1/rdbms/admin/catuppst.sql

TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP DBRESTART              2025-07-16 22:44:22
DBUA_TIMESTAMP DBRESTART     FINISHED 2025-07-16 22:44:22  Container=PTDB Id=3
DBUA_TIMESTAMP DBRESTART         NONE 2025-07-16 22:44:22


TIMESTAMP
--------------------------------------------------------------------------------
DBUA_TIMESTAMP CATUPPST       STARTED 2025-07-16 22:44:22 Container=PTDB Id=3

TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP POSTUP_BGN             2025-07-16 22:44:22
DBUA_TIMESTAMP POSTUP_BGN    FINISHED 2025-07-16 22:44:22  Container=PTDB Id=3
DBUA_TIMESTAMP POSTUP_BGN        NONE 2025-07-16 22:44:22


TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP CATREQ_BGN             2025-07-16 22:44:22
DBUA_TIMESTAMP CATREQ_BGN    FINISHED 2025-07-16 22:44:22  Container=PTDB Id=3
DBUA_TIMESTAMP CATREQ_BGN        NONE 2025-07-16 22:44:22

sPrvVersion = 12.2.0.1.0 nPrevMajorVer = 12
sRetFunc = ?/rdbms/admin/catupshd.sql
catrequtlmg: utlmmig.sql (bootstrap objects migration) not called
catrequtlmg: Gathering statistics not required returning

TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP CATREQ_END             2025-07-16 22:44:22
DBUA_TIMESTAMP CATREQ_END    FINISHED 2025-07-16 22:44:22  Container=PTDB Id=3
DBUA_TIMESTAMP CATREQ_END        NONE 2025-07-16 22:44:22

catuppst: Dropping library DBMS_DDL_INTERNAL_LIB
catuppst: Dropping view _CURRENT_EDITION_OBJ_MIG
catuppst: Dropping view _CURRENT_EDITION_STUB_MIG
catuppst: Dropping view _ACTUAL_EDITION_OBJ_MIG
catuppst: Dropping view DBA_PART_KEY_COLUMNS_V$_MIG
catuppst: Dropping view DBA_SUBPART_KEY_COLUMNS_V$_MIG
catuppst: Dropping table OBJ$MIG
catuppst: Dropping table USER$MIG
catuppst: Dropping table COL$MIG
catuppst: Dropping table CLU$MIG
catuppst: Dropping table CON$MIG
catuppst: Dropping table BOOTSTRAP$MIG
catuppst: Dropping table TAB$MIG
catuppst: Dropping table TS$MIG
catuppst: Dropping table IND$MIG
catuppst: Dropping table ICOL$MIG
catuppst: Dropping table LOB$MIG
catuppst: Dropping table COLTYPE$MIG
catuppst: Dropping table SUBCOLTYPE$MIG
catuppst: Dropping table NTAB$MIG
catuppst: Dropping table REFCON$MIG
catuppst: Dropping table OPQTYPE$MIG
catuppst: Dropping table ICOLDEP$MIG
catuppst: Dropping table VIEWTRCOL$MIG
catuppst: Dropping table ATTRCOL$MIG
catuppst: Dropping table TYPE_MISC$MIG
catuppst: Dropping table LIBRARY$MIG
catuppst: Dropping table ASSEMBLY$MIG
catuppst: Dropping table TSQ$MIG
catuppst: Dropping table FET$MIG

TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP POSTUP_END             2025-07-16 22:44:22
DBUA_TIMESTAMP POSTUP_END    FINISHED 2025-07-16 22:44:22  Container=PTDB Id=3
DBUA_TIMESTAMP POSTUP_END        NONE 2025-07-16 22:44:22


TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP CATUPPST               2025-07-16 22:44:22
DBUA_TIMESTAMP CATUPPST      FINISHED 2025-07-16 22:44:22  Container=PTDB Id=3
DBUA_TIMESTAMP CATUPPST          NONE 2025-07-16 22:44:22

 

 

3-12. 업그레이드한 신규 db로 사용하기

 

[root@tdb01p][/root]$ vi ~root/.bash_profile
[root@tdb01p][/root]$ cat ~root/.bash_profile | grep -i 19c

export GRID_HOME=/u01/app/19c/grid
export DB_HOME=$ORACLE_BASE/product/19c/db_1

[root@tdb01p][/root]$ vi ~grid/.bash_profile
[root@tdb01p][/root]$ cat ~grid/.bash_profile | grep -i 19c

export GRID_HOME=/u01/app/19c/grid
export DB_HOME=$ORACLE_BASE/product/19c/db_1

[root@tdb01p][/root]$ vi ~oracle/.bash_profile
[root@tdb01p][/root]$ cat ~oracle/.bash_profile | grep -i 19c

export GRID_HOME=/u01/app/19c/grid
export DB_HOME=$ORACLE_BASE/product/19c/db_1


[root@tdb01p][/root]$ vi ~oracle/.bash_profile
[root@tdb01p][/root]$ cat ~oracle/.bash_profile | grep -i ptdb

export ORACLE_UNQNAME=CPTDB #modify
export ORACLE_UNQNAME_LOWER=cptdb #modify
export ORACLE_DBNAME=CPTDB
export ORACLE_DBNAME_LOWER=cptdb
export ORACLE_SID=CPTDB #modify
export ORACLE_SID_LOWER=cptdb #modify

 

[CPTDB:oracle@tdb01p][/home/oracle]$ /u01/app/oracle/product/12c/db_1/bin/srvctl remove database -db ptdb
Remove the database ptdb? (y/[n]) y
[CPTDB:oracle@tdb01p][/home/oracle]$ csrt
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA1.dg
               ONLINE  ONLINE       tdb01p                   STABLE
ora.FRA1.dg
               ONLINE  ONLINE       tdb01p                   STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       tdb01p                   STABLE
ora.asm
               ONLINE  ONLINE       tdb01p                   Started,STABLE
ora.ons
               OFFLINE OFFLINE      tdb01p                   STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cptdb.db
      1        ONLINE  ONLINE       tdb01p                   Open,HOME=/u01/app/o
                                                             racle/product/19c/db
                                                             _1,STABLE
ora.cssd
      1        ONLINE  ONLINE       tdb01p                   STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.evmd
      1        ONLINE  ONLINE       tdb01p                   STABLE
--------------------------------------------------------------------------------

[+ASM:grid@tdb01p][/u01/app/12c/grid/sqlplus/admin]$ cp /u01/app/12c/grid/sqlplus/admin/glogin.sql /u01/app/19c/grid/sqlplus/admin/glogin.sql
[PTDB:oracle@tdb01p][/u01/app/oracle/product/12c/db_1/sqlplus/admin]$ cp /u01/app/oracle/product/12c/db_1/sqlplus/admin/glogin.sql.bak /u01/app/oracle/product/19c/db_1/sqlplus/admin/glogin.sql

 

 

--> 기존에 백업 해둔 파라미터 파일
[CPTDB:oracle@tdb01p][/tmp/backup_before_upgrade]$ cat /tmp/backup_before_upgrade/pfile_PTDB.ora
PTDB.__data_transfer_cache_size=0
PTDB.__db_cache_size=3019898880
PTDB.__inmemory_ext_roarea=0
PTDB.__inmemory_ext_rwarea=0
PTDB.__java_pool_size=16777216
PTDB.__large_pool_size=33554432
PTDB.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
PTDB.__pga_aggregate_target=1694498816
PTDB.__sga_target=5033164800
PTDB.__shared_io_pool_size=201326592
PTDB.__shared_pool_size=805306368
PTDB.__streams_pool_size=0
*._add_col_optim_enabled=FALSE
*._bloom_filter_enabled=FALSE
*._buddy_instance=0
*._cleanup_rollback_entries=2000
*._client_enable_auto_unregister=TRUE
*._clusterwide_global_transactions=FALSE
*._cursor_obsolete_threshold=1024
*._cursor_reload_failure_threshold=5
*._disable_system_state=0
*._dlm_stats_collect=0
*._drop_stat_segment=1
*._emon_send_timeout=10000
*._enable_shared_pool_durations=FALSE
*._fatalprocess_redo_dump_time_limit=0
*._gby_hash_aggregation_enabled=FALSE
*._high_priority_processes='LMS*|LM1*|LM2*|LM3*|LM4*|LM5*|LM6*|LM7*|LM8*|LM9*'
*._highest_priority_processes='VKTM|LG*|LMS*'
*._in_memory_undo=FALSE
*._index_partition_large_extents='FALSE'
*._kks_obsolete_dump_threshold=0
*._kks_parse_error_warning=0
*._memory_imm_mode_without_autosga=TRUE
*._nonfatalprocess_redo_dump_time_limit=0
*._optim_peek_user_binds=FALSE
*._optimizer_adaptive_cursor_sharing=FALSE
*._optimizer_aggr_groupby_elim=FALSE
*._optimizer_connect_by_cost_based=FALSE
*._optimizer_extended_cursor_sharing='NONE'
*._optimizer_extended_cursor_sharing_rel='NONE'
*._optimizer_gather_stats_on_load=FALSE
*._optimizer_null_aware_antijoin=FALSE
*._optimizer_use_feedback=FALSE
*._os_sched_high_priority=1
*._os_sched_highest_priority=1
*._partition_large_extents='FALSE'
*._pga_max_size=1073741824
*._PX_use_large_pool=TRUE
*._report_capture_cycle_time=0
*._rollback_segment_count=1000
*._rowsets_enabled=FALSE
*._securefiles_concurrency_estimate=50
*._sql_plan_directive_mgmt_control=0
*._sys_logon_delay=0
*._undo_autotune=FALSE
*._use_adaptive_log_file_sync='FALSE'
*._use_single_log_writer='TRUE'
*._verify_fg_log_checksum=FALSE
*.audit_file_dest='/u01/app/oracle/admin/PTDB/adump'
*.audit_sys_operations=TRUE
*.audit_trail='OS'
*.compatible='12.2.0'
*.control_file_record_keep_time=15
*.control_files='+DATA1/PTDB2/CONTROLFILE/current.261.1192648461'
*.db_block_size=8192
*.db_cache_size=3207803699
*.db_create_file_dest='+DATA1'
*.db_files=1000
*.db_name='PTDB'
*.deferred_segment_creation=FALSE
*.diagnostic_dest='/u01/app/oracle'
*.disk_asynch_io=TRUE
*.dispatchers='(PROTOCOL=TCP) (SERVICE=PTDBXDB)'
*.enable_ddl_logging=FALSE
*.enable_pluggable_database=FALSE
*.filesystemio_options='SETALL'
*.heat_map='OFF'
*.java_pool_size=167772160
*.large_pool_size=536870912
*.local_listener='(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=tdb01p)(PORT=1521)))'
*.log_archive_dest_1='LOCATION=+FRA1'
*.log_archive_format='%t_%s_%r.ARC'
*.max_string_size='EXTENDED'
*.memory_target=0
*.nls_language='AMERICAN'
*.nls_territory='KOREA'
*.open_cursors=300
*.optimizer_adaptive_plans=FALSE
*.optimizer_adaptive_reporting_only=TRUE
*.optimizer_adaptive_statistics=FALSE
*.optimizer_dynamic_sampling=0
*.optimizer_secure_view_merging=FALSE
*.parallel_force_local=TRUE
*.pga_aggregate_limit=0
*.pga_aggregate_target=1717986918
*.processes=1432
*.remote_login_passwordfile='EXCLUSIVE'
*.resource_limit=TRUE
*.resource_manager_plan='FORCE:'
*.result_cache_max_size=0
*.session_cached_cursors=100
*.sga_max_size=5153960755
*.sga_target=0
*.shared_pool_size=1073741824
*.star_transformation_enabled='FALSE'
*.streams_pool_size=167772160
*.temp_undo_enabled=FALSE
*.undo_tablespace='UNDOTBS1'
*.uniform_log_timestamp_format=FALSE
*.use_large_pages='ONLY'

 

--> 현재 업그레이드한 19c cdb의 파라미터 파일 백업
[2025-07-12:18:24:09][tdb01p]<SYS@CPTDB> create pfile from spfile;

File created.

Elapsed: 00:00:00.04

[CPTDB:oracle@tdb01p][/u01/app/oracle/product/19c/db_1/dbs]$ cat initCPTDB.ora.bak
CPTDB.__data_transfer_cache_size=0
CPTDB.__db_cache_size=385875968
CPTDB.__inmemory_ext_roarea=0
CPTDB.__inmemory_ext_rwarea=0
CPTDB.__java_pool_size=117440512
CPTDB.__large_pool_size=16777216
CPTDB.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
CPTDB.__pga_aggregate_target=536870912
CPTDB.__sga_target=1610612736
CPTDB.__shared_io_pool_size=83886080
CPTDB.__shared_pool_size=973078528
CPTDB.__streams_pool_size=16777216
CPTDB.__unified_pga_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/CPTDB/adump'
*.audit_trail='db'
*.compatible='19.0.0'
*.control_files='+DATA1/CPTDB/CONTROLFILE/current.334.1206401769','+FRA1/CPTDB/CONTROLFILE/current.405.1206401769'
*.db_block_size=8192
*.db_create_file_dest='+DATA1'
*.db_create_online_log_dest_1='+DATA1'
*.db_create_online_log_dest_2='+FRA1'
*.db_name='CPTDB'
*.db_recovery_file_dest='+FRA1'
*.db_recovery_file_dest_size=10240m
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=CPTDBXDB)'
*.enable_pluggable_database=true
*.local_listener='LISTENER_CPTDB'
*.nls_language='AMERICAN'
*.nls_territory='KOREA'
*.open_cursors=300
*.pga_aggregate_target=512m
*.processes=320
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=1536m
*.undo_tablespace='UNDOTBS1'

 

[CPTDB:oracle@tdb01p][/u01/app/oracle/product/19c/db_1/dbs]$ mv /u01/app/oracle/product/19c/db_1/dbs/initCPTDB.ora /u01/app/oracle/product/19c/db_1/dbs/initCPTDB.ora.bak

--> 업그레이드 전 과 업그레이드 후의 파라미터 파일을 참고하여 신규 파라미터 파일 생성

 

[CPTDB:oracle@tdb01p][/u01/app/oracle/product/19c/db_1/dbs]$ vi /u01/app/oracle/product/19c/db_1/dbs/initCPTDB.ora
[CPTDB:oracle@tdb01p][/u01/app/oracle/product/19c/db_1/dbs]$ cat /u01/app/oracle/product/19c/db_1/dbs/initCPTDB.ora
CPTDB.__data_transfer_cache_size=0
CPTDB.__db_cache_size=3019898880
CPTDB.__inmemory_ext_roarea=0
CPTDB.__inmemory_ext_rwarea=0
CPTDB.__java_pool_size=16777216
CPTDB.__large_pool_size=33554432
CPTDB.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
CPTDB.__pga_aggregate_target=1694498816
CPTDB.__sga_target=5033164800
CPTDB.__shared_io_pool_size=201326592
CPTDB.__shared_pool_size=805306368
CPTDB.__streams_pool_size=0
*._add_col_optim_enabled=FALSE
*._bloom_filter_enabled=FALSE
*._buddy_instance=0
*._cleanup_rollback_entries=2000
*._client_enable_auto_unregister=TRUE
*._clusterwide_global_transactions=FALSE
*._cursor_obsolete_threshold=1024
*._cursor_reload_failure_threshold=5
*._disable_system_state=0
*._dlm_stats_collect=0
*._drop_stat_segment=1
*._emon_send_timeout=10000
*._enable_shared_pool_durations=FALSE
*._fatalprocess_redo_dump_time_limit=0
*._gby_hash_aggregation_enabled=FALSE
*._high_priority_processes='LMS*|LM1*|LM2*|LM3*|LM4*|LM5*|LM6*|LM7*|LM8*|LM9*'
*._highest_priority_processes='VKTM|LG*|LMS*'
*._in_memory_undo=FALSE
*._index_partition_large_extents='FALSE'
*._kks_obsolete_dump_threshold=0
*._kks_parse_error_warning=0
*._memory_imm_mode_without_autosga=TRUE
*._nonfatalprocess_redo_dump_time_limit=0
*._optim_peek_user_binds=FALSE
*._optimizer_adaptive_cursor_sharing=FALSE
*._optimizer_aggr_groupby_elim=FALSE
*._optimizer_connect_by_cost_based=FALSE
*._optimizer_extended_cursor_sharing='NONE'
*._optimizer_extended_cursor_sharing_rel='NONE'
*._optimizer_gather_stats_on_load=FALSE
*._optimizer_null_aware_antijoin=FALSE
*._optimizer_use_feedback=FALSE
*._os_sched_high_priority=1
*._os_sched_highest_priority=1
*._partition_large_extents='FALSE'
*._pga_max_size=1073741824
*._PX_use_large_pool=TRUE
*._report_capture_cycle_time=0
*._rollback_segment_count=1000
*._rowsets_enabled=FALSE
*._securefiles_concurrency_estimate=50
*._sql_plan_directive_mgmt_control=0
*._sys_logon_delay=0
*._undo_autotune=FALSE
*._use_adaptive_log_file_sync='FALSE'
*._use_single_log_writer='TRUE'
*._verify_fg_log_checksum=FALSE
*.audit_file_dest='/u01/app/oracle/admin/CPTDB/adump'
*.audit_sys_operations=TRUE
*.audit_trail='OS'
*.compatible='19.0.0'
*.control_file_record_keep_time=15
*.control_files='+DATA1/CPTDB/CONTROLFILE/current.334.1206401769','+FRA1/CPTDB/CONTROLFILE/current.405.1206401769'
*.db_block_size=8192
*.db_cache_size=3207803699
*.db_create_file_dest='+DATA1'
*.db_files=1000
*.db_name='CPTDB'
*.deferred_segment_creation=FALSE
*.diagnostic_dest='/u01/app/oracle'
*.disk_asynch_io=TRUE
*.dispatchers='(PROTOCOL=TCP) (SERVICE=CPTDBXDB)'
*.enable_ddl_logging=FALSE
*.enable_pluggable_database=FALSE
*.filesystemio_options='SETALL'
*.heat_map='OFF'
*.java_pool_size=167772160
*.large_pool_size=536870912
*.local_listener='(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=tdb01p)(PORT=1521)))'
*.log_archive_dest_1='LOCATION=+FRA1'
*.log_archive_format='%t_%s_%r.ARC'
*.max_string_size='EXTENDED'
*.memory_target=0
*.nls_language='AMERICAN'
*.nls_territory='KOREA'
*.open_cursors=300
*.optimizer_adaptive_plans=FALSE
*.optimizer_adaptive_reporting_only=TRUE
*.optimizer_adaptive_statistics=FALSE
*.optimizer_dynamic_sampling=0
*.optimizer_secure_view_merging=FALSE
*.parallel_force_local=TRUE
*.pga_aggregate_limit=0
*.pga_aggregate_target=1717986918
*.processes=1432
*.remote_login_passwordfile='EXCLUSIVE'
*.resource_limit=TRUE
*.resource_manager_plan='FORCE:'
*.result_cache_max_size=0
*.session_cached_cursors=100
*.sga_max_size=5153960755
*.sga_target=0
*.shared_pool_size=1073741824
*.star_transformation_enabled='FALSE'
*.streams_pool_size=167772160
*.temp_undo_enabled=FALSE
*.undo_tablespace='UNDOTBS1'
*.uniform_log_timestamp_format=FALSE
*.use_large_pages='ONLY'
*.enable_pluggable_database=true

[CPTDB:oracle@tdb01p][/u01/app/oracle/product/19c/db_1/dbs]$ ss

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Jul 12 18:31:15 2025
Version 19.27.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.27.0.0.0

[2025-07-12:18:31:16][tdb01p]<SYS@CPTDB> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

[2025-07-12:18:31:16][tdb01p]<SYS@CPTDB> startup nomount pfile='/u01/app/oracle/product/19c/db_1/dbs/initCPTDB.ora';
ORACLE instance started.

Total System Global Area 5184156224 bytes
Fixed Size                  8950336 bytes
Variable Size            1946157056 bytes
Database Buffers         3221225472 bytes
Redo Buffers                7823360 bytes


[25/07/12][tdb01p]<SYS@CPTDB> alter database mount;

Database altered.

Elapsed: 00:00:04.64
[25/07/12][tdb01p]<SYS@CPTDB> alter database open;

Database altered.

Elapsed: 00:00:06.57


[25/07/12][tdb01p]<SYS@CPTDB> create spfile='+DATA1' from pfile='/u01/app/oracle/product/19c/db_1/dbs/initCPTDB.ora';

[25/07/12][tdb01p]<SYS@CPTDB> show parameter spfile;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      +DATA1/CPTDB/PARAMETERFILE/spf
                                                 ile.323.1206297367

 

[2025-07-16:22:54:36][tdb01p]<SYS@CPTDB> show pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       MOUNTED    (NULL)
         3 PTDB                           MOUNTED    (NULL)


[25/07/12][tdb01p]<SYS@CPTDB> alter pluggable database ptdb open;

Pluggable database altered.

Elapsed: 00:00:07.37
[25/07/12][tdb01p]<SYS@CPTDB> alter pluggable database ptdb save state;

Pluggable database altered.

 

 

4. 기존 디비로 원상복구 시키기

 

[CPTDB:oracle@tdb01p][/home/oracle]$ /u01/app/oracle/product/12c/db_1/bin/srvctl add database -db PTDB \
 -dbname PTDB -oraclehome /u01/app/oracle/product/12c/db_1 \
 -pwfile '/u01/app/oracle/product/12c/db_1/dbs/orapwPTDB' \
 -spfile '+DATA1/PTDB/PARAMETERFILE/spfile.273.1192667301' \
 -instance PTDB

 
[CPTDB:oracle@tdb01p][/home/oracle]$ csrt
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA1.dg
               ONLINE  ONLINE       tdb01p                   STABLE
ora.FRA1.dg
               ONLINE  ONLINE       tdb01p                   STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       tdb01p                   STABLE
ora.asm
               ONLINE  ONLINE       tdb01p                   Started,STABLE
ora.ons
               OFFLINE OFFLINE      tdb01p                   STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cptdb.db
      1        ONLINE  ONLINE       tdb01p                   Open,HOME=/u01/app/o
                                                             racle/product/19c/db
                                                             _1,STABLE
ora.cssd
      1        ONLINE  ONLINE       tdb01p                   STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.evmd
      1        ONLINE  ONLINE       tdb01p                   STABLE
ora.ptdb.db
      1        OFFLINE OFFLINE                               STABLE
--------------------------------------------------------------------------------

 

[CPTDB:oracle@tdb01p][/home/oracle]$ srvctl stop database -db cptdb
[CPTDB:oracle@tdb01p][/home/oracle]$ /u01/app/oracle/product/12c/db_1/bin/srvctl start database -db ptdb

[+ASM:grid@tdb01p][/u01/app/19c/grid/dbs]$ lsnrctl status

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 12-JUL-2025 19:04:33

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=tdb01p)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                12-JUL-2025 10:29:34
Uptime                    0 days 8 hr. 34 min. 59 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/19c/grid/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/tdb01p/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=tdb01p)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM", status READY, has 1 handler(s) for this service...
Service "+ASM_DATA1" has 1 instance(s).
  Instance "+ASM", status READY, has 1 handler(s) for this service...
Service "+ASM_FRA1" has 1 instance(s).
  Instance "+ASM", status READY, has 1 handler(s) for this service...
Service "PTDB" has 1 instance(s).
  Instance "PTDB", status READY, has 1 handler(s) for this service...
Service "PTDBXDB" has 1 instance(s).
  Instance "PTDB", status READY, has 1 handler(s) for this service...
The command completed successfully


5. 기존 디비 삭제 (원상 복구 할일 없는 상황)

 

[CPTDB:oracle@tdb01p][/home/oracle]$ /u01/app/oracle/product/12c/db_1/bin/srvctl stop database -db ptdb
[CPTDB:oracle@tdb01p][/home/oracle]$ /u01/app/oracle/product/12c/db_1/bin/srvctl remove database -db ptdb

Remove the database ptdb? (y/[n]) y

[CPTDB:oracle@tdb01p][/home/oracle]$ srvctl start database -db cptdb

[+ASM:grid@tdb01p][/home/grid]$ asmcmd
ASMCMD [+] > lsdg
State    Type    Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512             512   4096  4194304    393208    60124                0           60124              0             N  DATA1/
MOUNTED  EXTERN  N         512             512   4096  4194304    196604   192424                0          192424              0             N  FRA1/

ASMCMD [+] > cd DATA1
ASMCMD [+DATA1] > ls
ASM/
CPTDB/
PTDB/
orapwasm

ASMCMD [+DATA1] > rm -rf PTDB
ASMCMD [+DATA1] > lsdg
State    Type    Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512             512   4096  4194304    393208   224392                0          224392              0             N  DATA1/
MOUNTED  EXTERN  N         512             512   4096  4194304    196604   192424                0          192424              0             N  FRA1/

ASMCMD [+DATA1] > cd ..
ASMCMD [+] > cd +FRA1
ASMCMD [+FRA1] > ls
CPTDB/

PTDB/
ASMCMD [+FRA1] > rm -rf PTDB

 


 

반응형

+ Recent posts