Oracle 資料庫升級

chenoracle發表於2015-08-04

Oracle 資料庫升級

 

                    升級

  目的: 11.2.0.1.0--------&gt11.2.0.3.0

 

原庫基本資訊

 

1 檢視資料庫版本

SQL> select * from v$version where rownum<=2;

BANNER

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

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

PL/SQL Release 11.2.0.1.0 - Production

 

2 檢視失效的物件

SQL> select count(*) from dba_objects where status='INVALID';

  COUNT(*)

----------

         0

 

3 檢視引數

SQL> show parameter shared

NAME                                 TYPE                   VALUE

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

hi_shared_memory_address             integer                0

max_shared_servers                   integer

shared_memory_address                integer                0

shared_pool_reserved_size            big integer            3774873

shared_pool_size                     big integer            0

shared_server_sessions               integer

shared_servers                       integer                1

 

4 檢視 SGA

SQL> show sga

Total System Global Area  409194496 bytes

Fixed Size                  2213856 bytes

Variable Size             289409056 bytes

Database Buffers          113246208 bytes

Redo Buffers                4325376 bytes

 

5 檢視審計表

SQL> select * from aud$;

 

6 檢視各個元件版本

SQL> col comp_name for a40

SQL> col status for a10

SQL> col version for a20

SQL> select comp_name,status,version from dba_server_registry;

COMP_NAME                                STATUS     VERSION

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

OWB                                      VALID      11.2.0.1.0

Oracle Application Express               VALID      3.2.1.00.10

Oracle Enterprise Manager                VALID      11.2.0.1.0

OLAP Catalog                             VALID      11.2.0.1.0

Spatial                                  VALID      11.2.0.1.0

Oracle Multimedia                        VALID      11.2.0.1.0

Oracle XML Database                      VALID      11.2.0.1.0

Oracle Text                              VALID      11.2.0.1.0

Oracle Expression Filter                 VALID      11.2.0.1.0

Oracle Rules Manager                     VALID      11.2.0.1.0

Oracle Workspace Manager                 VALID      11.2.0.1.0

 

COMP_NAME                                STATUS     VERSION

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

Oracle Database Catalog Views            VALID      11.2.0.1.0

Oracle Database Packages and Types       VALID      11.2.0.1.0

JServer JAVA Virtual Machine             VALID      11.2.0.1.0

Oracle XDK                               VALID      11.2.0.1.0

Oracle Database Java Packages            VALID      11.2.0.1.0

OLAP Analytic Workspace                  VALID      11.2.0.1.0

Oracle OLAP API                          VALID      11.2.0.1.0

 

18 rows selected.

 

 

備份資料庫

SQL> shutdown immediate

 

SQL> startup mount

 

SQL> alter database archivelog;

 

SQL> alter database open;

 

[oracle@chen ~]$ mkdir backup

 

[oracle@chen ~]$ rman target / nocatalog

RMAN> backup database plus archivelog delete input format '/home/oracle/backup/chen_%U.bak';

 

[oracle@chen ~]$ sqlplus / as sysdba

 

停止資料庫,備份資料庫軟體目錄和產品目錄

 

SQL> shutdown immediate

 

[oracle@chen ~]$ lsnrctl stop

 

[oracle@chen ~]$ emctl status dbconsole

Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0

Copyright (c) 1996, 2009 Oracle Corporation.  All rights reserved.

Oracle Enterprise Manager 11g is running.

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

Logs are generated in directory /u01/app/oracle/product/11.2.0/chen_chen/sysman/log

 

[oracle@chen ~]$ emctl stop dbconsole

Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0

Copyright (c) 1996, 2009 Oracle Corporation.  All rights reserved.

Stopping Oracle Enterprise Manager 11g Database Control ...

 

all attemps to stop oc4j failed... now trying to kill 9

--- Failed to shutdown DBConsole Gracefully ---

 ...  Stopped.

 

 

[oracle@chen ~]$ tar -zcvf prou.tar /u01/app/oracle/

 

解壓 11.2.0.3.0 安裝介質

[root@chen u01]# mkdir database-1

[root@chen u01]# mv /root/p10404530_112030_Linux-x86-64_* database-1/

[root@chen database-1]# ll -rth

