oracle10g升級到oracle11g

*新路徑安裝11.2.0.3軟件

一、  好比原始目錄:/usr/oracle新目錄:/u01/oraclesql

二、  上傳oracle11g的文件1和2,並解壓數據庫

三、  Oracle用戶執行./runInstaller(若是是clone的虛擬機,記得修改hosts,ip主機名須要正確,不然報錯:PRVF-0002oracle

四、  選擇安裝目錄:/u01/oracle/app/product/11.2.0/dbhome_1app

五、  會出現一些警告:測試

 

Oracle推薦:spa

vi /etc/sysctl.conf操作系統

fs.file-max = 6815744     注:fs.file-max爲512 乘以processes日誌

net.core.rmem_max = 4194304ip

net.core.wmem_max = 1048586rem

net.ipv4.ip_local_port_range = 9000 65000

fs.aio-max-nr = 1048576

sysctl –p使生效

六、  安裝完成

*執行檢測

一、  運行檢測腳本

$ORACLE_HOME/rdbms/admin/目錄下

spool upgrade_info.log

@/tmp/utlu112i.sql

spool off

二、  測試中檢測出的問題:

--> 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;

 

三、  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.         

四、  臨時環境變量:

[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

 

五、  備份數據庫

乾淨關庫(shutdown immediate)啓動到mount(startup mount)備份數據庫(backup database plus archivelog)

六、  升級10g到11g

11g環境變量

執行dbua

七、   重建11g的監聽

 

*問題

一、閃回

因爲安裝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;

相關文章
相關標籤/搜索