반응형

사전 상태 확인

[oracle@ol7 ~]$ id
uid=54321(oracle) gid=54322(dba) groups=54322(dba) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[oracle@ol7 ~]$ env | grep SID
ORACLE_SID=TST
[oracle@ol7 ~]$
[oracle@ol7 ~]$ ps -ef | grep pmon
oracle    2648     1  0 10:27 ?        00:00:00 ora_pmon_CDBTST
oracle    3044     1  0 10:27 ?        00:00:00 ora_pmon_TST
oracle    3530  2589  0 10:29 pts/0    00:00:00 grep --color=auto pmon
[oracle@ol7 ~]$
[oracle@ol7 ~]$ sqlplus "/as sysdba"

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Oct 5 09:38:22 2022
Version 19.16.0.0.0

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


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

SQL> set linesize 150
SQL> col name for a20
SQL> SELECT dbid, name, db_unique_name, created, log_mode, open_mode, cdb, con_id FROM v$database;

      DBID NAME      DB_UNIQUE_NAME                 CREATED   LOG_MODE     OPEN_MODE            CDB     CON_ID
---------- --------- ------------------------------ --------- ------------ -------------------- --- ----------
2257768950 TST       TST                            28-SEP-22 ARCHIVELOG   READ WRITE           NO           0

SQL>
SQL> select con_id, name, open_mode, dbid, con_uid, guid from v$containers;

    CON_ID NAME                 OPEN_MODE        DBID    CON_UID GUID
---------- -------------------- ---------- ---------- ---------- --------------------------------
         0 TST                  READ WRITE 2257768950          0 E9E0BFB3A630405FE0536538A8C0FB1E

SQL>
SQL> select CON_ID, DBID, GUID, NAME, OPEN_MODE from v$pdbs;

no rows selected

SQL>
SQL> set linesize 150
SQL> col file_name for a50
SQL> select TABLESPACE_NAME, FILE_NAME from dba_data_files;

TABLESPACE_NAME                FILE_NAME
------------------------------ --------------------------------------------------
SYSTEM                         /oradata/system/sytem01.dbf
SYSAUX                         /oradata/system/sysaux01.dbf
UNDOTBS1                       /oradata/system/unotodb01.dbf
USERS                          /oradata/system/user01.dbf
TS_DATA                        /oradata/data/ts_data_01.dbf
TS_IDX                         /oradata/idx/ts_indx_01.dbf

6 rows selected.

SQL>
SQL> select TABLESPACE_NAME, FILE_NAME from dba_temp_files;

TABLESPACE_NAME                FILE_NAME
------------------------------ --------------------------------------------------
TEMP                           /oradata/temp/temp01.dbf

SQL>
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.16.0.0.0
[oracle@ol7 ~]$
[oracle@ol7 ~]$ export ORACLE_SID=CDBTST
[oracle@ol7 ~]$ export ORACLE_UNQNAME=CDBTST
[oracle@ol7 ~]$
[oracle@ol7 ~]$ env | grep ORACLE_SID
ORACLE_SID=CDBTST
[oracle@ol7 ~]$ env | grep ORACLE_UNQNAME
ORACLE_UNQNAME=CDBTST
[oracle@ol7 ~]$
[oracle@ol7 ~]$ sqlplus "/as sysdba"

SQL*Plus: Release 19.0.0.0.0 - Production on Thu Oct 6 11:21:57 2022
Version 19.16.0.0.0

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


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

SQL>
SQL> show con_id

CON_ID
------------------------------
1
SQL>
SQL> show con_name

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

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
SQL>
SQL> set linesize 150
SQL> col name for a20
SQL> SELECT dbid, name, db_unique_name, created, log_mode, open_mode, cdb, con_id FROM v$database;

      DBID NAME                 DB_UNIQUE_NAME                 CREATED   LOG_MODE     OPEN_MODE            CDB     CON_ID
---------- -------------------- ------------------------------ --------- ------------ -------------------- --- ----------
1215054330 CDBTST               CDBTST                         06-OCT-22 NOARCHIVELOG READ WRITE           YES          0

SQL> select CON_ID, DBID, GUID, NAME, OPEN_MODE from v$pdbs;

    CON_ID       DBID GUID                             NAME                 OPEN_MODE
---------- ---------- -------------------------------- -------------------- ----------
         2 3663278307 EA535EAA92860935E0536538A8C09DEC PDB$SEED             READ ONLY

SQL>
SQL> col file_name for a50
SQL> select TABLESPACE_NAME, FILE_NAME from dba_data_files;

TABLESPACE_NAME                FILE_NAME
------------------------------ --------------------------------------------------
SYSTEM                         /oracdbtst/CDBTST/system01.dbf
SYSAUX                         /oracdbtst/CDBTST/sysaux01.dbf
UNDOTBS1                       /oracdbtst/CDBTST/undotbs01.dbf
USERS                          /oracdbtst/CDBTST/users01.dbf

SQL> select TABLESPACE_NAME, FILE_NAME from dba_temp_files;

TABLESPACE_NAME                FILE_NAME
------------------------------ --------------------------------------------------
TEMP                           /oracdbtst/CDBTST/temp01.dbf

SQL>
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.16.0.0.0
[oracle@ol7 ~]$

non-CDB를 PDB로 변환 하기

[oracle@ol7 DATASYNCXML]$ pwd
/home/oracle/DATASYNCXML
[oracle@ol7 DATASYNCXML]$ ls
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$ env | grep SID
ORACLE_SID=TST
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$ sqlplus "/as sysdba"

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Oct 5 09:41:54 2022
Version 19.16.0.0.0

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


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

SQL>
SQL>
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> --Read Only로 Open
SQL> STARTUP OPEN READ ONLY;
ORACLE instance started.

Total System Global Area 1660940992 bytes
Fixed Size                  8897216 bytes
Variable Size            1090519040 bytes
Database Buffers          553648128 bytes
Redo Buffers                7876608 bytes
Database mounted.
Database opened.
SQL>
SQL> BEGIN
  2  DBMS_PDB.DESCRIBE(
  3  pdb_descr_file => '/home/oracle/DATASYNCXML/tst.xml');
  4  end;
  5  /

PL/SQL procedure successfully completed.

SQL> !pwd
/home/oracle/DATASYNCXML

SQL> !ls
tst.xml
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.16.0.0.0
[oracle@ol7 DATASYNCXML]$ exit
logout
[root@ol7 /]# id
uid=0(root) gid=0(root) groups=0(root) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[root@ol7 /]# pwd
/
[root@ol7 /]# mkdir -p /orapdbtst/system /orapdbtst/temp /orapdbtst/data /orapdbtst/idx
[root@ol7 /]# chown -R oracle:dba /orapdbtst
[root@ol7 /]#
[root@ol7 /]# su - oracle
Last login: Wed Oct  5 09:33:30 KST 2022 on pts/0
[oracle@ol7 ~]$ cd DATASYNCXML/
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$ id
uid=54321(oracle) gid=54322(dba) groups=54322(dba) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[oracle@ol7 DATASYNCXML]$ pwd
/home/oracle/DATASYNCXML
[oracle@ol7 DATASYNCXML]$ sqlplus "/as sysdba"

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Oct 5 11:02:13 2022
Version 19.16.0.0.0

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


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

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.16.0.0.0
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$ export ORACLE_SID=CDBTST
[oracle@ol7 DATASYNCXML]$ export ORACLE_UNQNAME=CDBTST
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$ env | grep ORACLE_SID
ORACLE_SID=CDBTST
[oracle@ol7 DATASYNCXML]$ env | grep ORACLE_UNQNAME
ORACLE_UNQNAME=CDBTST
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$ sqlplus "/as sysdba"

SQL*Plus: Release 19.0.0.0.0 - Production on Thu Oct 6 11:28:04 2022
Version 19.16.0.0.0

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


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

