Linux下升級Oracle 10

來源:互聯網
上載者:User

  環境:虛擬機器

  OS: Linux 5

  Oracle 升級前版本: 10.2.0.0.1

  先關閉資料庫和監聽

  然後殺掉所有的oracle進程

  ps -ef |grep oracle |grep -v grep |grep -v ef

  kill -9   進程號

  然後解壓安裝包,將安裝包改成使用者為oracle使用者所有,之前已是就不用改了.

  chown -R oracle:oinstall   Disk1

  我在運行runInstaller時報子目錄一個oui許可權錯誤.

  所以我把該軟體包全部改成可執行.

  chown -R 755 oracle:ointsll Disk1

  然後確保oracle使用者能開啟圖形介面,可用root使用者運行 xhost +

  然後以oracle使用者執行 ./opt/soft/Disk1/runInstaller

  出現圖形介面後和windows上一樣,選擇oracle_home 只有一個資料庫的話預設即可.

  完了最後會讓你以root使用者運行一個root.sh的指令碼, 該指令碼會提示是否覆蓋已存在的目錄,預設為否即可.

  安裝後以upgrade方式開啟資料庫及監聽.(否則報704錯誤)

  以sys使用者登入.檢查system資料表空間情況.

  select tablespace_name, sum(bytes)/(1024*1024) as free_space

  from dba_free_space

  where tablespace_name = 'SYSTEM'

  group by tablespace_name;

  如果該值小於50,則需要加大SYSTEM資料表空間;不建議使用resize方式而是使用添加檔案的方式.

  alter tablespace system add datafile '/opt/app/oradata/orcl/system02.dbf'size 300m;

  4).檢查shared_pool_size和java_pool_size大小,可適當增大.否則更新指令碼因pool空間不夠而無法升級成功.

  如果啟用自動sga管理,保證sga_max_size和sga_target在400M以上.

  5). 重啟資料庫, 開始運行升級指令碼,執行catupgrd.sql是個很耗時的過程.記憶體足夠的話已耗用時間半個小時左右,建議在運行期間關閉所有其它相關的運行程式,另外最好有200M的多餘記憶體空間

  shutdown immediate

  STARTUP upgrade

  spool /opt/app/patch.log

  @$Oracke_Home/rdbms/admin/catupgrd.sql

  SPOOL OFF

  檢查 /opt/app/patch.log是否有報錯.如有必要可重新運行.

  運行utlrp.sql以重新編譯所有無效的PL/SQL程式包。

  spool /opt/app/utlrp.log

  @$Oracke_Home/rdbms/admin/utlrp.sql

  spool off;

  檢查執行情況.

  utlrp.sql,catupgrd.sql,utlu102i.sql 執行沒有按照先後順序,也升級成功,不知道在後續的應該中是否有問題。

  7).根據實際情況調整SGA

  shutdown immediate;

  STARTUP;

  8).查看升級結果

  select * from v$version;

  column comp_name format a30;

  column version format a20

  select comp_name, status, substr(version,1,10) as version from dba_registry;

相關文章

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.