Search This Blog

Total Pageviews

Monday, 1 May 2017

Oracle Database 12c release 2 (12.2) preupgrade.jar

preupgrade.jar for Oracle Database 12c release 2 (12.2) 



Oracle Doc Link ....
https://docs.oracle.com/database/122/UPGRD/using-preupgrade-information-tool-for-oracle-database.htm#UPGRD-GUID-C0219AF1-AD43-4097-B358-E53E48958647

About the Pre-Upgrade Information Tool
The Pre-Upgrade Information Tool is revised and enhanced in Oracle Database 12c release 2 (12.2). You must run this tool to check your earlier release 
Oracle Database to determine if it is ready for upgrading to the new release.

preupgrd.sql & utluppkg.sql are deprecated in Oracle Database 12c release 2 (12.2)

Metalink  884522.1 – Download and Run Oracle’s Database Pre-Upgrade Utility



old home = /u01/app/oracle/product/12.1.0.2/db_1
New Home = /u02/app/oracle/product/12.2.0.1/db_1

if required ..
export TWO_TASK=

Command to run ...
[oracle@vbgeneric admin]$ /u01/app/oracle/product/12.1.0.2/db_1/jdk/bin/java -jar /u02/app/oracle/product/12.2.0.1/db_1/rdbms/admin/preupgrade.jar TEXT TERMINAL




Report generated by Oracle Database Pre-Upgrade Information Tool Version
12.2.0.1.0

Upgrade-To version: 12.2.0.1.0

=======================================
Status of the database prior to upgrade
=======================================

      Database Name:  ORCL12C
     Container Name:  CDB$ROOT
       Container ID:  1
            Version:  12.1.0.2.0
         Compatible:  12.1.0.2.0
          Blocksize:  8192
           Platform:  Linux x86 64-bit
      Timezone File:  18
  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
