探索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)
[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 根據 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
6.1 進入解壓目錄執行./runInstaller 開啟12c安裝程式
執行DBUA 對資料庫進行升級操作。
至此,用於升級的12c軟體包已經安裝完成。
六、執行升級檢查
-
SQL> select banner from v$version;
-
-
BANNER
-
--------------------------------------------------------------------------------
-
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
-
PL/SQL Release 12.1.0.1.0 - Production
-
CORE 12.1.0.1.0 Production
-
TNS for Linux: Version 12.1.0.1.0 - Production
-
NLSRTL Version 12.1.0.1.0 – Production
-
-
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 Application Express 4.2.0.00.27 VALID
-
OWB 11.2.0.3.0 VALID
-
OLAP Catalog 11.2.0.4.0 OPTION
-
OFF
-
Spatial 12.1.0.1.0 VALID
-
Oracle Multimedia 12.1.0.1.0 VALID
-
Oracle XML Database 12.1.0.1.0 VALID
-
Oracle Text 12.1.0.1.0 VALID
-
Oracle Workspace Manager 12.1.0.1.0 VALID
-
Oracle Database Catalog Views 12.1.0.1.0 VALID
-
Oracle Database Packages and Types 12.1.0.1.0 VALID
-
JServer JAVA Virtual Machine 12.1.0.1.0 VALID
-
Oracle XDK 12.1.0.1.0 VALID
-
Oracle Database Java Packages 12.1.0.1.0 VALID
-
OLAP Analytic Workspace 12.1.0.1.0 VALID
-
Oracle OLAP API 12.1.0.1.0 VALID
-
- 15 rows selected.
16.2 從上面我們可以看到有些元件的狀態是不對的,這是老版本的元件,不能直接透過升級上12c,需要執行如下SQL進行刪除。
-
SQL> @$ORACLE_HOME/rdbms/admin/emremove.sql
-
SQL> @$ORACLE_HOME/olap/admin/catnoamd.sql
- SQL> EXECUTE dbms_stats.gather_dictionary_stats;
-
SQL> select comp_name,version,status from dba_registry;
-
-
COMP_NAME VERSION STATUS
-
----------------------------------- --------------- -------
-
Oracle Application Express 4.2.0.00.27 VALID
-
OWB 11.2.0.3.0 VALID
-
Spatial 12.1.0.1.0 VALID
-
Oracle Multimedia 12.1.0.1.0 VALID
-
Oracle XML Database 12.1.0.1.0 VALID
-
Oracle Text 12.1.0.1.0 VALID
-
Oracle Workspace Manager 12.1.0.1.0 VALID
-
Oracle Database Catalog Views 12.1.0.1.0 VALID
-
Oracle Database Packages and Types 12.1.0.1.0 VALID
-
JServer JAVA Virtual Machine 12.1.0.1.0 VALID
-
Oracle XDK 12.1.0.1.0 VALID
-
Oracle Database Java Packages 12.1.0.1.0 VALID
-
OLAP Analytic Workspace 12.1.0.1.0 VALID
-
Oracle OLAP API 12.1.0.1.0 VALID
-
- 14 rows selected.
16.3 /etc/oratab 資訊對比
-
---升級前
-
[root@db01 ~]# grep DBSoft /etc/oratab
-
woo:/DBSoft/Product/11.2.0/db_1:N
-
-
---升級後
-
[root@db01 ~]# grep DBSoft /etc/oratab
- woo:/DBSoft/Product/12.1.0/db_1:N
注意:這部分不需要我們手工去修改/etc/oratab記錄,執行升級會自動完成修改。
16.4 執行升級後postupgrade_fixups.sql檢查:
-
SQL> @/DBSoft/cfgtoollogs/woo/preupgrade/postupgrade_fixups.sql
-
Post Upgrade Fixup Script Generated on 2014-11-20 05:18:29 Version: 12.1.0.1 Build: 007
-
Beginning Post-Upgrade Fixups...
-
-
PL/SQL procedure successfully completed.
-
PL/SQL procedure successfully completed.
-
-
**********************************************************************
-
Check Tag: OLD_TIME_ZONES_EXIST
-
Check Summary: Check for use of older timezone data file
-
Fix Summary: Update the timezone using the DBMS_DST package after upgrade is complete.
-
**********************************************************************
-
Fixup Returned Information:
-
INFORMATION: --> Older Timezone in use
-
-
Database is using a time zone file older than version 18.
-
After the upgrade, it is recommended that DBMS_DST package
-
be used to upgrade the 12.1.0.1.0 database time zone version
-
to the latest version which comes with the new release.
-
Please refer to My Oracle Support note number 977512.1 for details.
-
**********************************************************************
-
-
PL/SQL procedure successfully completed.
-
-
**********************************************************************
-
[Post-Upgrade Recommendations]
-
**********************************************************************
-
-
PL/SQL procedure successfully completed.
-
-
*****************************************
-
******** Fixed Object Statistics ********
-
*****************************************
-
-
Please create stats on fixed objects two weeks
-
after the upgrade using the command:
-
EXECUTE DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;
-
-
^^^ MANUAL ACTION SUGGESTED ^^^
-
-
PL/SQL procedure successfully completed.
-
-
**************************************************
-
************* Fixup Summary ************
-
-
1 fixup routine generated an INFORMATIONAL message that should be reviewed.
-
-
-
PL/SQL procedure successfully completed.
-
-
*************** Post Upgrade Fixup Script Complete ********************
-
-
PL/SQL procedure successfully completed.
-
- SQL>
從升級後的檢查結果來看,DST目前是18,說明不需要人工處理了,如果不是需要手工來處理,參考Metalink ID: 977512.1 或者參考Metalink ID 1585343.1
-
SQL> r
-
1 SELECT PROPERTY_NAME, SUBSTR(property_value, 1, 30) value
-
2 FROM DATABASE_PROPERTIES
-
3 WHERE PROPERTY_NAME LIKE \'DST_%\'
-
4* ORDER BY PROPERTY_NAME
-
-
PROPERTY_NAME VALUE
-
---------------------------------------- ------------------------------------------------------------------------------------------------------------------------
-
DST_PRIMARY_TT_VERSION 18
-
DST_SECONDARY_TT_VERSION 0
-
DST_UPGRADE_STATE NONE
-
-
SQL> select * from v$timezone_file;
-
-
FILENAME VERSION CON_ID
-
-------------------- ---------- ----------
-
timezlrg_18.dat 18 0
-
-
SQL> select TZ_VERSION from registry$database;
-
-
TZ_VERSION
-
----------
- 18
6.6 字符集檢查:
檢查國家字符集,如果是以下字符集則不需要做操作:
如果返回結果是 UTF8 或者 AL16UTF16,那麼什麼都不需要做了。
如果返回結果不是 UTF8 或者 AL16UTF16,那麼請參考下面的文件:
Note 276914.1 The National Character Set ( NLS_NCHAR_CHARACTERSET ) in
Oracle 9i, 10g , 11g and 12c (文件 ID 276914.1)
-
SQL> select value from nls_database_parameters where parameter=\'NLS_NCHAR_CHARACTERSET\';
-
-
VALUE
-
--------------------------------------------------------------------------------
- AL16UTF16
6.7 修改引數檔案中的版本號:
-
SQL> show parameter compatible
-
-
NAME TYPE VALUE
-
------------------------------------ ----------- ------------------------------
-
compatible string 11.2.0.0.0
-
noncdb_compatible boolean FALSE
-
-
SQL> alter system set compatible = \'12.1.0.1.0\' scope=spfile;
-
System altered.
-
-
SQL> startup force;
-
ORACLE instance started.
-
-
Total System Global Area 2772574208 bytes
-
Fixed Size 2292240 bytes
-
Variable Size 2533361136 bytes
-
Database Buffers 218103808 bytes
-
Redo Buffers 18817024 bytes
-
Database mounted.
-
Database opened.
-
SQL>
-
SQL> show parameter compatible
-
-
NAME TYPE VALUE
-
------------------------------------ ----------- ------------------------------
-
compatible string 12.1.0.1.0
-
noncdb_compatible boolean FALSE
- SQL>
至此,經過漫長而辛苦的升級,我們已經將11.2.0.4順利升級到了12.1.0.1,整個升級過程雖然有點長,但還是比較順利的。故需再生產環境中升級請大家務必預留好可用於升級的時間視窗,升級時間確實是非常的長。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8494287/viewspace-1405560/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 探索Oracle之資料庫升級四 11.2.0.4.0 PSU 11.2.0.4.3Oracle資料庫
- 探索Oracle之資料庫升級五 PSU 11.2.0.4.3 rollback 11.2.0.4.0Oracle資料庫
- 探索Oracle之資料庫升級一 升級補丁修復概述Oracle資料庫
- 探索Oracle之資料庫升級九 12.1.0.1 Update 12.1.0.2Oracle資料庫
- 探索Oracle之資料庫升級二 11.2.0.3升級到11.2.0.4完整步驟Oracle資料庫
- 探索Oracle之資料庫升級三 回退升級操作(11.2.0.4Downgrade 11.2.0.3)Oracle資料庫
- Oracle 11.2.0.4升級到12.2.0.1Oracle
- 探索Oracle之資料庫升級七 11gR2 to 12c 升級完成後插入PDBOracle資料庫
- Oracle 資料庫升級Oracle資料庫
- 探索Oracle之資料庫升級八 12c Downgrade 11gR2Oracle資料庫
- 資料庫升級之-XTTS資料庫TTS
- 資料庫升級之-Dataguard滾動升級資料庫
- 資料庫升級之-資料泵資料庫
- 探索Oracle之資料庫升級十 12c(12.1.0.2) CPU 19774304Oracle資料庫
- Oracle資料庫升級(轉發)Oracle資料庫
- Oracle 資料庫 升級為 RACOracle資料庫
- Oracle-Database-12c-12.2.0.1升級實戰OracleDatabase
- rac 升級crs 升級資料庫軟體,升級資料庫資料庫
- oracle資料庫升級11.2.0.3升級到11.2.0.4Oracle資料庫
- Oracle資料庫升級與補丁Oracle資料庫
- Oracle 資料庫升級注意事項Oracle資料庫
- 靜默方式安裝、升級oracle(三): 升級資料庫軟體及資料庫Oracle資料庫
- android資料庫如何進行版本升級?架構之資料庫框架升級Android資料庫架構框架
- 資料庫升級資料庫
- ♀♀資料庫升級♀♀資料庫
- 圖形化升級單機oracle 11.2.0.4 到 12.2.0.1Oracle
- ORACLE資料庫升級詳細步驟Oracle資料庫
- 【UP_ORACLE】使用AutoUpgrade工具升級Oracle 11.2.0.4至12.2.0.1Oracle
- RAC 資料庫升級 10.2.0.1.0 到 10.2.0.2.0 之升級catalog資料庫
- Oracle 12c資料庫升級實戰Oracle資料庫
- oracle資料庫11.2.0.3升級到11.2.0.4Oracle資料庫
- ZT 升級和移植Oracle資料庫方法若干Oracle資料庫
- Oracle資料庫異機升級(10.2.0.5 --> 11.2.0.4)Oracle資料庫
- oracle 資料庫從10.2.0.4升級到11.2.0.3Oracle資料庫
- Oracle資料庫升級前必要的準備工作Oracle資料庫
- 資料庫升級和工具資料庫
- 資料庫升級報錯資料庫
- 生產庫升級:oracle 9.2.0.1升級oracle 9.2.0.8Oracle