真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

OJVM+GIPSU補(bǔ)丁升級(jí)

先在DataGuard上執(zhí)行,DataGuard所有節(jié)點(diǎn)升級(jí)成功后,在生產(chǎn)上執(zhí)行,dg不需要執(zhí)行升級(jí)后跑腳本操作,只需當(dāng)主備庫(kù)補(bǔ)丁都打完后在主庫(kù)一個(gè)節(jié)點(diǎn)執(zhí)行即可;
當(dāng)升級(jí)前主庫(kù)需要停止日志傳輸?shù)絺鋷?kù),備庫(kù)需要停止日志應(yīng)用;
當(dāng)升級(jí)完成后注意檢查主備庫(kù)應(yīng)用情況;


核心步驟如下:
1.主庫(kù)禁用日志傳送到備庫(kù)
2.關(guān)閉備庫(kù),應(yīng)用補(bǔ)丁,但不執(zhí)行腳本(catpatch.sql等),啟動(dòng)到mount,不啟用日志恢復(fù)
3.關(guān)閉主庫(kù),應(yīng)用補(bǔ)丁,執(zhí)行腳本(run catpatch/catbundle/catcpu等)
4.啟動(dòng)主庫(kù),重新開啟日志傳送到備庫(kù)
5.備庫(kù)開啟日志恢復(fù)
6.檢查補(bǔ)丁應(yīng)用情況



************************************************
*     一、主備庫(kù)升級(jí)前檢查及相關(guān)操作           *
************************************************
This patch is Data Guard Standby First Installable - See My Oracle Support Document 1265700.1 Oracle Patch Assurance - Data Guard Standby-First Patch Apply for details on how to remove risk and reduce downtime when applying this patch.

---升級(jí)前主庫(kù)/DG備庫(kù)執(zhí)行----
先主庫(kù)停止傳輸日志
alter system set log_archive_dest_state_2=defer;

--備庫(kù)見檢查數(shù)據(jù)庫(kù)狀態(tài),角色;然后備庫(kù)修改,停止日志應(yīng)用,并關(guān)閉所有節(jié)點(diǎn)(根據(jù)所打補(bǔ)丁看是否需要停數(shù)據(jù)庫(kù))
select inst_id,host_name,instance_name,status from gv$instance;
select inst_id,database_role,switchover_status from gv$database;

recover managed standby database cancel;

shutdown immediate;     --根據(jù)所打補(bǔ)丁看是否需要停數(shù)據(jù)庫(kù)



--主/備應(yīng)用補(bǔ)丁如下列一二三四五步驟所述進(jìn)行,注意:備庫(kù)的補(bǔ)丁升級(jí)后注冊(cè)操作不需要做:

************************************************
*     二、以下步驟依次在RAC的所有節(jié)點(diǎn)執(zhí)行      *
************************************************
1. 確認(rèn)opatch版本
   su - oracle
   opatch version   ——11.2.0.3.6或以上
   su - grid
   opatch version   ——11.2.0.3.6或以上

2. 升級(jí)opatch(如果第1步不滿足,則執(zhí)行此步,否則忽略)
   su - oracle
   unzip p6880880_112000_Linux-x86-64.zip -d $ORACLE_HOME
   opatch version
   su - grid
   unzip p6880880_112000_Linux-x86-64.zip -d $GI_HOME
   opatch version



************************************************
*     三、以下步驟依次在RAC的所有節(jié)點(diǎn)執(zhí)行      *
************************************************
打GI PSU
How to Create an OCM Response file to Apply a Patch in Silent Mode - opatch silent (文檔 ID 966023.1)
2.1. 創(chuàng)建OCM文件
   su - oracle
   $ORACLE_HOME/OPatch/ocm/bin/emocmrsp -no_banner -output /home/oracle/ocm.rsp
   chmod 775 /home/oracle/ocm.rsp

-- Validation of Oracle Inventory(以GI和DB用戶分別運(yùn)行)
/OPatch/opatch lsinventory -detail -oh
$ORACLE_HOME/OPatch/opatch lsinventory -detail -oh  $ORACLE_HOME