total 2.4G

-rw-r--r-- 1 root root 1.3G Jun 12 10:39 p10404530_112030_Linux-x86-64_1of7.zip

-rw-r--r-- 1 root root 1.1G Jun 12 11:07 p10404530_112030_Linux-x86-64_2of7.zip

 

[root@chen database-1]# unzip p10404530_112030_Linux-x86-64_1of7.zip

[root@chen database-1]# unzip p10404530_112030_Linux-x86-64_2of7.zip

[root@chen u01]# chown -R oracle.oinstall /u01/

 

  升級資料軟體

1 ./runInstaller

[root@chen database-1]# xhost +

xhost:  unable to open display ""

 

[root@chen database-1]# su - oracle

[oracle@chen database]$ pwd

/u01/database-1/database

 

[oracle@chen database]$ ./runInstaller

[root@chen database-1]# cd /u01/app/oracle/product/11.2.4/

[root@chen 11.2.4]# ./root.sh

Performing root user operation for Oracle 11g

 

The following environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /u01/app/oracle/product/11.2.4

 

Enter the full pathname of the local bin directory: [/usr/local/bin]:

The contents of "dbhome" have not changed. No need to overwrite.

The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)

[n]: y

   Copying oraenv to /usr/local/bin ...

The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)

[n]: y

   Copying coraenv to /usr/local/bin ...

 

Entries will be added to the /etc/oratab file as needed by

Database Configuration Assistant when a database is created

Finished running generic part of root script.

Now product-specific root actions will be performed.

Finished product-specific root actions.

 

3 配置環境變數

[oracle@chen ~]$ vim .bash_profile

......

export ORACLE_HOME=$ORACLE_BASE/product/11.2.4

......

 

[oracle@chen ~]$ source .bash_profile

 

[oracle@chen ~]$ vim /etc/oratab

chen:/u01/app/oracle/product/11.2.4:N

 

4 複製引數檔案

[oracle@chen ~]$ cd $ORACLE_HOME/dbs

[oracle@chen dbs]$ pwd

/u01/app/oracle/product/11.2.4/dbs

[oracle@chen dbs]$ ls

init.ora

