*新路徑安裝11.2.0.3軟件
1、 比如原始目錄:/usr/oracle新目錄:/u01/oracle
2、 上傳oracle11g的文件1和2,並解壓
3、 Oracle用戶執行./runInstaller(如果是clone的虛擬機,記得修改hosts,ip主機名需要正確,否則報錯:PRVF-0002
4、 選擇安裝目錄:/u01/oracle/app/product/11.2.0/dbhome_1
5、 會出現一些警告:
Oracle推薦:
vi /etc/sysctl.conf
fs.file-max = 6815744 注:fs.file-max為512 乘以processes
net.core.rmem_max = 4194304
net.core.wmem_max = 1048586
net.ipv4.ip_local_port_range = 9000 65000
fs.aio-max-nr = 1048576
sysctl –p使生效
6、 安裝完成
*執行檢測
1、 運行檢測腳本
$ORACLE_HOME/rdbms/admin/目錄下
spool upgrade_info.log
@/tmp/utlu112i.sql
spool off
2、 測試中檢測出的問題:
--> If Target Oracle is 64-Bit, refer here for Update Parameters:
WARNING: --> "sga_target" needs to be increased to at least 596 MB
調整sga
SQL> alter system set sga_max_size=600M scope=spfile;
SQL> alter system set sga_target=600M scope=spfile;
重啟生效
重新執行檢測,發現已經沒有這個警告了。
其他的警告:
WARNING: --> Database is using a timezone file older than version 14.
.... After the release migration, it is recommended that DBMS_DST package
.... be used to upgrade the 10.2.0.4.0 database timezone version
.... to the latest version which comes with the new release.
時區問題:
SQL> select tz_version from registry$database;
TZ_VERSION
----------
4
時區轉換在11.2版中會自動完成。
WARNING: --> Your recycle bin is turned on and currently contains no objects.
.... Because it is REQUIRED that the recycle bin be empty prior to upgrading
.... and your recycle bin is turned on, you may need to execute the command:
PURGE DBA_RECYCLEBIN
.... prior to executing your upgrade to confirm the recycle bin is empty.
清空回收站
PURGE DBA_RECYCLEBIN;
3、 Oracle推薦收集統計信息:
EXECUTE dbms_stats.gather_dictionary_stats;
Oracle recommends reviewing any defined events prior to upgrading.
To view existing non-default events execute the following commands
while connected AS SYSDBA:
Events:
SELECT (translate(value,chr(13)||chr(10),' ')) FROM sys.v$parameter2
WHERE UPPER(name) ='EVENT' AND isdefault='FALSE'
Trace Events:
SELECT (translate(value,chr(13)||chr(10),' ')) from sys.v$parameter2
WHERE UPPER(name) = '_TRACE_EVENTS' AND isdefault='FALSE'
Changes will need to be made in the init.ora or spfile.
4、 臨時環境變量:
[oracle@uoraclea ~]$ vi ora11.env
export ORACLE_SID=testa
export ORACLE_BASE=/u01/oracle
export ORACLE_HOME=/u01/oracle/app/product/11.2.0/dbhome_1/
export PATH=$ORACLE_HOME/bin:$PATH
使用時:source /home/oracle/ora11.env
5、 備份數據庫
干凈關庫(shutdown immediate)啟動到mount(startup mount)備份數據庫(backup database plus archivelog)
6、 升級10g到11g
11g環境變量
執行dbua
7、 重建11g的監聽
*問題
1、閃回
由於安裝10g時,默認開啟閃回,並且歸檔目錄就是閃回目錄,升級過程中報錯:
ORA-19815: WARNING: db_recovery_file_dest_size of 2147483648 bytes is 100.00% used, and has 0 remaining bytes available.
oracle10g在默認情況下,歸檔日志是保存在閃回恢復區的,如果建庫的時候用的默認設置,閃回恢復區是2G,空間被占滿了以后就無法再歸檔了,即使操作系統有空間也不能歸檔了。
處理辦法:
關閉閃回
SQL> alter system set db_recovery_file_dest ='';
更改歸檔目錄
alter system set log_archive_dest_1='location=/u01/oracle/archivelog' scope=both;