SQL> SET SERVEROUTPUT ON;
SQL> DECLARE
  2  compatible CONSTANT VARCHAR2(3) := CASE DBMS_PDB.CHECK_PLUG_COMPATIBILITY(pdb_descr_file => '/home/oracle/DATASYNCXML/tst.xml')
  3  WHEN TRUE THEN 'YES'
  4  ELSE 'NO'
  5  END;
  6  BEGIN
  7  DBMS_OUTPUT.PUT_LINE(compatible);
  8  END;
  9  /
YES

PL/SQL procedure successfully completed.

SQL>
SQL> col cause for a20
SQL> col name for a20
SQL> col message for a35 word_wrapped
SQL> set linesize 150
SQL> select name,cause,type,message,status from PDB_PLUG_IN_VIOLATIONS where name='TST';

NAME                 CAUSE                TYPE      MESSAGE                             STATUS
-------------------- -------------------- --------- ----------------------------------- ---------
TST                  Non-CDB to PDB       WARNING   PDB plugged in is a non-CDB,        PENDING
                                                    requires noncdb_to_pdb.sql be run.

TST                  Parameter            WARNING   CDB parameter processes mismatch:   PENDING
                                                    Previous 150 Current 300


SQL>
SQL> CREATE PLUGGABLE DATABASE PDBTST USING '/home/oracle/DATASYNCXML/tst.xml'
  2  COPY
  3  FILE_NAME_CONVERT = ('/oradata/system/','/orapdbtst/system/',
  4  '/oradata/data/','/orapdbtst/data/',
  5  '/oradata/idx/','/orapdbtst/idx/',
  6  '/oradata/temp/','/orapdbtst/temp/');

Pluggable database created.

SQL>
SQL> show con_name

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

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDBTST                         MOUNTED
SQL>
SQL> ALTER SESSION SET CONTAINER=PDBTST;

Session altered.

SQL> show con_name

CON_NAME
------------------------------
PDBTST
SQL>
SQL> @$ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sql
SQL> SET FEEDBACK 1
~~~~~
PL/SQL procedure successfully completed.

SQL> alter PLUGGABLE database PDBTST close;

Pluggable database altered.

SQL>
SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         3 PDBTST                         MOUNTED
SQL>
SQL>
SQL> ALTER PLUGGABLE DATABASE OPEN;

Pluggable database altered.

SQL>
SQL>
SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         3 PDBTST                         READ WRITE NO
SQL>
SQL> col name for a20
SQL> SELECT name, open_mode FROM v$pdbs;

NAME                 OPEN_MODE
-------------------- ----------
PDBTST               READ WRITE

1 row selected.

SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.16.0.0.0
[oracle@ol7 ~]$

PDB 전환 확인

[oracle@ol7 ~]$ id
uid=54321(oracle) gid=54322(dba) groups=54322(dba) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[oracle@ol7 ~]$ env | grep SID
ORACLE_SID=CDBTST
[oracle@ol7 ~]$
[oracle@ol7 ~]$ sqlplus "/as sysdba"

SQL*Plus: Release 19.0.0.0.0 - Production on Thu Oct 6 14:02:59 2022
Version 19.16.0.0.0

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


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

SQL> show con_name

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

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDBTST                         READ WRITE NO
SQL>
SQL> select USERNAME from dba_users where username='SCOTT';

no rows selected

SQL>
SQL> ALTER SESSION SET CONTAINER=PDBTST;

Session altered.

SQL> show con_name

CON_NAME
------------------------------
PDBTST
SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         3 PDBTST                         READ WRITE NO
SQL> select USERNAME from dba_users where username='SCOTT';

USERNAME
--------------------------------------------------------------------------------
SCOTT

SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.16.0.0.0
[oracle@ol7 ~]$

참고문헌

How to Convert Non-CDB to PDB Database on same local host machine in 12c - Testcase (문서 ID 2012448.1)
반응형
반응형

사전 주요 파일 백업

[oracle@ol7 DATASYNCXML]$ id
uid=54321(oracle) gid=54322(dba) groups=54322(dba) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[oracle@ol7 DATASYNCXML]$ pwd
/home/oracle/DATASYNCXML
[oracle@ol7 DATASYNCXML]$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0.4
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.4.0 Production on Fri Sep 30 13:13:37 2022

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>
SQL> show parameter spfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u01/app/oracle/product/11.2.0.4/dbs/spfileTST.ora
SQL>
SQL> create pfile='/home/oracle/DATASYNCXML/initTST.ora_11g' from spfile;

File created.

SQL> ALTER DATABASE BACKUP CONTROLFILE TO TRACE AS '/home/oracle/DATASYNCXML/TST_cr_controlfile.sql_11g';

Database altered.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ol7 11.2.0.4]$ cd $ORACLE_HOME/network/admin
[oracle@ol7 admin]$ ls
listener.ora  samples  shrept.lst
[oracle@ol7 admin]$ cp *.ora /home/oracle/DATASYNCXML
[oracle@ol7 admin]$ cd $ORACLE_HOME/dbs
[oracle@ol7 dbs]$ ls
hc_TST.dat  init.ora  initTST.ora  lkTST  orapwTST  spfileTST.ora
[oracle@ol7 dbs]$ cp spfileTST.ora /home/oracle/DATASYNCXML/spfileTST.ora_11g
[oracle@ol7 dbs]$ cp orapwTST /home/oracle/DATASYNCXML/orapwTST_11g
[oracle@ol7 dbs]$ cd /home/oracle/DATASYNCXML/
[oracle@ol7 DATASYNCXML]$ ls
initTST.ora_11g  listener.ora  orapwTST_11g  spfileTST.ora_11g  TST_cr_controlfile.sql_11g
[oracle@ol7 DATASYNCXML]$

preupgrade_fixups 수행

[oracle@ol7 DATASYNCXML]$ id
uid=54321(oracle) gid=54322(dba) groups=54322(dba) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[oracle@ol7 DATASYNCXML]$ pwd
/home/oracle/DATASYNCXML
[oracle@ol7 DATASYNCXML]$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0.4
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$ $ORACLE_HOME/jdk/bin/java -jar /u01/app/oracle/product/19.0.0.0/rdbms/admin/preupgrade.jar TERMINAL TEXT
Report generated by Oracle Database Pre-Upgrade Information Tool Version
19.0.0.0.0 Build: 13 on 2022-09-30T14:52:28

Upgrade-To version: 19.0.0.0.0