[oracle@chen dbs]$ cp /u01/app/oracle/product/11.2.0/dbs/* .

[oracle@chen dbs]$ ls

hc_chen.dat  init.ora  lkCHEN  orapwchen  snapcf_chen.f  spfilechen.ora

 

5 複製網路檔案

[oracle@chen 11.2.4]$ cd $ORACLE_HOME/network/admin

[oracle@chen admin]$ ls

samples  shrept.lst

[oracle@chen admin]$ pwd

/u01/app/oracle/product/11.2.4/network/admin

[oracle@chen admin]$ cp -r /u01/app/oracle/product/11.2.0/network/admin/* .

[oracle@chen admin]$ ls

listener.ora  samples  shrept.lst  sqlnet.ora  tnsnames.ora

 

執行預升級指令碼檢測

1 升級模式啟動資料庫

 

[oracle@chen admin]$ sqlplus / as sysdba

 

SQL*Plus: Release 11.2.0.3.0 Production on Tue Aug 4 13:54:34 2015

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to an idle instance.

 

SQL> startup upgrade;

ORACLE instance started.

 

Total System Global Area  409194496 bytes

Fixed Size                  2228864 bytes

Variable Size             281021824 bytes

Database Buffers          121634816 bytes

Redo Buffers                4308992 bytes

Database mounted.

Database opened.

 

SQL> select instance_name,status from v$instance;

 

INSTANCE_NAME                    STATUS

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

chen                             OPEN MIGRATE

 

2 執行檢測指令碼 ( 檢測是否有不符合升級的選項 )

SQL> spool /home/oracle/c_utl01.txt       

SQL> @$ORACLE_HOME/rdbms/admin/utlu112i.sql

Oracle Database 11.2 Pre-Upgrade Information Tool 08-04-2015 13:58:22

Script Version: 11.2.0.3.0 Build: 001

.

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

Database:

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

--&gt name:          CHEN

--&gt version:       11.2.0.1.0

--&gt compatible:    11.2.0.0.0

--&gt blocksize:     8192

--&gt platform:      Linux x86 64-bit

--&gt timezone file: V11

.

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

Tablespaces: [make adjustments in the current environment]

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

--&gt SYSTEM tablespace is adequate for the upgrade.

.... minimum required size: 679 MB

--&gt SYSAUX tablespace is adequate for the upgrade.

.... minimum required size: 463 MB

--&gt UNDOTBS1 tablespace is adequate for the upgrade.

.... minimum required size: 400 MB

--&gt TEMP tablespace is adequate for the upgrade.

.... minimum required size: 60 MB

.

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

Flashback: OFF

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

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

Update Parameters: [Update Oracle Database 11.2 init.ora or spfile]

Note: Pre-upgrade tool was run on a lower version 64-bit database.

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

--&gt If Target Oracle is 32-Bit, refer here for Update Parameters:

WARNING: --&gt "memory_target" needs to be increased to at least 436 MB

.

--&gt If Target Oracle is 64-Bit, refer here for Update Parameters:

WARNING: --&gt "memory_target" needs to be increased to at least 620 MB

.

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

Renamed Parameters: [Update Oracle Database 11.2 init.ora or spfile]

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

-- No renamed parameters found. No changes are required.

.

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

Obsolete/Deprecated Parameters: [Update Oracle Database 11.2 init.ora or spfile]

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

-- No obsolete parameters found. No changes are required

.

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

Components: [The following database components will be upgraded or installed]

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

--&gt Oracle Catalog Views         [upgrade]  VALID

--&gt Oracle Packages and Types    [upgrade]  VALID

--&gt JServer JAVA Virtual Machine [upgrade]  VALID

--&gt Oracle XDK for Java          [upgrade]  VALID

--&gt Oracle Workspace Manager     [upgrade]  VALID

--&gt OLAP Analytic Workspace      [upgrade]  VALID

--&gt OLAP Catalog                 [upgrade]  VALID

--&gt EM Repository                [upgrade]  VALID

--&gt Oracle Text                  [upgrade]  VALID

--&gt Oracle XML Database          [upgrade]  VALID

--&gt Oracle Java Packages         [upgrade]  VALID

--&gt Oracle interMedia            [upgrade]  VALID

--&gt Spatial                      [upgrade]  VALID

--&gt Expression Filter            [upgrade]  VALID

--&gt Rule Manager                 [upgrade]  VALID

--&gt Oracle Application Express   [upgrade]  VALID

... APEX will only be upgraded if the version of APEX in

... the target Oracle home is higher than the current one.

--&gt Oracle OLAP API              [upgrade]  VALID

.

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

Miscellaneous Warnings

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

WARNING: --&gt Database is using a timezone file older than version 14.

.... After the release migration, it is recommended that DBMS_DST package

.... be used to upgrade the 11.2.0.1.0 database timezone version

.... to the latest version which comes with the new release.

WARNING: --&gt Database contains INVALID objects prior to upgrade.

.... The list of invalid SYS/SYSTEM objects was written to

.... registry$sys_inv_objs.

.... The list of non-SYS/SYSTEM objects was written to

.... registry$nonsys_inv_objs.

.... Use utluiobj.sql after the upgrade to identify any new invalid

.... objects due to the upgrade.

.... USER PUBLIC has 8 INVALID objects.

.... USER CTXSYS has 1 INVALID objects.

.... USER SYS has 11 INVALID objects.

WARNING: --&gt Database contains schemas with objects dependent on DBMS_LDAP package.

.... Refer to the 11g Upgrade Guide for instructions to configure Network ACLs.

.... USER APEX_030200 has dependent objects.

.

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

Recommendations

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

Oracle recommends gathering dictionary statistics prior to

upgrading the database.

To gather dictionary statistics execute the following command

while connected as SYSDBA:

 

    EXECUTE dbms_stats.gather_dictionary_stats;

 

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

Oracle recommends removing all hidden parameters prior to upgrading.

 

To view existing hidden parameters execute the following command

while connected AS SYSDBA:

 

    SELECT name,description from SYS.V$PARAMETER WHERE name

        LIKE '\_%' ESCAPE '\'

 

Changes will need to be made in the init.ora or spfile.

 

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

Oracle recommends reviewing any defined events prior to upgrading.

 

To view existing non-default events execute the following commands

while connected AS SYSDBA:

  Events:

    SELECT (translate(value,chr(13)||chr(10),' ')) FROM sys.v$parameter2

      WHERE  UPPER(name) ='EVENT' AND  isdefault='FALSE'

 

  Trace Events:

    SELECT (translate(value,chr(13)||chr(10),' ')) from sys.v$parameter2

      WHERE UPPER(name) = '_TRACE_EVENTS' AND isdefault='FALSE'

 

Changes will need to be made in the init.ora or spfile.

 

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

SQL> spool off

 

3 檢視並修改不滿足項

SQL> show parameter shared

NAME                                 TYPE                   VALUE

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

hi_shared_memory_address             integer                0

max_shared_servers                   integer

shared_memory_address                integer                0

shared_pool_reserved_size            big integer            6501171

shared_pool_size                     big integer            0

shared_server_sessions               integer

shared_servers                       integer                1

 

4 啟動資料庫閃回,建立回滾點

SQL> select flashback_on from v$database;

 

FLASHBACK_ON

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

NO

 

SQL> shutdown immediate

 

SQL> startup mount

 

SQL> alter database flashback on;

 

SQL> create restore point chen_rollback guarantee flashback database;  

 

Restore point created.

 

SQL> col name for a15

SQL> select scn,name,storage_size from v$restore_point;

 

       SCN NAME            STORAGE_SIZE

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

    968263 CHEN_ROLLBACK       52428800

 

 

5 再次進行檢查

SQL> @$ORACLE_HOME/rdbms/admin/utlu112i.sql

Oracle Database 11.2 Pre-Upgrade Information Tool 08-04-2015 14:14:24

Script Version: 11.2.0.3.0 Build: 001

.

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

Database:

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

--&gt name:          CHEN

--&gt version:       11.2.0.3.0

--&gt compatible:    11.2.0.0.0

--&gt blocksize:     8192

--&gt timezone file: V14

.

WARNING: --&gt Database not in OPEN state.

   Database must be in OPEN state for script to execute correctly.

   Current Status: MOUNTED.

 

SQL> shutdown immediate

 

SQL> startup upgrade;

ORACLE instance started.

 

Total System Global Area  409194496 bytes

Fixed Size                  2228864 bytes

Variable Size             281021824 bytes

Database Buffers          121634816 bytes

Redo Buffers                4308992 bytes

Database mounted.

Database opened.

 

SQL> @$ORACLE_HOME/rdbms/admin/utlu112i.sql

Oracle Database 11.2 Pre-Upgrade Information Tool 08-04-2015 14:17:12

Script Version: 11.2.0.3.0 Build: 001

.

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

Database:

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

--&gt name:          CHEN

--&gt version:       11.2.0.1.0

--&gt compatible:    11.2.0.0.0

--&gt blocksize:     8192

--&gt platform:      Linux x86 64-bit

--&gt timezone file: V11

.

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

Tablespaces: [make adjustments in the current environment]

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

--&gt SYSTEM tablespace is adequate for the upgrade.

.... minimum required size: 679 MB

--&gt SYSAUX tablespace is adequate for the upgrade.

.... minimum required size: 463 MB

--&gt UNDOTBS1 tablespace is adequate for the upgrade.

.... minimum required size: 400 MB

--&gt TEMP tablespace is adequate for the upgrade.

.... minimum required size: 60 MB

.

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

Flashback: ON

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

FlashbackInfo:

--&gt name:          /u01/app/oracle/flash_recovery_area

--&gt limit:         3882 MB

--&gt used:          1090 MB

--&gt size:          3882 MB

--&gt reclaim:       0 MB

--&gt files:         5

WARNING: --&gt Flashback Recovery Area Set.  Please ensure adequate disk space     in recover

y areas before performing an upgrade.

.

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

Update Parameters: [Update Oracle Database 11.2 init.ora or spfile]

Note: Pre-upgrade tool was run on a lower version 64-bit database.

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

--&gt If Target Oracle is 32-Bit, refer here for Update Parameters:

WARNING: --&gt "memory_target" needs to be increased to at least 436 MB

.

 

--&gt If Target Oracle is 64-Bit, refer here for Update Parameters:

WARNING: --&gt "memory_target" needs to be increased to at least 620 MB

.

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

Renamed Parameters: [Update Oracle Database 11.2 init.ora or spfile]

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

-- No renamed parameters found. No changes are required.

.

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

Obsolete/Deprecated Parameters: [Update Oracle Database 11.2 init.ora or spfile]

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

-- No obsolete parameters found. No changes are required

.

 

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

Components: [The following database components will be upgraded or installed]

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

--&gt Oracle Catalog Views         [upgrade]  VALID

--&gt Oracle Packages and Types    [upgrade]  VALID

--&gt JServer JAVA Virtual Machine [upgrade]  VALID

--&gt Oracle XDK for Java          [upgrade]  VALID

--&gt Oracle Workspace Manager     [upgrade]  VALID

--&gt OLAP Analytic Workspace      [upgrade]  VALID

--&gt OLAP Catalog                 [upgrade]  VALID

--&gt EM Repository                [upgrade]  VALID

--&gt Oracle Text                  [upgrade]  VALID

--&gt Oracle XML Database          [upgrade]  VALID

--&gt Oracle Java Packages         [upgrade]  VALID

--&gt Oracle interMedia            [upgrade]  VALID

--&gt Spatial                      [upgrade]  VALID

--&gt Expression Filter            [upgrade]  VALID

--&gt Rule Manager                 [upgrade]  VALID

--&gt Oracle Application Express   [upgrade]  VALID

... APEX will only be upgraded if the version of APEX in

... the target Oracle home is higher than the current one.

--&gt Oracle OLAP API              [upgrade]  VALID

.

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

Miscellaneous Warnings

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

WARNING: --&gt Database is using a timezone file older than version 14.

.... After the release migration, it is recommended that DBMS_DST package

.... be used to upgrade the 11.2.0.1.0 database timezone version

.... to the latest version which comes with the new release.

WARNING: --&gt Database contains INVALID objects prior to upgrade.

.... The list of invalid SYS/SYSTEM objects was written to

.... registry$sys_inv_objs.

.... The list of non-SYS/SYSTEM objects was written to

.... registry$nonsys_inv_objs.

.... Use utluiobj.sql after the upgrade to identify any new invalid

.... objects due to the upgrade.

.... USER PUBLIC has 8 INVALID objects.

.... USER CTXSYS has 1 INVALID objects.

.... USER SYS has 11 INVALID objects.

WARNING: --&gt Your recycle bin is turned on and currently contains no objects.

.... Because it is REQUIRED that the recycle bin be empty prior to upgrading

.... and your recycle bin is turned on, you may need to execute the command:

        PURGE DBA_RECYCLEBIN

.... prior to executing your upgrade to confirm the recycle bin is empty.

WARNING: --&gt Database contains schemas with objects dependent on DBMS_LDAP package.

.... Refer to the 11g Upgrade Guide for instructions to configure Network ACLs.

.... USER APEX_030200 has dependent objects.

.

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

Recommendations

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

Oracle recommends gathering dictionary statistics prior to

upgrading the database.

To gather dictionary statistics execute the following command

while connected as SYSDBA:

 

    EXECUTE dbms_stats.gather_dictionary_stats;

 

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

Oracle recommends removing all hidden parameters prior to upgrading.

 

To view existing hidden parameters execute the following command

while connected AS SYSDBA:

 

    SELECT name,description from SYS.V$PARAMETER WHERE name

        LIKE '\_%' ESCAPE '\'

 

Changes will need to be made in the init.ora or spfile.

 

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

Oracle recommends reviewing any defined events prior to upgrading.

 

To view existing non-default events execute the following commands

while connected AS SYSDBA:

  Events:

    SELECT (translate(value,chr(13)||chr(10),' ')) FROM sys.v$parameter2

      WHERE  UPPER(name) ='EVENT' AND  isdefault='FALSE'

 

  Trace Events:

    SELECT (translate(value,chr(13)||chr(10),' ')) from sys.v$parameter2

      WHERE UPPER(name) = '_TRACE_EVENTS' AND isdefault='FALSE'

 

Changes will need to be made in the init.ora or spfile.

 

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

 

 

SQL> select count(*) from dba_objects where status='INVALID';

 

  COUNT(*)

----------

       172

 

執行升級指令碼

 

1 資料庫以升級模式啟動

SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

 

SQL> startup upgrade;

ORACLE instance started.

 

Total System Global Area  409194496 bytes

Fixed Size                  2228864 bytes

Variable Size             281021824 bytes

Database Buffers          121634816 bytes

Redo Buffers                4308992 bytes

Database mounted.

Database opened.

 

2 執行升級指令碼

SQL> set echo on

SQL> spool /home/oracle/upgrade.log

SQL> set time on

14:30:37 SQL> @$ORACLE_HOME/rdbms/admin/catupgrd.sql

。。。。。。

15:24:47 SQL> Rem check instance version and status; set session attributes

15:24:47 SQL> EXECUTE dbms_registry.check_server_instance;

ERROR:

ORA-03114: not connected to ORACLE

 

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

 

升級完成後,編譯失效物件

 

1 啟動資料庫 open

SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

 

SQL> startup

ORACLE instance started.

 

Total System Global Area  409194496 bytes

Fixed Size                  2228864 bytes

Variable Size             394268032 bytes

Database Buffers            8388608 bytes

Redo Buffers                4308992 bytes

Database mounted.

Database opened.

 

2 檢視失效物件個數

SQL> select count(*) from dba_objects where status='INVALID';

 

  COUNT(*)

----------

      2407

 

3 執行 utlrp.sql 指令碼,編譯失效物件

SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql

 

TIMESTAMP

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

COMP_TIMESTAMP UTLRP_BGN  2015-08-04 15:29:53

 

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  2015-08-04 15:34:04

 

DOC> The following query reports the number of objects that have compiled

DOC> with errors (objects that compile with errors have status set to 3 in

DOC> obj$). 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

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

                  4

 

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.

 

4 再次檢視失效物件個數

SQL> select count(*) from dba_objects where status='INVALID';

  COUNT(*)

----------

        78

 

檢視升級後資料庫版本等資訊

 

1 檢視資料庫個元件版本

SQL> col comp_name for a40

SQL> col status for a10

SQL> col version for a20

SQL> select comp_name,status,version from dba_server_registry;

COMP_NAME                                STATUS     VERSION

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

OWB                                      VALID      11.2.0.1.0

Oracle Application Express               VALID      3.2.1.00.10

Oracle Enterprise Manager                VALID      11.2.0.3.0

OLAP Catalog                             VALID      11.2.0.3.0

Spatial                                  INVALID    11.2.0.1.0

Oracle Multimedia                        VALID      11.2.0.3.0

Oracle XML Database                      VALID      11.2.0.3.0

Oracle Text                              VALID      11.2.0.3.0

Oracle Expression Filter                 VALID      11.2.0.1.0

Oracle Rules Manager                     VALID      11.2.0.1.0

Oracle Workspace Manager                 VALID      11.2.0.1.0

 

COMP_NAME                                STATUS     VERSION

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

Oracle Database Catalog Views            VALID      11.2.0.3.0

Oracle Database Packages and Types       VALID      11.2.0.3.0

JServer JAVA Virtual Machine             VALID      11.2.0.3.0

Oracle XDK                               VALID      11.2.0.3.0

Oracle Database Java Packages            VALID      11.2.0.3.0

OLAP Analytic Workspace                  VALID      11.2.0.3.0

Oracle OLAP API                          VALID      11.2.0.1.0

 

18 rows selected.

 

2 檢視資料庫版本號

SQL> select * from v$version where rownum<=2;

BANNER

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

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

PL/SQL Release 11.2.0.3.0 - Production

 

[oracle@chen ~]$ emctl status dbconsole

Environment variable ORACLE_UNQNAME not defined. Please set ORACLE_UNQNAME to database unique name.

[oracle@chen ~]$ export ORACLE_UNQNAME=$ORACLE_SID

[oracle@chen ~]$ emctl status dbconsole

OC4J Configuration issue. /u01/app/oracle/product/11.2.4/oc4j/j2ee/OC4J_DBConsole_chen_chen not found.


歡迎關注我的微信公眾號"IT小Chen",共同學習,共同成長!!!

Oracle 資料庫升級

Oracle 資料庫升級



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

相關文章