==============

  Run <preupgradeLogDirPath>/preupgrade_fixups_CDB_ROOT.sql to complete all
  of the BEFORE UPGRADE action items below marked with '(AUTOFIXUP)'.

  REQUIRED ACTIONS
  ================
   + Adjust TABLESPACE SIZES as needed.
                                                Auto      12.2.0.1.0
     Tablespace                        Size     Extend    Min Size    Action
     ----------                     ----------  --------  ----------  ------

     SYSAUX                             880 MB  ENABLED       902 MB  None
     SYSTEM                             800 MB  ENABLED      1244 MB  None
     TEMP                               197 MB  DISABLED      150 MB  None
     UNDOTBS2                           100 MB  ENABLED       400 MB  None

     Note that 12.2.0.1.0 minimum sizes are estimates.
     If you plan to upgrade multiple pluggable databases concurrently,
     then you must ensure that the UNDO tablespace size is equal to at least
     the number of pluggable databases that you upgrade concurrently,
     multiplied by that minimum.  Failing to allocate sufficient space can
     cause the upgrade to fail.




   + Update NUMERIC INITIALIZATION PARAMETERS to meet estimated minimums.

     Parameter                         12.2.0.1.0 minimum
     ---------                         ------------------
     memory_target*                            3594518528

     * These minimum memory/pool sizes are recommended for the upgrade process


   + REMOVE the following OBSOLETE initialization parameters.

     Parameter
     ------------------------------
     exclude_seed_cdb_view




   + (AUTOFIXUP) Empty the RECYCLEBIN immediately before database upgrade.

     The database contains 6 objects in the recycle bin.

     The recycle bin must be completely empty before database upgrade.

  RECOMMENDED ACTIONS
  ===================
   + Review and remove any unnecessary HIDDEN/UNDERSCORE parameters.

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

     _catalog_foreign_restore
     _ash_size

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

   + (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.1.0.2
     Oracle Database SQL Tuning Guide.

  INFORMATION ONLY
  ================
   + Ensure there is additional disk space in LOG_ARCHIVE_DEST_1 for at least
     18 GB of archived logs.  Check alert log during the upgrade that there
     is no write error to the destination due to lack of disk space.  Execute
     'archive log list' and query v$archive_dest for more
     LOG_ARCHIVE_DEST_<N> destinations to check.

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

     Archive Log Destination:
      Parameter    :  LOG_ARCHIVE_DEST_1
      Destination  :  /u01/app/oracle/Archive

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

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

  Run <preupgradeLogDirPath>/postupgrade_fixups_CDB_ROOT.sql to complete all
  of the AFTER UPGRADE action items below marked with '(AUTOFIXUP)'.

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

  RECOMMENDED ACTIONS
  ===================
   + Upgrade the database time zone version using the DBMS_DST package.

     The database is using timezone datafile version 18 and the target
     12.2.0.1.0 database ships with timezone datafile version 26.

     Oracle recommends using the most recent timezone data.  For further
     information, refer to My Oracle Support Note 1585343.1.

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




Report generated by Oracle Database Pre-Upgrade Information Tool Version
12.2.0.1.0

Upgrade-To version: 12.2.0.1.0

=======================================
Status of the database prior to upgrade
=======================================

      Database Name:  ORCL12C
     Container Name:  PDB$SEED
       Container ID:  2
            Version:  12.1.0.2.0
         Compatible:  12.1.0.2.0
          Blocksize:  8192
           Platform:  Linux x86 64-bit
      Timezone File:  18
  Database log mode:  ARCHIVELOG
           Readonly:  TRUE
            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
==============

  Run <preupgradeLogDirPath>/preupgrade_fixups_PDB_SEED.sql to complete all
  of the BEFORE UPGRADE action items below marked with '(AUTOFIXUP)'.

  REQUIRED ACTIONS
  ================
   + Adjust TABLESPACE SIZES as needed.
                                                Auto      12.2.0.1.0
     Tablespace                        Size     Extend    Min Size    Action
     ----------                     ----------  --------  ----------  ------

     SYSAUX                             740 MB  DISABLED      716 MB  None
     SYSTEM                             260 MB  ENABLED       696 MB  None
     TEMP                               100 MB  ENABLED       150 MB  None

     Note that 12.2.0.1.0 minimum sizes are estimates.
     If you plan to upgrade multiple pluggable databases concurrently,
     then you must ensure that the UNDO tablespace size is equal to at least
     the number of pluggable databases that you upgrade concurrently,
     multiplied by that minimum.  Failing to allocate sufficient space can
     cause the upgrade to fail.




   + REMOVE the following OBSOLETE initialization parameters.

     Parameter
     ------------------------------
     exclude_seed_cdb_view




  RECOMMENDED ACTIONS
  ===================
   + Run 12.1.0.2.0 $ORACLE_HOME/rdbms/admin/utlrp.sql to recompile invalid
     objects.  You can view the individual invalid objects with

       SET SERVEROUTPUT ON;
       EXECUTE DBMS_PREUP.INVALID_OBJECTS;

     2 objects are INVALID.

     There should be no INVALID objects in SYS/SYSTEM or user schemas before
     database upgrade.

   + Review and remove any unnecessary HIDDEN/UNDERSCORE parameters.

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

     _catalog_foreign_restore
     _ash_size

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

   + (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.1.0.2
     Oracle Database SQL Tuning Guide.

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

  Run <preupgradeLogDirPath>/postupgrade_fixups_PDB_SEED.sql to complete all
  of the AFTER UPGRADE action items below marked with '(AUTOFIXUP)'.

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

  RECOMMENDED ACTIONS
  ===================
   + Upgrade the database time zone version using the DBMS_DST package.

     The database is using timezone datafile version 18 and the target
     12.2.0.1.0 database ships with timezone datafile version 26.

     Oracle recommends using the most recent timezone data.  For further
     information, refer to My Oracle Support Note 1585343.1.

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




Report generated by Oracle Database Pre-Upgrade Information Tool Version
12.2.0.1.0

Upgrade-To version: 12.2.0.1.0

=======================================
Status of the database prior to upgrade
=======================================

      Database Name:  ORCL12C
     Container Name:  ORCL
       Container ID:  3
            Version:  12.1.0.2.0
         Compatible:  12.1.0.2.0
          Blocksize:  8192
           Platform:  Linux x86 64-bit
      Timezone File:  18
  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 Application Express             [to be upgraded]  VALID
  Oracle OLAP API                        [to be upgraded]  VALID


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

  Run <preupgradeLogDirPath>/preupgrade_fixups_ORCL.sql to complete all
  of the BEFORE UPGRADE action items below marked with '(AUTOFIXUP)'.

  REQUIRED ACTIONS
  ================
   + Adjust TABLESPACE SIZES as needed.
                                                Auto      12.2.0.1.0
     Tablespace                        Size     Extend    Min Size    Action
     ----------                     ----------  --------  ----------  ------

     EXAMPLE                           1244 MB  DISABLED     1217 MB  None
     SYSAUX                            1220 MB  ENABLED      2095 MB  None
     SYSTEM                             410 MB  ENABLED       911 MB  None
     TEMP                               197 MB  DISABLED      150 MB  None
     USERS                              150 MB  DISABLED      148 MB  None

     Note that 12.2.0.1.0 minimum sizes are estimates.
     If you plan to upgrade multiple pluggable databases concurrently,
     then you must ensure that the UNDO tablespace size is equal to at least
     the number of pluggable databases that you upgrade concurrently,
     multiplied by that minimum.  Failing to allocate sufficient space can
     cause the upgrade to fail.




   + REMOVE the following OBSOLETE initialization parameters.

     Parameter
     ------------------------------
     exclude_seed_cdb_view




   + (AUTOFIXUP) Empty the RECYCLEBIN immediately before database upgrade.

     The database contains 7 objects in the recycle bin.

     The recycle bin must be completely empty before database upgrade.

   + Set the OPEN_CURSORS initialization parameter to at least 150 before
     upgrading the database.

     The OPEN_CURSORS initialization parameter is set to 50.

     The OPEN_CURSORS initialization parameter must be set to a minimum of
     150 to avoid exceeding number of open cursors during Oracle Application
     Express (APEX) upgrade.

     Note that updating the PFILE/SPFILE will not take effect until the next
     database startup.

  RECOMMENDED ACTIONS
  ===================
   + Run 12.1.0.2.0 $ORACLE_HOME/rdbms/admin/utlrp.sql to recompile invalid
     objects.  You can view the individual invalid objects with

       SET SERVEROUTPUT ON;
       EXECUTE DBMS_PREUP.INVALID_OBJECTS;

     492 objects are INVALID.

     There should be no INVALID objects in SYS/SYSTEM or user schemas before
     database upgrade.

   + Review and remove any unnecessary HIDDEN/UNDERSCORE parameters.

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

     _catalog_foreign_restore
     _ash_size

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

   + (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.1.0.2
     Oracle Database SQL Tuning Guide.

   + Please make sure that all the MVs are refreshed and sys.sumdelta$
     becomes empty before doing upgrade, unless you have strong business
     reasons not to do so. You can use dbms_mview.refresh() to refresh the
     MVs except those stale ones  to be kept due to business need. If there
     are any stale MVs depending on changes in sys.sumdelta$, do not truncate
     it, because doing so will cause wrong results after refresh.

     There is one or more non-fresh MV in the database or sumdelta$ is not
     empty.

     Oracle recommends that all materialized views (MV's) are refreshed
     before upgrading the database because this will clear the MV logs and
     the sumdelta$ table, and make the UPGRADE process faster. If you choose
     to not refresh some MVs, the change data for those MV's will be carried
     through the UPGRADE process. After UPGRADE, you can refresh the MV's and
      MV incremental refresh should work in normal cases.

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

  Run <preupgradeLogDirPath>/postupgrade_fixups_ORCL.sql to complete all
  of the AFTER UPGRADE action items below marked with '(AUTOFIXUP)'.

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

  RECOMMENDED ACTIONS
  ===================
   + If you use the -T option for the database upgrade, then run
     $ORACLE_HOME/rdbms/admin/utluptabdata.sql after the upgrade is complete,
     to VALIDATE and UPGRADE any user tables affected by changes to
     Oracle-Maintained types.

     There are user tables dependent on Oracle-Maintained object types.

     If the -T option is used to set user tablespaces to READ ONLY during the
     upgrade, user tables in those tablespaces, that are dependent on
     Oracle-Maintained types, will not be automatically upgraded. If a type
     is evolved during the upgrade, any dependent tables need to be
     re-validated and upgraded to the latest type version AFTER the database
     upgrade completes.

   + Upgrade the database time zone version using the DBMS_DST package.

     The database is using timezone datafile version 18 and the target
     12.2.0.1.0 database ships with timezone datafile version 26.

     Oracle recommends using the most recent timezone data.  For further
     information, refer to My Oracle Support Note 1585343.1.

   + Patch your APEX software from version 5.0.3.00.03 to at least version
     5.0.4.00.12.

     Your existing version of APEX (5.0.3.00.03) does not require upgrade,
     but may still need manual APEX patching.

     The APEX patching process is not performed by the 12.1.0.2.0 Oracle
     database upgrade.  The APEX version upgrade only ensures that the APEX
     version is upgraded to version 5.0 and does not guarantee the version is
     brought all the way to the patched level 5.0.4.00.12.  If a PDB from
     this CDB is unplugged and plugged into another ROOT, the plugin process
     may require the PDB to be at the patched level 5.0.4.00.12.  That
     patching process, if desired, must be performed manually.  See My Oracle
     Support Note 1088970.1 for more details.

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




Report generated by Oracle Database Pre-Upgrade Information Tool Version
12.2.0.1.0

Upgrade-To version: 12.2.0.1.0

=======================================
Status of the database prior to upgrade
=======================================

      Database Name:  ORCL12C
     Container Name:  ORDS
       Container ID:  4
            Version:  12.1.0.2.0
         Compatible:  12.1.0.2.0
          Blocksize:  8192
           Platform:  Linux x86 64-bit
      Timezone File:  18
  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
==============

  Run <preupgradeLogDirPath>/preupgrade_fixups_ORDS.sql to complete all
  of the BEFORE UPGRADE action items below marked with '(AUTOFIXUP)'.

  REQUIRED ACTIONS
  ================
   + Adjust TABLESPACE SIZES as needed.
                                                Auto      12.2.0.1.0
     Tablespace                        Size     Extend    Min Size    Action
     ----------                     ----------  --------  ----------  ------

     SYSAUX                             740 MB  DISABLED      724 MB  None
     SYSTEM                             260 MB  ENABLED       699 MB  None
     TEMP                                20 MB  ENABLED       150 MB  None

     Note that 12.2.0.1.0 minimum sizes are estimates.
     If you plan to upgrade multiple pluggable databases concurrently,
     then you must ensure that the UNDO tablespace size is equal to at least
     the number of pluggable databases that you upgrade concurrently,
     multiplied by that minimum.  Failing to allocate sufficient space can
     cause the upgrade to fail.




   + REMOVE the following OBSOLETE initialization parameters.

     Parameter
     ------------------------------
     exclude_seed_cdb_view




   + (AUTOFIXUP) Empty the RECYCLEBIN immediately before database upgrade.

     The database contains 7 objects in the recycle bin.

     The recycle bin must be completely empty before database upgrade.

  RECOMMENDED ACTIONS
  ===================
   + Run 12.1.0.2.0 $ORACLE_HOME/rdbms/admin/utlrp.sql to recompile invalid
     objects.  You can view the individual invalid objects with

       SET SERVEROUTPUT ON;
       EXECUTE DBMS_PREUP.INVALID_OBJECTS;

     2 objects are INVALID.

     There should be no INVALID objects in SYS/SYSTEM or user schemas before
     database upgrade.

   + Review and remove any unnecessary HIDDEN/UNDERSCORE parameters.

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

     _catalog_foreign_restore
     _ash_size

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

   + (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.1.0.2
     Oracle Database SQL Tuning Guide.

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

  Run <preupgradeLogDirPath>/postupgrade_fixups_ORDS.sql to complete all
  of the AFTER UPGRADE action items below marked with '(AUTOFIXUP)'.

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

  RECOMMENDED ACTIONS
  ===================
   + Upgrade the database time zone version using the DBMS_DST package.

     The database is using timezone datafile version 18 and the target
     12.2.0.1.0 database ships with timezone datafile version 26.

     Oracle recommends using the most recent timezone data.  For further
     information, refer to My Oracle Support Note 1585343.1.

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




Report generated by Oracle Database Pre-Upgrade Information Tool Version
12.2.0.1.0

Upgrade-To version: 12.2.0.1.0

=======================================
Status of the database prior to upgrade
=======================================

      Database Name:  ORCL12C
     Container Name:  ANUJ
       Container ID:  5
            Version:  12.1.0.2.0
         Compatible:  12.1.0.2.0
          Blocksize:  8192
           Platform:  Linux x86 64-bit
      Timezone File:  18
  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
==============

  Run <preupgradeLogDirPath>/preupgrade_fixups_ANUJ.sql to complete all
  of the BEFORE UPGRADE action items below marked with '(AUTOFIXUP)'.

  REQUIRED ACTIONS
  ================
   + Adjust TABLESPACE SIZES as needed.
                                                Auto      12.2.0.1.0
     Tablespace                        Size     Extend    Min Size    Action
     ----------                     ----------  --------  ----------  ------

     SYSAUX                             740 MB  DISABLED      722 MB  None
     SYSTEM                             260 MB  ENABLED       697 MB  None
     TEMP                                20 MB  ENABLED       150 MB  None

     Note that 12.2.0.1.0 minimum sizes are estimates.
     If you plan to upgrade multiple pluggable databases concurrently,
     then you must ensure that the UNDO tablespace size is equal to at least
     the number of pluggable databases that you upgrade concurrently,
     multiplied by that minimum.  Failing to allocate sufficient space can
     cause the upgrade to fail.




   + REMOVE the following OBSOLETE initialization parameters.

     Parameter
     ------------------------------
     exclude_seed_cdb_view




   + (AUTOFIXUP) Empty the RECYCLEBIN immediately before database upgrade.

     The database contains 2 objects in the recycle bin.

     The recycle bin must be completely empty before database upgrade.

  RECOMMENDED ACTIONS
  ===================
   + Run 12.1.0.2.0 $ORACLE_HOME/rdbms/admin/utlrp.sql to recompile invalid
     objects.  You can view the individual invalid objects with

       SET SERVEROUTPUT ON;
       EXECUTE DBMS_PREUP.INVALID_OBJECTS;

     2 objects are INVALID.

     There should be no INVALID objects in SYS/SYSTEM or user schemas before
     database upgrade.

   + Review and remove any unnecessary HIDDEN/UNDERSCORE parameters.

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

     _catalog_foreign_restore
     _ash_size

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

   + (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.1.0.2
     Oracle Database SQL Tuning Guide.

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

  Run <preupgradeLogDirPath>/postupgrade_fixups_ANUJ.sql to complete all
  of the AFTER UPGRADE action items below marked with '(AUTOFIXUP)'.

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

  RECOMMENDED ACTIONS
  ===================
   + Upgrade the database time zone version using the DBMS_DST package.

     The database is using timezone datafile version 18 and the target
     12.2.0.1.0 database ships with timezone datafile version 26.

     Oracle recommends using the most recent timezone data.  For further
     information, refer to My Oracle Support Note 1585343.1.

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




Report generated by Oracle Database Pre-Upgrade Information Tool Version
12.2.0.1.0

Upgrade-To version: 12.2.0.1.0

=======================================
Status of the database prior to upgrade
=======================================

      Database Name:  ORCL12C
     Container Name:  VIHAAN
       Container ID:  6
            Version:  12.1.0.2.0
         Compatible:  12.1.0.2.0
          Blocksize:  8192
           Platform:  Linux x86 64-bit
      Timezone File:  18
  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
==============

  Run <preupgradeLogDirPath>/preupgrade_fixups_VIHAAN.sql to complete all
  of the BEFORE UPGRADE action items below marked with '(AUTOFIXUP)'.

  REQUIRED ACTIONS
  ================
   + Adjust TABLESPACE SIZES as needed.
                                                Auto      12.2.0.1.0
     Tablespace                        Size     Extend    Min Size    Action
     ----------                     ----------  --------  ----------  ------

     SYSAUX                             740 MB  DISABLED      721 MB  None
     SYSTEM                             260 MB  ENABLED       697 MB  None
     TEMP                                20 MB  ENABLED       150 MB  None

     Note that 12.2.0.1.0 minimum sizes are estimates.
     If you plan to upgrade multiple pluggable databases concurrently,
     then you must ensure that the UNDO tablespace size is equal to at least
     the number of pluggable databases that you upgrade concurrently,
     multiplied by that minimum.  Failing to allocate sufficient space can
     cause the upgrade to fail.




   + REMOVE the following OBSOLETE initialization parameters.

     Parameter
     ------------------------------
     exclude_seed_cdb_view




   + (AUTOFIXUP) Empty the RECYCLEBIN immediately before database upgrade.

     The database contains 1 objects in the recycle bin.

     The recycle bin must be completely empty before database upgrade.

  RECOMMENDED ACTIONS
  ===================
   + Run 12.1.0.2.0 $ORACLE_HOME/rdbms/admin/utlrp.sql to recompile invalid
     objects.  You can view the individual invalid objects with

       SET SERVEROUTPUT ON;
       EXECUTE DBMS_PREUP.INVALID_OBJECTS;

     2 objects are INVALID.

     There should be no INVALID objects in SYS/SYSTEM or user schemas before
     database upgrade.

   + Review and remove any unnecessary HIDDEN/UNDERSCORE parameters.

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

     _catalog_foreign_restore
     _ash_size

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

   + (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.1.0.2
     Oracle Database SQL Tuning Guide.

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

  Run <preupgradeLogDirPath>/postupgrade_fixups_VIHAAN.sql to complete all
  of the AFTER UPGRADE action items below marked with '(AUTOFIXUP)'.

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

  RECOMMENDED ACTIONS
  ===================
   + Upgrade the database time zone version using the DBMS_DST package.

     The database is using timezone datafile version 18 and the target
     12.2.0.1.0 database ships with timezone datafile version 26.

     Oracle recommends using the most recent timezone data.  For further
     information, refer to My Oracle Support Note 1585343.1.

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




Report generated by Oracle Database Pre-Upgrade Information Tool Version
12.2.0.1.0

Upgrade-To version: 12.2.0.1.0

=======================================
Status of the database prior to upgrade
=======================================

      Database Name:  ORCL12C
     Container Name:  ORCLDP
       Container ID:  7
            Version:  12.1.0.2.0
         Compatible:  12.1.0.2.0
          Blocksize:  8192
           Platform:  Linux x86 64-bit
      Timezone File:  18
  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 Application Express             [to be upgraded]  VALID
  Oracle OLAP API                        [to be upgraded]  VALID


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

  Run <preupgradeLogDirPath>/preupgrade_fixups_ORCLDP.sql to complete all
  of the BEFORE UPGRADE action items below marked with '(AUTOFIXUP)'.

  REQUIRED ACTIONS
  ================
   + Adjust TABLESPACE SIZES as needed.
                                                Auto      12.2.0.1.0
     Tablespace                        Size     Extend    Min Size    Action
     ----------                     ----------  --------  ----------  ------

     EXAMPLE                           1244 MB  DISABLED     1217 MB  None
     SYSAUX                            1220 MB  ENABLED      2095 MB  None
     SYSTEM                             410 MB  ENABLED       911 MB  None
     TEMP                                20 MB  ENABLED       150 MB  None
     USERS                              150 MB  DISABLED      148 MB  None

     Note that 12.2.0.1.0 minimum sizes are estimates.
     If you plan to upgrade multiple pluggable databases concurrently,
     then you must ensure that the UNDO tablespace size is equal to at least
     the number of pluggable databases that you upgrade concurrently,
     multiplied by that minimum.  Failing to allocate sufficient space can
     cause the upgrade to fail.




   + REMOVE the following OBSOLETE initialization parameters.

     Parameter
     ------------------------------
     exclude_seed_cdb_view




   + (AUTOFIXUP) Empty the RECYCLEBIN immediately before database upgrade.

     The database contains 7 objects in the recycle bin.

     The recycle bin must be completely empty before database upgrade.

   + Set the OPEN_CURSORS initialization parameter to at least 150 before
     upgrading the database.

     The OPEN_CURSORS initialization parameter is set to 50.

     The OPEN_CURSORS initialization parameter must be set to a minimum of
     150 to avoid exceeding number of open cursors during Oracle Application
     Express (APEX) upgrade.

     Note that updating the PFILE/SPFILE will not take effect until the next
     database startup.

  RECOMMENDED ACTIONS
  ===================
   + Run 12.1.0.2.0 $ORACLE_HOME/rdbms/admin/utlrp.sql to recompile invalid
     objects.  You can view the individual invalid objects with

       SET SERVEROUTPUT ON;
       EXECUTE DBMS_PREUP.INVALID_OBJECTS;

     492 objects are INVALID.

     There should be no INVALID objects in SYS/SYSTEM or user schemas before
     database upgrade.

   + Review and remove any unnecessary HIDDEN/UNDERSCORE parameters.

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

     _catalog_foreign_restore
     _ash_size

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

   + (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.1.0.2
     Oracle Database SQL Tuning Guide.

   + Please make sure that all the MVs are refreshed and sys.sumdelta$
     becomes empty before doing upgrade, unless you have strong business
     reasons not to do so. You can use dbms_mview.refresh() to refresh the
     MVs except those stale ones  to be kept due to business need. If there
     are any stale MVs depending on changes in sys.sumdelta$, do not truncate
     it, because doing so will cause wrong results after refresh.

     There is one or more non-fresh MV in the database or sumdelta$ is not
     empty.

     Oracle recommends that all materialized views (MV's) are refreshed
     before upgrading the database because this will clear the MV logs and
     the sumdelta$ table, and make the UPGRADE process faster. If you choose
     to not refresh some MVs, the change data for those MV's will be carried
     through the UPGRADE process. After UPGRADE, you can refresh the MV's and
      MV incremental refresh should work in normal cases.

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

  Run <preupgradeLogDirPath>/postupgrade_fixups_ORCLDP.sql to complete all
  of the AFTER UPGRADE action items below marked with '(AUTOFIXUP)'.

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

  RECOMMENDED ACTIONS
  ===================
   + If you use the -T option for the database upgrade, then run
     $ORACLE_HOME/rdbms/admin/utluptabdata.sql after the upgrade is complete,
     to VALIDATE and UPGRADE any user tables affected by changes to
     Oracle-Maintained types.

     There are user tables dependent on Oracle-Maintained object types.

     If the -T option is used to set user tablespaces to READ ONLY during the
     upgrade, user tables in those tablespaces, that are dependent on
     Oracle-Maintained types, will not be automatically upgraded. If a type
     is evolved during the upgrade, any dependent tables need to be
     re-validated and upgraded to the latest type version AFTER the database
     upgrade completes.

   + Upgrade the database time zone version using the DBMS_DST package.

     The database is using timezone datafile version 18 and the target
     12.2.0.1.0 database ships with timezone datafile version 26.

     Oracle recommends using the most recent timezone data.  For further
     information, refer to My Oracle Support Note 1585343.1.

   + Patch your APEX software from version 5.0.3.00.03 to at least version
     5.0.4.00.12.

     Your existing version of APEX (5.0.3.00.03) does not require upgrade,
     but may still need manual APEX patching.

     The APEX patching process is not performed by the 12.1.0.2.0 Oracle
     database upgrade.  The APEX version upgrade only ensures that the APEX
     version is upgraded to version 5.0 and does not guarantee the version is
     brought all the way to the patched level 5.0.4.00.12.  If a PDB from
     this CDB is unplugged and plugged into another ROOT, the plugin process
     may require the PDB to be at the patched level 5.0.4.00.12.  That
     patching process, if desired, must be performed manually.  See My Oracle
     Support Note 1088970.1 for more details.

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




Preupgrade generated files:
    /u01/app/oracle/cfgtoollogs/orcl12c/preupgrade/preupgrade_fixups.sql
    /u01/app/oracle/cfgtoollogs/orcl12c/preupgrade/postupgrade_fixups.sql




[oracle@vbgeneric admin]$ ls -ltr /u01/app/oracle/cfgtoollogs/orcl12c/preupgrade/*fix*.sql
-rw-r--r-- 1 oracle oinstall  6201 May  1 08:20 /u01/app/oracle/cfgtoollogs/orcl12c/preupgrade/preupgrade_fixups_CDB_ROOT.sql
-rw-r--r-- 1 oracle oinstall  5549 May  1 08:20 /u01/app/oracle/cfgtoollogs/orcl12c/preupgrade/postupgrade_fixups_CDB_ROOT.sql
-rw-r--r-- 1 oracle oinstall  5070 May  1 08:21 /u01/app/oracle/cfgtoollogs/orcl12c/preupgrade/preupgrade_fixups_PDB_SEED.sql
-rw-r--r-- 1 oracle oinstall  5549 May  1 08:21 /u01/app/oracle/cfgtoollogs/orcl12c/preupgrade/postupgrade_fixups_PDB_SEED.sql
-rw-r--r-- 1 oracle oinstall  8230 May  1 08:21 /u01/app/oracle/cfgtoollogs/orcl12c/preupgrade/preupgrade_fixups_ORCL.sql
-rw-r--r-- 1 oracle oinstall  8112 May  1 08:21 /u01/app/oracle/cfgtoollogs/orcl12c/preupgrade/postupgrade_fixups_ORCL.sql
-rw-r--r-- 1 oracle oinstall  5737 May  1 08:21 /u01/app/oracle/cfgtoollogs/orcl12c/preupgrade/preupgrade_fixups_ORDS.sql
-rw-r--r-- 1 oracle oinstall  5533 May  1 08:21 /u01/app/oracle/cfgtoollogs/orcl12c/preupgrade/postupgrade_fixups_ORDS.sql
-rw-r--r-- 1 oracle oinstall  5737 May  1 08:21 /u01/app/oracle/cfgtoollogs/orcl12c/preupgrade/preupgrade_fixups_ANUJ.sql
-rw-r--r-- 1 oracle oinstall  5533 May  1 08:21 /u01/app/oracle/cfgtoollogs/orcl12c/preupgrade/postupgrade_fixups_ANUJ.sql
-rw-r--r-- 1 oracle oinstall  5745 May  1 08:21 /u01/app/oracle/cfgtoollogs/orcl12c/preupgrade/preupgrade_fixups_VIHAAN.sql
-rw-r--r-- 1 oracle oinstall  5541 May  1 08:21 /u01/app/oracle/cfgtoollogs/orcl12c/preupgrade/postupgrade_fixups_VIHAAN.sql
-rw-r--r-- 1 oracle oinstall  8238 May  1 08:22 /u01/app/oracle/cfgtoollogs/orcl12c/preupgrade/preupgrade_fixups_ORCLDP.sql
-rw-r--r-- 1 oracle oinstall  8120 May  1 08:22 /u01/app/oracle/cfgtoollogs/orcl12c/preupgrade/postupgrade_fixups_ORCLDP.sql
-rw-r--r-- 1 oracle oinstall 34965 May  1 08:22 /u01/app/oracle/cfgtoollogs/orcl12c/preupgrade/preupgrade_fixups.sql
-rw-r--r-- 1 oracle oinstall 24858 May  1 08:22 /u01/app/oracle/cfgtoollogs/orcl12c/preupgrade/postupgrade_fixups.sql



**********************************

For Out put in Dir 

[oracle@vbgeneric Upgrade]$ /u01/app/oracle/product/12.1.0.2/db_1/jdk/bin/java -jar /u02/app/oracle/product/12.2.0.1/db_1/rdbms/admin/preupgrade.jar FILE DIR /tmp/Upgrade


Preupgrade generated files:
    /tmp/Upgrade/preupgrade.log
    /tmp/Upgrade/preupgrade_fixups.sql
    /tmp/Upgrade/postupgrade_fixups.sql



[oracle@vbgeneric Upgrade]$ ls -ltr /tmp/Upgrade/*.*
-rw-r--r-- 1 oracle oinstall   5373 May  1 08:32 /tmp/Upgrade/dbms_registry_basic.sql
-rw-r--r-- 1 oracle oinstall  12693 May  1 08:32 /tmp/Upgrade/dbms_registry_extended.sql
-rw-r--r-- 1 oracle oinstall   7027 May  1 08:32 /tmp/Upgrade/preupgrade_driver.sql
-rw-r--r-- 1 oracle oinstall 390244 May  1 08:32 /tmp/Upgrade/preupgrade_package.sql
-rw-r--r-- 1 oracle oinstall  60144 May  1 08:32 /tmp/Upgrade/preupgrade_messages.properties
-rw-r--r-- 1 oracle oinstall    400 May  1 08:32 /tmp/Upgrade/dir_preUpgrade_catCon_catcon_14209.lst
-rw-r--r-- 1 oracle oinstall   7377 May  1 08:32 /tmp/Upgrade/dir_preUpgrade_catCon0.log
-rw-r--r-- 1 oracle oinstall   5617 May  1 08:32 /tmp/Upgrade/dir_preUpgrade_catCon1.log
-rw-r--r-- 1 oracle oinstall   6201 May  1 08:32 /tmp/Upgrade/preupgrade_fixups_CDB_ROOT.sql
-rw-r--r-- 1 oracle oinstall   5549 May  1 08:32 /tmp/Upgrade/postupgrade_fixups_CDB_ROOT.sql
-rw-r--r-- 1 oracle oinstall   6779 May  1 08:32 /tmp/Upgrade/preupgrade_CDB_ROOT.log
-rw-r--r-- 1 oracle oinstall   5070 May  1 08:32 /tmp/Upgrade/preupgrade_fixups_PDB_SEED.sql
-rw-r--r-- 1 oracle oinstall   5549 May  1 08:32 /tmp/Upgrade/postupgrade_fixups_PDB_SEED.sql
-rw-r--r-- 1 oracle oinstall   5714 May  1 08:32 /tmp/Upgrade/preupgrade_PDB_SEED.log
-rw-r--r-- 1 oracle oinstall   8230 May  1 08:32 /tmp/Upgrade/preupgrade_fixups_ORCL.sql
-rw-r--r-- 1 oracle oinstall   8112 May  1 08:32 /tmp/Upgrade/postupgrade_fixups_ORCL.sql
-rw-r--r-- 1 oracle oinstall   9119 May  1 08:32 /tmp/Upgrade/preupgrade_ORCL.log
-rw-r--r-- 1 oracle oinstall   5737 May  1 08:33 /tmp/Upgrade/preupgrade_fixups_ORDS.sql
-rw-r--r-- 1 oracle oinstall   5533 May  1 08:33 /tmp/Upgrade/postupgrade_fixups_ORDS.sql
-rw-r--r-- 1 oracle oinstall   5921 May  1 08:33 /tmp/Upgrade/preupgrade_ORDS.log
-rw-r--r-- 1 oracle oinstall   5737 May  1 08:33 /tmp/Upgrade/preupgrade_fixups_ANUJ.sql
-rw-r--r-- 1 oracle oinstall   5533 May  1 08:33 /tmp/Upgrade/postupgrade_fixups_ANUJ.sql
-rw-r--r-- 1 oracle oinstall   5921 May  1 08:33 /tmp/Upgrade/preupgrade_ANUJ.log
-rw-r--r-- 1 oracle oinstall   5745 May  1 08:33 /tmp/Upgrade/preupgrade_fixups_VIHAAN.sql
-rw-r--r-- 1 oracle oinstall   5541 May  1 08:33 /tmp/Upgrade/postupgrade_fixups_VIHAAN.sql
-rw-r--r-- 1 oracle oinstall   5927 May  1 08:33 /tmp/Upgrade/preupgrade_VIHAAN.log
-rw-r--r-- 1 oracle oinstall   8238 May  1 08:33 /tmp/Upgrade/preupgrade_fixups_ORCLDP.sql
-rw-r--r-- 1 oracle oinstall   8120 May  1 08:33 /tmp/Upgrade/postupgrade_fixups_ORCLDP.sql
-rw-r--r-- 1 oracle oinstall   9125 May  1 08:33 /tmp/Upgrade/preupgrade_ORCLDP.log
-rw-r--r-- 1 oracle oinstall  25444 May  1 08:33 /tmp/Upgrade/execPreUpgrade_catCon0.log
-rw-r--r-- 1 oracle oinstall  19536 May  1 08:33 /tmp/Upgrade/execPreUpgrade_catCon1.log
-rw-r--r-- 1 oracle oinstall  49434 May  1 08:33 /tmp/Upgrade/execPreUpgrade_catCon_catcon_14339.lst
-rw-r--r-- 1 oracle oinstall  48506 May  1 08:33 /tmp/Upgrade/preupgrade.log
-rw-r--r-- 1 oracle oinstall  34965 May  1 08:33 /tmp/Upgrade/preupgrade_fixups.sql
-rw-r--r-- 1 oracle oinstall  24858 May  1 08:33 /tmp/Upgrade/postupgrade_fixups.sql



Sunday, 30 April 2017

Oracle Upgrade path as Per Metalink Note 2189854.1


Oracle Upgrade path as Per Metalink Note 2189854.1  ...






 OS certification  for database 

https://support.oracle.com/epmos/faces/CertifyHome

Direct Upgrade to 12.2:
Source DatabaseTarget Database
11.2.0.3 and higher12.2.0.x
12.1.0.x (12.1.0.1 - 12.1.0.2)12.2.0.x

Indirect Upgrade to 12.2:
Source DatabaseUpgrade PathTarget Database
7.3.3 (lower)7.3.4 --> 9.2.0.8 --> 11.2.0.3 or higher12.2.0.x
8.0.5 ( or lower )8.0.6 --> 9.2.0.8 --> 11.2.0.3 or higher12.2.0.x
8.1.7 ( or lower )8.1.7 --> 9.2.0.8 --> 11.2.0.3 or higher12.2.0.x
9.0.1.3 ( or lower )9.0.1.3 --> 9.2.0.8 --> 11.2.0.3 or higher12.2.0.x
9.2.0.7 ( or lower )9.2.0.7 --> 11.2.0.3 or higher12.2.0.x
10.2.0.4 ( or lower )10.2.0.4 --> 11.2.0.3 or higher12.2.0.x
11.1.0.611.1.0.6 --> 11.2.0.3 or higher12.2.0.x
11.2.0.111.2.0.1 --> 11.2.0.3 or higher12.2.0.x


       Minimum Version of the database that can be directly upgraded to Oracle Database 19c

                              Source Database                        Destination Database
                                 18 (all releases)                                 19c
                                 12.2.0.1                                 19c
                                 12.1.0.2                                 19c
                                 11.2.0.4                                 19c
Direct upgrade to 19c is not supported to rest of the database releases/versions which are not mentioned above.
So first Upgrade to an intermediate Oracle Database release which  can be then directly be upgraded to 19c.

                                                                                       Minimum Version of the database that can be directly upgraded to Oracle Database 21c

                        Source Database         Destination Database
                                       19c                                  21c
                                       18c                                  21c
                                       12c Release 2 (12.2)                                  21c

Direct upgrade to 21c is not supported to rest of the database releases/versions which are not mentioned above.
So first Upgrade to an intermediate Oracle Database release which can be then directly be upgraded to 21c.


Note: 23ai released only for Oracle Database Cloud services & Exadata
23ai is still not released for On-Premises Server.Once it's released the information will be updated.

                                                                                           Minimum Version of the database that can be directly upgraded to Oracle Database 23ai

                                     Source Database             Destination Database
                                          21c                                 23ai
                                          19c                                 23ai

Direct upgrade to 23ai is not supported to rest of the database releases/versions which are not mentioned above.
So first Upgrade to an intermediate Oracle Database release which can be then directly be upgraded to 23ai.




Helpful metalink note ..
Note: 2173141.1 Complete Checklist for Manual Upgrades to non-CDB Oracle Database 12.2
Note: 2173144.1 Complete Checklist for Manual Upgrade for Multitenant Architecture Oracle Databases from 12.1. to 12.2.
Note: 2189854.1 Complete Checklist for Upgrading to Oracle Database 12.2 using DBUA for Known Issues and Alerts
Note: 2239820.1 12.2.0.1 Base Release – Availability and Known Issues


Friday, 28 April 2017

Oracle 12c cloning pdb without local undo tablespace ...

Oracle 12c clone pdb !!!



[oracle@vbgeneric ~]$  export TWO_TASK=
[oracle@vbgeneric ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Fri Apr 28 04:14:36 2017

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options


set linesize 200
COL VERSION FORMAT A15
COL STATUS  FORMAT A20
COL PRODUCT FORMAT a50
SELECT * FROM PRODUCT_COMPONENT_VERSION;

PRODUCT                                            VERSION         STATUS
-------------------------------------------------- --------------- --------------------
NLSRTL                                             12.1.0.2.0      Production
Oracle Database 12c Enterprise Edition             12.1.0.2.0      64bit Production
PL/SQL                                             12.1.0.2.0      Production
TNS for Linux:                                     12.1.0.2.0      Production


SQL> select banner from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
PL/SQL Release 12.1.0.2.0 - Production
CORE    12.1.0.2.0      Production
TNS for Linux: Version 12.1.0.2.0 - Production
NLSRTL Version 12.1.0.2.0 - Production



SQL> select name,open_mode from v$pdbs;

NAME                           OPEN_MODE
------------------------------ ----------
PDB$SEED                       READ ONLY
ORCL                           READ WRITE <<<<<<Create duplicate database from this database to ORCLDB
ORDS                           READ WRITE
ANUJ                           MOUNTED
VIHAAN                         MOUNTED


In tnsname.ora file 

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

 tnsping ORCL

TNS Ping Utility for Linux: Version 12.1.0.2.0 - Production on 28-APR-2017 04:19:24

Copyright (c) 1997, 2014, Oracle.  All rights reserved.

Used parameter files:
/u01/app/oracle/product/12.1.0.2/db_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl)))
OK (10 msec)



check sys connection ..


[oracle@vbgeneric dbs]$ sqlplus 'sys/vihaan@orcl as sysdba'

SQL*Plus: Release 12.1.0.2.0 Production on Fri Apr 28 04:52:17 2017

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



set linesize 200 pagesize 200
col FILE_NAME   for a70
SELECT CON_ID, TABLESPACE_NAME,FILE_NAME FROM CDB_DATA_FILES ;

    CON_ID TABLESPACE_NAME                FILE_NAME
---------- ------------------------------ ----------------------------------------------------------------------
         3 SYSTEM                         /u01/app/oracle/oradata/orcl12c/orcl/system01.dbf
         3 SYSAUX                         /u01/app/oracle/oradata/orcl12c/orcl/sysaux01.dbf
         3 USERS                          /u01/app/oracle/oradata/orcl12c/orcl/SAMPLE_SCHEMA_users01.dbf
         3 EXAMPLE                        /u01/app/oracle/oradata/orcl12c/orcl/example01.dbf
         3 APEX_1851336378250219          /u01/app/oracle/oradata/orcl12c/orcl/APEX_1851336378250219.dbf
         3 APEX_5457999048253711          /u01/app/oracle/oradata/orcl12c/orcl/APEX_5457999048253711.dbf
         3 APEX_5500333564645084          /u01/app/oracle/oradata/orcl12c/orcl/APEX_5500333564645084.dbf

7 rows selected.

create dir ...

cd /u01/app/oracle/oradata/orcl12c/

[oracle@vbgeneric orcl12c]$ mkdir orcldp

[oracle@vbgeneric orcl12c]$ ls -ld */
drwxr-x--- 2 oracle oinstall 4096 Apr 21 16:01 ANUJ/
drwxr-x--- 2 oracle oinstall 4096 Nov 20 12:14 orcl/
drwxr-xr-x 2 oracle oinstall 4096 Apr 28 05:10 orcldp/
drwxr-x--- 2 oracle oinstall 4096 Apr 21 14:12 ORDS/
drwxr-x--- 2 oracle oinstall 4096 Jun  2  2016 pdbseed/
drwxr-xr-x 2 oracle oinstall 4096 Apr 23 14:13 VIHAAN/



[oracle@vbgeneric ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Fri Apr 28 04:14:36 2017

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options


SET LINESIZE 200 PAGESIZE 100 SERVEROUTPUT ON
COLUMN "DB DETAILS" FORMAT A100
SELECT
 'DB_NAME: ' ||sys_context('userenv', 'db_name')                  ||
 ' \CDB:-' ||(select cdb from v$database)                         ||
 ' \AUTH_ID: ' ||sys_context('userenv', 'authenticated_identity') ||
 ' \USER: ' ||sys_context('userenv', 'current_user')              ||
 ' \CONTAINER:' ||nvl(sys_Context('userenv', 'con_Name'), 'NON-CDB') "DB DETAILS"
 FROM DUAL ;

DB DETAILS
----------------------------------------------------------------------------------------------------
DB_NAME: orcl12c \CDB:-YES \AUTH_ID: oracle \USER: SYS \CONTAINER:CDB$ROOT


SQL> create database link clone_link1 connect to clone identified by clone using 'orcl';
Database link created.


SQL> create pluggable database orcldp from orcl@clone_link1 file_name_convert=('orcl','orcldb');

Pluggable database created.


SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 ORCL                           READ WRITE NO
         4 ORDS                           READ WRITE NO
         5 ANUJ                           READ WRITE NO
         6 VIHAAN                         READ WRITE NO
         7 ORCLDP                         MOUNTED  <<<<<<<< Duplicate database from ORCL to ORCLDP


SQL> alter pluggable database ORCLDP open;

Pluggable database altered.


SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 ORCL                           READ WRITE NO
         4 ORDS                           READ WRITE NO
         5 ANUJ                           READ WRITE NO
         6 VIHAAN                         READ WRITE NO
         7 ORCLDP                         READ WRITE NO

Sunday, 23 April 2017

How to change Pluggable databse parameter ?


How to change pluggable databse parameter ?  



 
The parameters are set for a PDB and are stored in table PDB_SPFILE$ , across PDB .

[oracle@vbgeneric ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Sat Apr 22 09:49:19 2017

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options


or 

alter session set container=cdb$root;


SET LINESIZE 200 PAGESIZE 100 SERVEROUTPUT ON
COLUMN "DB DETAILS" FORMAT A100
SELECT
 'DB_NAME: ' ||sys_context('userenv', 'db_name') ||
 ' \CDB:-' ||(select cdb from v$database) ||
 ' \AUTH_ID: ' ||sys_context('userenv', 'authenticated_identity') ||
 ' \USER: ' ||sys_context('userenv', 'current_user') ||
 ' \CONTAINER:'||nvl(sys_Context('userenv', 'con_Name'), 'NON-CDB') "DB DETAILS..."
 FROM DUAL ;

DB DETAILS
----------------------------------------------------------------------------------------------------
DB_NAME: orcl12c \CDB:-YES \AUTH_ID: oracle \USER: SYS \CONTAINER:ANUJ


SQL> show pdbs

 CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
 2 PDB$SEED READ ONLY NO
 3 ORCL READ WRITE NO
 4 ORDS READ WRITE NO
 5 ANUJ READ WRITE NO


SET SERVEROUTPUT ON
COLUMN "RESTRICTED" FORMAT A10
select 
 v.name, 
 v.open_mode, 
 nvl(v.restricted, 'n/a') "RESTRICTED", 
 d.status from v$pdbs v , dba_pdbs d
where 1=1
and v.guid=d.guid
order by v.create_scn;

NAME OPEN_MODE RESTRICTED STATUS
------------------------- ---------- ---------- ---------
PDB$SEED READ ONLY NO NORMAL
ORCL READ WRITE NO NORMAL
ORDS READ WRITE NO NORMAL
ANUJ READ WRITE NO NORMAL



Pluggable database parameter ..

col container_name for a20
col parameter for a20
col value$ for a30
select container.con_id,container.name container_name, par.name PARAMETER,par.value$ from pdb_spfile$ par, v$containers container
where par.pdb_uid = container.con_uid
order by 1

 CON_ID CONTAINER_NAME PARAMETER VALUE$
---------- -------------------- -------------------- ------------------------------
 2 PDB$SEED max_string_size 'EXTENDED'
 3 ORCL max_string_size 'EXTENDED'
 3 ORCL job_queue_processes 2
 3 ORCL db_securefile 'PREFERRED'
 3 ORCL open_cursors 50
 4 ORDS max_string_size 'EXTENDED'
 5 ANUJ max_string_size 'EXTENDED'
 5 ANUJ open_cursors 300

8 rows selected.



SQL> alter session set container=ANUJ;

Session altered.



set linesize 200 
col name for a25
col VALUE for a20
select name, con_id, value from v$system_parameter where name='open_cursors';

NAME CON_ID VALUE
------------------------- ---------- --------------------
open_cursors 0 300


SQL> alter system set open_cursors=301 scope=both;

System altered.

SQL> show parameter open_cursors

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
open_cursors integer 301



set linesize 200
col name for a25
col VALUE for a20
select name, con_id, value from v$system_parameter where name='open_cursors';

NAME CON_ID VALUE
------------------------- ---------- --------------------
open_cursors 5 301



set linesize 200
col name for a25
col VALUE for a20
col CON_NAME for a20
select s.name, s.con_id, p.name CON_NAME,s.value from v$system_parameter s,v$pdbs p 
where 1=1
and s.con_id=p.con_id
and s.name='open_cursors';

NAME CON_ID CON_NAME VALUE
------------------------- ---------- -------------------- --------------------
open_cursors 5 ANUJ 301


set linesize 200
col name for a25
col VALUE for a20
col CON_NAME for a20
select s.name, s.con_id, p.name CON_NAME,s.value from v$system_parameter s,v$pdbs p 
where 1=1
and s.con_id=p.con_id
-- and s.name='open_cursors';

NAME CON_ID CON_NAME VALUE
------------------------- ---------- -------------------- --------------------
resource_manager_plan 5 ANUJ
open_cursors 5 ANUJ 301
max_string_size 5 ANUJ EXTENDED



alter session set container=cdb$root;


SET LINESIZE 200 PAGESIZE 100 SERVEROUTPUT ON
COLUMN "DB DETAILS" FORMAT A100
SELECT
 'DB_NAME: ' ||sys_context('userenv', 'db_name') ||
 ' \CDB:-' ||(select cdb from v$database) ||
 ' \AUTH_ID: ' ||sys_context('userenv', 'authenticated_identity') ||
 ' \USER: ' ||sys_context('userenv', 'current_user') ||
 ' \CONTAINER:' ||nvl(sys_Context('userenv', 'con_Name'), 'NON-CDB') "DB DETAILS"
 FROM DUAL ;

DB DETAILS
----------------------------------------------------------------------------------------------------
DB_NAME: orcl12c \CDB:-YES \AUTH_ID: oracle \USER: SYS \CONTAINER:CDB$ROOT



set linesize 200
col name for a25
col VALUE for a20
col CON_NAME for a20
select s.name, s.con_id, p.name CON_NAME,s.value from v$system_parameter s,v$pdbs p 
where 1=1
and s.con_id=p.con_id
and s.name='open_cursors';


NAME CON_ID CON_NAME VALUE
------------------------- ---------- -------------------- --------------------
open_cursors 3 ORCL 50
open_cursors 5 ANUJ 301



col container_name for a10
col parameter for a20
col value$    for a30
select container.name container_name, par.name PARAMETER,par.value$ from pdb_spfile$ par, v$containers container
where par.pdb_uid = container.con_uid
-- and par.name = 'cursor_sharing';

CONTAINER_ PARAMETER            VALUE$
---------- -------------------- ------------------------------
ORCL       job_queue_processes  2
PDB$SEED   max_string_size      'EXTENDED'
ORCL       max_string_size      'EXTENDED'
ORCL       db_securefile        'PREFERRED'
ORDS       max_string_size      'EXTENDED'
ORCL       open_cursors         50
ANUJ       max_string_size      'EXTENDED'
ANUJ       open_cursors         301

8 rows selected.


How to create Pluggable database from SEED database ?



How to Create   Pluggable database ??


To check current environment of CDB and PDB


SET LINESIZE 200 PAGESIZE 100 SERVEROUTPUT ON
COLUMN "DB DETAILS" FORMAT A100
SELECT
 'DB_NAME: ' ||sys_context('userenv', 'db_name') ||
 ' \CDB:-' ||(select cdb from v$database) ||
 ' \AUTH_ID: ' ||sys_context('userenv', 'authenticated_identity') ||
 ' \USER: ' ||sys_context('userenv', 'current_user') ||
 ' \CONTAINER:' ||nvl(sys_Context('userenv', 'con_Name'), 'NON-CDB') "DB DETAILS"
 FROM DUAL ;


DB DETAILS
----------------------------------------------------------------------------------------------------
DB_NAME: orcl12c \CDB:-YES \AUTH_ID: oracle \USER: SYS \CONTAINER:ANUJ


set linesize 200 pagesize 200 
col FILE_NAME for a70
SELECT CON_ID, TABLESPACE_NAME,FILE_NAME FROM CDB_DATA_FILES ;

 CON_ID TABLESPACE_NAME FILE_NAME
---------- ------------------------------ ----------------------------------------------------------------------
 3 SYSTEM /u01/app/oracle/oradata/orcl12c/orcl/system01.dbf
 3 SYSAUX /u01/app/oracle/oradata/orcl12c/orcl/sysaux01.dbf
 3 USERS /u01/app/oracle/oradata/orcl12c/orcl/SAMPLE_SCHEMA_users01.dbf
 3 EXAMPLE /u01/app/oracle/oradata/orcl12c/orcl/example01.dbf
 3 APEX_1851336378250219 /u01/app/oracle/oradata/orcl12c/orcl/APEX_1851336378250219.dbf
 3 APEX_5457999048253711 /u01/app/oracle/oradata/orcl12c/orcl/APEX_5457999048253711.dbf
 3 APEX_5500333564645084 /u01/app/oracle/oradata/orcl12c/orcl/APEX_5500333564645084.dbf
 1 SYSTEM /u01/app/oracle/oradata/orcl12c/system01.dbf
 1 SYSAUX /u01/app/oracle/oradata/orcl12c/sysaux01.dbf
 1 USERS /u01/app/oracle/oradata/orcl12c/users01.dbf
 1 UNDOTBS2 /u01/app/oracle/oradata/orcl12c/undotbs2.dbf
 1 APEX /u01/app/oracle/oradata/orcl12c/apex01.dbf
 5 SYSTEM /u01/app/oracle/oradata/orcl12c/ANUJ/system01.dbf
 5 SYSAUX /u01/app/oracle/oradata/orcl12c/ANUJ/sysaux01.dbf
 5 USERS /u01/app/oracle/oradata/orcl12c/ANUJ/users01.dbf
 4 SYSTEM /u01/app/oracle/oradata/orcl12c/ORDS/system01.dbf
 4 SYSAUX /u01/app/oracle/oradata/orcl12c/ORDS/sysaux01.dbf
 4 USERS /u01/app/oracle/oradata/orcl12c/ORDS/users02.dbf
 4 USERS /u01/app/oracle/oradata/orcl12c/ORDS/users01.dbf

19 rows selected.


How to check seed database path ?


SQL> alter session set exclude_seed_cdb_view=false;

Session altered.

show parameter EXCLUDE_SEED_CDB_VIEW

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
exclude_seed_cdb_view boolean FALSE


Now seed database file ..

set linesize 200 pagesize 200 
col FILE_NAME for a70
SELECT CON_ID, TABLESPACE_NAME,FILE_NAME FROM CDB_DATA_FILES ;

 CON_ID TABLESPACE_NAME FILE_NAME
---------- ------------------------------ ----------------------------------------------------------------------
 1 SYSTEM /u01/app/oracle/oradata/orcl12c/system01.dbf
 1 SYSAUX /u01/app/oracle/oradata/orcl12c/sysaux01.dbf
 1 USERS /u01/app/oracle/oradata/orcl12c/users01.dbf
 1 UNDOTBS2 /u01/app/oracle/oradata/orcl12c/undotbs2.dbf
 1 APEX /u01/app/oracle/oradata/orcl12c/apex01.dbf
 2 SYSTEM /u01/app/oracle/oradata/orcl12c/pdbseed/system01.dbf
 2 SYSAUX /u01/app/oracle/oradata/orcl12c/pdbseed/sysaux01.dbf
 3 SYSTEM /u01/app/oracle/oradata/orcl12c/orcl/system01.dbf
 3 SYSAUX /u01/app/oracle/oradata/orcl12c/orcl/sysaux01.dbf
 3 USERS /u01/app/oracle/oradata/orcl12c/orcl/SAMPLE_SCHEMA_users01.dbf
 3 EXAMPLE /u01/app/oracle/oradata/orcl12c/orcl/example01.dbf
 3 APEX_1851336378250219 /u01/app/oracle/oradata/orcl12c/orcl/APEX_1851336378250219.dbf
 3 APEX_5457999048253711 /u01/app/oracle/oradata/orcl12c/orcl/APEX_5457999048253711.dbf
 3 APEX_5500333564645084 /u01/app/oracle/oradata/orcl12c/orcl/APEX_5500333564645084.dbf
 5 SYSTEM /u01/app/oracle/oradata/orcl12c/ANUJ/system01.dbf
 5 SYSAUX /u01/app/oracle/oradata/orcl12c/ANUJ/sysaux01.dbf
 5 USERS /u01/app/oracle/oradata/orcl12c/ANUJ/users01.dbf
 4 SYSTEM /u01/app/oracle/oradata/orcl12c/ORDS/system01.dbf
 4 SYSAUX /u01/app/oracle/oradata/orcl12c/ORDS/sysaux01.dbf
 4 USERS /u01/app/oracle/oradata/orcl12c/ORDS/users02.dbf
 4 USERS /u01/app/oracle/oradata/orcl12c/ORDS/users01.dbf

21 rows selected.




 alter system set "EXCLUDE_SEED_CDB_VIEW"=FALSE ;

System altered.


set linesize 200 pagesize 200 
col FILE_NAME for a70
SELECT CON_ID, TABLESPACE_NAME,FILE_NAME FROM CDB_DATA_FILES ;

 CON_ID TABLESPACE_NAME FILE_NAME
---------- ------------------------------ ----------------------------------------------------------------------
 2 SYSTEM /u01/app/oracle/oradata/orcl12c/pdbseed/system01.dbf
 2 SYSAUX /u01/app/oracle/oradata/orcl12c/pdbseed/sysaux01.dbf
 4 SYSTEM /u01/app/oracle/oradata/orcl12c/ORDS/system01.dbf
 4 SYSAUX /u01/app/oracle/oradata/orcl12c/ORDS/sysaux01.dbf
 4 USERS /u01/app/oracle/oradata/orcl12c/ORDS/users02.dbf
 4 USERS /u01/app/oracle/oradata/orcl12c/ORDS/users01.dbf
 3 SYSTEM /u01/app/oracle/oradata/orcl12c/orcl/system01.dbf
 3 SYSAUX /u01/app/oracle/oradata/orcl12c/orcl/sysaux01.dbf
 3 USERS /u01/app/oracle/oradata/orcl12c/orcl/SAMPLE_SCHEMA_users01.dbf
 3 EXAMPLE /u01/app/oracle/oradata/orcl12c/orcl/example01.dbf
 3 APEX_1851336378250219 /u01/app/oracle/oradata/orcl12c/orcl/APEX_1851336378250219.dbf
 3 APEX_5457999048253711 /u01/app/oracle/oradata/orcl12c/orcl/APEX_5457999048253711.dbf
 3 APEX_5500333564645084 /u01/app/oracle/oradata/orcl12c/orcl/APEX_5500333564645084.dbf
 1 SYSTEM /u01/app/oracle/oradata/orcl12c/system01.dbf
 1 SYSAUX /u01/app/oracle/oradata/orcl12c/sysaux01.dbf
 1 USERS /u01/app/oracle/oradata/orcl12c/users01.dbf
 1 UNDOTBS2 /u01/app/oracle/oradata/orcl12c/undotbs2.dbf
 1 APEX /u01/app/oracle/oradata/orcl12c/apex01.dbf

18 rows selected.



SET SERVEROUTPUT ON
COLUMN "RESTRICTED" FORMAT A10
select 
 v.name, 
 v.open_mode, 
 nvl(v.restricted, 'n/a') "RESTRICTED", 
 d.status from v$pdbs v , dba_pdbs d
where 1=1
and v.guid=d.guid
order by v.create_scn;

NAME OPEN_MODE RESTRICTED STATUS
------------------------------ ---------- ---------- ---------
PDB$SEED READ ONLY NO NORMAL
ORCL READ WRITE NO NORMAL
ORDS READ WRITE NO NORMAL
=========================================
To check seed database file only 
set linesize 200
col FILE_NAME for a80
select TABLESPACE_NAME, FILE_NAME  from cdb_data_files   where CON_ID=( select CON_ID from v$pdbs where NAME='PDB$SEED' ) 
union 
select TABLESPACE_NAME, FILE_NAME  from cdb_temp_files where CON_ID=( select CON_ID from v$pdbs where NAME='PDB$SEED' );



set linesize 200
col FILE_NAME for a80
select TABLESPACE_NAME, FILE_NAME  from cdb_data_files   where CON_ID=( select CON_ID from v$pdbs where NAME='PDB$SEED' )
union
select TABLESPACE_NAME, FILE_NAME  from cdb_temp_files where CON_ID=( select CON_ID   from v$pdbs where NAME='PDB$SEED' );

no rows selected


Check this parameter ...

SQL> show parameter EXCLUDE_SEED_CDB_VIEW

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
exclude_seed_cdb_view                boolean     TRUE


SQL> alter session set EXCLUDE_SEED_CDB_VIEW=false ;

Session altered.


set linesize 200
col FILE_NAME for a80
select TABLESPACE_NAME, FILE_NAME  from cdb_data_files   where CON_ID=( select CON_ID from v$pdbs where NAME='PDB$SEED' )
union
select TABLESPACE_NAME, FILE_NAME  from cdb_temp_files where CON_ID=( select CON_ID from v$pdbs where NAME='PDB$SEED' );


TABLESPACE_NAME                FILE_NAME
------------------------------ --------------------------------------------------------------------------------
TEMP                           /u01/app/oracle/oradata/orcl12c/pdbseed/pdbseed_temp012016-06-02_07-10-28-AM.dbf
SYSAUX                         /u01/app/oracle/oradata/orcl12c/pdbseed/sysaux01.dbf
SYSTEM                         /u01/app/oracle/oradata/orcl12c/pdbseed/system01.dbf


==========================================================

 As seed database path 

from 
/u01/app/oracle/oradata/orcl12c/pdbseed/system01.dbf
to 
/u01/app/oracle/oradata/orcl12c/ANUJ/users01.dbf

So convert parameter .. 
FILE_NAME_CONVERT = ('/pdbseed/', '/ANUJ/')




Create Pluggable databse ..


SQL> SQL>
CREATE PLUGGABLE DATABASE anuj ADMIN USER vihaan IDENTIFIED BY vihaan123
storage (maxsize 5G MAX_SHARED_TEMP_SIZE 500M)
DEFAULT TABLESPACE "USERS" DATAFILE '/u01/app/oracle/oradata/orcl12c/ANUJ/users01.dbf' SIZE 5M REUSE AUTOEXTEND ON
FILE_NAME_CONVERT = ('/pdbseed/', '/ANUJ/');

Pluggable database created.


SET SERVEROUTPUT ON
COLUMN "RESTRICTED" FORMAT A10
select
 v.name,
 v.open_mode,
 nvl(v.restricted, 'n/a') "RESTRICTED",
 d.status from v$pdbs v , dba_pdbs d
where 1=1
and v.guid=d.guid
order by v.create_scn;

NAME OPEN_MODE RESTRICTED STATUS
------------------------------ ---------- ---------- ---------
PDB$SEED READ ONLY NO NORMAL
ORCL READ WRITE NO NORMAL
ORDS READ WRITE NO NORMAL
ANUJ MOUNTED n/a NEW

SQL> alter pluggable database ANUJ open ;

Pluggable database altered.


NAME OPEN_MODE RESTRICTED STATUS
------------------------------ ---------- ---------- ---------
PDB$SEED READ ONLY NO NORMAL
ORCL READ WRITE NO NORMAL
ORDS READ WRITE NO NORMAL
ANUJ READ WRITE NO NORMAL


==============================
 pwd
/u01/app/oracle/oradata/vihcdb1

 ls -ltr
total 2439372
drwxr-xr-x 2 oracle oinstall      4096 Sep 23 13:53 pdbseed
-rw-r----- 1 oracle oinstall  20979712 Sep 23 15:15 temp01.dbf
-rw-r----- 1 oracle oinstall  52429312 Sep 23 21:16 redo02a.log
-rw-r----- 1 oracle oinstall 524296192 Sep 23 21:21 users01.dbf
-rw-r----- 1 oracle oinstall 734011392 Sep 24 03:52 system01.dbf
-rw-r----- 1 oracle oinstall  52429312 Sep 24 04:01 redo03a.log
-rw-r----- 1 oracle oinstall 466624512 Sep 24 04:05 undotbs01.dbf
-rw-r----- 1 oracle oinstall 576724992 Sep 24 04:05 sysaux01.dbf
-rw-r----- 1 oracle oinstall  52429312 Sep 24 04:05 redo01a.log
-rw-r----- 1 oracle oinstall  18038784 Sep 24 04:05 ora_control1.ctl
-rw-r----- 1 oracle oinstall  18038784 Sep 24 04:05 ora_control2.ctl

[oracle@cl-ora vihcdb1]$ mkdir ANUJ
[oracle@cl-ora vihcdb1]$ cd ANUJ/
[oracle@cl-ora ANUJ]$ pwd
/u01/app/oracle/oradata/vihcdb1/ANUJ
[oracle@cl-ora ANUJ]$ !sql



CREATE PLUGGABLE DATABASE anuj ADMIN USER vihaan IDENTIFIED BY vihaan123
SQL>   2  storage (maxsize 5G MAX_SHARED_TEMP_SIZE 500M)
  3  DEFAULT TABLESPACE "USERS" DATAFILE '/u01/app/oracle/oradata/vihcdb1/ANUJ/users01.dbf' SIZE 5M REUSE AUTOEXTEND ON
  4  FILE_NAME_CONVERT = ('/pdbseed/', '/ANUJ/');


Pluggable database created.


CREATE PLUGGABLE DATABASE anuj ADMIN USER vihaan IDENTIFIED BY vihaan123
SQL>   2  storage (maxsize 5G MAX_SHARED_TEMP_SIZE 500M)
  3  DEFAULT TABLESPACE "USERS" DATAFILE '/u01/app/oracle/oradata/vihcdb1/ANUJ/users01.dbf' SIZE 5M REUSE AUTOEXTEND ON
  4  FILE_NAME_CONVERT = ('/pdbseed/', '/ANUJ/');


Pluggable database created.

SQL> SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 ANUJ                           MOUNTED
SQL> alter session set container=anuj ;
 
Session altered.

SQL> startup ;
Pluggable Database opened.
SQL> show pdbs

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

Friday, 21 April 2017

Pluggable database database add datafile ...

How to add datafile in  Pluggable database !!!


Pluggable database add datafile ..... 


set linesize 200 pagesize 200 
col FILE_NAME for a70
col PDB_NAME for a20
select a.CON_ID,PDB_NAME,b.status pdbstatus,TABLESPACE_NAME,FILE_NAME ,trunc(BYTES/1024/1024/1024,2) Gb, trunc(MAXBYTES/1024/1024/1024,2) Max from cdb_data_files a,dba_pdbs b
where b.PDB_ID=a.CON_ID
order by 1;

 CON_ID PDB_NAME PDBSTATUS TABLESPACE_NAME FILE_NAME GB MAX
---------- -------------------- --------- ------------------------------ ---------------------------------------------------------------------- ---------- ----------
 3 ORCL NORMAL SYSTEM /u01/app/oracle/oradata/orcl12c/orcl/system01.dbf .39 31.99
 3 ORCL NORMAL APEX_5500333564645084 /u01/app/oracle/oradata/orcl12c/orcl/APEX_5500333564645084.dbf 0 .09
 3 ORCL NORMAL APEX_5457999048253711 /u01/app/oracle/oradata/orcl12c/orcl/APEX_5457999048253711.dbf 0 .02
 3 ORCL NORMAL SYSAUX /u01/app/oracle/oradata/orcl12c/orcl/sysaux01.dbf 1.19 31.99
 3 ORCL NORMAL EXAMPLE /u01/app/oracle/oradata/orcl12c/orcl/example01.dbf 1.21 31.99
 3 ORCL NORMAL USERS /u01/app/oracle/oradata/orcl12c/orcl/SAMPLE_SCHEMA_users01.dbf .14 31.99
 3 ORCL NORMAL APEX_1851336378250219 /u01/app/oracle/oradata/orcl12c/orcl/APEX_1851336378250219.dbf 0 .02
 4 ORDS NORMAL SYSTEM /u01/app/oracle/oradata/orcl12c/ORDS/system01.dbf .25 31.99
 4 ORDS NORMAL USERS /u01/app/oracle/oradata/orcl12c/ORDS/users01.dbf .04 31.99
 4 ORDS NORMAL SYSAUX /u01/app/oracle/oradata/orcl12c/ORDS/sysaux01.dbf .72 31.99

10 rows selected.

alter session set container=ORDS; 

SQL> show con_id

CON_ID
------------------------------
4

SQL> show con_name

CON_NAME
------------------------------
ORDS

or


SQL> show con_id con_name

CON_ID
------------------------------
4

CON_NAME
------------------------------
ORDS


SQL> alter tablespace USERS add datafile '/u01/app/oracle/oradata/orcl12c/ORDS/users02.dbf' size 1g AUTOEXTEND ON;

Tablespace altered.

set linesize 200 pagesize 200
col FILE_NAME for a70
col PDB_NAME for a20
select a.CON_ID,PDB_NAME,b.status pdbstatus,TABLESPACE_NAME,FILE_NAME ,trunc(BYTES/1024/1024/1024,2) Gb, trunc(MAXBYTES/1024/1024/1024,2) Max from cdb_data_files a,dba_pdbs b
where b.PDB_ID=a.CON_ID
order by 1;

 CON_ID PDB_NAME PDBSTATUS TABLESPACE_NAME FILE_NAME GB MAX
---------- -------------------- --------- ------------------------------ ---------------------------------------------------------------------- ---------- ----------
 4 ORDS NORMAL SYSTEM /u01/app/oracle/oradata/orcl12c/ORDS/system01.dbf .25 31.99
 4 ORDS NORMAL SYSAUX /u01/app/oracle/oradata/orcl12c/ORDS/sysaux01.dbf .72 31.99
 4 ORDS NORMAL USERS /u01/app/oracle/oradata/orcl12c/ORDS/users02.dbf 1 31.99
 4 ORDS NORMAL USERS /u01/app/oracle/oradata/orcl12c/ORDS/users01.dbf .04 31.99

Oracle DBA

anuj blog Archive