【操作】資料庫部分升級到10.2.0.3(補充)

secooler發表於2009-08-23
這個文章是《【操作】升級資料庫軟體到10.2.0.3》http://space.itpub.net/?uid-519536-action-viewspace-itemid-612530的補充

在Oracle軟體部分升級之後,補充一下資料庫部分的升級過程。

主要是分兩步走
第一步:升級資料字典;
第二步:檢查無效的物件,對無效的物件進行編譯


以下詳細記錄了資料庫部分升級的過程。

1.升級資料字典
1)以upgrade形式啟動資料庫
SQL> startup upgrade;
ORACLE instance started.

Total System Global Area 1577058304 bytes
Fixed Size                  2073024 bytes
Variable Size             385879616 bytes
Database Buffers         1174405120 bytes
Redo Buffers               14700544 bytes
Database mounted.
Database opened.

2)執行catupgrd.sql指令碼升級資料字典
SQL@> spool upgrade.log
SQL@> @?/rdbms/admin/catupgrd.sql
注:這裡輸出大量的資訊,而且升級需要很長時間,可以先去休息一下。
SQL> spool off

3)停掉資料庫,完成資料字典的升級
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.


2.檢查無效的物件,對無效的物件進行編譯
1)啟動資料庫
SQL> startup;
ORACLE instance started.

Total System Global Area 1577058304 bytes
Fixed Size                  2073024 bytes
Variable Size             385879616 bytes
Database Buffers         1174405120 bytes
Redo Buffers               14700544 bytes
Database mounted.
Database opened.

2)檢查是否有無效物件需要編譯
SQL> select count(*) from dba_objects where status='INVALID';

  COUNT(*)
----------
       192

