jeudi 1 octobre 2020

How to Upgrade Oracle RAC Database from 12c to 19c

 

How to Upgrade Oracle RAC Database from 12c to 19c

 

1.       Run preupgrade tool script

Preupgrade.jar tool file is available with the Oracle Database binary. Run this:

[oracle@uat-entdbrac05 db_1]$ $ORACLE_HOME/db_1/ jdk/bin/java -jar /u01/app/oracle/product/19.3.0/db_1/rdbms/admin/preupgrade.jar

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

PREUPGRADE SUMMARY

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

  /u01/app/oracle/cfgtoollogs/CSMCDB/preupgrade/preupgrade.log

  /u01/app/oracle/cfgtoollogs/CSMCDB/preupgrade/preupgrade_fixups.sql

  /u01/app/oracle/cfgtoollogs/CSMCDB/preupgrade/postupgrade_fixups.sql

Execute fixup scripts across the entire CDB:

Before upgrade:

 

1. Execute preupgrade fixups with the below command

$ORACLE_HOME/perl/bin/perl -I$ORACLE_HOME/perl/lib -I$ORACLE_HOME/rdbms/admin $ORACLE_HOME/rdbms/admin/catcon.pl -l /u01/app/oracle/cfgtoollogs/CSMCDB/preupgrade/ -b preup_CSMCDB /u01/app/oracle/cfgtoollogs/CSMCDB/preupgrade/preupgrade_fixups.sql

 

2. Review logs under /u01/app/oracle/cfgtoollogs/CSMCDB/preupgrade/

 

After the upgrade:

 

1. Execute postupgrade fixups with the below command

$ORACLE_HOME/perl/bin/perl -I$ORACLE_HOME/perl/lib -I$ORACLE_HOME/rdbms/admin $ORACLE_HOME/rdbms/admin/catcon.pl -l /u01/app/oracle/cfgtoollogs/CSMCDB/preupgrade/ -b postup_CSMCDB /u01/app/oracle/cfgtoollogs/CSMCDB/preupgrade/postupgrade_fixups.sql

 

2. Review logs under /u01/app/oracle/cfgtoollogs/CSMCDB/preupgrade/

 

Preupgrade complete: 2020-09-15T15:32:49

[oracle@uat-entdbrac05 db_1]$

 

2.       Run the pre-upgrade fixup script:

[oracle@uat-entdbrac05 db_1]$ sqlplus / as sysdba

 

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Sep 15 15:37:57 2020

Version 19.3.0.0.0

 

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

Connected to:

Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

Advanced Analytics and Real Application Testing options

 

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

Executing Oracle PRE-Upgrade Fixup Script

 

Auto-Generated by:       Oracle Preupgrade Script

                         Version: 19.0.0.0.0 Build: 1

Generated on:            2020-09-15 15:31:05

 

For Source Database:     CBD01

Source Database Version: 12.1.0.2.0

For Upgrade to Version:  19.0.0.0.0

 

Executing in container:  CDB$ROOT

Preup                             Preupgrade

Action                            Issue Is

Number  Preupgrade Check Name     Remedied    Further DBA Action

------  ---------------------      -------  ------------------------

    1.  purge_recyclebin          YES      None.

    2.  apex_manual_upgrade       NO       Manual fixup recommended.

    3.  dictionary_stats          YES      None.

    4.  tablespaces_info          NO       Informational only.

                                           Further action is optional.

    5.  sync_standby_db           NO       Informational only.

                                           Further action is optional.

    6.  min_archive_dest_size     NO       Informational only.

                                           Further action is optional.

    7.  cycle_number              NO       Informational only.

                                           Further action is optional.

    8.  rman_recovery_version     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.

Session altered.

SQL>

3.       Run utlrp.sql:( to compile invalid objects)

SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql

 

TIMESTAMP

---------------------------------------------------------------------

COMP_TIMESTAMP UTLRP_BGN  2020-09-15 15:49:46

 

DOC>   The following PL/SQL block invokes UTL_RECOMP to recompile invalid

DOC>   objects in the database. Recompilation time is proportional to the

DOC>   number of invalid objects in the database, so this command may take

DOC>   a long time to execute on a database with a large number of invalid

DOC>   objects.

DOC>

DOC>   Use the following queries to track recompilation progress:

DOC>

DOC>   1. Query returning the number of invalid objects remaining. This

DOC>      number should decrease with time.

DOC>         SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);

DOC>

DOC>   2. Query returning the number of objects compiled so far. This number

DOC>      should increase with time.

DOC>         SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;

DOC>

DOC>   This script automatically chooses serial or parallel recompilation

DOC>   based on the number of CPUs available (parameter cpu_count) multiplied

DOC>   by the number of threads per CPU (parameter parallel_threads_per_cpu).

DOC>   On RAC, this number is added across all RAC nodes.

