首页 > 代码库 > 探索Oracle之数据库升级六 11.2.0.4.3 Upgrade12c(12.2.0.1)

探索Oracle之数据库升级六 11.2.0.4.3 Upgrade12c(12.2.0.1)

探索Oracle之数据库升级六
11.2.0.4.3 Upgrade12c(12.2.0.1)

一、前言:

      Oracle 12c发布距今已经一年有余了,其最大亮点是一个可以插拔的数据库(PDB),这是在之前版本没有的;但是如果我们要将以前版本的数据库升级到12c来,那么也应顺其自然的将其变成一个pdb,那么我们的工作不仅包含了数据库软件的升级,同时也包含如何将一个NO-CDB的数据库plug to CDB none

二、升级要求:

 

三、升级前准备:       3.1、查看数据库版本及补丁信息

SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE 11.2.0.4.0 Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 – Production

SQL> show parameter name;

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------

cell_offloadgroup_name string
db_file_name_convert string
db_name string woo
db_unique_name string woo
global_names boolean FALSE
instance_name string woo
lock_name_space string
log_file_name_convert string
processor_group_name string
service_names string woo

SQL> set pagesize 500
SQL> set line 300 
SQL> col comp_name format a40
SQL> col comp_name format a35
SQL> col version format a15
SQL> col status format a7
SQL> select comp_name,version,status from dba_registry;

COMP_NAME VERSION STATUS
----------------------------------- --------------- -------

Oracle Enterprise Manager 11.2.0.4.0 VALID
OWB 11.2.0.3.0 VALID
Oracle Application Express 3.2.1.00.12 VALID
OLAP Catalog 11.2.0.4.0 VALID
Spatial 11.2.0.4.0 VALID
Oracle Multimedia 11.2.0.4.0 VALID
Oracle XML Database 11.2.0.4.0 VALID
Oracle Text 11.2.0.4.0 VALID
Oracle Expression Filter 11.2.0.4.0 VALID
Oracle Rules Manager 11.2.0.4.0 VALID
Oracle Workspace Manager 11.2.0.4.0 VALID
Oracle Database Catalog Views 11.2.0.4.0 VALID
Oracle Database Packages and Types 11.2.0.4.0 VALID
JServer JAVA Virtual Machine 11.2.0.4.0 VALID
Oracle XDK 11.2.0.4.0 VALID
Oracle Database Java Packages 11.2.0.4.0 VALID
OLAP Analytic Workspace 11.2.0.4.0 VALID
Oracle OLAP API 11.2.0.4.0 VALID

18 rows selected.

[oracle@db01 OPatch]$ ./opatch lspatches
18522509;Database Patch Set Update : 11.2.0.4.3 (18522509) 


3.2、备份数据库

[oracle@db01 Phycal]$ pwd
 /DBBackup/Phycal
 [oracle@db01 Phycal]$ rman target / 

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Nov 20 04:41:01 2014 
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved. 
connected to target database: WOO (DBID=4199532651) 

