oracle資料庫psu升級(本實驗是將10.2.0.3.12升級到10.2.0.3.15)

來源:互聯網
上載者:User

標籤:

psu升級(本實驗是將10.2.0.3.12升級到10.2.0.3.15)

一、解壓安裝包
自訂存放路徑為/home/oracle/yjb/psu/10.2.0.3.15
cd /home/oracle/yjb/psu/10.2.0.3.15
unzip p6880880_112000_04-SEP-2015_Linux-x86-64.zip
unzip p20760997_112030_15_Linux-x86-64.zip -d 1120315

二、檢查psu補丁是否有衝突
/home/oracle/yjb/psu/10.2.0.3.15/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /home/oracle/yjb/psu/10.2.0.3.15/1120315

三、資訊收集
--查看組件資訊
set linesize 500 pagesize 600
col COMP_NAME for a30
select COMP_ID,COMP_NAME,VERSION,STATUS from DBA_REGISTRY;
--查看補丁情況
set linesize 500 pagesize 600
col ACTION_TIME for a30
col COMMENTS for a30
select ACTION_TIME, ACTION, COMMENTS from sys.DBA_REGISTRY_HISTORY;
--查看無效對象
select count(*) from dba_objects where status<>‘VALID‘;


四、停止資料庫
--停止資料庫外部進程
ps -ef|grep -v grep |grep LOCAL=NO|awk ‘{print $2}‘|xargs kill -9
--停庫
alter system checkpoint
shutdown immediate
--停監聽
lsnrctl stop

--查看啟停日誌
/home/oracle/diag/rdbms/sccp/sccp/trace/alert*.log

五、備份
使用root使用者備份oracle_home (將#ORACLE_HOME上級目錄整個備份)
tar -zcvpf db_20151103.tar.gz db_1

六、打PSU
su - oracle
cd /home/oracle/yjb/psu/10.2.0.3.15/1120315/20760997 ---20760997為壓縮包解壓出的目錄(不進入該目錄apply會報錯)
/home/oracle/yjb/psu/10.2.0.3.15/OPatch/opatch apply

----如果補丁過程中出現以下錯誤
OPatch報錯 Prerequisite check "CheckActiveFilesAndExecutables" failed
Following executables are active :
/opt/oracle/product/10.2.0/bin/oracle
ApplySession failed during prerequisite checks: Prerequisite check "CheckActiveFilesAndExecutables" failed.

通過以下命令找到正在佔用檔案的進程,然後kill進程
fuser /opt/oracle/product/10.2.0/bin/oracle

七、檢查資料庫
su – oracle
$ORACLE_HOME/OPatch/opatch lsinv

八、更新資料字典、編譯失效對象
su - oracle
cd $ORACLE_HOME/rdbms/admin
SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> @catbundle.sql psu apply
SQL> @utlrp.sql


九、重啟資料庫
shutdown immediate
startup

十、檢查資料庫狀態
--查看組件資訊
set linesize 500 pagesize 600
col COMP_NAME for a30
select COMP_ID,COMP_NAME,VERSION,STATUS from DBA_REGISTRY;
--查看補丁情況
set linesize 500 pagesize 600
col ACTION_TIME for a30
col COMMENTS for a30
select ACTION_TIME, ACTION, COMMENTS from sys.DBA_REGISTRY_HISTORY;
--查看無效對象
select count(*) from dba_objects where status<>‘VALID‘;

 

十一、啟動監聽
lsnrctl start
ps -ef|grep -v grep |grep LOCAL=NO|wc -l
SQL> CONNECT / AS SYSDBA
SQL>alter system register;

若監聽啟動失敗
cd $ORACLE_HOME/network/admin
mv sqlnet.ora sqlnet.orabak
lsnrctl start
ps -ef|grep -v grep |grep LOCAL=NO|wc -l
SQL> CONNECT / AS SYSDBA
SQL>alter system regiter
SQL>exit
mv sqlnet.orabak sqlnet.ora

 

oracle資料庫psu升級(本實驗是將10.2.0.3.12升級到10.2.0.3.15)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.