oracle 10.2.0.1升级到10.2.0.4
--*********************************
-- Oracle 10.2.0.1 升級(jí)到 10.2.0.4
--*********************************
本文是基于LINUX環(huán)境下的ORACLE,不過(guò)和WIN差別不是很大,命令等都是一樣的。我升級(jí)時(shí)也是參照此文檔執(zhí)行。所以可執(zhí)行性比較強(qiáng)。?
?
? 數(shù)據(jù)庫(kù)升級(jí)并不難,只要遵循其步驟,一般問(wèn)題不大。但是升級(jí)失敗的情況也是屢見(jiàn)不鮮,尤其是生產(chǎn)數(shù)據(jù)庫(kù)的升級(jí),搞不定的時(shí)候甚至要創(chuàng)建SR。
? 下面描述基于Linux(Oracle Linux 5.4/2.6.18-164.el5PAE)平臺(tái)下Oracle 10.2.0.1 升級(jí)到10.2.0.4的步驟。
? Oracle升級(jí)包的下載,請(qǐng)鏈接:Oracle 補(bǔ)丁全集 (Oracle 9i 10g 11g Path)
? 注:
??? 在9i以前,無(wú)論升級(jí)/降級(jí),數(shù)據(jù)庫(kù)都是startup migrate
??? 10g后增加了upgrade參數(shù),升級(jí)可直接用startup upgrade,降級(jí)仍是startup migrate
?
一、單實(shí)例升級(jí)先決條件:
?
1.表空間需求
? 確保system表空間至少有10M空間可用,下面給出查詢(xún)語(yǔ)句
??????????
??? col "tablespace_name" for a20
??? col "Usage_Percent" for a10
??? SELECTupper(f.tablespace_name) "tablespace_name"
???????? ,d.tot_grootte_mb "tablespace_size(M)"
???????? ,d.tot_grootte_mb - f.total_bytes "used_size(M)"
???????? ,to_char(round((d.tot_grootte_mb - f.total_bytes) / d.tot_grootte_mb * 100,
?????????????? 2),
???????????? '990.99') "Usage_Percent"
???????? ,f.total_bytes "free_size(M)"
??? FROM?? (SELECT tablespace_name
??????????? ,round(SUM(bytes) / 1024 / 1024) total_bytes
??????????? ,round(MAX(bytes) / (1024 * 1024), 2) max_bytes
??????? FROM?? sys.dba_free_space
??????? GROUP? BY tablespace_name) f
??????? ,(SELECT dd.tablespace_name
??????????? ,round(SUM(bytes) / 1024 / 1024) tot_grootte_mb
??????? FROM?? sys.dba_data_files dd
??????? GROUP? BY dd.tablespace_name) d
??? WHERE? d.tablespace_name = f.tablespace_name
??? ORDER? BY2DESC;
?
2.系統(tǒng)參數(shù):
? 確保參數(shù)SHARED_POOL_SIZE 和 JAVA_POOL_SIZE大于150MB以上,為加快升級(jí)速度,在系統(tǒng)內(nèi)存可用的情況下,可臨時(shí)調(diào)大這2個(gè)參數(shù)
????????? SQL> SHOW PARAMETER SHARED_POOL_SIZE
????????? SQL> SHOW PARAMETER JAVA_POOL_SIZE
????????? SQL> ALTERSYSTEMSET SHARED_POOL_SIZE='200M'SCOPE=spfile;
????????? SQL> ALTERSYSTEMSET JAVA_POOL_SIZE='200M'SCOPE=spfile;
?
二、實(shí)施升級(jí)
?
1.關(guān)閉需要升級(jí)的實(shí)例
? 停止實(shí)例
??? SQL> shutdownimmediate?
? 停止與該實(shí)例相關(guān)的所有后臺(tái)進(jìn)程
??? lsnrctl emctl
?
2.備份Oracle Home 目錄及數(shù)據(jù)庫(kù)
? tar -cvf $ORACLE_BASE /orabak/??? --確保Oracle相關(guān)的所有配置都位于$ORACLE_BASE目錄,如監(jiān)聽(tīng)等
? cp *.dbf con*.ora redo*.log /orabak/? --對(duì)數(shù)據(jù)庫(kù)實(shí)施冷備
?
3.升級(jí)軟件
? ./runIstanller?? -->oracle 賬戶(hù)
? root.sh ?????????-->root 賬戶(hù)
?
4.更新數(shù)據(jù)字典
? SQL> startup upgrade
? SQL> spool patch.log
? SQL> @?/rdbms/admin/catupgrd.sql?? --注9i 使用catpatch.sql? (注:這個(gè)地方也需要注意文件的實(shí)際存放路徑。)
? SQL> spool off
?
5.重編譯失效對(duì)象:
? sql>shutdownimmediate
? sql>startup
? SQL>@?/rdbms/admin/utlrp.sql (注:這個(gè)地方目錄要根據(jù)實(shí)際情況,rtlrp.sql首先要找到這個(gè)文件,在安裝主目錄下。)
?
6.升級(jí)后的檢測(cè)
? SQL>select comp_name,version,status from sys.dba_registry;
?
? 檢查組件的升級(jí)情況
? SQL>select * from utl_recomp_errors;
?
7.修改兼容性參數(shù)
?
? SQL> altersystemset compatible='10.2.0.4.0'scope=spfile;
?
8.重新啟動(dòng)數(shù)據(jù)庫(kù):
? SQL> SHUTDOWN
? SQL> STARTUP
?
9.如果使用了恢復(fù)目錄,則執(zhí)行下面的命令
? $ rman catalog username/password@alias
? RMAN> UPGRADE CATALOG;
?
10.升級(jí)回退:
? SQL> STARTUP DOWNGRADE
?
? SQL> SPOOL downgrade.log
?
? SQL> @catdwgrd.sql(10.2.10運(yùn)行的是這個(gè),而10.1降級(jí)用的是d92000.sql,即dold_release.sql)
?
? Sql>spool off
?
? Sql>shutdownimmediate
?
12.檢查升級(jí)后的情況
?
? SQL> select comp_name,version,status from sys.dba_registry;
?
? COMP_NAME??????????????????????????????? VERSION??????????????????????? STATUS
? ---------------------------------------- ------------------------------ -----------
? Oracle Database Catalog Views??????????? 10.2.0.4.0???????????????????? VALID
? Oracle DatabasePackagesandTypes?????? 10.2.0.4.0???????????????????? VALID
? Oracle Workspace Manager???????????????? 10.2.0.4.3???????????????????? VALID
? JServer JAVAVirtual Machine???????? ????10.2.0.4.0???????????????????? VALID
? Oracle XDK?????????????????????????????? 10.2.0.4.0???????????????????? VALID
? Oracle DatabaseJavaPackages??????????? 10.2.0.4.0???????????????????? VALID
? Oracle Expression Filter???????????????? 10.2.0.4.0? ???????????????????VALID
? Oracle DataMining?????????????????????? 10.2.0.4.0???????????????????? VALID
? Oracle Text????????????????????????????? 10.2.0.4.0???????????????????? VALID
? Oracle XMLDatabase????????????????????? 10.2.0.4.0????????????????? ???VALID
? Oracle Rule Manager????????????????????? 10.2.0.4.0???????????????????? VALID
?
? COMP_NAME??????????????????????????????? VERSION??????????????????????? STATUS
? ---------------------------------------- ------------------------------ -----------
? Oracle interMedia??????????????????????? 10.2.0.4.0???????????????????? VALID
? OLAP Analytic Workspace????????????????? 10.2.0.4.0???????????????????? VALID
? Oracle OLAP API????????????????????????? 10.2.0.4.0???????????????????? VALID
? OLAP Catalog???????????????????????????? 10.2.0.4.0???????????????????? VALID
? Spatial????????????????????????????????? 10.2.0.4.0???????????????????? VALID
? Oracle Enterprise Manager??????????????? 10.2.0.4.0???????????????????? VALID
?
? 17rows selected.
?
? SQL> select * from utl_recomp_errors;
?
? norows selected
總結(jié)
以上是生活随笔為你收集整理的oracle 10.2.0.1升级到10.2.0.4的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 按word内容关键字搜索
- 下一篇: 大数据丨网络爬虫技术总结