RMAN> run{
 2> allocate channel chan_name type disk;
 3> backup database format '/DBBackup/Phycal/WOO%U.bak' TAG before_upgrade;
 4> BACKUP CURRENT CONTROLFILE;
 5> } 

 using target database control file instead of recovery catalog
 allocated channel: chan_name
 channel chan_name: SID=28 device type=DISK 

 Starting backup at 20-NOV-14
 channel chan_name: starting full datafile backup set
 channel chan_name: specifying datafile(s) in backup set
 input datafile file number=00001 name=/DBData/woo/woo/system01.dbf
 input datafile file number=00002 name=/DBData/woo/woo/sysaux01.dbf
 input datafile file number=00003 name=/DBData/woo/woo/undotbs01.dbf
 input datafile file number=00004 name=/DBData/woo/woo/users01.dbf
 channel chan_name: starting piece 1 at 20-NOV-14
 channel chan_name: finished piece 1 at 20-NOV-14
 piece handle=/DBBackup/Phycal/WOO0apo2ar4_1_1.bak tag=BEFORE_UPGRADE comment=NONE
 channel chan_name: backup set complete, elapsed time: 00:01:25
 channel chan_name: starting full datafile backup set
 channel chan_name: specifying datafile(s) in backup set
 including current control file in backup set
 including current SPFILE in backup set
 channel chan_name: starting piece 1 at 20-NOV-14
 channel chan_name: finished piece 1 at 20-NOV-14
 piece handle=/DBBackup/Phycal/WOO0bpo2atp_1_1.bak tag=BEFORE_UPGRADE comment=NONE
 channel chan_name: backup set complete, elapsed time: 00:00:01
 Finished backup at 20-NOV-14 

 Starting backup at 20-NOV-14
 channel chan_name: starting full datafile backup set
 channel chan_name: specifying datafile(s) in backup set
 including current control file in backup set
 channel chan_name: starting piece 1 at 20-NOV-14
 channel chan_name: finished piece 1 at 20-NOV-14
 piece handle=/DBSoft/fast_recovery_area/WOO/backupset/2014_11_20/o1_mf_ncnnf_TAG20141120T044237_b6t05y5x_.bkp tag=TAG20141120T044237 comment=NONE
 channel chan_name: backup set complete, elapsed time: 00:00:01
 Finished backup at 20-NOV-14
 released channel: chan_name 

RMAN> list backupset; 


 List of Backup Sets
 =================== 


 BS Key  Type LV Size       Device Type Elapsed Time Completion Time
 ------- ---- -- ---------- ----------- ------------ ---------------
 9       Full    1.20G      DISK        00:01:24     20-NOV-14      
         BP Key: 9   Status: AVAILABLE  Compressed: NO  Tag: BEFORE_UPGRADE
         Piece Name: /DBBackup/Phycal/WOO0apo2ar4_1_1.bak
   List of Datafiles in backup set 9
   File LV Type Ckp SCN    Ckp Time  Name
   ---- -- ---- ---------- --------- ----
   1       Full 3242521    20-NOV-14 /DBData/woo/woo/system01.dbf
   2       Full 3242521    20-NOV-14 /DBData/woo/woo/sysaux01.dbf
   3       Full 3242521    20-NOV-14 /DBData/woo/woo/undotbs01.dbf
   4       Full 3242521    20-NOV-14 /DBData/woo/woo/users01.dbf 

 BS Key  Type LV Size       Device Type Elapsed Time Completion Time
 ------- ---- -- ---------- ----------- ------------ ---------------
 10      Full    9.64M      DISK        00:00:02     20-NOV-14      
         BP Key: 10   Status: AVAILABLE  Compressed: NO  Tag: BEFORE_UPGRADE
         Piece Name: /DBBackup/Phycal/WOO0bpo2atp_1_1.bak
   SPFILE Included: Modification time: 12-NOV-14
   SPFILE db_unique_name: WOO
   Control File Included: Ckp SCN: 3242657      Ckp time: 20-NOV-14 

 BS Key  Type LV Size       Device Type Elapsed Time Completion Time
 ------- ---- -- ---------- ----------- ------------ ---------------
 11      Full    9.61M      DISK        00:00:01     20-NOV-14      
         BP Key: 11   Status: AVAILABLE  Compressed: NO  Tag: TAG20141120T044237
         Piece Name: /DBSoft/fast_recovery_area/WOO/backupset/2014_11_20/o1_mf_ncnnf_TAG20141120T044237_b6t05y5x_.bkp
   Control File Included: Ckp SCN: 3242671      Ckp time: 20-NOV-14 


四、执行预升级脚本:
4.1
根据Metalink ID:1503653 step 3中提到的到Metalink ID:556610.1下载预升级脚本preupgrd.sql检查是否满足升级条件。

[oracle@db01 ~]$ sqlplus / as sysdba @preupgrd.sql
 
SQL*Plus: Release 11.2.0.4.0 Production on Thu Nov 20 05:18:26 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.

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

Loading Pre-Upgrade Package...
Executing Pre-Upgrade Checks...
Pre-Upgrade Checks Complete.
      ************************************************************

Results of the checks are located at:
 /DBSoft/cfgtoollogs/woo/preupgrade/preupgrade.log

