Oracle DG/ADG上CPU/PSU補丁安裝

wl365365發表於2015-07-28
1. 保證DG或者ADG的環境是正常的

2. 斷開主庫和備庫的傳輸

3.停止主庫listener和db

4.停止備庫listener和db

5. 確認OPatch的版本是否正確
OPatch Utility Information

You must use the OPatch utility version 11.1.0.6.2 or later. Oracle recommends that you use the latest released OPatch 11.1, which is available for download from My Oracle Support patch 6880880 by selecting the 11.1.0.0.0 release.

For information about OPatch documentation, including any known issues, see My Oracle Support Note 293369.1 OPatch documentation list.

6.確保PATH變數設定正確
有可能遇到crti.o不存在的錯誤,其實是存在的,設定下變數
find / -name crti.o
/usr/lib64/crti.o
/usr/lib/x86_64-redhat-linux5E/lib64/crti.o

LIBRARY_PATH=/usr/lib/x86_64-redhat-linux5E:$LIBRARY_PATH
export LIBRARY_PATH

7.在主庫解壓補丁
unzip p8290402_111060_<platform>.zip

cd 8290402
opatch napply -skip_subset -skip_duplicate

8. 在非RAC環境下操作
	
  1. For each database instance running on the Oracle home being patched:

    1. Connect to the database using SQL*Plus. Connect as SYSDBA and run the catbundle.sql script as follows:

      cd $ORACLE_HOME/rdbms/admin
      sqlplus /nolog
      SQL> CONNECT / AS SYSDBA
      SQL> STARTUP
      SQL> @catbundle.sql cpu apply
      SQL> QUIT
      

      For information about the catbundle.sql script, see My Oracle Support Note 605795.1 Introduction to Oracle Database catbundle.sql.

    2. If you are not applying CPUApr2009 on top of a previous CPU, enter the following statements after running the catbundle.sql script. (If you are applying CPUApr2009 on top of a previous CPU, you do not need to enter the following statements.)

      cd $ORACLE_HOME/rdbms/admin
      sqlplus /nolog
      SQL> CONNECT / AS SYSDBA
      SQL> @utlrp.sql
      
  2. Check the following log files in $ORACLE_HOME/cfgtoollogs/catbundle any errors:

    catbundle_CPU_<database SID>_APPLY_<TIMESTAMP>.log
    catbundle_CPU_<database sid>_GENERATE_<TIMESTAMP>.log
    

    where TIMESTAMP is of the form YYYYMMMDD_HH_MM_SS. If there are errors, refer to Section 4, "Known Issues".

Recompiling Views in the Database

You may skip this section if you have recompiled views for this database during the installation of a previous CPU or if the database was created with release 11.1.0.6 or later.

The time required to recompile the views and related objects depends on the total number of objects and on your system configuration. In one internal Oracle test with approximately 2000 views and 4000 objects, the total execution time for view_recompile_jan2008cpu.sql and utlrp.sql was about 30 minutes.


Note:

Depending on these considerations and your downtime schedule, you can choose to schedule the recompilation of views independent of the rest of the CPU installation. If you do this, your system will continue to work; however, the CPU installation will not be complete until the view recompilation is completed.

If you want to check whether view recompilation has already been performed for the database, execute the following statement.

SELECT * FROM registry$history where ID = '6452863';

If the view recompilation has been performed, this statement returns one or more rows. If the view recompilation has not been performed, this statement returns no rows.

  1. If any invalid objects were reported, run the utlrp.sql script as follows:

    cd $ORACLE_HOME/rdbms/admin
    sqlplus /nolog
    SQL> CONNECT / AS SYSDBA
    SQL> @utlrp.sql
    

    Then, manually recompile any invalid objects. For example:

    SQL> alter package schemaname.packagename compile;

RAC的參照patch中readme就可以了
9. 啟動主庫的listener
10. 在備庫進行軟體的opatch
在備庫解壓補丁 unzip p8290402_111060_<platform>.zip 
cd 8290402
opatch napply -skip_subset -skip_duplicate

11.啟動備庫listener

12.啟動備庫的db

13.將主備庫的同步關係建立
alter system set LOG_ARCHIVE_DEST_STATE_2=enable scope=both;

14.檢查主備庫的同步以及補丁是否應用
select name,SEQUENCE#,APPLIED from v$archived_log order by sequence#;

在primary, standby分別執行opatch lsinventory

在資料庫裡檢查補丁是否安裝成功
SELECT * FROM registry$history where ID = '6452863';



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

相關文章