欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

RedHat Linux5.5下Oracle 11g安装图解

程序员文章站 2024-04-02 19:57:28
...

RedHat Linux5.5下Oracle 11g安装图解

Linux下安装Oracle系统最好是1G内存,2G的swap空间,,硬盘至少需要4.5G空间。

至少环境在Linux Server release 5.3以上

如果是Linux Server release 5.1,改装oracle10.2g吧

一、查看Linux版本

[root@localhost ~]# cat /etc/issue
Red Hat Enterprise Linux Server release 5.5 (Tikanga)

[root@localhost ~]# cat /etc/RedHat-release
Red Hat Enterprise Linux Server release 5.5 (Tikanga)

二、到oracle官方网站下载对应版本的oracle,我下的是oracle for linux X86

三、在linux下创建oracle用户,以及管理组
3.1 以root用户登录linux,执行以下命令

[root@localhost ~]#/usr/sbin/groupadd dba
[root@localhost ~]#/usr/sbin/groupadd oper
[root@localhost ~]#/usr/sbin/groupadd oinstall

小技巧:
查看Linux用户组命令:

[root@localhost ~]# cat /etc/group

3.2 添加oracle用户

[root@localhost ~]#useradd oracle
[root@localhost ~]#/usr/sbin/usermod -g oinstall -G dba oracle
[root@localhost ~]#passwd oracle
Changing password for user oracle.
New UNIX password: oracle
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password: oracle
passwd: all authentication tokens updated successfully.

3.3 预先创建安装目录
[root@localhost ~]#mkdir -p /opt/oracle/product
[root@localhost ~]#mkdir -p /opt/oracle/product/OraHome
[root@localhost ~]#mkdir -p /opt/oraInventory
[root@localhost ~]#mkdir -p /opt/oracle/oradata
[root@localhost ~]#mkdir -p /var/opt/oracle

3.4 设置目录的所有者所属组和权限

[root@localhost ~]#chown -R oracle.oinstall /opt/oracle
[root@localhost ~]#chown -R oracle.oinstall /opt/oracle/oradata
[root@localhost ~]#chown -R oracle.oinstall /opt/oracle/product/OraHome
[root@localhost ~]#chown -R oracle.dba /opt/oraInventory
[root@localhost ~]#chown oracle.dba /var/opt/oracle
[root@localhost ~]#chmod -R 775 /opt/oracle
[root@localhost ~]#chmod -R 755 /var/opt/oracle

3.5 设置用户oracle的环境变量

#su - oracle
[oracle@localhost ~]$ vi /home/oracle/.bash_profile

在文件底部添加

export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/product/OraHome
export ORACLE_SID=orcl
export ORACLE_OWNER=oracle
export ORACLE_TERM=vt100
export PATH=$PATH:$ORACLE_HOME/bin:$HOME/bin
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/Apache/Apache/bin:$PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
export CLASSPATH
PATH=$PATH:/usr/sbin; export PATH
PATH=$PATH:/usr/bin; export PATH

--执行以下命令让配置马上生效或以oracle用户登录使设置生效

[oracle@localhost ~]$ source $HOME/.bash_profile

RedHat Linux5.5下Oracle 11g安装图解