Pre-Upgrade Fixup Script (run in source database environment):
 /DBSoft/cfgtoollogs/woo/preupgrade/preupgrade_fixups.sql

Post-Upgrade Fixup Script (run shortly after upgrade):
 /DBSoft/cfgtoollogs/woo/preupgrade/postupgrade_fixups.sql

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

         Fixup scripts must be reviewed prior to being executed.

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

      ************************************************************
                   ====>> USER ACTION REQUIRED <<====
      ************************************************************

 The following are *** ERROR LEVEL CONDITIONS *** that must be addressed
                    prior to attempting your upgrade.
            Failure to do so will result in a failed upgrade.

 1) Check Tag: PURGE_RECYCLEBIN
    Check Summary: Check that recycle bin is empty prior to upgrade
    Fixup Summary:
     \"The recycle bin will be purged.\"

            You MUST resolve the above error prior to upgrade

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

SQL> 


       在这里已经把需要修改的相关操作封装到了preupgrade_fixups.sql脚本中,执行该脚本按照提示修复存在的问题即可。

 

4.2 主要需要修复如下问题: 

       ALTER SYSTEM SET PROCESSES=300 SCOPE=SPFILE;   

       @$ORACLE_HOME/rdbms/admin/emremove.sql   

       @$ORACLE_HOME/olap/admin/catnoamd.sql   

        EXECUTE dbms_stats.gather_dictionary_stats;

 

4.3 执行dbupgdiag.sql收集升级前信息   

    如果有异常参考Metalink ID:556610.1进行修改。

[oracle@db01 ~]$ ll dbupgdiag.sql 
-rwxr-xr-x 1 oracle oinstall 24140 Nov 20 04:52 dbupgdiag.sql

[oracle@db01 ~]$ sqlplus / as sysdba @dbupgdiag.sql

SQL*Plus: Release 11.2.0.4.0 Production on Thu Nov 20 05:04:47 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.

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

Enter location for Spooled output:

Enter value for 1: 
SP2-0137: DEFINE requires a value following equal sign

20_Nov_2014_0504 .log

woo_
Enter value for log_path: /home/oracle/diag/
SP2-0606: Cannot create SPOOL file \"/home/oracle/woo_upgrade_diag.log/db_upg_diag_woo_20_Nov_2014_0504.log\"


                          *** Start of LogFile ***

  Oracle Database Upgrade Diagnostic Utility 11-20-2014 05:05:16

===============
Hostname
===============

db01

===============
Database Name
===============

WOO

===============
Database Uptime
===============

00:34 20-NOV-14

=================
Database Wordsize
=================

This is a 64-bit database

================
Software Version
================

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE 11.2.0.4.0 Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production

=============
Compatibility
=============

Compatibility is set as 11.2.0.0.0

================
Archive Log Mode
================

Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 151
Next log sequence to archive 153
Current log sequence 153

================
Auditing Check
================

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
audit_file_dest string /DBSoft/admin/woo/adump
audit_sys_operations boolean FALSE
audit_syslog_level string
audit_trail string DB

================
Cluster Check
================

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
cluster_database boolean FALSE
cluster_database_instances integer 1

DOC>################################################################
DOC>
DOC> If CLUSTER_DATABASE is set to TRUE, change it to FALSE before
DOC> upgrading the database
DOC>
DOC>################################################################
DOC>#

===========================================
Tablespace and the owner of the aud$ table
===========================================

OWNER TABLESPACE_NAME
------------ ------------------------------
SYS SYSTEM

============================================================================
count of records in the sys.aud$ table where dbid is null- Standard Auditing
============================================================================

         0

============================================================================================
count of records in the system.aud$ when dbid is null, Std Auditing with OLS or DV installed
============================================================================================

select count(*) from system.aud$ where dbid is null
                           *
ERROR at line 1:
ORA-00942: table or view does not exist

=============================================================================
count of records in the sys.fga_log$ when dbid is null, Fine Grained Auditing
=============================================================================

         0

==========================================
Oracle Label Security is installed or not
==========================================

Oracle Label Security is NOT installed at database level

