Step by Step oracle database 10gR2 upgrade to 11.2.0.2(九)

2014-11-24 08:58:48 · 作者: · 浏览: 9
to gather the statistics --

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

EXEC DBMS_STATS.GATHER_DICTIONARY_STATS('CTXSYS', OPTIONS=>'GATHER STALE', ESTIMATE_PERCENT=>DBMS_STATS.AUTO_SAMPLE_SIZE, METHOD_OPT=>'FOR ALL COLUMNS SIZE AUTO', CASCADE=>TRUE);

-- There are no stale statistics in DMSYS schema.

-- There are no stale statistics in EXFSYS schema.

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

-- MDSYS schema contains stale statistics use the following to gather the statistics --

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

EXEC DBMS_STATS.GATHER_DICTIONARY_STATS('MDSYS', OPTIONS=>'GATHER STALE', ESTIMATE_PERCENT=>DBMS_STATS.AUTO_SAMPLE_SIZE, METHOD_OPT=>'FOR ALL COLUMNS SIZE AUTO', CASCADE=>TRUE);

-- There are no stale statistics in ORDSYS schema.

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

-- SYS schema contains stale statistics use the following to gather the statistics --

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

EXEC DBMS_STATS.GATHER_DICTIONARY_STATS('SYS', OPTIONS=>'GATHER STALE', ESTIMATE_PERCENT=>DBMS_STATS.AUTO_SAMPLE_SIZE, METHOD_OPT=>'FOR ALL COLUMNS SIZE AUTO', CASCADE=>TRUE);

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

-- SYSMAN schema contains stale statistics use the following to gather the statistics --

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

EXEC DBMS_STATS.GATHER_DICTIONARY_STATS('SYSMAN', OPTIONS=>'GATHER STALE', ESTIMATE_PERCENT=>DBMS_STATS.AUTO_SAMPLE_SIZE, METHOD_OPT=>'FOR ALL COLUMNS SIZE AUTO', CASCADE=>TRUE);

-- There are no stale statistics in WMSYS schema.

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

-- XDB schema contains stale statistics use the following to gather the statistics --

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

EXEC DBMS_STATS.GATHER_DICTIONARY_STATS('XDB', OPTIONS=>'GATHER STALE', ESTIMATE_PERCENT=>DBMS_STATS.AUTO_SAMPLE_SIZE, METHOD_OPT=>'FOR ALL COLUMNS SIZE AUTO', CASCADE=>TRUE);

根据上面结果,执行相关的SQL即可。

11. Check for TIMESTAMP WITH TIMEZONE Datatype

select TZ_VERSION from registry$database;

12. Check that the National Characterset (NLS_NCHAR_CHARACTERSET) is UTF8 or AL16UTF16.

select value from NLS_DATABASE_PARAMETERS where parameter = 'NLS_NCHAR_CHARACTERSET';

If this is UTF8 or AL16UTF16 then no action is needed.

If is not UTF8 or AL16UTF16 then refer to the following article:

Note 276914.1 The National Character Set in Oracle 9i and 10g.

13. Optimizer Statistics

$ sqlplus "/as sysdba"

SQL> @check_schema_stale_stats.SQL

SQL> EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;

14. Disable Oracle Database Vault

15. Backing up Enterprise Manager Database Control Data

16. check 数据字典错误

SET verify off

SET SPACE 0

SET line 120

SET heading off

SET feedback off

SET page