*新路径安装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;