=======================================
Status of the database prior to upgrade
=======================================
      Database Name:  TST
     Container Name:  Not Applicable in Pre-12.1 database
       Container ID:  Not Applicable in Pre-12.1 database
            Version:  11.2.0.4.0
     DB Patch Level:  PSU 11.2.0.4.201020
         Compatible:  11.2.0.4.0
          Blocksize:  8192
           Platform:  Linux x86 64-bit
      Timezone File:  14
  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
  Oracle Workspace Manager               [to be upgraded]  VALID
  OLAP Analytic Workspace                [to be upgraded]  VALID
  Oracle Enterprise Manager Repository   [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
  Expression Filter                      [to be upgraded]  VALID
  Rule Manager                           [to be upgraded]  VALID
  Oracle OLAP API                        [to be upgraded]  VALID

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

  REQUIRED ACTIONS
  ================
  1.  (AUTOFIXUP) Empty the RECYCLEBIN immediately before database upgrade.

      The database contains 5 objects in the recycle bin.

      The recycle bin must be completely empty before database upgrade.

  RECOMMENDED ACTIONS
  ===================
  2.  Update NUMERIC INITIALIZATION PARAMETERS to meet estimated minimums.
      This action may be done now or when starting the database in upgrade mode
      using the 19 ORACLE HOME.

       Parameter                                 Currently  19 minimum
       ---------                                 ---------  ------------------
       processes                                       150                 300

      The database upgrade process requires certain initialization parameters
      to meet minimum values.  The Oracle upgrade process itself has minimum
      values which may be higher and are marked with an asterisk.  After
      upgrading, those asterisked parameter values may be reset if needed.

  3.  Remove the EM repository.

      - Copy the $ORACLE_HOME/rdbms/admin/emremove.sql script from the target
      19 ORACLE_HOME into the source 11.2.0.4.0 ORACLE_HOME.

      Step 1: If database control is configured, stop EM Database Control,
      using the following command

        $> emctl stop dbconsole

      Step 2: Connect to the database using the SYS account AS SYSDBA

        SET ECHO ON;
        SET SERVEROUTPUT ON;
        @emremove.sql

      Without the set echo and serveroutput commands, you will not be able to
      follow the progress of the script.

      The database has an Enterprise Manager Database Control repository.

      Starting with Oracle Database 12c, the local Enterprise Manager Database
      Control does not exist anymore. The repository will be removed from your
      database during the upgrade.  This step can be manually performed before
      the upgrade to reduce downtime.

  4.  Remove OLAP Catalog by running the 11.2.0.4.0 SQL script
      $ORACLE_HOME/olap/admin/catnoamd.sql script.

      The OLAP Catalog component, AMD, exists in the database.

      Starting with Oracle Database 12c, the OLAP Catalog (OLAP AMD) is
      desupported and will be automatically marked as OPTION OFF during the
      database upgrade if present. Oracle recommends removing OLAP Catalog
      (OLAP AMD) before database upgrade.  This step can be manually performed
      before the upgrade to reduce downtime.

  5.  Upgrade Oracle Application Express (APEX) manually before the database
      upgrade.

      The database contains APEX version 3.2.1.00.12. Upgrade APEX to at least
      version 18.2.0.00.12.

      Starting with Oracle Database Release 18, APEX is not upgraded
      automatically as part of the database upgrade. Refer to My Oracle Support
      Note 1088970.1 for information about APEX installation and upgrades.

  6.  (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 11.2.0.4
      Oracle Database Performance Tuning Guide.

  7.  (AUTOFIXUP) Directly grant ADMINISTER DATABASE TRIGGER privilege to the
      owner of the trigger or drop and re-create the trigger with a user that
      was granted directly with such. You can list those triggers using: SELECT
      OWNER, TRIGGER_NAME FROM DBA_TRIGGERS WHERE
      TRIM(BASE_OBJECT_TYPE)='DATABASE' AND OWNER NOT IN (SELECT GRANTEE FROM
      DBA_SYS_PRIVS WHERE PRIVILEGE='ADMINISTER DATABASE TRIGGER').

      There is one or more database triggers whose owner does not have the
      right privilege on the database.

      The creation of database triggers must be done by users granted with
      ADMINISTER DATABASE TRIGGER privilege. Privilege must have been granted
      directly.

  8.  (AUTOFIXUP) Gather statistics on fixed objects prior to the upgrade using
      the command:

        EXECUTE DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;

      None of the fixed object tables have had stats collected.

      Gathering statistics on fixed objects, if none have been gathered yet, is
      recommended prior to upgrading.

      For information on managing optimizer statistics, refer to the 11.2.0.4
      Oracle Database Performance Tuning Guide.

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

      Component Current     Current     Original    Previous    Component
      CID       Version     Status      Version     Version     Schema
      --------- ----------- ----------- ----------- ----------- -----------
      AMD       11.2.0.4.0  VALID                               OLAPSYS
      APEX      3.2.1.00.12 VALID                               APEX_030200
      APS       11.2.0.4.0  VALID                               SYS
      CATALOG   11.2.0.4.0  VALID                               SYS
      CATJAVA   11.2.0.4.0  VALID                               SYS
      CATPROC   11.2.0.4.0  VALID                               SYS
      CONTEXT   11.2.0.4.0  VALID                               CTXSYS
      EM        11.2.0.4.0  VALID                               SYSMAN
      EXF       11.2.0.4.0  VALID                               EXFSYS
      JAVAVM    11.2.0.4.0  VALID                               SYS
      ORDIM     11.2.0.4.0  VALID                               ORDSYS
      OWB       11.2.0.4.0  VALID                               OWBSYS
      OWM       11.2.0.4.0  VALID                               WMSYS
      RUL       11.2.0.4.0  VALID                               EXFSYS
      SDO       11.2.0.4.0  VALID                               MDSYS
      XDB       11.2.0.4.0  VALID                               XDB
      XML       11.2.0.4.0  VALID                               SYS
      XOQ       11.2.0.4.0  VALID                               SYS

      Review the information before upgrading.

  10. To help you keep track of your tablespace allocations, the following
      AUTOEXTEND tablespaces are expected to successfully EXTEND during the
      upgrade process.

                                                 Min Size
      Tablespace                        Size     For Upgrade
      ----------                     ----------  -----------
      SYSAUX                             600 MB       747 MB
      SYSTEM                             750 MB      1186 MB

      Minimum tablespace sizes for upgrade are estimates.

  11. Run $ORACLE_HOME/rdbms/admin/catnoexf.sql located in the new Oracle
      Database Oracle home to remove both EXF and RUL.

      Expression Filter (EXF) or Rules Manager (RUL) exist in the database.

      Starting with Oracle Database release 12.1, the Expression Filter (EXF)
      and Database Rules Manager (RUL) features are desupported, and are
      removed during the upgrade process.  This step can be manually performed
      before the upgrade to reduce downtime.

  12. Ensure there is additional disk space in LOG_ARCHIVE_DEST_1 for at least
      4950 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  :  /log/arch/

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

  13. 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.

  14. Here is a count of invalid objects by users:

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

      Review the information before upgrading.

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

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

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

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

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

      The database is using time zone file version 14 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.

  16. (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.

  17. 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 11.2.0.4
      Oracle Database Performance Tuning Guide.

  INFORMATION ONLY
  ================
  18. Check the Oracle documentation for the identified components for their
      specific upgrade procedure.

      The database upgrade script will not upgrade the following Oracle
      components:  OLAP Catalog,OWB

      The Oracle database upgrade script upgrades most, but not all Oracle
      Database components that may be installed.  Some components that are not
      upgraded may have their own upgrade scripts, or they may be deprecated or
      obsolete.

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

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


==================
PREUPGRADE SUMMARY
==================
  /u01/app/oracle/cfgtoollogs/TST/preupgrade/preupgrade.log
  /u01/app/oracle/cfgtoollogs/TST/preupgrade/preupgrade_fixups.sql
  /u01/app/oracle/cfgtoollogs/TST/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/TST/preupgrade/preupgrade_fixups.sql

After the upgrade:

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

Preupgrade complete: 2022-09-30T14:52:29
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.4.0 Production on Fri Sep 30 14:57:46 2022

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> @/u01/app/oracle/cfgtoollogs/TST/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:            2022-09-30 14:52:25

For Source Database:     TST
Source Database Version: 11.2.0.4.0
For Upgrade to Version:  19.0.0.0.0

Preup                             Preupgrade
Action                            Issue Is
Number  Preupgrade Check Name     Remedied    Further DBA Action
------  ------------------------  ----------  --------------------------------
    1.  purge_recyclebin          YES         None.
    2.  parameter_min_val         NO          Manual fixup recommended.
    3.  em_present                NO          Manual fixup recommended.
    4.  amd_exists                NO          Manual fixup recommended.
    5.  apex_manual_upgrade       NO          Manual fixup recommended.
    6.  dictionary_stats          YES         None.
    7.  trgowner_no_admndbtrg     YES         None.
    8.  pre_fixed_objects         YES         None.
    9.  component_info            NO          Informational only.
                                              Further action is optional.
   10.  tablespaces_info          NO          Informational only.
                                              Further action is optional.
   11.  exf_rul_exists            NO          Informational only.
                                              Further action is optional.
   12.  min_archive_dest_size     NO          Informational only.
                                              Further action is optional.
   13.  rman_recovery_version     NO          Informational only.
                                              Further action is optional.
   14.  invalid_all_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.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ol7 DATASYNCXML]$

Manual fixup 진행 및 DB Shutdown

[oracle@ol7 DATASYNCXML]$ id
uid=54321(oracle) gid=54322(dba) groups=54322(dba) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[oracle@ol7 DATASYNCXML]$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0.4
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.4.0 Production on Fri Sep 30 15:06:25 2022

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>
SQL> show parameter processes

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
aq_tm_processes                      integer     1
db_writer_processes                  integer     1
gcs_server_processes                 integer     0
global_txn_processes                 integer     1
job_queue_processes                  integer     1000
log_archive_max_processes            integer     4
processes                            integer     150
SQL>
SQL> alter system set processes=300 scope=spfile sid='*';

System altered.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$ cp /u01/app/oracle/product/19.0.0.0/rdbms/admin/emremove.sql $ORACLE_HOME/rdbms/admin/emremove.sql
[oracle@ol7 DATASYNCXML]$ cd $ORACLE_HOME/rdbms/admin/
[oracle@ol7 admin]$ pwd
/u01/app/oracle/product/11.2.0.4/rdbms/admin
[oracle@ol7 admin]$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.4.0 Production on Fri Sep 30 15:12:54 2022

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> SET ECHO ON;
SQL> SET SERVEROUTPUT ON;
SQL> @emremove.sql
SQL> Rem
SQL> Rem $Header: rdbms/admin/emremove.sql /main/5 2017/05/28 22:46:05 stanaya Exp $
SQL> Rem
SQL> Rem emremove.sql
~~~~
Dropping synonym : MGMT$ALERT_CURRENT ...
Dropping synonym : MGMT$ALERT_ANNOTATIONS ...
Dropping synonym : EMD_MNTR ...
Dropping synonym : ECM_UTIL ...
Finished phase 5
Starting phase 6 : Dropping Oracle Enterprise Manager related other roles ...
Process DBSNMP user
Done processing DBSNMP user
Finished phase 6
The Oracle Enterprise Manager related schemas and objects are dropped.
Do the manual steps to studown the DB Control if not done before running this
script and then delete the DB Control configuration files

PL/SQL procedure successfully completed.

SQL>
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ol7 admin]$
[oracle@ol7 admin]$ ls -al catnoamd.sql
-rw-r--r--. 1 oracle dba 11916 Apr 13  2013 catnoamd.sql
[oracle@ol7 admin]$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.4.0 Production on Fri Sep 30 15:23:42 2022

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> @catnoamd.sql

Synonym dropped.
~~~~~~~~~~
Role dropped.


PL/SQL procedure successfully completed.


1 row deleted.

SQL>
SQL> PURGE DBA_RECYCLEBIN ;

DBA Recyclebin purged.

SQL> EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;

PL/SQL procedure successfully completed.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ol7 admin]$

