ITPub博客

首页 > 数据库 > Oracle > 简单oracle安装步骤

简单oracle安装步骤

原创 Oracle 作者:Michael_DD 时间:2015-06-23 14:08:09 0 删除 编辑
简单oracle安装步骤

 一: 安装包:
cd /etc/yum.repos.d/
vi rhel54.repo
[Server]
name=Red Hat Enterprise Linux Server
baseurl=ftp://172.26.0.11/Server64/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
yum -y install 


yum -y install binutils
yum -y install compat-libstdc++-33
yum -y install elfutils-libelf
yum -y install glibc
yum -y install glibc-common
yum -y install ksh
yum -y install libaio
yum -y install libgcc
yum -y install libstdc++
yum -y install make
yum -y install elfutils-libelf-devel
yum -y install glibc-headers
yum -y install glibc-devel
yum -y install gcc
yum -y install libstdc++-devel
yum -y install gcc-c++
yum -y install libaio-devel
yum -y install sysstat
yum -y install unixODBC
yum -y install unixODBC-devel
yum -y install libXp


二:修改核心参数 
1:/etc/sysctl.conf中添加
kernel.shmall = 4294967296
kernel.shmmax = 68719476736
kernel.shmmni = 4096 
kernel.sem = 310 32000 100 128 
fs.file-max = 6815744
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144 
net.core.rmem_max = 4194304 
net.core.wmem_default = 262144 
net.core.wmem_max = 1048576
sysctl -p  --需要在/etc/目录下
kernel.shmall = physical RAM size / pagesize For most systems, this will be the value 2097152. See Note 301830.1 for more information. 
kernel.shmmax = 1/2 of physical RAM, but not greater than 4GB. This would be the value 2147483648 for a system with 4Gb of physical RAM. 
kernel.shmmni = 4096 
kernel.sem = 250 32000 100 128 
fs.file-max = 512 x processes (for example 6815744 for 13312 processes)
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500 
net.core.rmem_default = 262144 
net.core.rmem_max = 4194304 
net.core.wmem_default = 262144 
net.core.wmem_max = 1048576


2: 修改/etc/security/limits.conf
添加:
* soft nproc 2047 
* hard nproc 16384 
* soft nofile 1024 
* hard nofile 65536


3:修改/etc/pam.d/login
添加:


session required pam_limits.so
4:修改/etc/profile
添加:




5: 创建oracle用户
[root@esalespreapp1 etc]# groupadd -g 500 dba
[root@esalespreapp1 etc]# groupadd -g 501 oinstall
[root@esalespreapp1 etc]# groupadd -g 502 oper
[root@esalespreapp1 etc]# useradd -u 500 -g oinstall -G dba,oper oracle
[root@esalespreapp1 etc]# id oracle
uid=500(oracle) gid=501(oinstall) groups=501(oinstall),500(dba),502(oper)
[root@esalespreapp1 etc]# passwd oracle
Changing password for user oracle.
New UNIX password: 
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password: 
passwd: all authentication tokens updated successfully.


groupadd -g 500 oinstall
groupadd -g 501 dba
groupadd -g 502 oper
groupadd -g 503 asmdba
groupadd -g 504 asmadmin
groupadd -g 505 asmoper
useradd -u 500 -g oinstall -G dba,oper,asmdba oracle
useradd -u 501 -g oinstall -G dba,oper,asmdba,asmadmin,asmoper grid
passwd oracle
passwd grid

[root@rac1 tmp]# id oracle
uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba),502(oper),503(asmdba)
[root@rac1 tmp]# id grid
uid=501(grid) gid=500(oinstall) groups=500(oinstall),501(dba),502(oper),503(asmdba),504(asmadmin),505(asmoper)

2.3 创建密码不过期
chage -M 99999 oracle
chage -M 99999 grid




配置vnc:
vncserver
或者:
vncserver -geometry 1280x900

vncserver -kill szdevdb3:1
cd .vnc   目录


[oracle@szruledb2 .vnc]$ vi xstartup 
注释并加入一行
gnome-session &




[oracle@szsgisuatdb1 .vnc]$ vi xstartup
#!/bin/sh


# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
gnome-session &








6:修改ORACLE用户的profile
[oracle@esalespreapp1 ~]$ vi .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=/app
export ORACLE_SID=esales
export ORACLE_HOME=$ORACLE_BASE/product/ora11g
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
export PATH=$ORACLE_HOME/bin:$PATH
export EDITOR=vi
export NLS_LANG='SIMPLIFIED CHINESE_CHINA.ZHS16GBK'
umask 022




生效配置文件


. prof_grp
source prof_grp


建目录:

mkdir -p /app/grid
mkdir -p /app/oracle
mkdir -p /app/oraInventory
mkdir -p /app/soft
mkdir -p /app/soft/grid
mkdir -p /app/soft/oracle
mkdir -p /app/soft/asmlib
mkdir -p /backup
mkdir -p /arch

chown -R oracle:oinstall /app
chown -R oracle:oinstall /arch
chown -R oracle:oinstall /backup
chown -R grid:oinstall /app/grid
chown -R oracle:oinstall /app/oracle
chown -R grid:oinstall /app/oraInventory
chown -R grid:oinstall /app/soft/grid
chown -R oracle:oinstall /app/soft/oracle
chmod -R 755 /app


7: 停止防火墙
[root@szuatdb1 oracle]# service iptables stop
Flushing firewall rules: [ OK ]
Setting chains to policy ACCEPT: filter [ OK ]
Unloading iptables modules: [ OK ]
[root@szuatdb1 oracle]# chkconfig iptables off
[root@szuatdb1 oracle]# 






三: 安装数据库软件:
dbca
$ dbca
DISPLAY not set.
Set DISPLAY environment variable, then re-run.
$
export DISPLAY=ip:0.0


四:修改参数
alter profile default limit password_life_time unlimited;
alter profile default limit FAILED_LOGIN_ATTEMPTS unlimited;
alter system set sec_case_sensitive_logon=false;


建库


 语言选择:zh16gbk




启动


echo $ORACLE_SID
ps -ef|grep smon
export ORACLE_SID=testdb
 sqlplus "/as sysdba"
shutdown immediate




配置监听
netca


alter system set local_listener=LISTENER_ATP;


alter system register;

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29500582/viewspace-1709064/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-02-22

  • 博文量
    326
  • 访问量
    2671970