DOC>

DOC>   UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallel

DOC>   recompilation. Jobs are created without instance affinity so that they

DOC>   can migrate across RAC nodes. Use the following queries to verify

DOC>   whether UTL_RECOMP jobs are being created and run correctly:

DOC>

DOC>   1. Query showing jobs created by UTL_RECOMP

DOC>         SELECT job_name FROM dba_scheduler_jobs

DOC>            WHERE job_name like 'UTL_RECOMP_SLAVE_%';

DOC>

DOC>   2. Query showing UTL_RECOMP jobs that are running

DOC>         SELECT job_name FROM dba_scheduler_running_jobs

DOC>            WHERE job_name like 'UTL_RECOMP_SLAVE_%';

DOC>#

PL/SQL procedure successfully completed.

 

TIMESTAMP

----------------------------------------------------------------------

COMP_TIMESTAMP UTLRP_END  2020-09-15 15:49:50

 

DOC> The following query reports the number of objects that have compiled

DOC> with errors.

DOC>

DOC> If the number is higher than expected, please examine the error

DOC> messages reported with each object (using SHOW ERRORS) to see if they

DOC> point to system misconfiguration or resource constraints that must be

DOC> fixed before attempting to recompile these objects.

DOC>#

 

OBJECTS WITH ERRORS

-------------------

                  0

 

DOC> The following query reports the number of errors caught during

DOC> recompilation. If this number is non-zero, please query the error

DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors

DOC> are due to misconfiguration or resource constraints that must be

DOC> fixed before objects can compile successfully.

DOC>#

 

ERRORS DURING RECOMPILATION

---------------------------

                          0

Function created.

PL/SQL procedure successfully completed.

Function dropped.

...Database user "SYS", database schema "APEX_040200", user# "98" 15:50:39

...Compiled 0 out of 3014 objects considered, 0 failed compilation 15:50:40

...271 packages

...263 package bodies

...452 tables

...11 functions

...16 procedures

...3 sequences

...457 triggers

...1320 indexes

...211 views

...0 libraries

...6 types

...0 type bodies

...0 operators

...0 index types

...Begin key object existence check 15:50:40

...Completed key object existence check 15:50:41

...Setting DBMS Registry 15:50:41

...Setting DBMS Registry Complete 15:50:41

...Exiting validate 15:50:41

 

PL/SQL procedure successfully completed.

 

SQL>

SQL>

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

 

  COUNT(*)

----------

         0

 

SQL>

4.       Check database component status:

SQL> set pagesize500

SQL> set linesize 100

SQL>

SQL> select substr(comp_name,1,40) comp_name, status, substr(version,1,10) version from dba_registry order by comp_name;

 

COMP_NAME                                STATUS      VERSION

---------------------------------------- ----------- ----------

JServer JAVA Virtual Machine             VALID       12.1.0.2.0

OLAP Analytic Workspace                  VALID       12.1.0.2.0

Oracle Application Express               VALID       4.2.5.00.0

Oracle Database Catalog Views            VALID       12.1.0.2.0

Oracle Database Java Packages            VALID       12.1.0.2.0

Oracle Database Packages and Types       VALID       12.1.0.2.0

Oracle Database Vault                    VALID       12.1.0.2.0

Oracle Label Security                    VALID       12.1.0.2.0

Oracle Multimedia                        VALID       12.1.0.2.0

Oracle OLAP API                          VALID       12.1.0.2.0

Oracle Real Application Clusters         VALID       12.1.0.2.0

Oracle Text                              VALID       12.1.0.2.0

Oracle Workspace Manager                 VALID       12.1.0.2.0

Oracle XDK                               VALID       12.1.0.2.0

Oracle XML Database                      VALID       12.1.0.2.0

Spatial                                  VALID       12.1.0.2.0

 

16 rows selected.

 

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

 

no rows selected

5.       4.Check timezone version:

SQL> select * from v$timezone_file;

 

FILENAME                VERSION     CON_ID

-------------------- ---------- ----------

timezlrg_18.dat              18          0

 

6.       Check files in backup mode:(should return zero rows)

 

SQL> SELECT * FROM v$backup WHERE status != 'NOT ACTIVE';

 

no rows selected

 

SQL> SELECT * FROM v$recover_file;

 

no rows selected

 

6.Purge recyclebin

 

SQL> purge dba_recyclebin;

DBA Recyclebin purged.

 

SQL> alter system set db_recovery_file_dest ='+FRA';

System altered.

SQL> alter database flashback on;

Database altered.

 

 

 

7.       Start DBUA


For upgrade purpose, do not provide any SYS credentials


 


 


 


 


 


 


 


 


 


 

 


 


 


 

Aucun commentaire:

Enregistrer un commentaire

How to fix errors : -         ORA-38760: This database instance failed to turn on flashback database -         ORA-38780: Restore poin...