11g 설정 파일을 19c로 복사

[oracle@ol7 ~]$ id
uid=54321(oracle) gid=54322(dba) groups=54322(dba) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[oracle@ol7 ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0.4
[oracle@ol7 ~]$ lsnrctl stop

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 30-SEP-2022 15:28:17

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ol7.localdomain)(PORT=1521)))
The command completed successfully
[oracle@ol7 ~]$ cd DATASYNCXML/
[oracle@ol7 DATASYNCXML]$ ls
initTST.ora_11g  listener.ora  orapwTST_11g  spfileTST.ora_11g  TST_cr_controlfile.sql_11g
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$ export ORACLE_HOME=/u01/app/oracle/product/19.0.0.0/
[oracle@ol7 DATASYNCXML]$ ls
initTST.ora_11g  listener.ora  orapwTST_11g  spfileTST.ora_11g  TST_cr_controlfile.sql_11g
[oracle@ol7 DATASYNCXML]$ cp listener.ora $ORACLE_HOME/network/admin
[oracle@ol7 DATASYNCXML]$ cp spfileTST.ora_11g $ORACLE_HOME/dbs/spfileTST.ora
[oracle@ol7 DATASYNCXML]$ cp orapwTST_11g $ORACLE_HOME/dbs/orapwTST
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$ id
uid=54321(oracle) gid=54322(dba) groups=54322(dba) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[oracle@ol7 DATASYNCXML]$ echo $ORACLE_HOME
/u01/app/oracle/product/19.0.0.0
[oracle@ol7 DATASYNCXML]$ orapwd file=/u01/app/oracle/product/19.0.0.0/dbs/orapwTST force=y format=12

Enter password for SYS:
[oracle@ol7 DATASYNCXML]$ ls -al /u01/app/oracle/product/19.0.0.0/dbs
total 16
drwxr-xr-x.  2 oracle dba   59 Sep 30 15:41 .
drwxr-xr-x. 70 oracle dba 4096 Sep 30 15:40 ..
-rw-r--r--.  1 oracle dba 3079 May 14  2015 init.ora
-rw-r-----.  1 oracle dba 2048 Sep 30 15:41 orapwTST
-rw-r-----.  1 oracle dba 2560 Sep 30 15:31 spfileTST.ora
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$ lsnrctl start

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 30-SEP-2022 15:42:36

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

Starting /u01/app/oracle/product/19.0.0.0/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /u01/app/oracle/product/19.0.0.0/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/ol7/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ol7)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ol7.localdomain)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                30-SEP-2022 15:42:36
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/19.0.0.0/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/ol7/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ol7)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully
[oracle@ol7 DATASYNCXML]$

Oracle DB 19c Upgrade

[oracle@ol7 DATASYNCXML]$ id
uid=54321(oracle) gid=54322(dba) groups=54322(dba) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[oracle@ol7 DATASYNCXML]$ echo $ORACLE_HOME
/u01/app/oracle/product/19.0.0.0
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$ sqlplus "/as sysdba"

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Sep 30 15:43:49 2022
Version 19.16.0.0.0

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

Connected to an idle instance.

SQL> startup upgrade
ORACLE instance started.

Total System Global Area 1660940992 bytes
Fixed Size                  8897216 bytes
Variable Size             956301312 bytes
Database Buffers          687865856 bytes
Redo Buffers                7876608 bytes
Database mounted.
Database opened.
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.16.0.0.0
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$ $ORACLE_HOME/bin/dbupgrade

Argument list for [/u01/app/oracle/product/19.0.0.0/rdbms/admin/catctl.pl]
For Oracle internal use only A = 0
Run in                       c = 0
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 = 0
Priority List Name           L = 0
Upgrade Mode active          M = 0
SQL Process Count            n = 0
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.16.0.0.0DBRU_LINUX.X64_220701]


/u01/app/oracle/product/19.0.0.0/rdbms/admin/orahome = [/u01/app/oracle/product/19.0.0.0]
/u01/app/oracle/product/19.0.0.0/bin/orabasehome = [/u01/app/oracle/product/19.0.0.0]
catctlGetOraBaseLogDir = [/u01/app/oracle/product/19.0.0.0]

Analyzing file /u01/app/oracle/product/19.0.0.0/rdbms/admin/catupgrd.sql

Log file directory = [/tmp/cfgtoollogs/upgrade20220930154446]

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

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

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


Number of Cpus        = 2
Database Name         = TST
DataBase Version      = 11.2.0.4.0
catcon::set_log_file_base_path: ALL catcon-related output will be written to [/u01/app/oracle/product/19.0.0.0/cfgtoollogs/TST/upgrade20220930154447/catupgrd_catcon_11869.lst]

catcon::set_log_file_base_path: catcon: See [/u01/app/oracle/product/19.0.0.0/cfgtoollogs/TST/upgrade20220930154447/catupgrd*.log] files for output generated by scripts

catcon::set_log_file_base_path: catcon: See [/u01/app/oracle/product/19.0.0.0/cfgtoollogs/TST/upgrade20220930154447/catupgrd_*.lst] files for spool files, if any


Log file directory = [/u01/app/oracle/product/19.0.0.0/cfgtoollogs/TST/upgrade20220930154447]

