ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 【操作】数据库部分升级到10.2.0.3(补充)

【操作】数据库部分升级到10.2.0.3(补充)

原创 Linux操作系统 作者:secooler 时间:2009-08-23 20:03:26 0 删除 编辑
这个文章是《【操作】升级数据库软件到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/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
Oracle ACE 总监,阿里云MVP,北京大学理学硕士,恩墨学院创始人,教育专家,中国区 Cloudera 首位官方授权大数据讲师,金牌培训专家,BDA大数据联盟创始人,OCM联盟创始人,ACCUG创始人、ACOUG核心专家,Blogger。

注册时间:2008-03-16

  • 博文量
    797
  • 访问量
    7978271