2.2 停止EM進(jìn)程(如果沒有安裝EM,則忽略)
   su - oracle
   emctl stop dbconsole
   
--One-off Patch Conflict Detection and Resolution補(bǔ)丁沖突檢測(cè)
How to Use the My Oracle Support Conflict Checker Tool for Patches Installed with OPatch [Video] (文檔 ID 1091294.1)

2.3 升級(jí)PSU (As root user, execute the following command on each node of the cluster:不能并行執(zhí)行)
   su - root
   cd /tmp/patch
   unzip p26030870_112040_Linux-x86-64.zip
   opatch auto /tmp/patch/26030870/26030799 -ocmrf /home/oracle/ocm.rsp

使用GI下的opatch工具


*****************************************************
*     四、OJVM補(bǔ)丁升級(jí)                              *
*****************************************************

3. OJVM補(bǔ)丁升級(jí)(db下執(zhí)行)

3.1 檢查補(bǔ)丁沖突
    $ cd /tmp/patch/26030870/26027154
    $ opatch prereq CheckConflictAgainstOHWithDetail -ph ./
    
3.2 檢查數(shù)據(jù)庫(kù)連接數(shù)、關(guān)閉監(jiān)聽、最后關(guān)閉crs(所有節(jié)點(diǎn)都執(zhí)行)
--檢查pmon進(jìn)程:
    ps -ef|grep pmon

--檢查連接數(shù)、殺連接、關(guān)監(jiān)聽
    ps -ef|grep LOCAL=NO|grep -v grep |wc -l
    
    ps -ef|grep LOCAL=NO|grep -v grep|awk '{print $2}'|xargs kill -9    
    
    lsnrctl stop
    
--停crs:
    crsctl stop crs   
   
3.3 應(yīng)用補(bǔ)?。?br />    cd /tmp/patch/26030870/26027154
    opatch apply -local
    
3.4 確認(rèn)補(bǔ)丁數(shù)據(jù)庫(kù)是否應(yīng)用
    opatch lsinventory
    opatch lspatches  
    
3.5 啟所有已經(jīng)打完補(bǔ)丁的節(jié)點(diǎn)的crs
    crsctl start crs


***************************************************************************************
*     五、升級(jí)成功后,在生產(chǎn)的一個(gè)節(jié)點(diǎn)上執(zhí)行(且在主庫(kù)的一個(gè)節(jié)點(diǎn)打就行,備庫(kù)不打      *
***************************************************************************************
--For an Oracle RAC environment, perform these steps on only one node.(在主庫(kù)一個(gè)節(jié)點(diǎn)執(zhí)行即可,備庫(kù)不用執(zhí)行,且主備庫(kù)的補(bǔ)丁都已經(jīng)應(yīng)用成功)
SQL installation is performed after the primary database and all standby databases have the database home binaries patched to the same level。

4.1 大GI PSU升級(jí)后腳本
-- 執(zhí)行catbundle.sql文件
   cd $ORACLE_HOME/rdbms/admin
   sqlplus /nolog
   SQL> CONNECT / AS SYSDBA
   SQL> STARTUP
   SQL> @catbundle.sql psu apply
   SQL> QUIT
   
 --執(zhí)行重編譯
   cd $ORACLE_HOME/rdbms/admin
   sqlplus /nolog
   SQL> CONNECT / AS SYSDBA
   SQL> @utlrp.sql
   
 -- Check the following log files in $ORACLE_BASE/cfgtoollogs/catbundle for any errors:
   catbundle_PSU__APPLY_.log
   catbundle_PSU__GENERATE_.log
 
 
-- 升級(jí)RMAN CATALOG(如果沒有用到Oracle Recovery Manager,則忽略)
   su - oracle
   rman catalog username/password@alias
   RMAN> UPGRADE CATALOG;
   
-- 驗(yàn)證:DB和GI下都執(zhí)行
   opatch lspatches
       
4.2 OJVM補(bǔ)丁升級(jí)后注冊(cè)操作

-- 通過針對(duì)單個(gè)實(shí)例環(huán)境運(yùn)行以下命令來安裝修補(bǔ)程序的SQL部分。
注意:此步驟適用于單實(shí)例打OJVM PSU
cd $ORACLE_HOME/sqlpatch/26027154
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> startup upgrade
SQL> @postinstall.sql
SQL> shutdown
SQL> startup    

-- 對(duì)于Oracle RAC環(huán)境,請(qǐng)使用以下命令重新加載其中一個(gè)節(jié)點(diǎn)上的軟件包。 確保遠(yuǎn)程節(jié)點(diǎn)上沒有其他數(shù)據(jù)庫(kù)實(shí)例處于啟動(dòng)狀態(tài)。
注意:此步驟需要關(guān)閉rac上非跑腳本的其他實(shí)例

cd $ORACLE_HOME/sqlpatch/26027154
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> alter system set cluster_database=false scope=spfile;
SQL> SHUTDOWN
SQL> STARTUP UPGRADE
SQL> @postinstall.sql
SQL> alter system set cluster_database=true scope=spfile;
SQL> SHUTDOWN
SQL> STARTUP

-- 在安裝補(bǔ)丁的SQL部分之后,一些軟件包可能變?yōu)闊o效。 這將在訪問時(shí)得到重新編譯,或者你可以運(yùn)行utlrp.sql讓它們回到有效狀態(tài)。
注意:RAC或者單實(shí)例都需要執(zhí)行

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