Parallel SQL Process Count            = 4
Components in [TST]
    Installed [APEX APS CATALOG CATJAVA CATPROC CONTEXT JAVAVM ORDIM OWM SDO XDB XML XOQ]
Not Installed [DV EM MGW ODM OLS RAC WK]
DataBase Version      = 11.2.0.4.0

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

------------------------------------------------------
Phases [0-107]         End Time:[2022_09_30 16:11:03]
------------------------------------------------------

Grand Total Time: 1575s

 LOG FILES: (/u01/app/oracle/product/19.0.0.0/cfgtoollogs/TST/upgrade20220930154447/catupgrd*.log)

Upgrade Summary Report Located in:
/u01/app/oracle/product/19.0.0.0/cfgtoollogs/TST/upgrade20220930154447/upg_summary.log

Grand Total Upgrade Time:    [0d:0h:26m:15s]
[oracle@ol7 DATASYNCXML]$

Upgrade 후속 작업 및 Upgrade 확인

[oracle@ol7 DATASYNCXML]$ id
uid=54321(oracle) gid=54322(dba) groups=54322(dba) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[oracle@ol7 DATASYNCXML]$ echo $ORACLE_HOME
/u01/app/oracle/product/19.0.0.0
[oracle@ol7 DATASYNCXML]$ sqlplus "/as sysdba"

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Sep 30 16:14:34 2022
Version 19.16.0.0.0

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

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 1660940992 bytes
Fixed Size                  8897216 bytes
Variable Size            1124073472 bytes
Database Buffers          520093696 bytes
Redo Buffers                7876608 bytes
Database mounted.
Database opened.
SQL>
SQL> @/u01/app/oracle/cfgtoollogs/TST/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.
Executing Oracle POST-Upgrade Fixup Script

Auto-Generated by:       Oracle Preupgrade Script
                         Version: 19.0.0.0.0 Build: 13
Generated on:            2022-09-30 14:52:28

For Source Database:     TST
Source Database Version: 11.2.0.4.0
For Upgrade to Version:  19.0.0.0.0

Preup                             Preupgrade
Action                            Issue Is
Number  Preupgrade Check Name     Remedied    Further DBA Action
------  ------------------------  ----------  --------------------------------
   15.  old_time_zones_exist      NO          Manual fixup recommended.
   16.  post_dictionary           YES         None.
   17.  post_fixed_objects        NO          Informational only.
                                              Further action is optional.
   18.  upg_by_std_upgrd          YES         None.

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>
SQL> select BANNER from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

SQL>
SQL>
SQL>
SQL> SET LINESIZE 400
SQL> COLUMN ACTION_TIME FORMAT A20
SQL> COLUMN ACTION FORMAT A10
SQL> COLUMN STATUS FORMAT A10
SQL> COLUMN DESCRIPTION FORMAT A60
SQL> COLUMN VERSION FORMAT A10
SQL> SELECT TO_CHAR(ACTION_TIME, 'YYYYMMDD HH24:MI:SS') AS ACTION_TIME,ACTION,STATUS,DESCRIPTION,SOURCE_VERSION
  2  ,TARGET_VERSION,PATCH_ID FROM DBA_REGISTRY_SQLPATCH ORDER BY ACTION_TIME;

ACTION_TIME          ACTION     STATUS     DESCRIPTION                                                  SOURCE_VERSION  TARGET_VERSION    PATCH_ID
-------------------- ---------- ---------- ------------------------------------------------------------ --------------- --------------- ----------
20220930 16:08:39    APPLY      SUCCESS    Database Release Update : 19.16.0.0.220719 (34133642)        19.1.0.0.0      19.16.0.0.0       34133642

SQL>
SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /log/arch/
Oldest online log sequence     139
Next log sequence to archive   141
Current log sequence           141
SQL>
SQL>
SQL> show parameter compatible

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
compatible                           string      11.2.0.4.0
noncdb_compatible                    boolean     FALSE
SQL>
SQL>
SQL> alter system set compatible='19.0.0' scope=spfile sid='*';

System altered.

SQL>
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.16.0.0.0
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$ sqlplus "/as sysdba"

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Sep 30 16:46:42 2022
Version 19.16.0.0.0

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

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 1660940992 bytes
Fixed Size                  8897216 bytes
Variable Size            1090519040 bytes
Database Buffers          553648128 bytes
Redo Buffers                7876608 bytes
Database mounted.
Database opened.
SQL>
SQL> show parameter compatible

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
compatible                           string      19.0.0
noncdb_compatible                    boolean     FALSE
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.16.0.0.0
[oracle@ol7 DATASYNCXML]$
반응형
반응형

기존상태 확인

[oracle@ol7 DATASYNCXML]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 29 09:34:42 2022
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> --SPFILE 확인
SQL> show parameter spfile
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /dev/raw/raw9
SQL>
SQL> --Control File 확인
SQL> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
/dev/raw/raw10
/dev/raw/raw11
SQL>
SQL> --Data File 확인
SQL> col FILE_NAME for a30
SQL> select TABLESPACE_NAME, FILE_NAME from dba_data_files;
TABLESPACE_NAME                FILE_NAME
------------------------------ ------------------------------
SYSTEM                         /dev/raw/raw1
SYSAUX                         /dev/raw/raw2
UNDOTBS1                       /dev/raw/raw5
USERS                          /dev/raw/raw4
TS_DATA                        /dev/raw/raw12
TS_IDX                         /dev/raw/raw13
6 rows selected.
SQL>
SQL> --Temp File 확인
SQL> select TABLESPACE_NAME, FILE_NAME from dba_temp_files;
TABLESPACE_NAME                FILE_NAME
------------------------------ ------------------------------
TEMP                           /dev/raw/raw3
SQL>
SQL> --Redo Log 확인
SQL> SET LINESIZE 150
SQL> COLUMN member FORMAT A20
SQL> COLUMN first_change# FORMAT 99999999999999999999
SQL> COLUMN next_change# FORMAT 99999999999999999999
SQL> SELECT l.thread#,
SQL>        lf.group#,
SQL>        lf.member,
SQL>        TRUNC(l.bytes/1024/1024) AS size_mb,
SQL>        l.status,
SQL>        l.archived,
SQL>        lf.type,
SQL>        lf.is_recovery_dest_file AS rdf,
SQL>        l.sequence#,
SQL>        l.first_change#,
SQL>        l.next_change#   
SQL> FROM   v$logfile lf
SQL>        JOIN v$log l ON l.group# = lf.group#
SQL> ORDER BY l.thread#,lf.group#, lf.member;

   THREAD#     GROUP# MEMBER                  SIZE_MB STATUS           ARC TYPE    RDF  SEQUENCE#         FIRST_CHANGE#          NEXT_CHANGE#
---------- ---------- -------------------- ---------- ---------------- --- ------- --- ---------- --------------------- ---------------------
         1          1 /dev/raw/raw6                50 CURRENT          NO  ONLINE  NO          85                818528       281474976710655
         1          2 /dev/raw/raw7                50 INACTIVE         YES ONLINE  NO          83                818196                818419
         1          3 /dev/raw/raw8                50 INACTIVE         YES ONLINE  NO          84                818419                818528

SQL>
SQL> --Archive Log 확인
SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /log/arch/
Oldest online log sequence     83
Next log sequence to archive   85
Current log sequence           85
SQL>
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ol7 DATASYNCXML]$

RMAN를 이용한 Rawdevice를 Filesystem으로 변경 하기

사전 확인 / 주요 파일 백업 DB 종료

