可选择桌面环境
可参考 http://blog.csdn.net/zhang123456456/article/details/56690945
# yum -y install binutils compat-libstdc++-33 compat-libstdc++-33.i686 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc.i686 glibc-common glibc-devel glibc-devel.i686 glibc-headers ksh libaio libaio.i686 libaio-devel libaio-devel.i686 libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel make sysstat libtermcap-devel readline-devel unixODBC unixODBC-devel compat-db compat-gcc-34 compat-libstdc++-296 # yum -y install libXp libXp.i686 libXt.i686 libXtst.i686
确认以下包有没有安装,然后重启图形界面再次安装
libgomp-4.4.0-6.el5.x86_64.rpm \ kernel-headers-2.6.18-164.el5.x86_64.rpm \ glibc-headers-2.5-42.x86_64.rpm \ libstdc++-devel-4.1.2-46.el5.x86_64.rpm \ sysstat-7.0.2-3.el5.x86_64.rpm \ glibc-devel-2.5-42.x86_64.rpm \ libaio-devel-0.3.106-3.2.x86_64.rpm \ gcc-4.1.2-46.el5.x86_64.rpm \ gcc-c++-4.1.2-46.el5.x86_64.rpm \ elfutils-libelf-devel-static-0.137-3.el5.x86_64.rpm \ elfutils-libelf-devel-0.137-3.el5.x86_64.rpm \ libtermcap-devel-2.0.8-46.1.x86_64.rpm \ readline-devel-5.1-3.el5.x86_64.rpm \ unixODBC-2.2.11-7.1.x86_64.rpm \ unixODBC-devel-2.2.11-7.1.x86_64.rpm \ glibc-devel-2.5-42.i386.rpm \ libaio-devel-0.3.106-3.2.i386.rpm \ compat-db-4.2.52-5.1.x86_64.rpm \ compat-gcc-34-3.4.6-4.x86_64.rpm \ compat-gcc-34-c++-3.4.6-4.x86_64.rpm \ gdb-6.8-37.el5.x86_64.rpm \ libXp-1.0.0-8.1.el5.i386.rpm \ libstdc++-devel-4.1.2-46.el5.i386.rpm compat-libstdc++-296-2.96-132.7.2.i386.rpm compat-libstdc++-33-3.2.3-47.3.i386.rpm
# vim /etc/sysctl.conf
在文件末尾添加一下内容:
#use for Oracle kernel.shmall = 2097152 kernel.shmmax = 2147483648 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 net.ipv4.ip_local_port_range = 1024 65000 net.core.rmem_default = 4194304 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 262144
立即执行修改:
# sysctl -p
此文件用于设置系统资源限制.
# vi /etc/security/limits.conf
在文件末尾加上以下内容:
oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536
# vi /etc/pam.d/login
在文件末尾加上以下内容:
session required /lib/security/pam_limits.so session required pam_limits.so
groupadd -g 60001 oinstall groupadd -g 60002 dba useradd -g oinstall -G dba oracle
修改密码:
# passwd oracle
限制其他用户使用:
# vim /etc/profile
在文件末尾加入以下内容:
if [ $USER = "oracle" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi fi
注意: 如果文件是不能修改的. 保存时输入 :wq! 强制保存.
因为Oracle10G发行的时候, Centos6.5还没有发行. 所以必须修改:
# vim /etc/redhat-release
删除文件本身内容, 重新录入以下内容:
CentOS release 4 (Final) #Red Hat Enterprise Linux Server release 4.8 (Santiago)
mkdir -p /u01/app/oracle/ chown -R oracle:oinstall /u01/app/oracle/ chmod -R 775 /u01/app/oracle/
-- 以后的配置都用oracle用户执行
$ vi ~/.bash_profile
在文件末尾加入以下内容:
#Oracle Settings export TMP=/tmp; export TMPDIR=$TMP; export ORACLE_BASE=/u01/app/oracle; export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_SID=orcl; export ORACLE_TERM=xterm; export PATH=/usr/sbin:$PATH; export PATH=$ORACLE_HOME/bin:$PATH; export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;
使配置生效
$ source /home/oracle/.bash_profile
[root@oralce10g u01]# mv 10201_database_linux_x86_64.cpio.gz /u01/app/oracle/
首先解压gz包.
$ gzip -d 10201_database_linux_x86_64.cpio.gz
在使用cpio解压出文件.
$ cpio -idmv < 10201_database_linux_x86_64.cpio
$ cd /u01/app/oracle/database/ $ ./runInstaller
-- 报错 , 安装到84%的时候会出现这个错误. 据了解是安装程序的一个BUG. 直接选Continue(继续安装)
--root , 跑两个脚本
最后点击exit, 退出 10.2.0.1 软件安装。
只安装了数据库软件,没有建库
[oracle@oralce10g ora_psu]$ pwd /tmp/ora_psu [oracle@oralce10g ora_psu]$ ll total 1167536 -rw-r--r--. 1 oracle oinstall 1195551830 Sep 22 03:15 p6810189_10204_Linux-x86-64.zip [oracle@oralce10g ora_psu]$ unzip p6810189_10204_Linux-x86-64.zip [oracle@oralce10g ora_psu]$ ls Disk1 p6810189_10204_Linux-x86-64.zip README.html [oracle@oralce10g ora_psu]$ cd Disk1/ [oracle@oralce10g Disk1]$ ls 10204_buglist.htm install patch_note.htm response runInstaller stage [oracle@oralce10g Disk1]$ ./runInstaller
一路点击 next ,注意 指定Oracle Home 目录详细时,依然指定为旧路径 。 如:原 ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1 ,则升级时依然指定为它。
-- root 用户,跑一个脚本
-- 脚本跑完之后,最后,点击exit ,退出
至此, 0racle 10.2.0.1 升级到 oracle 10.2.0.4 完毕 。
升级之前,已经建立数据库(与上面的区别就是要停库、跑数据字典)
停止实例
SQL> shutdown immediate
停止与该实例相关的所有后台进程
停止与该实例相关的所有后台进程
SQL>lsnrctl stop SQL>emctl stop dbconsle
tar -cvf $ORACLE_BASE /orabak/ --确保Oracle相关的所有配置都位于$ORACLE_BASE目录,如监听等 cp *.dbf con*.ora redo*.log /orabak/ --对数据库实施冷备
./runIstanller -->oracle 账户
root.sh -->root 账户
SQL> startup upgrade SQL> spool patch.log SQL> @?/rdbms/admin/catupgrd.sql --注9i 使用catpatch.sql SQL> spool off
sql>shutdown immediate sql>startup SQL>@?/rdbms/admin/utlrp.sql
SQL>select comp_name,version,status from sys.dba_registry;
检查组件的升级情况
SQL>select * from utl_recomp_errors;
SQL> alter system set compatible='10.2.0.4.0' scope=spfile;
SQL> SHUTDOWN SQL> STARTUP
$ rman catalog username/password@alias RMAN> UPGRADE CATALOG;
SQL> STARTUP DOWNGRADE SQL> SPOOL downgrade.log SQL> @catdwgrd.sql(10.2.10运行的是这个,而10.1降级用的是d92000.sql,即dold_release.sql) Sql>spool off Sql>shutdown immediate
SQL> select comp_name,version,status from sys.dba_registry;
-- 点击 finish
-- 点击 exit , 完成建库。
-- 验证一切操作是否成功!
[oracle@oralce10g Disk1]$ ps -ef|grep ora_mmon oracle 5795 1 0 04:50 ? 00:00:00 ora_mmon_orcl oracle 10458 51002 0 05:07 pts/3 00:00:00 grep ora_mmon [oracle@oralce10g Disk1]$ [oracle@oralce10g Disk1]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.4.0 - Production on Fri Sep 22 05:08:56 2017 Copyright (c) 1982, 2007, Oracle. All Rights Reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> select count(*) from dba_objects where status<>'VALID'; COUNT(*) \---------- 0
一路点击 next ,最后Finish完成。