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;