现在的位置: 首页 > 综合 > 正文

linux安装oracle

2012年05月21日 综合 ⁄ 共 5983字 ⁄ 字号 暂无评论

安装环境 redhat linux5.4 企业版
1首先修改hosts文件

[root@hfang ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
192.168.100.10 hfang.com
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
[root@hfang ~]#
[root@hfang ~]#
2 挂载光盘
[root@hfang ~]# mkdir /mnt/cdrom/
[root@hfang ~]# mount /dev/cdrom /mnt/cdrom/

3查询 以下包确认全部安装

binutils-2.15.92.0.2-13.EL4

compat-db-4.1.25-9

compat-libstdc++-296-2.96-132.7.2

control-center-2.8.0-12

gcc-3.4.3-22.1.EL4

gcc-c++-3.4.3-22.1.EL44

glibc-2.3.4-2.9

glibc-common-2.3.4-2.9

libstdc++-3.4.3-22.1

libstdc++-devel-3.4.3-22.1

make-3.80-5

pdksh-5.2.14-30

sysstat-5.0.5-1

libXp-1.0.0.8.1.e15.i386.rpm
setarch-1.6-1

4创建用户组以及用户
[root@hfang ~]# hostname
hfang.com
[root@hfang ~]# mkdir /mnt/cdrom/
[root@hfang ~]# mount /dev/cdrom /mnt/cdrom/
[root@hfang ~]# groupadd dba
[root@hfang ~]# groupadd opinstall
[root@hfang ~]# groupadd oper
[root@hfang ~]# useradd -g oinstall -G dba,oper oracle
[root@hfang ~]# passwd oracle

5编辑sysctl.conf文件 添加下列语句
[root@hfang ~]# cat /etc/sysctl.conf
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.

# Controls IP packet forwarding
net.ipv4.ip_forward = 0

# Controls source route verification
net.ipv4.conf.default.rp_filter = 1

# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0

# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0

# Controls whether core dumps will append the PID to the core filename
# Useful for debugging multi-threaded applications
kernel.core_uses_pid = 1

# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1

# Controls the maximum size of a message, in bytes
kernel.msgmnb = 65536

# Controls the default maxmimum size of a mesage queue
kernel.msgmax = 65536

# Controls the maximum shared segment size, in bytes
kernel.shmmax = 4294967295

# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 268435456
kernel.shmall = 2097152
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 = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144

[root@hfang ~]#
6 编辑limits.conf文件 添加下列语句
[root@hfang ~]# cat /etc/security/limits.conf
# /etc/security/limits.conf
#
#Each line describes a limit for a user in the form:
#
#
#
#Where:
# can be:
# - an user name
# - a group name, with @group syntax
# - the wildcard *, for default entry
# - the wildcard %, can be also used with %group syntax,
# for maxlogin limit
#
# can have the two values:
# - "soft" for enforcing the soft limits
# - "hard" for enforcing hard limits
#
# can be one of the following:
# - core - limits the core file size (KB)
# - data - max data size (KB)
# - fsize - maximum filesize (KB)
# - memlock - max locked-in-memory address space (KB)
# - nofile - max number of open files
# - rss - max resident set size (KB)
# - stack - max stack size (KB)
# - cpu - max CPU time (MIN)
# - nproc - max number of processes
# - as - address space limit
# - maxlogins - max number of logins for this user
# - maxsyslogins - max number of logins on the system
# - priority - the priority to run user process with
# - locks - max number of file locks the user can hold
# - sigpending - max number of pending signals
# - msgqueue - max memory used by POSIX message queues (bytes)
# - nice - max nice priority allowed to raise to
# - rtprio - max realtime priority
#
#
#

#* soft core 0
#* hard rss 10000
#@student hard nproc 20
#@faculty soft nproc 20
#@faculty hard nproc 50
#ftp hard nproc 0
#@student - maxlogins 4
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

# End of file
[root@hfang ~]#

7 编辑login文件添加下列内容
[root@hfang ~]# cat /etc/pam.d/login
#%PAM-1.0
auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
auth include system-auth
account required pam_nologin.so
account include system-auth
password include system-auth
# pam_selinux.so close should be the first session rule
session required pam_selinux.so close
session include system-auth
session required pam_loginuid.so
session optional pam_console.so
# pam_selinux.so open should only be followed by sessions to be executed in the user context
session required pam_selinux.so open
session optional pam_keyinit.so force revoke
session required /lib/security/pam_limits.so
session required pam_limits.so

8 编辑profile文件

[root@hfang ~]# cat /etc/profile
# /etc/profile

# System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

pathmunge () {
if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then
if [ "$2" = "after" ] ; then
PATH=$PATH:$1
else
PATH=$1:$PATH
fi
fi
}

# ksh workaround
if [ -z "$EUID" -a -x /usr/bin/id ]; then
EUID=`id -u`
UID=`id -ru`
fi

# Path manipulation
if [ "$EUID" = "0" ]; then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
fi

# No core files by default
ulimit -S -c 0 > /dev/null 2>&1

if [ -x /usr/bin/id ]; then
USER="`id -un`"
LOGNAME=$USER
MAIL="/var/spool/mail/$USER"
fi

HOSTNAME=`/bin/hostname`
HISTSIZE=1000

if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
INPUTRC=/etc/inputrc
fi

export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC

for i in /etc/profile.d/*.sh ; do
if [ -r "$i" ]; then
if [ "$PS1" ]; then
. $i
else
. $i >/dev/null 2>&1
fi
fi
done

unset i
unset pathmunge

9 创建相关目录并
[root@hfang ~]# make /u01/app/oracle/
[root@hfang ~]# chown -R oracle:oinstall /u01/app/oracle/

[root@hfang ~]# chmod -r 755 /u01/app/oracle/
[root@hfang ~]# mkdir /u01/flash_recovery_area/
[root@hfang ~]# chown oracle:oinstall /u01/flash_recovery_area/
[root@hfang ~]# chmod 755 /u01/flash_recovery_area/
执行下列语句 使oracle数据库能调用时钟界面
[root@hfang ~]# xhost local:oracle
重新挂在光盘 将oracle的镜像
[root@hfang ~]# umount /mnt/cdrom/
[root@hfang ~]# mount /dev/cdrom /mnt/cdrom/
下面我们到linux图形界面下去操作
[oracle@hfang ~]$ cat .bash_profile
# .bash_profile

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

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/10.2.0
export ORACLE_SID=hfang
export PATH=$ORACLE_HOME/bin:$PATH

[oracle@hfang ~]$
[oracle@hfang ~]$ . .bash_profile
[oracle@hfang ~]$ /mnt/cdrom/database/runInstaller 安装
选择暂时不安装数据库
默认安装 知道弹出执行脚本的窗口 按照提示
打开编辑器 选择root用户 执行脚本(共两个)然后点击OK
弹出End of installation 记下所显示的域名 ,可以通过网页登陆(非本地需要DNS服务器进行解析 或者域名改为ip地址)
创建监听器
[oracle@hfang ~]$ neta
一路图形界面默认,做一个监听器即可
建立数据库
[oracle@hfang ~]$dbca
一路默认 将Sample Schemas 界面的钩钩打上
在Character Sets 中选择中文选项 Use Unicode(Al32UTF8)
其他默认
知道弹出Datebase Configuration Assistant 界面提示退出
测试登陆

给我留言

留言无头像?