================
Number of AQ Records in Message Queue Tables
================

SYS - ALERT_QT - 58
SYS - AQ$_MEM_MC - 0
SYS - AQ_EVENT_TABLE - 0
SYS - AQ_PROP_TABLE - 0
SYS - KUPC$DATAPUMP_QUETAB - 0
SYS - SCHEDULER$_EVENT_QTAB - 0
SYS - SCHEDULER$_REMDB_JOBQTAB - 0
SYS - SCHEDULER_FILEWATCHER_QT - 0
SYS - SYS$SERVICE_METRICS_TAB - 0
SYSMAN - MGMT_LOADER_QTABLE - 0
SYSMAN - MGMT_NOTIFY_INPUT_QTABLE - 0
SYSMAN - MGMT_NOTIFY_QTABLE - 0
SYSMAN - MGMT_PAF_MSG_QTABLE_1 - 0
SYSMAN - MGMT_PAF_MSG_QTABLE_2 - 0
SYSMAN - MGMT_TASK_QTABLE - 28
SYSTEM - DEF$_AQCALL - 0
SYSTEM - DEF$_AQERROR - 0
WMSYS - WM$EVENT_QUEUE_TABLE - 0

================
Time Zone version
================
        14

================
Local Listener
================



================
Default and Temporary Tablespaces By User
================

USERNAME TEMPORARY_TABLESPACE DEFAULT_TABLESPACE
---------------------------- ---------------------- ----------------------
MGMT_VIEW TEMP SYSTEM
SYS TEMP SYSTEM
SYSTEM TEMP SYSTEM
DBSNMP TEMP SYSAUX
SYSMAN TEMP SYSAUX
OUTLN TEMP SYSTEM
FLOWS_FILES TEMP SYSAUX
MDSYS TEMP SYSAUX
ORDSYS TEMP SYSAUX
EXFSYS TEMP SYSAUX
WMSYS TEMP SYSAUX
APPQOSSYS TEMP SYSAUX
APEX_030200 TEMP SYSAUX
OWBSYS_AUDIT TEMP SYSAUX
ORDDATA TEMP SYSAUX
CTXSYS TEMP SYSAUX
ANONYMOUS TEMP SYSAUX
XDB TEMP SYSAUX
ORDPLUGINS TEMP SYSAUX
OWBSYS TEMP SYSAUX
SI_INFORMTN_SCHEMA TEMP SYSAUX
OLAPSYS TEMP SYSAUX
SCOTT TEMP USERS
ORACLE_OCM TEMP USERS
XS$NULL TEMP USERS
MDDATA TEMP USERS
DIP TEMP USERS
APEX_PUBLIC_USER TEMP USERS
SPATIAL_CSW_ADMIN_USR TEMP USERS
SPATIAL_WFS_ADMIN_USR TEMP USERS

================
Component Status
================

Comp ID Component Status Version Org_Version Prv_Version
------- ---------------------------------- --------- -------------- -------------- --------------

AMD OLAP Catalog VALID 11.2.0.4.0 11.2.0.3.0 11.2.0.3.0
APEX Oracle Application Express VALID 3.2.1.00.12
APS OLAP Analytic Workspace VALID 11.2.0.4.0 11.2.0.3.0 11.2.0.3.0
CATALOG Oracle Database Catalog Views VALID 11.2.0.4.0 11.2.0.3.0 11.2.0.3.0
CATJAVA Oracle Database Java Packages VALID 11.2.0.4.0 11.2.0.3.0 11.2.0.3.0
CATPROC Oracle Database Packages and Types VALID 11.2.0.4.0 11.2.0.3.0 11.2.0.3.0
CONTEXT Oracle Text VALID 11.2.0.4.0 11.2.0.3.0 11.2.0.3.0
EM Oracle Enterprise Manager VALID 11.2.0.4.0
EXF Oracle Expression Filter VALID 11.2.0.4.0 11.2.0.3.0 11.2.0.3.0
JAVAVM JServer JAVA Virtual Machine VALID 11.2.0.4.0 11.2.0.3.0 11.2.0.3.0
ORDIM Oracle Multimedia VALID 11.2.0.4.0 11.2.0.3.0 11.2.0.3.0
OWB OWB VALID 11.2.0.3.0
OWM Oracle Workspace Manager VALID 11.2.0.4.0 11.2.0.3.0
RUL Oracle Rules Manager VALID 11.2.0.4.0 11.2.0.3.0 11.2.0.3.0
SDO Spatial VALID 11.2.0.4.0 11.2.0.3.0 11.2.0.3.0
XDB Oracle XML Database VALID 11.2.0.4.0 11.2.0.3.0 11.2.0.3.0
XML Oracle XDK VALID 11.2.0.4.0 11.2.0.3.0 11.2.0.3.0
XOQ Oracle OLAP API VALID 11.2.0.4.0 11.2.0.3.0 11.2.0.3.0

