簡單oracle安裝步驟

swq618發表於2016-04-20
<strong><span style="font-size:18px;">簡單oracle安裝步驟</span></strong> <hr /> <br /> &nbsp;一: 安裝包:<br /> cd /etc/yum.repos.d/<br /> vi rhel54.repo<br /> [Server]<br /> name=Red Hat Enterprise Linux Server<br /> baseurl=ftp://172.26.0.11/Server64/<br /> enabled=1<br /> gpgcheck=1<br /> gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release<br /> yum -y install&nbsp;<br /> <br /> <br /> yum -y install binutils<br /> yum -y install compat-libstdc++-33<br /> yum -y install elfutils-libelf<br /> yum -y install glibc<br /> yum -y install glibc-common<br /> yum -y install ksh<br /> yum -y install libaio<br /> yum -y install libgcc<br /> yum -y install libstdc++<br /> yum -y install make<br /> yum -y install elfutils-libelf-devel<br /> yum -y install glibc-headers<br /> yum -y install glibc-devel<br /> yum -y install gcc<br /> yum -y install libstdc++-devel<br /> yum -y install gcc-c++<br /> yum -y install libaio-devel<br /> yum -y install sysstat<br /> yum -y install unixODBC<br /> yum -y install unixODBC-devel<br /> yum -y install libXp<br /> <br /> <br /> 二:修改核心引數&nbsp;<br /> 1:/etc/sysctl.conf中新增<br /> kernel.shmall = 4294967296<br /> kernel.shmmax = 68719476736<br /> kernel.shmmni = 4096&nbsp;<br /> kernel.sem = 310 32000 100 128&nbsp;<br /> fs.file-max = 6815744<br /> fs.aio-max-nr = 1048576<br /> net.ipv4.ip_local_port_range = 9000 65500<br /> net.core.rmem_default = 262144&nbsp;<br /> net.core.rmem_max = 4194304&nbsp;<br /> net.core.wmem_default = 262144&nbsp;<br /> net.core.wmem_max = 1048576<br /> sysctl -p &nbsp;--需要在/etc/目錄下<br /> kernel.shmall = physical RAM size / pagesize For most systems, this will be the value 2097152. See Note 301830.1 for more information.&nbsp;<br /> 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.&nbsp;<br /> kernel.shmmni = 4096&nbsp;<br /> kernel.sem = 250 32000 100 128&nbsp;<br /> fs.file-max = 512 x processes (for example 6815744 for 13312 processes)<br /> fs.aio-max-nr = 1048576<br /> net.ipv4.ip_local_port_range = 9000 65500&nbsp;<br /> net.core.rmem_default = 262144&nbsp;<br /> net.core.rmem_max = 4194304&nbsp;<br /> net.core.wmem_default = 262144&nbsp;<br /> net.core.wmem_max = 1048576<br /> <br /> <br /> 2: 修改/etc/security/limits.conf<br /> 新增:<br /> * soft nproc 2047&nbsp;<br /> * hard nproc 16384&nbsp;<br /> * soft nofile 1024&nbsp;<br /> * hard nofile 65536<br /> <br /> <br /> 3:修改/etc/pam.d/login<br /> 新增:<br /> <br /> <br /> session required pam_limits.so<br /> 4:修改/etc/profile<br /> 新增:<br /> <br /> <br /> <br /> <br /> 5: 建立oracle使用者<br /> [root@esalespreapp1 etc]# groupadd -g 500 dba<br /> [root@esalespreapp1 etc]# groupadd -g 501 oinstall<br /> [root@esalespreapp1 etc]# groupadd -g 502 oper<br /> [root@esalespreapp1 etc]# useradd -u 500 -g oinstall -G dba,oper oracle<br /> [root@esalespreapp1 etc]# id oracle<br /> uid=500(oracle) gid=501(oinstall) groups=501(oinstall),500(dba),502(oper)<br /> [root@esalespreapp1 etc]# passwd oracle<br /> Changing password for user oracle.<br /> New UNIX password:&nbsp;<br /> BAD PASSWORD: it is based on a dictionary word<br /> Retype new UNIX password:&nbsp;<br /> passwd: all authentication tokens updated successfully.<br /> <br /> <br /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">groupadd -g 500 oinstall</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">groupadd -g 501 dba</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">groupadd -g 502 oper</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">groupadd -g 503 asmdba</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">groupadd -g 504 asmadmin</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">groupadd -g 505 asmoper</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">useradd -u 500 -g oinstall -G dba,oper,asmdba oracle</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">useradd -u 501 -g oinstall -G dba,oper,asmdba,asmadmin,asmoper grid</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">passwd oracle</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">passwd grid</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">[root@rac1 tmp]# id oracle</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba),502(oper),503(asmdba)</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">[root@rac1 tmp]# id grid</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">uid=501(grid) gid=500(oinstall) groups=500(oinstall),501(dba),502(oper),503(asmdba),504(asmadmin),505(asmoper)</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">2.3 建立密碼不過期</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">chage -M 99999 oracle</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">chage -M 99999 grid</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <br /> <br /> <br /> <br /> 配置vnc:<br /> vncserver<br /> 或者:<br /> vncserver -geometry 1280x900<br /> <br /> vncserver -kill szdevdb3:1<br /> cd .vnc &nbsp; 目錄<br /> <br /> <br /> [oracle@szruledb2 .vnc]$ vi xstartup&nbsp;<br /> 註釋並加入一行<br /> gnome-session &amp;<br /> <br /> <br /> <br /> <br /> [oracle@szsgisuatdb1 .vnc]$ vi xstartup<br /> #!/bin/sh<br /> <br /> <br /> # Uncomment the following two lines for normal desktop:<br /> # unset SESSION_MANAGER<br /> # exec /etc/X11/xinit/xinitrc<br /> [ -x /etc/vnc/xstartup ] &amp;&amp; exec /etc/vnc/xstartup<br /> [ -r $HOME/.Xresources ] &amp;&amp; xrdb $HOME/.Xresources<br /> xsetroot -solid grey<br /> vncconfig -iconic &amp;<br /> xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &amp;<br /> #twm &amp;<br /> gnome-session &amp;<br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> 6:修改ORACLE使用者的profile<br /> [oracle@esalespreapp1 ~]$ vi .bash_profile<br /> # .bash_profile<br /> # Get the aliases and functions<br /> if [ -f ~/.bashrc ]; then<br /> . ~/.bashrc<br /> fi<br /> # User specific environment and startup programs<br /> PATH=$PATH:$HOME/bin<br /> export PATH<br /> export ORACLE_BASE=/app<br /> export ORACLE_SID=esales<br /> export ORACLE_HOME=$ORACLE_BASE/product/ora11g<br /> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib<br /> export PATH=$ORACLE_HOME/bin:$PATH<br /> export EDITOR=vi<br /> export NLS_LANG='SIMPLIFIED CHINESE_CHINA.ZHS16GBK'<br /> umask 022<br /> <br /> <br /> <br /> <br /> 生效配置檔案<br /> <br /> <br /> . prof_grp<br /> source prof_grp<br /> <br /> <br /> 建目錄:<br /> <br /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">mkdir -p /app/grid</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">mkdir -p /app/oracle</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">mkdir -p /app/oraInventory</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">mkdir -p /app/soft</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">mkdir -p /app/soft/grid</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">mkdir -p /app/soft/oracle</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">mkdir -p /app/soft/asmlib</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">mkdir -p /backup</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">mkdir -p /arch</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">chown -R oracle:oinstall /app</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">chown -R oracle:oinstall /arch</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">chown -R oracle:oinstall /backup</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">chown -R grid:oinstall /app/grid</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">chown -R oracle:oinstall /app/oracle</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">chown -R grid:oinstall /app/oraInventory</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">chown -R grid:oinstall /app/soft/grid</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">chown -R oracle:oinstall /app/soft/oracle</span><br style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;" /> <span style="color:#666666;font-family:宋體, Arial;line-height:26px;white-space:normal;background-color:#FFFFFF;">chmod -R 755 /app</span><br /> <br /> <br /> 7: 停止防火牆<br /> [root@szuatdb1 oracle]# service iptables stop<br /> Flushing firewall rules: [ OK ]<br /> Setting chains to policy ACCEPT: filter [ OK ]<br /> Unloading iptables modules: [ OK ]<br /> [root@szuatdb1 oracle]# chkconfig iptables off<br /> [root@szuatdb1 oracle]#&nbsp;<br /> <br /> <br /> <br /> <br /> <br /> <br /> 三: 安裝資料庫軟體:<br /> dbca<br /> $ dbca<br /> DISPLAY not set.<br /> Set DISPLAY environment variable, then re-run.<br /> $<br /> export DISPLAY=ip:0.0<br /> <br /> <br /> 四:修改引數<br /> alter profile default limit password_life_time unlimited;<br /> alter profile default limit FAILED_LOGIN_ATTEMPTS unlimited;<br /> alter system set sec_case_sensitive_logon=false;<br /> <br /> <br /> 建庫<br /> <br /> <br /> &nbsp;語言選擇:zh16gbk<br /> <br /> <br /> <br /> <br /> 啟動<br /> <br /> <br /> echo $ORACLE_SID<br /> ps -ef|grep smon<br /> export ORACLE_SID=testdb<br /> &nbsp;sqlplus "/as sysdba"<br /> shutdown immediate<br /> <br /> <br /> <br /> <br /> 配置監聽<br /> netca<br /> <br /> <br /> alter system set local_listener=LISTENER_ATP;<br /> <br /> <br /> alter system register;<br />

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29674916/viewspace-2084911/,如需轉載,請註明出處,否則將追究法律責任。

相關文章