*****************************************************
*     六、如果出現(xiàn)異常,回滾并停止升級(jí),分析原因    *
*****************************************************
   回滾(GI PUS)
   su - root
   opatch auto /tmp/patch/26030799 -rollback -ocmrf /home/oracle/ocm.rsp

   回滾注冊(cè):注意需要在當(dāng)時(shí)打補(bǔ)丁完成后注冊(cè)的那個(gè)rac節(jié)點(diǎn)上操作
   step 1:Start all database instances running from the Oracle home. (For more information, see Oracle Database Administrator's Guide.)
   step 2:For each database instance running out of the ORACLE_HOME, connect to the database using SQL*Plus as SYSDBA and run the rollback script as follows:

    cd $ORACLE_HOME/rdbms/admin
    sqlplus /nolog
    SQL> CONNECT / AS SYSDBA
    SQL> STARTUP
    SQL> @catbundle_PSU__ROLLBACK.sql
    SQL> QUIT
    In an Oracle RAC environment, the name of the rollback script will have the format catbundle_PSU__ROLLBACK.sql.

   step 3:If the OJVM PSU was applied for a previous GI PSU patch, you may see invalid Java classes after execution of the catbundle.sql script in the previous step. If this is the case, run utlrp.sql to re-validate these Java classes.

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

    $ opatch lsinventory
   
   
   回滾(OJVM 補(bǔ)丁)
   crsctl stop crs
   opatch rollback -id 26027154
   crsctl start crs
   opatch lsinventory
 
   回滾后注冊(cè):
   The following steps load modified SQL files into the database. For an Oracle RAC environment, perform these steps on only one node.

   step 1:Install the SQL portion of the patch by running the following command for a single instance environment.

   cd $ORACLE_HOME/sqlpatch/26027154
   sqlplus /nolog
   SQL> CONNECT / AS SYSDBA
   SQL> startup upgrade
   SQL> @postdeinstall.sql
   SQL> shutdown
   SQL> startup

   For an Oracle RAC environment, reload the packages on one of the nodes using the following commands. Make sure no other instance of the database is up on the remote nodes.
   注意:此步驟需要關(guān)閉rac上非跑腳本的其他實(shí)例

   cd $ORACLE_HOME/sqlpatch/26027154
   sqlplus /nolog
   SQL> CONNECT / AS SYSDBA
   SQL> STARTUP
   SQL> alter system set cluster_database=false scope=spfile;
   SQL> SHUTDOWN
   SQL> STARTUP UPGRADE
   SQL> @postdeinstall.sql
   SQL> alter system set cluster_database=true scope=spfile;
   SQL> SHUTDOWN
   SQL> STARTUP
   
   step 2:After installing the SQL portion of the patch, some packages could become INVALID. This will get recompiled upon access or you can run utlrp.sql to get them back into a VALID state.

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


*****************************************************
*     七、主備庫(kù)升級(jí)成功后啟用備庫(kù),并查看同步情況  *
*****************************************************   
--主庫(kù)日志應(yīng)用成功后,修改主庫(kù)參數(shù)及備庫(kù)應(yīng)用日志,同時(shí)檢查同步情況:

先主庫(kù)啟用傳輸日志
alter system set log_archive_dest_state_2=enable;

備庫(kù)啟動(dòng),并應(yīng)用日志
startup

recover managed standby database using current logfile;

最后檢查同步情況:
 select process, sequence#, status, delay_mins from v$managed_standby;

========================================================================
*************************************************************
*                                GI PSU補(bǔ)丁升級(jí)示例操作步驟                                           *                       
*************************************************************

GI PSU補(bǔ)丁可以以滾動(dòng)方式應(yīng)用GI HOME和DB HOME。注意下載補(bǔ)丁的存放位置應(yīng)該是GI和db共享的目錄;

一、檢查rac沒法節(jié)點(diǎn)的opatch工具版本大于或等于11.2.0.3.6:

更新db和GI下的opatch工具:
$ unzip -d
$ /OPatch/opatch version

二、配置響應(yīng)文件
su - oracle
$ORACLE_HOME/OPatch/ocm/bin/emocmrsp -no_banner -output /home/oracle/ocm.rsp
chmod 775 /home/oracle/ocm.rsp

三、驗(yàn)證有效期
-- Validation of Oracle Inventory(以GI和DB用戶分別運(yùn)行)
$ORACLE_HOME/OPatch/opatch lsinventory -detail -oh  $ORACLE_HOME

四、打補(bǔ)丁或回滾補(bǔ)丁前應(yīng)停止EM進(jìn)程(如果沒有安裝EM,則忽略)
su - oracle
/bin/emctl stop dbconsole

五、升級(jí)PSU(As root user, execute the following command on each node of the cluster:不能并行執(zhí)行)
--As root user, execute the following command on each node of the cluster:
以root用戶身份,在集群的每個(gè)節(jié)點(diǎn)上執(zhí)行以下命令:

注意:PSU補(bǔ)丁的存放位置應(yīng)該是GI和db共享的目錄,并以GI下的opatch工具去執(zhí)行

$ cd
$ unzip p27107360_112040_.zip
# opatch auto /27107360 -ocmrf

六、升級(jí)后數(shù)據(jù)庫(kù)注冊(cè),跑腳本:對(duì)于rac只需在一個(gè)節(jié)點(diǎn)上操作即可
--執(zhí)行腳本catbundle.sql
cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> @catbundle.sql psu apply
SQL> QUIT

The catbundle.sql execution is reflected in the dba_registry_history view by a row associated with bundle series PSU.

--編譯失效對(duì)象
cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> @utlrp.sql

--檢查日志有無報(bào)錯(cuò)
catbundle_PSU__APPLY_.log
catbundle_PSU__GENERATE_.log

--如果在使用rman恢復(fù)目錄,則執(zhí)行如下:
$ rman catalog username/password@alias
RMAN> UPGRADE CATALOG;


七、回滾PSU:
--root身份執(zhí)行:
As root user, execute the following command on each node of the cluster.

# opatch auto /27107360 -rollback -ocmrf

八、回滾后注冊(cè):在執(zhí)行打補(bǔ)丁注冊(cè)后的節(jié)點(diǎn)上執(zhí)行回滾后注冊(cè)
8.1 Start all database instances running from the Oracle home

8.2 執(zhí)行腳本

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

8.3 編譯失效對(duì)象

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

8.4 Check the log file for any errors.

The log file is found in $ORACLE_BASE/cfgtoollogs/catbundle and is named catbundle_PSU__ROLLBACK_.log where TIMESTAMP is of the form YYYYMMMDD_HH_MM_SS. If there are error.

8.5 檢查

$ opatch lsinventory



當(dāng)前標(biāo)題:OJVM+GIPSU補(bǔ)丁升級(jí)
文章URL:http://weahome.cn/article/goiepj.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部