======================================================
List of Invalid Database Objects Owned by SYS / SYSTEM
======================================================


Number of Invalid Objects
------------------------------------------------------------------
There are no Invalid Objects

DOC>################################################################
DOC>
DOC> If there are no Invalid objects below will result in zero rows.
DOC>
DOC>################################################################
DOC>#

no rows selected

================================
List of Invalid Database Objects
================================

Number of Invalid Objects
------------------------------------------------------------------
There are no Invalid Objects

DOC>################################################################
DOC>
DOC> If there are no Invalid objects below will result in zero rows.
DOC>
DOC>################################################################
DOC>#

no rows selected

======================================================
Count of Invalids by Schema
======================================================



==============================================================
Identifying whether a database was created as 32-bit or 64-bit
==============================================================

DOC>###########################################################################
DOC>
DOC> Result referencing the string \'B023\' ==> Database was created as 32-bit
DOC> Result referencing the string \'B047\' ==> Database was created as 64-bit
DOC> When String results in \'B023\' and when upgrading database to 10.2.0.3.0
DOC> (64-bit) , For known issue refer below articles
DOC>
DOC> Note 412271.1 ORA-600 [22635] and ORA-600 [KOKEIIX1] Reported While
DOC> Upgrading Or Patching Databases To 10.2.0.3
DOC> Note 579523.1 ORA-600 [22635], ORA-600 [KOKEIIX1], ORA-7445 [KOPESIZ] and
DOC> OCI-21500 [KOXSIHREAD1] Reported While Upgrading To 11.1.0.6
DOC>
DOC>###########################################################################
DOC>#

Metadata Initial DB Creation Info
-------- -----------------------------------
B047 Database was created as 64-bit

===================================================
Number of Duplicate Objects Owned by SYS and SYSTEM
===================================================

Counting duplicate objects ....

  COUNT(1)
----------
         0

=========================================
Duplicate Objects Owned by SYS and SYSTEM
=========================================

Querying duplicate objects ....

DOC>
DOC>################################################################################
DOC>
DOC> If any objects found please follow below article.
DOC> Note 1030426.6 How to Clean Up Duplicate Objects Owned by SYS and SYSTEM schema
DOC> Read the Exceptions carefully before taking actions.
DOC>
DOC>################################################################################
DOC>#

========================
Password protected roles
========================

DOC>
DOC>################################################################################
DOC>
DOC> In version 11.2 password protected roles are no longer enabled by default so if
DOC> an application relies on such roles being enabled by default and no action is
DOC> performed to allow the user to enter the password with the set role command, it
DOC> is recommended to remove the password from those roles (to allow for existing
DOC> privileges to remain available). For more information see:
DOC>
DOC> Note 745407.1 : What Roles Can Be Set as Default for a User?
DOC>
DOC>################################################################################
DOC>#

Querying for password protected roles ....


Password protected Role Assigned by default to user
------------------------------ ------------------------------
OWB$CLIENT OWBSYS

================
JVM Verification
================


================================================
Checking Existence of Java-Based Users and Roles
================================================


DOC>
DOC>################################################################################
DOC>
DOC> There should not be any Java Based users for database version 9.0.1 and above.
DOC> If any users found, it is faulty JVM.
DOC>
DOC>################################################################################
DOC>#


User Existence
---------------------------
No Java Based Users

