centos 5 安装oracle 10g

来源:互联网 发布:移除数组中某个元素 编辑:程序博客网 时间:2024/06/07 03:53

CentOS 必需的安装包
* GNOME Desktop Environment
* Editors
* Graphical Internet
* Text-based Internet
* Development Libraries
* Development Tools
* Legacy Software Development
* Server Configuration Tools
* Administration Tools
* Base
* Legacy Software Support
* System Tools
* X Window System
修改host文件
Hosts File
# vi /etc/hosts
//192.168.1.50 oracle oracle.localdomain oracle
127.0.0.1 oracle localhost.localdomain localhost//机器的静态IP,不要用127.0.0.1,否则检验时网络错误。
设置内核参数
# vi /etc/sysctl.conf
#kernel.shmall = 2097152
#kernel.shmmax = 2147483648
kernel.shmmni = 4096
# 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
# /sbin/sysctl -p
设置最大打开文件数
# echo -ne “
* soft nofile 65536
* hard nofile 65536
” >>/etc/security/limits.conf
# vi /etc/sysctl.conf
fs.file-max = 65536
# vi /etc/pam.d/login
sessionrequired /lib/security/pam_limits.so
安装必须的编译安装包
# yum -y install setarch-2*
# yum -y install make-3*
# yum -y install glibc-2*
# yum -y install libaio-0*
# yum -y install compat-libstdc++-33-3*
# yum -y install compat-gcc-34-3*
# yum -y install compat-gcc-34-c++-3*
# yum -y install gcc-4*
# yum -y install libXp-1*
# yum -y install openmotif-2*
# yum -y install compat-db-4*
建立oracle用户及组
# groupadd oinstall
# groupadd dba
# groupadd oper
# useradd -g oinstall -G dba oracle
# passwd oracle
oracle数据库下载
* Oracle Database 10g Release 2 (10.2.0.1) Software
建立ORACLE_HOME目录,解压数据库安装文件
# mkdir -p /home/oracle/product/10.2.0/db_1         
# unzip 10201_database_linux32.zip
# mv database /home/oracle
# chown -R oracle.oinstall /home/oracle   -----将product目录设置成oracle用户目录
修改操作系统版本标识
# vi /etc/redhat-release
#CentOS release 5.2 (Final)
redhat-4
修改ORACLE环境变量
# su - oracle
$ vi .bash_profile
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/home/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
if [ $USER = "oracle" ]; then                  ---------------注意有空格
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
配置XDMCP
对于GDM
# vi /etc/gdm/custom.conf
[xdmcp]
Enable=1
对于KDM
# vi /usr/share/config/kdm/Xaccess
* #any host can get a login window
# vi /usr/share/config/kdm/kdmrc
[xdmcp]
Enable=true
防火墙配置
防火墙开放UDP端口177
防火墙开放TCP端口6000~6010
改变操作系统运行等级
# vi /etc/inittab
id:5:initdefault:
# reboot
安装oracle数据库
# su - oracle
注销用oracle 用户登录
$export LANG=C
$ export DISPLAY=192.168.1.3:0.0                --------------设置成客户端的IP:0.0
$ /home/oracle/database/runInstaller
* 为客户机IP地址,xp下使用Xmanager 2.0连接远程服务器的桌面
1. Select Installation Method
选择Advanced Installation
2. Specify Inventory Directory and Credentials
3. Select Installation Type
选择Enterprise Edition
4. Specify Home Details
Name文本框中填写db_1
5. Product-Specific Prerequisite Checks
6. Select Configuration Option
选择create a database
7. Select Database Configuration
选择General Purpose
8. Specify Database Configuration Options
选择Select Database character set : UTF-8
9. Select Database Management Option
选择Use Database Control Database Management
10. Specify Database Storage Option
选择File System
11. Specify Backup and Recovery Options
选择Do not enable Automated backups
12. Specify Database Schema Passwords
选择Use the same password for all the accounts
13. Summary
14. Install
15. Configuration Assistants
16. Database Configuration Assistant
17. Database Configuration Assistant Password Management
选择Password Management,除system以外全部锁定
18. Execute Configuration Scripts
在root环境中执行
# /home/oracle/oraInventory/orainstRoot.sh
# /home/oracle/product/10.2.0/db_1/root.sh
19. End Of Installation
恢复操作系统版本
# vi /etc/redhat-release
CentOS release 5.2 (Final)
设置数据库开机自动启动
# /etc/oratab
orcl:/home/oracle/product/10.2.0/db_1:Y
# vi /etc/rc.local
su - oracle -c ‘dbstart’
# su - oracle
$ vi /home/oracle/product/10.2.0/db_1/bin/dbstart
第78行修改为
ORACLE_HOME_LISTNER=$ORACLE_HOME/
数据库相关命令
$ dbstart [ start | status | stop ]
$ lsnrctl [ start | status | stop ]
$ emctl [ start | status | stop ] dbconsole
$ sqlplus /nolog
>connect system/passwd as sysdba
DBCA - Database Configuration Assistant
$ dbca
启动EM
http://localhost:1158/em/

 

 

 

___________注意用户是否有权限。。