环境安装:
yum group install "X Window System" "GNOME Desktop Environment" "Editors" "Graphical Internet" "Text-based Internet" "Server Configuration Tools" "Development Tools" "Administration Tools" "System Tools"
yum -y install binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel gcc gcc-c++ libaio-devel libaio libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel pdksh numactl-devel glibc-headers
rpm -ivh libXp-*
IP设置:
vim /etc/sysconfig/network-scripts/ifcfg-eth0 改成静态IP
内核修改:
# Red Hat Enterprise Linux 5.0 and CentOS 5.x
kernel.shmmax = 536870912 这个可用已经有的值
kernel.shmmni = 4096
kernel.shmall = 2097152
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=262144
net.core.rmem_max=262144
net.core.wmem_default=262144
net.core.wmem_max=262144
sysctl -p
用户设置:
groupinstall oinstall
groupinstall dba
groupadd oper
useradd -g oinstall -G dba oracle
passwd oracle
用户环境变量:
export ORACLE_BASE=/u01/oracle
export ORACLE_SID=db1 这个是自己设置的唯一值
export ORACLE_HOME=$ORACLE_BASE/oracle/product/10.2.0/db_1
PATH=/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/bin:/sbin:$PATH;
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_TERM=xterm
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:/usr/lib:/usr/local/lib;
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib64:/usr/lib;
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOMR/jlib:$ORACLE_HOME/rdbms/jlib;
export CLASSPATH
export LANG=en_US
umask 022
source .bash_profile
设置DISPLAY:
export DISPLAY=IP:0.0 这里的IP指的是客户端的IP
xhost +
更改/etc/redhat-realse,里面的内容改成:Red Hat Enterprise Linux Server release 5 (ShangHai)
解压进行安装:
cpio.gz安装:zcat XXX.cpio.gz|cpio -idmv,之后以oracle运行runInstaller
Oracle安装好后,下载Oracle补丁文件
关闭Oracle现有的服务,emctl stop dbconsole ; lsnrct1 stop ; shutdown ,没有Oracle的进程运行
检查升级前无效对象:
SQL> select owner,object_name,subobject_name,object_type,status from dba_objects where status<>'VALID'
export DISPLAY=IP:0.0 这里的IP指的是客户端IP
xhost +
进行解压,直接运行runInstaller,进行安装
以upgrade方式打开数据库:
startup upgrade;
以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;
设置SHARED_POOL_SIZE and JAVA_POOL_SIZE初始化参数
SQL> ALTER SYSTEM SET SHARED_POOL_SIZE='150M' SCOPE=spfile;
SQL> ALTER SYSTEM SET JAVA_POOL_SIZE='150M' SCOPE=spfile;
注:检查shared_pool_size和java_pool_size大小,可适当增大(我们这里都设置成了150M,默认是0)。否则更新脚本因pool空间不够而无法升级成功。
如果启用自动sga管理,保证sga_max_size和sga_target在400M以上,如果是ASM系统则JAVA_POOL_SIZE不能设置。
升级脚本:
SQL> STARTUP UPGRADE
SQL> SPOLL error.log 在用户家目录下生成的记录日志
SQL> @?/rdbms/admin/catupgrd.sql 这个大概运行的时间30分钟
SQL> SPOOL OFF
编译无效对象:
SQL> SHUTDOWN IMMEDIATE
SQL> STARTUP
SQL> @?/rdbms/admin/utlrp.sql
注:运行utlrp.sql以重新编译所有无效的PL/SQL程序包
正常运行结果:
ERRORS DURING RECOMPILATION
---------------------------
0
检查无效对象,必须无,至少比升级前要少:
SQL> select owner,object_name,subobject_name,object_type,status from dba_objects where status<>'VALID'
升级后确认:
lsnrctl start
emctl start dbconsol
sqlplus / as sysdba ; startup
检查版本:
select comp_name,version from dba_registry; 全部是10.2.0.4.0
检查连接:
sqlplus 或telnet