[oracle@ol7 DATASYNCXML]$ id
uid=54321(oracle) gid=54322(dba) groups=54322(dba) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[oracle@ol7 DATASYNCXML]$ pwd
/home/oracle/DATASYNCXML
[oracle@ol7 DATASYNCXML]$ ls
[oracle@ol7 DATASYNCXML]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 29 09:54:41 2022
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> --Spfile 백업
SQL> create pfile='/home/oracle/DATASYNCXML/initTST.ora_org' from spfile;
File created.
SQL>
SQL> --Control File 백업
SQL> ALTER DATABASE BACKUP CONTROLFILE TO TRACE AS '/home/oracle/DATASYNCXML/TST_cr_controlfile.sql';
Database altered.
SQL>
SQL> --주요 Table Row수 확인
SQL> select count(*) from scott.big_emp;
  COUNT(*)
----------
   3440640
SQL>
SQL> --SCN Number 확인
SQL> select dbms_flashback.get_system_change_number from dual;
GET_SYSTEM_CHANGE_NUMBER
------------------------
                  819396

SQL>
SQL> --DB 종료
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ol7 DATASYNCXML]$

RMAN으로 Rawdevice를 Filesystem으로 변경 하기(Temp/Redo/Control 제외)

[oracle@ol7 DATASYNCXML]$ id
uid=54321(oracle) gid=54322(dba) groups=54322(dba) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[oracle@ol7 DATASYNCXML]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 29 10:30:54 2022
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> --DB를 Mounut 하기
SQL> startup mount;
ORACLE instance started.
Total System Global Area 1653518336 bytes
Fixed Size                  2253784 bytes
Variable Size            1040190504 bytes
Database Buffers          603979776 bytes
Redo Buffers                7094272 bytes
Database mounted.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Thu Sep 29 10:36:46 2022
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database: TST (DBID=2257768950, not open)
RMAN> run {
2> allocate channel c1 type disk;
3> copy datafile '/dev/raw/raw1' to '/oradata/system/sytem01.dbf';
4> copy datafile '/dev/raw/raw2' to '/oradata/system/sysaux01.dbf';
5> copy datafile '/dev/raw/raw5' to '/oradata/system/unotodb01.dbf';
6> copy datafile '/dev/raw/raw4' to '/oradata/system/user01.dbf';
7> copy datafile '/dev/raw/raw12' to '/oradata/data/ts_data_01.dbf';
8> copy datafile '/dev/raw/raw13' to '/oradata/idx/ts_indx_01.dbf';
9> }
using target database control file instead of recovery catalog
allocated channel: c1
channel c1: SID=133 device type=DISK
Starting backup at 29-SEP-22
channel c1: starting datafile copy
input datafile file number=00001 name=/dev/raw/raw1
output file name=/oradata/system/sytem01.dbf tag=TAG20220929T103806 RECID=1 STAMP=1116671888
channel c1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 29-SEP-22
Starting backup at 29-SEP-22
channel c1: starting datafile copy
input datafile file number=00002 name=/dev/raw/raw2
output file name=/oradata/system/sysaux01.dbf tag=TAG20220929T103809 RECID=2 STAMP=1116671891
channel c1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 29-SEP-22
Starting backup at 29-SEP-22
channel c1: starting datafile copy
input datafile file number=00003 name=/dev/raw/raw5
output file name=/oradata/system/unotodb01.dbf tag=TAG20220929T103812 RECID=3 STAMP=1116671895
channel c1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 29-SEP-22
Starting backup at 29-SEP-22
channel c1: starting datafile copy
input datafile file number=00004 name=/dev/raw/raw4
output file name=/oradata/system/user01.dbf tag=TAG20220929T103815 RECID=4 STAMP=1116671895
channel c1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 29-SEP-22
Starting backup at 29-SEP-22
channel c1: starting datafile copy
input datafile file number=00005 name=/dev/raw/raw12
output file name=/oradata/data/ts_data_01.dbf tag=TAG20220929T103816 RECID=5 STAMP=1116671899
channel c1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 29-SEP-22
Starting backup at 29-SEP-22
channel c1: starting datafile copy
input datafile file number=00006 name=/dev/raw/raw13
output file name=/oradata/idx/ts_indx_01.dbf tag=TAG20220929T103820 RECID=6 STAMP=1116671902
channel c1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 29-SEP-22
released channel: c1
RMAN> exit
Recovery Manager complete.
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 29 10:40:08 2022
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select status from v$instance;
STATUS
------------
MOUNTED
SQL>
SQL> --DBF File Rename
SQL> alter database rename file '/dev/raw/raw1' to '/oradata/system/sytem01.dbf';
Database altered.
SQL> alter database rename file '/dev/raw/raw2' to '/oradata/system/sysaux01.dbf';
Database altered.
SQL> alter database rename file '/dev/raw/raw5' to '/oradata/system/unotodb01.dbf';
Database altered.
SQL> alter database rename file '/dev/raw/raw4' to '/oradata/system/user01.dbf';
Database altered.
SQL> alter database rename file '/dev/raw/raw12' to '/oradata/data/ts_data_01.dbf';
Database altered.
SQL> alter database rename file '/dev/raw/raw13' to '/oradata/idx/ts_indx_01.dbf';
Database altered.
SQL>
SQL> --Database Open
SQL> alter database open;
Database altered.
SQL> select status from v$instance;
STATUS
------------
OPEN
SQL> select count(*) from scott.big_emp;
  COUNT(*)
----------
   3440640
SQL> select dbms_flashback.get_system_change_number from dual;
GET_SYSTEM_CHANGE_NUMBER
------------------------
                  819977
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ol7 DATASYNCXML]$

Temp Tablespace Filesystem으로 생성 및 기존 Raw Device Temp Tablespace 삭제

[oracle@ol7 DATASYNCXML]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 29 10:46:40 2022
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
SQL> --사용자 기본 Temp Tablespace 확인
SQL> select username, TEMPORARY_TABLESPACE from dba_users where ACCOUNT_STATUS='OPEN';
USERNAME                       TEMPORARY_TABLESPACE
------------------------------ ------------------------------
SYSTEM                         TEMP
SYS                            TEMP
SCOTT                          TEMP
SQL>
SQL>  --Temp Tablespace 상태 학인
SQL> col FILE_NAME for a20
SQL> select TABLESPACE_NAME, FILE_NAME from dba_temp_files;
TABLESPACE_NAME                FILE_NAME
------------------------------ --------------------
TEMP                           /dev/raw/raw3
SQL>
SQL> --임시 Temp Tablespace 생성 및 기존 Raw Device Temp Tablespace 삭제
SQL> create temporary tablespace temp2 tempfile '/oradata/temp/imsi01.dbf' size 512m autoextend on;
Tablespace created.
SQL> alter database default temporary tablespace temp2;
Database altered.
SQL> select TABLESPACE_NAME, FILE_NAME from dba_temp_files;
TABLESPACE_NAME                FILE_NAME
------------------------------ ------------------------------
TEMP                           /dev/raw/raw3
TEMP2                          /oradata/temp/imsi01.dbf
SQL> select username, TEMPORARY_TABLESPACE from dba_users where ACCOUNT_STATUS='OPEN';
USERNAME                       TEMPORARY_TABLESPACE
------------------------------ ------------------------------
SYSTEM                         TEMP2
SYS                            TEMP2
SCOTT                          TEMP2
SQL>
SQL> drop tablespace temp;
Tablespace dropped.
SQL> select TABLESPACE_NAME, FILE_NAME from dba_temp_files;
TABLESPACE_NAME                FILE_NAME
------------------------------ ------------------------------
TEMP2                          /oradata/temp/imsi01.dbf
SQL>
SQL> --정식 Temp Tablespace 생성 및 임시 Temp Tablespace 삭제
SQL> create temporary tablespace temp tempfile '/oradata/temp/temp01.dbf' size 512m autoextend on;
Tablespace created.
SQL> alter database default temporary tablespace temp;
Database altered.
SQL> select TABLESPACE_NAME, FILE_NAME from dba_temp_files;
TABLESPACE_NAME                FILE_NAME
------------------------------ ------------------------------
TEMP                           /oradata/temp/temp01.dbf
TEMP2                          /oradata/temp/imsi01.dbf
SQL> select username, TEMPORARY_TABLESPACE from dba_users where ACCOUNT_STATUS='OPEN';
USERNAME                       TEMPORARY_TABLESPACE
------------------------------ ------------------------------
SYSTEM                         TEMP
SYS                            TEMP
SCOTT                          TEMP
SQL>
SQL> drop tablespace TEMP2;
Tablespace dropped.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ol7 DATASYNCXML]$

