Linux 下Orcale10g的安装

1.下载安装文件

这里使用10201_database_linux32.zip这个安装包,并且需要以root用户登录

2.查看系统的资源及环境是否符合安装条件

grep MemTotal /proc/meminfo    查询内存大小 10g需>512M

grep SwapTotal /proc/meminfo 查询交换空间大小 10g需 > 1G

另外10g还需要2.5GB的磁盘空间

[root@localhost ~]# grep MemTotal /proc/meminfo
MemTotal:      1035400 kB
[root@localhost ~]# grep SwapTotal /proc/meminfo
SwapTotal:     2031608 kB
[root@localhost ~]# df -h
文件系统              容量  已用 可用 已用% 挂载点
/dev/mapper/VolGroup00-LogVol00
                       37G  5.3G   30G  15% /
/dev/sda1              99M   11M   83M  12% /boot
tmpfs                 506M     0  506M   0% /dev/shm
[root@localhost ~]# 

#vi /etc/redhat-relese

将其中的的内容Red Hat Enterprise Linux Server release 5 (Tikanga)

修改为

redhat-4

安装需要的软件包如下图:(在系统安装盘的Server中会有,网上下载亦可)

Linux 下Orcale10g的安装_第1张图片

3.创建用户和组,及orcale安装目录及数据存放目录

[root@localhost ~]# groupadd oinstall
[root@localhost ~]# groupadd dba
[root@localhost ~]# /usr/sbin/useradd -g oinstall -G dba oracle
[root@localhost ~]# passwd oracle
Changing password for user oracle.
New UNIX password: 
BAD PASSWORD: it is WAY too short
Retype new UNIX password: 
Sorry, passwords do not match.
New UNIX password: 
Retype new UNIX password: 
passwd: all authentication tokens updated successfully.
[root@localhost ~]# mkdir /opt/oracle
[root@localhost ~]# mkdir /opt/oradata
[root@localhost ~]# chown -R oracle:oinstall /opt/oracle /opt/oradata
[root@localhost ~]# chmod -R 755 /opt/oracle /opt/oradata

4.配置环境变量

切换用户并配置用户环境变量

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

添加如下内容

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs
# Controls the maximum shared segment size, in bytes
kernel.shmmax = 2147483648
kernel.shmmni = 4096
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

# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 2097152

ORACLE_BASE=/opt/oracleORACLE_SID=orclORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1LD_LIBARY_PATH=$ORACLE_HOME/libPATH=$PATH:$HOME/bin:$ORACLE_HOME/binexport ORACLE_BASE ORACLE_SID ORACLE_HOME LD_LIBARY_PATH PATH


5.设置系统参数

切换为root用户

# Controls the maximum shared segment size, in bytes
kernel.shmmax = 2147483648
kernel.shmmni = 4096
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

# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 2097152

设置完成后 使用/sbin/sysctl -p使配置生效

[root@localhost ~]# vi /etc/sysctl.conf
[root@localhost ~]# /sbin/sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 2147483648
kernel.shmmni = 4096
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
kernel.shmall = 2097152

还需添加

# 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


# vi /etc/profile

if[$USER = "oracle"];then
  if[$SHELL="/bin/ksh"];then
    ulimit -p 16384
    ulimit -n 65536
  else
    ulimit -u 16384 -n 65536
  if
Fi


检查

# vi /etc/hosts

是否有下行内容 如果没有添加上

127.0.0.1               localhost.localdomain localhost

6.执行安装

使用unzip 解压安装包

执行如下命令 弹出图形安装界面


如果文字显示不正确

 # export LANG=en_US.UTF-8 设置字符集

[root@localhost opt]# xhost local:oracle non-network local connections being added to access control list
non-network local connections being added to access control list
xhost:  bad hostname "non-network"
xhost:  bad hostname "local"
xhost:  bad hostname "connections"
xhost:  bad hostname "being"
xhost:  bad hostname "added"
xhost:  bad hostname "to"
xhost:  bad hostname "access"
xhost:  bad hostname "control"
xhost:  bad hostname "list"
[root@localhost opt]# chown -R oracle:oinstall database
[root@localhost opt]# su oracle
[oracle@localhost opt]$ cd /opt/database
[oracle@localhost database]$ ls
doc  install  response  runInstaller  stage  welcome.html
[oracle@localhost database]$ ./runInstaller
7.将

#vi /etc/redhat-relese

中的内容还原为

Red Hat Enterprise Linux Server release 5 (Tikanga)





你可能感兴趣的:(Linux 下Orcale10g的安装)