1、RedhatLinux65下Oracle10g安装配置手册Redhat-Linux-6.5下Oracle-10g安装配置手册Redhat Linux 6.2下Oracle 10g安装配置手册1. 安装准备1.1 RedHat Linux Server 6.2安装文件1.2 Oracle 10g Linux安装文件1.3 检查安装包rpm -qa |grep makeautomake-1.11.1-1.2.el6.noarchmake-3.81-19.el6.x86_64rpm -qa|grep glibcglibc-common-2.12-1.47.el6.x86_64glibc-2.12-1
2、.47.el6.i686glibc-headers-2.12-1.47.el6.x86_64glibc-devel-2.12-1.47.el6.i686compat-glibc-headers-2.5-46.2.x86_64glibc-2.12-1.47.el6.x86_64glibc-utils-2.12-1.47.el6.x86_64glibc-devel-2.12-1.47.el6.x86_64compat-glibc-2.5-46.2.x86_64rpm -qa |grep libaiolibaio-devel-0.3.107-10.el6.i686libaio-0.3.107-10.
3、el6.x86_64libaio-devel-0.3.107-10.el6.x86_64libaio-0.3.107-10.el6.i686rpm -qa |grep gcc gcc-objc-4.4.6-3.el6.x86_64gcc-objc+-4.4.6-3.el6.x86_64compat-gcc-34-g77-3.4.6-19.el6.x86_64gcc-gfortran-4.4.6-3.el6.x86_64gcc-gnat-4.4.6-3.el6.x86_64compat-gcc-34-c+-3.4.6-19.el6.x86_64gcc-java-4.4.6-3.el6.x86_6
4、4gcc-4.4.6-3.el6.x86_64compat-gcc-34-3.4.6-19.el6.x86_64gcc-c+-4.4.6-3.el6.x86_64libgcc-4.4.6-3.el6.i686libgcc-4.4.6-3.el6.x86_64rpm -qa |grep compat-libstdccompat-libstdc+-296-2.96-144.el6.i686compat-libstdc+-33-3.2.3-69.el6.i686compat-libstdc+-33-3.2.3-69.el6.x86_64rpm -qa |grep compat-gcc compat-
5、gcc-34-g77-3.4.6-19.el6.x86_64compat-gcc-34-c+-3.4.6-19.el6.x86_64compat-gcc-34-3.4.6-19.el6.x86_64rpm -qa |grep libXplibXp-1.0.0-15.1.el6.x86_64libXp-devel-1.0.0-15.1.el6.x86_64libXpm-3.5.8-2.el6.i686libXpm-devel-3.5.8-2.el6.x86_64libXp-devel-1.0.0-15.1.el6.i686libXpm-3.5.8-2.el6.x86_64libXpm-devel
6、-3.5.8-2.el6.i686libXp-1.0.0-15.1.el6.i686rpm -qa |grep openmotif openmotif-devel-2.3.3-4.el6.x86_64openmotif-2.3.3-4.el6.x86_64openmotif22-2.2.3-19.el6.x86_64openmotif22-2.2.3-19.el6.i686rpm -qa |grep compat-db compat-db43-4.3.29-15.el6.x86_64compat-db43-4.3.29-15.el6.i686compat-db42-4.2.52-15.el6.
7、i686compat-db-4.6.21-15.el6.i686compat-db-4.6.21-15.el6.x86_64compat-db42-4.2.52-15.el6.x86_642. 硬件要求1.1 物理内存至少2G查看命令:grep MemTotal /proc/meminfo1.2 交换分区:至少1G,最好是物理内存的2倍查看命令:grep SwapTotal /proc/meminfo1.3 硬盘空闲区至少4G查看命令:df h3. 创建安装oracle 所需的组和用户以下操作需要使用root账户创建。3.1 创建oinstall用户组groupadd g 701 oinsta
8、ll3.2 创建dba用户组groupadd g 702 dba3.3 创建oracle用户useradd g oinstall G dba oracle3.4 初始化oracle用户密码passwd oracle4. 创建Oracle安装目录本示例中,Oracle安装路径为:/oracle/product/10.2/db_14.1 创建oracle安装目录mkdir p /oracle/product/10.2/db_14.2 修改目录所属用户为oracle用户chown R oracle:oinstall /oracle4.3 修改目录权限chmod R 755 /oracle 或者chm
9、od -R ug=rwx,o=rx /oracle5. 配置内核参数5.1 编辑/etc/sysctl.conf文件,添加或修改如下的行:本人实际配置环境中,红色部分是需要修改行,蓝色部分为添加行。kernel.shmall = 2097152kernel.shmmax = 21474836481374389535.72kernel.shmmni = 4096kernel.sem = 250 32000 100 128fs.file-max = 65536net.ipv4.ip_local_port_range = 1024 65000net.core.rmem_default=262144n
10、et.core.rmem_max=262144net.core.wmem_default=262144net.core.wmem_max=2621445.2 查看当前内核参数的值/sbin/sysctl p 注:(一般为内存的0.7倍)OLTP系统SGA+PGA(Total Memory)*0.8 SAG /var/log/oracle date +! %T %a %D : Starting Oracle Databases as part of system up. /var/log/oracle echo - /var/log/oracle su - $ORA_OWNER -c $ORA_
11、HOME/bin/dbstart /var/log/oracle echo Done. echo -n Starting Oracle Listeners: su - $ORA_OWNER -c $ORA_HOME/bin/lsnrctl start /var/log/oracle echo Done. echo echo - /var/log/oracle date +! %T %a %D : Finished. /var/log/oracle echo - /var/log/oracle touch /var/lock/subsys/oracle ; stop) echo -n Shutt
12、ing Down Oracle Listeners: echo - /var/log/oracle date +! %T %a %D : Shutting Down Oracle Databases as part of system down. /var/log/oracle echo - /var/log/oracle su - $ORA_OWNER -c $ORA_HOME/bin/lsnrctl stop /var/log/oracle echo Done. rm -f /var/lock/subsys/oracle echo -n Shutting Down Oracle Datab
13、ases: su - $ORA_OWNER -c $ORA_HOME/bin/dbshut /var/log/oracle echo Done. echo echo - /var/log/oracle date +! %T %a %D : Finished. /var/log/oracle echo - /var/log/oracle ; restart) echo -n Restarting Oracle Databases: echo - /var/log/oracle date +! %T %a %D : Restarting Oracle Databases as part of sy
14、stem up. /var/log/oracle echo - /var/log/oracle su - $ORA_OWNER -c $ORA_HOME/bin/dbshut /var/log/oracle su - $ORA_OWNER -c $ORA_HOME/bin/dbstart /var/log/oracle echo Done. echo -n Restarting Oracle Listeners: su - $ORA_OWNER -c $ORA_HOME/bin/lsnrctl stop /var/log/oracle su - $ORA_OWNER -c $ORA_HOME/
15、bin/lsnrctl start /var/log/oracle echo Done. echo echo - /var/log/oracle date +! %T %a %D : Finished. /var/log/oracle echo - /var/log/oracle touch /var/lock/subsys/oracle ; *) echo Usage: oracle start | stop | restart exit 1esacexit 08.1 修改/etc/rc.d/init.d/oracle执行权限chmod 755 /etc/rc.d/init.d/oracle
16、8.2 添加oracle服务chkconig -add oracle8.3 设置oracle服务自启动chkconfig oracle on8.4 启动、关闭、重启oracle命令启动oracle数据库:service oracle start关闭oracle数据库:service oracle stop重启oracle数据库service oracle restart附录1:安装过程中遇到的问题及解决方法1 xhost:unable to open display解决方法:1)查看/etc/inittab文件里,把init3或者其他值改成init52)reboot system,用root用
17、户通过图形界面进入系统,在终端里执行xhost +,(一般在这里都xhost会执行成功,如果无法执行成功,那你图形肯定有问题!)2 执行runInstaller时报错:Exception in thread main java.lang.UnsatisfiedLinkError:/tmp/OraInstall2007-12-21_10-40-21PM/jre/lib/i386/libawt.so:libXp.so.6: cannot open shared object file: No such file or directory解决方法:安装libXp.rpm。这个文件可以在linux安装
18、文件中找到。如果是使用iso文件安装的,可以先挂载光驱:mount /dev/cdrom /mnt 3 使用oracle用户,使用dbstart无法启动数据库的问题1) 检查dbstart文件vi $ORACLE_HOME/bin/dbstart检查ORACLE_HOME_LISTNER项的路径,将其改为$ORACLE_HOME,如下:2) 进行完上述操作后,重新执行dbstart时,数据库仍不能启动。此时,登陆sqlplus,使用命令startup mount;可以登陆。同时伴有,数据库起来后,重启机器后,执行dbstart又不能启动数据库的情况。解决方法:检查 /etc/oratab文件,
19、按下面方法操作。此处还有一种修改方法:#注释掉上面的行,增加下面行$ORACLE_SID:$ORACLE_HOME:Y3) 如果执行dbstart仍不能启动,检查dbstart文件中的oratab项配置是否和下图中的一致,如果不一致修改。4 ORA-01031: insufficient privileges问题先照着问题3的方法检查一遍。5 在linux下挂载iso的方法mount o loop linux.iso /mnt/cd16 跟踪命令的执行过程strace -v ps -ef 2 ps.txt 写入ps.txt文件7、Host.conf文件配置错误错误代码如下:/etc/host.
20、conf:line3:bad command 127.0.0.1 localhost原因是: /etc/host.conf 中多出来一行内容引起的:127.0.0.1 localhost8、startup 开启出错9、执行IMPDP时,停止不动,关闭之后重新启Impdp job时,出现下面的错误oraeventhenry $ impdp event ATTACH=event.SYS_IMPORT_SCHEMA_01 Import: Release 10.2.0.4.0 - 64bit Production on Sunday, 25 September, 2011 10:07:05 Copyr
21、ight (c) 2003, 2007, Oracle. All rights reserved.Password: UDI-00008: operation generated ORACLE error 257ORA-00257: archiver error. Connect internal only, until freed.1) 查看Archive log 所在位置SQL Show parameter log_archeive_dest2) 一般VALUE为空时,可以用archive log list;检查一下归档目录和log sequenceSQL archive log list
22、;3) 检查flash recovery area 的使用情况,可以看见archivelog已经很大了,SQL select * from v$flash_recovery_area_usage;4) 计算flash recovery area 已经占用的空间Select sum(percent_space_used)*3/100 from v$flash_recovery_area_usage;5) 找到Recovery 目录,show parameter recoverSQL show parameter recover;6) 上述结果告诉我们,归档位置默认是在flash_recovery
23、_area下转移或清除对应的归档日志(注意:再删除归档日之后,必须用RMAN维护控制文件,否则空间显示仍然不释放)7) 检查一些无用的archivelogRMAN crosscheck archivelog all;8) 删除过期的归档RMAN delete expired archivelog all;Delete archivelog until time sysdate-1; 删除截止前一天的所有archivelog9) 修改制定的归档文件路径或者修改flash_recovery_area的大小SQL alter system set log_archive_dest=/oracle/o
24、raarch_log scope=both;SQL alter system set db_recovery_file_dest_size=3G scope=both;10、启动Data Pump Jobs-查询正在运行的Data Pump Jobs SQL select * from v$dba_datapump_jobs; -启动Jobs $ impdp event ATTACH=event.SYS_IMPORT_SCHEMA_01 -查看Job运行状态: Impdp status -停止Job Impdp stop_job -启动jobs Impdp start_job -查看对应的SE
25、SSION SQL select sid,serial# from v$session s, dba_datapump_sessions d where s.saddr=d.saddr; Select * from v$dba_datapump_jobs; -查询正在运行的Data Pump JobsImport stop_jobImport start_jobTMS.INTERFACE_TO_OMS_PG.RE_SENDLOADING_STATUS;登录到远程系统$ssh -XY oracleremotehost执行oracle安装程序$/path/to/client/runInstaller -ignoreSysPrereqs因为oracle 10g认证的linux系统只有redhat-3, SuSE-9, redhat-4, UnitedLi
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1