File system으로 Redolog 생성 및 기존 Raw Device Redolog 삭제

[oracle@ol7 DATASYNCXML]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 29 11:09:32 2022
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
SQL> --현 상태 학인
SQL> SET LINESIZE 150
SQL> COLUMN member FORMAT A50
SQL> SELECT l.thread#, lf.group#, lf.member, l.status, l.archived, lf.type
  2  FROM   v$logfile lf
  3  JOIN v$log l ON l.group# = lf.group#
  4  ORDER BY l.thread#,lf.group#, lf.member;

   THREAD#     GROUP# MEMBER                                             STATUS           ARC TYPE
---------- ---------- -------------------------------------------------- ---------------- --- -------
         1          1 /dev/raw/raw6                                      CURRENT          NO  ONLINE
         1          2 /dev/raw/raw7                                      INACTIVE         YES ONLINE
         1          3 /dev/raw/raw8                                      INACTIVE         YES ONLINE

SQL>
SQL> --임시 Redo Log 생성
SQL> alter database add logfile group 11 '/oradata/redo1/imsi_redo11.log' size 200m;
Database altered.
SQL> alter database add logfile group 12 '/oradata/redo1/imsi_redo12.log' size 200m;
Database altered.
SQL> alter database add logfile group 13 '/oradata/redo1/imsi_redo13.log' size 200m;
Database altered.
SQL> SELECT l.thread#, lf.group#, lf.member, l.status, l.archived, lf.type
  2  FROM   v$logfile lf
  3  JOIN v$log l ON l.group# = lf.group#
  4  ORDER BY l.thread#,lf.group#, lf.member;

   THREAD#     GROUP# MEMBER                                             STATUS           ARC TYPE
---------- ---------- -------------------------------------------------- ---------------- --- -------
         1          1 /dev/raw/raw6                                      CURRENT          NO  ONLINE
         1          2 /dev/raw/raw7                                      INACTIVE         YES ONLINE
         1          3 /dev/raw/raw8                                      INACTIVE         YES ONLINE
         1         11 /oradata/redo1/imsi_redo11.log                     UNUSED           YES ONLINE
         1         12 /oradata/redo1/imsi_redo12.log                     UNUSED           YES ONLINE
         1         13 /oradata/redo1/imsi_redo13.log                     UNUSED           YES ONLINE

6 rows selected.
SQL>
SQL> --기존 Rawdevice Redo Log 삭제
SQL> alter system switch logfile; --3~4회 반복
System altered.
SQL> SELECT l.thread#, lf.group#, lf.member, l.status, l.archived, lf.type
  2  FROM   v$logfile lf
  3  JOIN v$log l ON l.group# = lf.group#
  4  ORDER BY l.thread#,lf.group#, lf.member;
   THREAD#     GROUP# MEMBER                                             STATUS           ARC TYPE
---------- ---------- -------------------------------------------------- ---------------- --- -------
         1          1 /dev/raw/raw6                                      INACTIVE         YES ONLINE
         1          2 /dev/raw/raw7                                      INACTIVE         YES ONLINE
         1          3 /dev/raw/raw8                                      INACTIVE         YES ONLINE
         1         11 /oradata/redo1/imsi_redo11.log                     CURRENT          NO  ONLINE
         1         12 /oradata/redo1/imsi_redo12.log                     INACTIVE         YES ONLINE
         1         13 /oradata/redo1/imsi_redo13.log                     INACTIVE         YES ONLINE

6 rows selected.
SQL>
SQL> --리두로그 상태가 INACTIVE 인 경우만 삭제 가능
SQL> alter database drop logfile group 1;
Database altered.
SQL> alter database drop logfile group 2;
Database altered.
SQL> alter database drop logfile group 3;
Database altered.
SQL> SELECT l.thread#, lf.group#, lf.member, l.status, l.archived, lf.type
  2  FROM   v$logfile lf
  3  JOIN v$log l ON l.group# = lf.group#
  4  ORDER BY l.thread#,lf.group#, lf.member;

   THREAD#     GROUP# MEMBER                                             STATUS           ARC TYPE
---------- ---------- -------------------------------------------------- ---------------- --- -------
         1         11 /oradata/redo1/imsi_redo11.log                     CURRENT          NO  ONLINE
         1         12 /oradata/redo1/imsi_redo12.log                     INACTIVE         YES ONLINE
         1         13 /oradata/redo1/imsi_redo13.log                     INACTIVE         YES ONLINE
SQL>
SQL>
SQL> --정식 Redo log 생성
SQL> alter database add logfile group 1 '/oradata/redo1/redo11.log' size 200m;
Database altered.
SQL> alter database add logfile group 2 '/oradata/redo1/redo12.log' size 200m;
Database altered.
SQL> alter database add logfile group 3 '/oradata/redo1/redo13.log' size 200m;
Database altered.
SQL> SELECT l.thread#, lf.group#, lf.member, l.status, l.archived, lf.type
  2  FROM   v$logfile lf
  3  JOIN v$log l ON l.group# = lf.group#
  4  ORDER BY l.thread#,lf.group#, lf.member;
   THREAD#     GROUP# MEMBER                                             STATUS           ARC TYPE
---------- ---------- -------------------------------------------------- ---------------- --- -------
         1          1 /oradata/redo1/redo11.log                          UNUSED           YES ONLINE
         1          2 /oradata/redo1/redo12.log                          UNUSED           YES ONLINE
         1          3 /oradata/redo1/redo13.log                          UNUSED           YES ONLINE
         1         11 /oradata/redo1/imsi_redo11.log                     CURRENT          NO  ONLINE
         1         12 /oradata/redo1/imsi_redo12.log                     INACTIVE         YES ONLINE
         1         13 /oradata/redo1/imsi_redo13.log                     INACTIVE         YES ONLINE

6 rows selected.
SQL>
SQL> --임시 Redo Log 삭제
SQL> alter system switch logfile; --3~4회 반복
System altered.
SQL> SELECT l.thread#, lf.group#, lf.member, l.status, l.archived, lf.type
  2  FROM   v$logfile lf
  3  JOIN v$log l ON l.group# = lf.group#
  4  ORDER BY l.thread#,lf.group#, lf.member;

   THREAD#     GROUP# MEMBER                                             STATUS           ARC TYPE
---------- ---------- -------------------------------------------------- ---------------- --- -------
         1          1 /oradata/redo1/redo11.log                          INACTIVE         YES ONLINE
         1          2 /oradata/redo1/redo12.log                          CURRENT          NO  ONLINE
         1          3 /oradata/redo1/redo13.log                          INACTIVE         YES ONLINE
         1         11 /oradata/redo1/imsi_redo11.log                     INACTIVE         YES ONLINE
         1         12 /oradata/redo1/imsi_redo12.log                     INACTIVE         YES ONLINE
         1         13 /oradata/redo1/imsi_redo13.log                     INACTIVE         YES ONLINE

6 rows selected.
SQL>
SQL> --리두로그 상태가 INACTIVE 인 경우만 삭제 가능
SQL> alter database drop logfile group 11;
Database altered.
SQL> alter database drop logfile group 12;
Database altered.
SQL> alter database drop logfile group 13;
Database altered.
SQL> SELECT l.thread#, lf.group#, lf.member, l.status, l.archived, lf.type
  2  FROM   v$logfile lf
  3  JOIN v$log l ON l.group# = lf.group#
  4  ORDER BY l.thread#,lf.group#, lf.member;
   THREAD#     GROUP# MEMBER                                             STATUS           ARC TYPE