DOC>
DOC>###############################################################
DOC>
DOC> Healthy JVM Should contain Six Roles.
DOC> If there are more or less than six role, JVM is inconsistent.
DOC>
DOC>###############################################################
DOC>#


Role
------------------------------
There are 6 JAVA related roles
Roles

ROLE
------------------------------
JAVA_DEPLOY
JAVAUSERPRIV
JAVAIDPRIV
JAVASYSPRIV
JAVADEBUGPRIV
JAVA_ADMIN

=========================================
List of Invalid Java Objects owned by SYS
=========================================

There are no SYS owned invalid JAVA objects

DOC>
DOC>#################################################################
DOC>
DOC> Check the status of the main JVM interface packages DBMS_JAVA
DOC> and INITJVMAUX and make sure it is VALID.
DOC>
DOC> If there are no Invalid objects below will result in zero rows.
DOC>
DOC>#################################################################
DOC>#

no rows selected

DOC>
DOC>#################################################################
DOC>
DOC> If the JAVAVM component is not installed in the database (for
DOC> example, after creating the database with custom scripts), the
DOC> next query will report the following error:
DOC>
DOC> select dbms_java.longname(\'foo\') \"JAVAVM TESTING\" from dual
DOC> *
DOC> ERROR at line 1:
DOC> ORA-00904: \"DBMS_JAVA\".\"LONGNAME\": invalid identifier
DOC>
DOC> If the JAVAVM component is installed, the query should succeed
DOC> with \'foo\' as result.
DOC>
DOC>#################################################################
DOC>#

JAVAVM TESTING
---------------
foo

===================================
Oracle Multimedia/InterMedia status
===================================

.
Oracle Multimedia/interMedia is installed and listed with the following version: 11.2.0.4.0 and status: VALID
.
Checking for installed Database Schemas...
ORDSYS user exists.
ORDPLUGINS user exists.
MDSYS user exists.
SI_INFORMTN_SCHEMA user exists.
ORDDATA user exists.
.
Checking for Prerequisite Components...
JAVAVM installed and listed as valid
XDK installed and listed as valid
XDB installed and listed as valid
Validating Oracle Multimedia/interMedia...(no output if component status is valid)

PL/SQL procedure successfully completed.

                            *** End of LogFile ***

							
not spooling currently

Enter value for log_path: /home/oracle/diag/

Upload db_upg_diag_woo_20_Nov_2014_0504.log from \"/home/oracle/diag\" directory

SQL> exit 


 

4.4 升级前检查无效对象:
[oracle@db01 ~]$ cd $ORACLE_HOME/rdbms/admin 
[oracle@db01 admin]$ sqlplus / as sysdba @utlrp.sql

SQL*Plus: Release 11.2.0.4.0 Production on Thu Nov 20 06:13:55 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.

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

TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN 2014-11-20 06:13:56

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 2014-11-20 06:14:06

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.

PL/SQL procedure successfully completed.

SQL> 

五、开始安装ORACLE 12C软件

   5.1 创建12c安装所需目录

[oracle@db01 DBSoft]$ mkdir -p /DBSoft/Product/12.1.0/db_1
 
[oracle@db01 DBSoft]$ chown -R oracle:oinstall /DBSoft/Product/12.1.0
[oracle@db01 DBSoft]$ chmod -R 755 /DBSoft/Product/12.1.0
[oracle@db01 DBSoft]$ cd /DBSoft/Product/12.1.0 


 5.2 修改用户环境变量:

[oracle@db01 Product]$ vi ~/.bash_profile
 
export PATH
export EDITOR=vi
export ORACLE_SID=woo
export ORACLE_BASE=/DBSoft
export ORACLE_HOME=$ORACLE_BASE/Product/12.1.0/db_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$ORACLE_HOME/bin:$PATH
umask 022 


5.3 解压缩软件:

[oracle@db01 ~]$ unzip linuxamd64_12c_database_1of2.zip
[oracle@db01 ~]$ unzip linuxamd64_12c_database_2of2.zip


 



 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

探索Oracle之数据库升级六 11.2.0.4.3 Upgrade12c(12.2.0.1)