SQL> set lin 120
SQL> set pages 0
SQL> col OBJECT_NAME for a50
SQL> select owner,object_name from dba_objects where status='INVALID';
SYS                            DBA_LOCK_INTERNAL
PUBLIC                         DBA_LOCK_INTERNAL
SYS                            DBA_DDL_LOCKS
PUBLIC                         DBA_DDL_LOCKS
SYS                            AQ$_AQ_SRVNTFN_TABLE_F
SYS                            AQ$AQ_SRVNTFN_TABLE
SYS                            AQ$_SCHEDULER$_JOBQTAB_F
SYS                            AQ$SCHEDULER$_JOBQTAB
SYS                            AQ$SCHEDULER$_JOBQTAB_R
SYS                            AQ$_SCHEDULER$_EVENT_QTAB_F
SYS                            AQ$SCHEDULER$_EVENT_QTAB_R
SYS                            AQ$_AQ$_MEM_MC_F
SYS                            AQ$_ALERT_QT_F
SYS                            AQ$ALERT_QT_R
SYS                            AQ$_SYS$SERVICE_METRICS_TAB_F
SYS                            AQ$SYS$SERVICE_METRICS_TAB_R
SYS                            LTADM
WMSYS                          WM$GETDBVERSIONSTR
SYS                            LT_CTX_PKG
SYS                            LTUTIL
SYS                            LTRIC
SYS                            LTDDL
SYS                            UD_TRIGS
SYS                            OWM_DDL_PKG
SYS                            OWM_MP_PKG
SYS                            USER_WORKSPACES
PUBLIC                         USER_WORKSPACES
SYS                            ALL_WORKSPACES
SYS                            DBA_WORKSPACES
WMSYS                          USER_WORKSPACE_PRIVS
WMSYS                          USER_WM_VERSIONED_TABLES
WMSYS                          ALL_WM_VERSIONED_TABLES
WMSYS                          DBA_WM_VERSIONED_TABLES
WMSYS                          ALL_WM_MODIFIED_TABLES
WMSYS                          ALL_WM_TAB_TRIGGERS
SYS                            DBA_WORKSPACE_SESSIONS
WMSYS                          USER_WM_RIC_INFO
WMSYS                          ALL_WM_RIC_INFO
WMSYS                          WM$ALL_LOCKS_VIEW
WMSYS                          ALL_WM_LOCKED_TABLES
WMSYS                          USER_WM_LOCKED_TABLES
PUBLIC                         ALL_WORKSPACES
PUBLIC                         USER_WORKSPACE_PRIVS
PUBLIC                         USER_WM_VERSIONED_TABLES
PUBLIC                         ALL_WM_VERSIONED_TABLES
PUBLIC                         ALL_WM_MODIFIED_TABLES
PUBLIC                         ALL_WM_TAB_TRIGGERS
PUBLIC                         DBA_WORKSPACE_SESSIONS
PUBLIC                         USER_WM_RIC_INFO
PUBLIC                         ALL_WM_RIC_INFO
PUBLIC                         ALL_WM_LOCKED_TABLES
PUBLIC                         USER_WM_LOCKED_TABLES
PUBLIC                         DBA_WORKSPACES
PUBLIC                         DBA_WM_VERSIONED_TABLES
WMSYS                          ALL_WM_VT_ERRORS
PUBLIC                         ALL_WM_VT_ERRORS
SYS                            WM$WORKSPACE_SESSIONS_VIEW
WMSYS                          USER_WM_CONSTRAINTS
PUBLIC                         USER_WM_CONSTRAINTS
WMSYS                          ALL_WM_CONSTRAINTS
PUBLIC                         ALL_WM_CONSTRAINTS
WMSYS                          USER_WM_IND_COLUMNS
PUBLIC                         USER_WM_IND_COLUMNS
WMSYS                          ALL_WM_IND_COLUMNS
PUBLIC                         ALL_WM_IND_COLUMNS
WMSYS                          USER_WM_IND_EXPRESSIONS
PUBLIC                         USER_WM_IND_EXPRESSIONS
WMSYS                          ALL_WM_IND_EXPRESSIONS
PUBLIC                         ALL_WM_IND_EXPRESSIONS
WMSYS                          USER_WM_CONS_COLUMNS
PUBLIC                         USER_WM_CONS_COLUMNS
WMSYS                          ALL_WM_CONS_COLUMNS
PUBLIC                         ALL_WM_CONS_COLUMNS
WMSYS                          USER_MP_PARENT_WORKSPACES
PUBLIC                         USER_MP_PARENT_WORKSPACES
WMSYS                          ALL_MP_PARENT_WORKSPACES
PUBLIC                         ALL_MP_PARENT_WORKSPACES
WMSYS                          USER_MP_GRAPH_WORKSPACES
PUBLIC                         USER_MP_GRAPH_WORKSPACES
WMSYS                          ALL_MP_GRAPH_WORKSPACES
PUBLIC                         ALL_MP_GRAPH_WORKSPACES
WMSYS                          AQ$_WM$EVENT_QUEUE_TABLE_F
WMSYS                          AQ$WM$EVENT_QUEUE_TABLE_R
SYS                            WM_COMPRESS_BATCH_SIZES
PUBLIC                         WM_COMPRESS_BATCH_SIZES
SYS                            LTUTIL
SYS                            LT_CTX_PKG
SYS                            LTADM
SYS                            LTRIC
SYS                            LTDTRG
SYS                            LTAQ
SYS                            WM_DDL_UTIL
SYS                            LTDDL
SYS                            LTPRIV
SYS                            LT_EXPORT_PKG
SYS                            UD_TRIGS
SYS                            OWM_DDL_PKG
SYS                            OWM_REPUTIL
SYS                            OWM_MIG_PKG
SYS                            OWM_BULK_LOAD_PKG
SYS                            OWM_MP_PKG
SYS                            OWM_IEXP_PKG
SYS                            LT
SYS                            NO_VM_DROP_PROC
SYS                            NO_VM_DROP
SYS                            NO_VM_DROP_A
SYS                            VALIDATE_OWM
WMSYS                          VALIDATE_OWM
PUBLIC                         MGMT$ALERT_CURRENT
PUBLIC                         MGMT$ALERT_HISTORY
PUBLIC                         MGMT$AVAILABILITY_CURRENT
PUBLIC                         MGMT$AVAILABILITY_HISTORY
PUBLIC                         MGMT$BLACKOUT_HISTORY
PUBLIC                         MGMT$CLUSTER_INTERCONNECTS
PUBLIC                         MGMT$CSA_CLIENTS
PUBLIC                         MGMT$CSA_HOST_COOKIES
PUBLIC                         MGMT$CSA_HOST_CPUS
PUBLIC                         MGMT$CSA_HOST_CUSTOM
PUBLIC                         MGMT$CSA_HOST_IOCARDS
PUBLIC                         MGMT$CSA_HOST_NICS
PUBLIC                         MGMT$CSA_HOST_OS_COMPONENTS
PUBLIC                         MGMT$CSA_HOST_OS_FILESYSTEMS
PUBLIC                         MGMT$CSA_HOST_OS_PROPERTIES
PUBLIC                         MGMT$CSA_HOST_SW
PUBLIC                         MGMT$DB_CONTROLFILES
PUBLIC                         MGMT$DB_DATAFILES
PUBLIC                         MGMT$DB_DBNINSTANCEINFO
PUBLIC                         MGMT$DB_FEATUREUSAGE
PUBLIC                         MGMT$DB_INIT_PARAMS
PUBLIC                         MGMT$DB_LICENSE
PUBLIC                         MGMT$DB_REDOLOGS
PUBLIC                         MGMT$DB_ROLLBACK_SEGS
PUBLIC                         MGMT$DB_SGA
PUBLIC                         MGMT$DB_TABLESPACES
PUBLIC                         MGMT$DELTA_COMPONENTS
PUBLIC                         MGMT$DELTA_COMPONENT_DETAILS
PUBLIC                         MGMT$DELTA_FS_MOUNT
PUBLIC                         MGMT$DELTA_HARDWARE
PUBLIC                         MGMT$DELTA_HOST_CONFIG
PUBLIC                         MGMT$DELTA_INIT
PUBLIC                         MGMT$DELTA_ONEOFF_PATCHES
PUBLIC                         MGMT$DELTA_ORACLE_HOME
PUBLIC                         MGMT$DELTA_OS_COMPONENTS
PUBLIC                         MGMT$DELTA_OS_COMP_DETAILS
PUBLIC                         MGMT$DELTA_OS_KERNEL_PARAMS
PUBLIC                         MGMT$DELTA_PATCHSETS
PUBLIC                         MGMT$DELTA_PATCHSET_DETAILS
PUBLIC                         MGMT$DELTA_TABLESPACES
PUBLIC                         MGMT$DELTA_VENDOR_SW
PUBLIC                         MGMT$DELTA_VIEW
PUBLIC                         MGMT$DELTA_VIEW_DETAILS
PUBLIC                         MGMT$ECM_CURRENT_SNAPSHOTS
PUBLIC                         MGMT$ECM_VISIBLE_SNAPSHOTS
PUBLIC                         MGMT$GROUP_DERIVED_MEMBERSHIPS
PUBLIC                         MGMT$GROUP_FLAT_MEMBERSHIPS
PUBLIC                         MGMT$GROUP_MEMBERS
PUBLIC                         MGMT$HA_BACKUP
PUBLIC                         MGMT$HA_FILES
PUBLIC                         MGMT$HA_INFO
PUBLIC                         MGMT$HA_INIT_PARAMS
PUBLIC                         MGMT$HA_MTTR
PUBLIC                         MGMT$HA_RMAN_CONFIG
PUBLIC                         MGMT$HW_NIC
PUBLIC                         MGMT$INTERFACE_STATS
PUBLIC                         MGMT$METRIC_COLLECTION
PUBLIC                         MGMT$METRIC_CURRENT
PUBLIC                         MGMT$METRIC_DAILY
PUBLIC                         MGMT$METRIC_DETAILS
PUBLIC                         MGMT$METRIC_HOURLY
PUBLIC                         MGMT$MISSING_TARGETS
PUBLIC                         MGMT$MISSING_TARGETS_IN_GROUPS
PUBLIC                         MGMT$OS_COMPONENTS
PUBLIC                         MGMT$OS_FS_MOUNT
PUBLIC                         MGMT$OS_HW_SUMMARY
PUBLIC                         MGMT$OS_KERNEL_PARAMS
PUBLIC                         MGMT$OS_PATCHES
PUBLIC                         MGMT$OS_SUMMARY
PUBLIC                         MGMT$RACDB_INTERCONNECTS
PUBLIC                         MGMT$SOFTWARE_COMPONENTS
PUBLIC                         MGMT$SOFTWARE_COMPONENT_ONEOFF
PUBLIC                         MGMT$SOFTWARE_COMP_PATCHSET
PUBLIC                         MGMT$SOFTWARE_DEPENDENCIES
PUBLIC                         MGMT$SOFTWARE_HOMES
PUBLIC                         MGMT$SOFTWARE_ONEOFF_PATCHES
PUBLIC                         MGMT$SOFTWARE_OTHERS
PUBLIC                         MGMT$SOFTWARE_PATCHES_IN_HOMES
PUBLIC                         MGMT$SOFTWARE_PATCHSETS
PUBLIC                         MGMT$TARGET
PUBLIC                         MGMT$TARGET_COMPONENTS
PUBLIC                         MGMT$TARGET_COMPOSITE
PUBLIC                         MGMT$TARGET_PROPERTIES
PUBLIC                         MGMT$TARGET_TYPE

192 rows selected.

3)使用utlrp.sql指令碼編譯無效的物件
SQL> @?/rdbms/admin/utlrp.sql

4)再次確定是否還存在無效物件
SQL> select count(*) from dba_objects where status='INVALID';

  COUNT(*)
----------
         0

SQL> select owner,object_name from dba_objects where status='INVALID';

no rows selected

5)如不再存在無效物件,重新啟動資料庫完成整個資料庫的升級
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.

Total System Global Area 1577058304 bytes
Fixed Size                  2073024 bytes
Variable Size             385879616 bytes
Database Buffers         1174405120 bytes
Redo Buffers               14700544 bytes
Database mounted.
Database opened.
SQL>


OK,整個資料庫部分的升級告一段落。

-- The End --

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/519536/viewspace-613045/,如需轉載,請註明出處,否則將追究法律責任。

相關文章