---------- ---------- -------------------------------------------------- ---------------- --- -------
         1          1 /oradata/redo1/redo11.log                          INACTIVE         YES ONLINE
         1          2 /oradata/redo1/redo12.log                          CURRENT          NO  ONLINE
         1          3 /oradata/redo1/redo13.log                          INACTIVE         YES ONLINE

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ol7 DATASYNCXML]$

Control File/Spfile을 File systemd로 변경 하기

[oracle@ol7 DATASYNCXML]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 29 11:34:55 2022
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> --Control File 상태 확인
SQL> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
/dev/raw/raw10
/dev/raw/raw11
SQL> --DB 중지
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 29 11:37:46 2022
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> --DB NOMOUNT
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 1653518336 bytes
Fixed Size                  2253784 bytes
Variable Size            1040190504 bytes
Database Buffers          603979776 bytes
Redo Buffers                7094272 bytes
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$ --rman을 이용하여 Control File Resotre
[oracle@ol7 DATASYNCXML]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Thu Sep 29 11:40:17 2022
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database: TST (not mounted)
RMAN> restore controlfile to '/oradata/control/control01.ctl' from '/dev/raw/raw10';
Starting restore at 29-SEP-22
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=134 device type=DISK
channel ORA_DISK_1: copied control file copy
Finished restore at 29-SEP-22
RMAN> quit
Recovery Manager complete.
[oracle@ol7 DATASYNCXML]$ --Control File을 다중화를 위해서 복사
[oracle@ol7 DATASYNCXML]$ ls -al /oradata/control/control01.ctl
-rw-r-----. 1 oracle dba 10043392 Sep 29 11:40 /oradata/control/control01.ctl
[oracle@ol7 DATASYNCXML]$ cp /oradata/control/control01.ctl /oradata/control/control02.ctl
[oracle@ol7 DATASYNCXML]$ ls -al /oradata/control/control*
-rw-r-----. 1 oracle dba 10043392 Sep 29 11:40 /oradata/control/control01.ctl
-rw-r-----. 1 oracle dba 10043392 Sep 29 11:41 /oradata/control/control02.ctl
[oracle@ol7 DATASYNCXML]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 29 11:41:23 2022
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> --DB Shutdown
SQL> shutdown immediate
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$ pwd
/home/oracle/DATASYNCXML
[oracle@ol7 DATASYNCXML]$ ls
initTST.ora_org  TST_cr_controlfile.sql
[oracle@ol7 DATASYNCXML]$ cp initTST.ora_org imsiTST.ora
[oracle@ol7 DATASYNCXML]$ vi imsiTST.ora
[oracle@ol7 DATASYNCXML]$ more imsiTST.ora
*.audit_file_dest='/log/dblog/admin/TST/adump'
*.audit_trail='none'
*.compatible='11.2.0.4.0'
#*.control_files='/dev/raw/raw10','/dev/raw/raw11' --주석 처리
*.control_files='/oradata/control/control01.ctl','/oradata/control/control02.ctl' --변경 Control File 추가
*.db_block_size=8192
*.db_domain=''
*.db_name='TST'
*.diagnostic_dest='/log/dblog/'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=TSTXDB)'
*.log_archive_dest_1='location=/log/arch/'
*.log_archive_format='TST_%t_%s_%r.log'
*.memory_target=1645215744
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
[oracle@ol7 DATASYNCXML]$
[oracle@ol7 DATASYNCXML]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 29 11:45:59 2022
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> --임시 Pfile을 이용하여 DB Startup
SQL> startup pfile='/home/oracle/DATASYNCXML/imsiTST.ora';
ORACLE instance started.
Total System Global Area 1653518336 bytes
Fixed Size                  2253784 bytes
Variable Size            1006636072 bytes
Database Buffers          637534208 bytes
Redo Buffers                7094272 bytes
Database mounted.
Database opened.
SQL>
SQL> --Spfile 생성
SQL> create spfile from pfile='/home/oracle/DATASYNCXML/imsiTST.ora';
File created.
SQL> !ls -al /u01/app/oracle/product/11.2.0.4/dbs/sp*
-rw-r-----. 1 oracle dba 2560 Sep 29 11:47 /u01/app/oracle/product/11.2.0.4/dbs/spfileTST.ora
SQL> 
SQL> --DB Restart
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 1653518336 bytes
Fixed Size                  2253784 bytes
Variable Size            1006636072 bytes
Database Buffers          637534208 bytes
Redo Buffers                7094272 bytes
Database mounted.
Database opened.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ol7 DATASYNCXML]$

최종 상태 확인

[oracle@ol7 DATASYNCXML]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 29 11:50:35 2022
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
SQL> --SPFILE 확인
SQL> show parameter spfile
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u01/app/oracle/product/11.2.0.4/dbs/spfileTST.ora
SQL>
SQL> --Control File 확인
SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
/oradata/control/control01.ctl
/oradata/control/control02.ctl
SQL>
SQL> --Data File 확인
SQL> col FILE_NAME for a30
SQL> select TABLESPACE_NAME, FILE_NAME from dba_data_files;
TABLESPACE_NAME                FILE_NAME
------------------------------ ------------------------------
SYSTEM                         /oradata/system/sytem01.dbf
SYSAUX                         /oradata/system/sysaux01.dbf
UNDOTBS1                       /oradata/system/unotodb01.dbf
USERS                          /oradata/system/user01.dbf
TS_DATA                        /oradata/data/ts_data_01.dbf
TS_IDX                         /oradata/idx/ts_indx_01.dbf
6 rows selected.
SQL>
SQL> --Temp File 확인
SQL> select TABLESPACE_NAME, FILE_NAME from dba_temp_files;
TABLESPACE_NAME                FILE_NAME
------------------------------ ------------------------------
TEMP                           /oradata/temp/temp01.dbf
SQL>
SQL> --Redo Log 확인
SQL> SET LINESIZE 200
SQL> COLUMN member FORMAT A50
SQL> COLUMN first_change# FORMAT 99999999999999999999
SQL> COLUMN next_change# FORMAT 99999999999999999999
SQL> SELECT l.thread#,lf.group#,lf.member,TRUNC(l.bytes/1024/1024) AS size_mb,l.status,l.archived,lf.type,
  2  lf.is_recovery_dest_file AS rdf,l.sequence#,l.first_change#,l.next_change#
  3  FROM   v$logfile lf
  4  JOIN v$log l ON l.group# = lf.group#
  5  ORDER BY l.thread#,lf.group#, lf.member;

   THREAD#     GROUP# MEMBER                                                SIZE_MB STATUS           ARC TYPE    RDF  SEQUENCE#         FIRST_CHANGE#          NEXT_CHANGE#
---------- ---------- -------------------------------------------------- ---------- ---------------- --- ------- --- ---------- --------------------- ---------------------
         1          1 /oradata/redo1/redo11.log                                 200 INACTIVE         YES ONLINE  NO         105                822039                822042
         1          2 /oradata/redo1/redo12.log                                 200 CURRENT          NO  ONLINE  NO         106                822042       281474976710655
         1          3 /oradata/redo1/redo13.log                                 200 INACTIVE         YES ONLINE  NO         101                822002                822005

SQL>
SQL> --Archive Log 확인
SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /log/arch/
Oldest online log sequence     101
Next log sequence to archive   106
Current log sequence           106
SQL>
SQL> --주요 Table Row수 확인
SQL> select count(*) from scott.big_emp;
  COUNT(*)
----------
   3440640
SQL>
SQL> --SCN Number 확인
SQL> select dbms_flashback.get_system_change_number from dual;
GET_SYSTEM_CHANGE_NUMBER
------------------------
                  823169
SQL>
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ol7 DATASYNCXML]$

참고문서

Raw Device 에서 File System 으로 데이타파일 변환하기 (문서 ID 1907460.1)

 

반응형

+ Recent posts