{"id":497,"date":"2016-10-03T14:55:10","date_gmt":"2016-10-03T06:55:10","guid":{"rendered":"http:\/\/www.821121.com\/?p=497"},"modified":"2020-12-11T10:03:46","modified_gmt":"2020-12-11T02:03:46","slug":"oracle10-2-0-1%e6%95%b0%e6%8d%ae%e5%ba%93%e5%8d%87%e7%ba%a7%e8%87%b310-2-0-5%e9%83%a8%e7%bd%b2%e6%89%8b%e5%86%8c","status":"publish","type":"post","link":"http:\/\/www.821121.com\/?p=497","title":{"rendered":"Oracle10.2.0.5\u6570\u636e\u5e93 RAC\u90e8\u7f72(\u4e00)"},"content":{"rendered":"<pre><code class=\"language-sql\">RAC\u7684host\u4fe1\u606f\uff1a\n192.168.0.31 ten1\n192.168.0.32 ten2\n192.168.0.33 ten1-vip\n192.168.0.34 ten2-vip\n192.168.178.31 ten1-priv\n192.168.178.32 ten2-priv\n\n\u8282\u70b91\uff1a\nip\uff1a192.168.0.31     \u7cfb\u7edf\uff1alinux5.7   \u6570\u636e\u5e93\uff1aoracle10gRAC    sys\u5bc6\u7801\uff1a123456  \n\n\u8282\u70b92\uff1a\nip\uff1a192.168.0.32    \u7cfb\u7edf\uff1alinux5.7   \u6570\u636e\u5e93\uff1aoracle10gRAC    sys\u5bc6\u7801\uff1a123456<\/code><\/pre>\n<pre><code class=\"language-sql\">0.\u5b89\u88c5\u90e8\u7f72\u524d\u68c0\u67e5\uff0c\u8be6\u60c5\u89c110g_rac excel\u8868\u3002\n1.\u68c0\u67e5\u7f51\u7edc\uff0c\u6709\u4e24\u4e2a\u4e0d\u540c\u7684\u7f51\u6bb5,\u4e24\u4e2a\u9759\u6001IP.\nifconfig\n\u7f51\u53611\uff08public ip\uff09\uff1avi \/etc\/sysconfig\/network-scripts\/ifcfg-ens33     \nBOOTPROTO=static\nIPADDR=192.168.0.31\uff08\u586b\u4f60\u7684ip\uff09                   \nNETMASK=255.255.255.0  \uff08\u586b\u4f60\u7684\u63a9\u7801\u503c\uff09          \nGATEWAY=192.168.0.1    (\u9ed8\u8ba4\u7f51\u5173)\n\u7f51\u53612\uff08\u5fc3\u8df3ip\uff09\uff1avi \/etc\/sysconfig\/network-scripts\/ifcfg-ens34\nDEVICE=eth1\nTYPE=Ethernet\nONBOOT=yes\nNM_CONTROLLED=yes\nBOOTPROTO=static\nIPADDR=192.168.178.31\nNETMASK=255.255.255.0\n\nservice network restart     \/\/\u91cd\u542f\u7f51\u7edc\n\n2.\u68c0\u67e5linux\u7cfb\u7edf\u7248\u672c,\u9700\u6c42\u7cfb\u7edf\u4e3alinux5\uff0c\u4e24\u53f0\u673a\u5668\u7684\u7cfb\u7edf\u8981\u540c\u6837\u7684\u3002\n cat \/etc\/redhat-release\n uname -r\n\n3.\u68c0\u67e5\u5b89\u88c5\u6240\u9700\u7684\u78c1\u76d8\n\n4.\u8c03\u6574\u597d\u65f6\u533a\u548c\u65f6\u95f4\ndate \nrm -rf \/etc\/localtime\nln -s \/usr\/share\/zoneinfo\/Asia\/Shanghai \/etc\/localtime\ndate -s &quot;2015-6-8 15:36:00&quot;\n\n5.\u68c0\u67e5iso\u955c\u50cf\u662f\u5426\u6302\u4e0a\u3002\nmount \/dev\/sr0 \/mnt<\/code><\/pre>\n<h1>1\u3001\u5b89\u88c5\u8f6f\u4ef6\u5305<\/h1>\n<pre><code class=\"language-sql\">mount  \/dev\/cdrom \/mnt\n\nvi \/etc\/yum.repos.d\/ol.repo\n\n[local-source]\nname=ol\nbaseurl=file:\/\/\/mnt\/Server\nenabled=1\ngpgcheck=0\n\n\u5b89\u88c5rpm\u4f9d\u8d56\u5305\n\nyum install -y libXau*  libxcb*  libX11* libXext* libICE*  libuuid* libSM*  libXt* libXi* libXtst* libXp* glibc-devel* libaio-devel* libaio* compat-libstdc++* libXpm* libXp-devel* libXpm-devel* compat-libstdc++* compat-libstdc++* compat-libstdc++* gcc-4.4.6* gcc-c++* unixODBC-*\nyum install -y libXp.so.6\nyum install -y libXt.so.6\nyum install -y libXtst.so.6<\/code><\/pre>\n<h1>2\u3001\u521b\u5efa\u7528\u6237\u3001\u7ec4\u3001\u76ee\u5f55<\/h1>\n<pre><code class=\"language-sql\">\u521b\u5efa\u7528\u6237\u3001\u7ec4\ngroupadd -g 1005 oinstall\ngroupadd -g 1001 dba\nuseradd -u 1101 -g oinstall -G dba oracle\n\n\u521b\u5efa\u76ee\u5f55\u3001\u8d4b\u6743\nmkdir -p  \/u01\/app\/oracle\nchown -R oracle:oinstall \/u01\nchmod -R 775 \/u01\/\npasswd oracle\n\n\u4f5c\u7528          \u8def\u5f84\noracle_base \/u01\/app\/oracle\nOracle_home  \/u01\/app\/oracle\/product\/10.2.0\/db_1\nORA_CRS_HOME    \/u01\/app\/oracle\/product\/10.2.0\/crs\n<\/code><\/pre>\n<h1>3\u3001\u914d\u7f6e\u5171\u4eab\u78c1\u76d8\uff08\u591a\u8def\u5f84+udev\uff09--&gt;\u8fd9\u91cc\u4f7f\u7528\u865a\u62df\u673a<\/h1>\n<pre><code class=\"language-sql\">\u5207\u6362\u5230vmware\u5b89\u88c5\u76ee\u5f55   cd D:\\Soft\\VMware\ncmd  \u547d\u4ee4\n.\\vmware-vdiskmanager.exe -c -s 2G -a lsilogic -t 2 &quot;D:\\Soft\\VMware\\Oracle\\Shared\\10g\\OCR1.vmdk&quot;\n.\\vmware-vdiskmanager.exe -c -s 2G -a lsilogic -t 2 &quot;D:\\Soft\\VMware\\Oracle\\Shared\\10g\\OCR2.vmdk&quot;\n.\\vmware-vdiskmanager.exe -c -s 20G -a lsilogic -t 2 &quot;D:\\Soft\\VMware\\Oracle\\Shared\\10g\\DATA.vmdk&quot;\n\u5206\u522b\u6253\u5f00\u4e24\u53f0\u865a\u62df\u673a\u76ee\u5f55\u4e2d\u7684vmx\u6587\u4ef6\uff0c\u5728\u6700\u540e\u4e00\u884c\u6dfb\u52a0\uff1a\nscsi1.present = &quot;TRUE&quot;\nscsi1.virtualDev = &quot;lsilogic&quot;\nscsi1.sharedBus = &quot;virtual&quot;\n\nscsi1:1.present = &quot;TRUE&quot;\nscsi1:1.mode = &quot;independent-persistent&quot;\nscsi1:1.filename = &quot;D:\\Soft\\VMware\\Oracle\\Shared\\10g\\OCR1.vmdk&quot;\nscsi1:1.deviceType = &quot;Disk&quot;\n\nscsi1:2.present = &quot;TRUE&quot;\nscsi1:2.mode = &quot;independent-persistent&quot;\nscsi1:2.filename = &quot;D:\\Soft\\VMware\\Oracle\\Shared\\10g\\OCR2.vmdk&quot;\nscsi1:2.deviceType = &quot;Disk&quot;\n\nscsi1:3.present = &quot;TRUE&quot;\nscsi1:3.mode = &quot;independent-persistent&quot;\nscsi1:3.filename = &quot;D:\\Soft\\VMware\\Oracle\\Shared\\10g\\DATA.vmdk&quot;\nscsi1:3.deviceType = &quot;Disk&quot; \n\ndisk.locking = &quot;false&quot;\ndiskLib.dataCacheMaxSize = &quot;0&quot;\ndiskLib.dataCacheMaxReadAheadSize = &quot;0&quot;\ndiskLib.DataCacheMinReadAheadSize = &quot;0&quot;\ndiskLib.dataCachePageSize = &quot;4096&quot;\ndiskLib.maxUnsyncedWrites = &quot;0&quot;\n\n\u6302\u88f8\u76d8\nfdisk \/dev\/sdb\nfdisk \/dev\/sdc\nfdisk \/dev\/sdd\nn p 1 \u56de\u8f66 \u56de\u8f66 w\n\nudev\u89c4\u5219\uff1a\n\nvi \/etc\/udev\/rules.d\/60-raw.rules\n\nACTION==&quot;add&quot;,KERNEL==&quot;sdb1&quot;,RUN+=&quot;\/bin\/raw \/dev\/raw\/raw1 %N&quot;\nACTION==&quot;add&quot;,KERNEL==&quot;sdc1&quot;,RUN+=&quot;\/bin\/raw \/dev\/raw\/raw2 %N&quot;\nACTION==&quot;add&quot;,KERNEL==&quot;sdd1&quot;,RUN+=&quot;\/bin\/raw \/dev\/raw\/raw3 %N&quot;\nKERNEL==&quot;raw1&quot;, OWNER=&quot;oracle&quot;, GROUP=&quot;oinstall&quot;, MODE=&quot;660&quot;\nKERNEL==&quot;raw2&quot;, OWNER=&quot;oracle&quot;, GROUP=&quot;oinstall&quot;, MODE=&quot;660&quot;\nKERNEL==&quot;raw3&quot;, OWNER=&quot;oracle&quot;, GROUP=&quot;oinstall&quot;, MODE=&quot;660&quot;\n\nstart_udev\n\n\u67e5\u770b\u662f\u5426OK\n[root@localhost device-mapper-multipath-0.4.7]#  ls -l \/dev\/raw\ntotal 0\ncrw-rw---- 1 root root 162, 1 Oct  5 14:42 raw1\ncrw-rw---- 1 root root 162, 2 Oct  5 14:42 raw2\ncrw-rw---- 1 root root 162, 3 Oct  5 14:42 raw3<\/code><\/pre>\n<h1>4\u914d\u7f6e\u7cfb\u7edf\u53c2\u6570<\/h1>\n<h2>4.1\u4fee\u6539\u4e3b\u673a\u540d<\/h2>\n<pre><code class=\"language-sql\">vi \/etc\/hosts\n192.168.0.31 ten1\n192.168.0.32 ten2\n192.168.0.33 ten1-vip\n192.168.0.34 ten2-vip\n192.168.178.31 ten1-priv\n192.168.178.32 ten2-priv\n\nvi \/etc\/sysconfig\/network  \n  ten1   ten2\n\nhostname ten1\nhostname ten2<\/code><\/pre>\n<h2>4.2\u914d\u7f6e\u7cfb\u7edf\u6587\u4ef6<\/h2>\n<pre><code class=\"language-sql\">--\/etc\/security\/limits.conf \u662f Linux \u8d44\u6e90\u4f7f\u7528\u914d\u7f6e\u6587\u4ef6\uff0c\u7528\u6765\u9650\u5236\u7528\u6237\u5bf9\u7cfb\u7edf\u8d44\u6e90\u7684\u4f7f\u7528 \n--https:\/\/www.cnblogs.com\/pzk7788\/p\/7250723.html\n\nvi \/etc\/security\/limits.conf\n\u6dfb\u52a0\noracle soft nproc 2047\noracle hard nproc 16384\noracle soft nofile 1024\noracle hard nofile 65536\n\nvi \/etc\/pam.d\/login \u6dfb\u52a0\uff1a\nsession required pam_limits.so \n\n\u8bbe\u7f6e\u5185\u6838\u53c2\u6570\uff0c\u7f16\u8f91\u6587\u4ef6\u5e76\u4f7f\u4e4b\u751f\u6548\uff0c\u5176\u503c\u4e0d\u5c0f\u4e8e\u5982\u4e0b\u8bbe\u7f6e\u3002\n\u4ee5\u4e0b\u662f\u53c2\u8003\u5185\u5bb9\nvi \/etc\/sysctl.conf\n\nkernel.shmmni = 4096\nkernel.sem = 250 32000 100 128\nfs.file-max = 6815744\nnet.ipv4.ip_local_port_range = 1024  65000\nnet.core.rmem_default = 262144\nnet.core.rmem_max = 4194304\nnet.core.wmem_default = 262144\nnet.core.wmem_max = 1048576\nkernel.shmall = 2097152\nkernel.shmmax = 562511173\nkernel.shmmni = 4096\nkernel.sem = 250 32000 100 128\nfs.aio-max-nr=3145728\n\n\u914d\u7f6e\u751f\u6548\uff0c\u5728\u5168\u90e8\u8282\u70b9\u64cd\u4f5c\nsysctl -p\n\nvi \/etc\/profile\u6dfb\u52a0\uff1a\nif [ $USER = &quot;oracle&quot; ]; then\n    if [ $SHELL = &quot;\/bin\/ksh&quot; ]; then\n       ulimit -u 16384\n       ulimit -n 65536\n    else\n       ulimit -u 16384 -n 65536\n    fi\nfi<\/code><\/pre>\n<h2>4.3\u7981\u7528SELinux\u3001\u9632\u706b\u5899<\/h2>\n<pre><code class=\"language-sql\">SELinux\u5efa\u8bae\u7981\u7528\u6b64\u529f\u80fd\u3002\nvi \/etc\/selinux\/config\nSELINUX=disabled\n\u9700\u8981\u91cd\u542f\u3002\n\u9632\u706b\u5899\u7981\u7528\uff1a\n\/etc\/init.d\/iptables stop\nchkconfig iptables off<\/code><\/pre>\n<h2>4.4 oracle\u7528\u6237\u73af\u5883\u53d8\u91cf\u914d\u7f6e<\/h2>\n<pre><code class=\"language-sql\">oracle\u7528\u6237\uff0c2\u4e2a\u8282\u70b9\u4e0a\u914d\u7f6e\uff1a\nvi ~\/.bash_profile  \u7f16\u8f91\u540esource ~\/.bash_profile\nexport TMP=\/tmp \nexport TMPDIR=$TMP \nexport ORACLE_SID=ten1   #\u8282\u70b91\u7684\u914d\u7f6e\nexport ORACLE_BASE=\/u01\/app\/oracle \nexport ORACLE_HOME=$ORACLE_BASE\/product\/10.2.0\/db_1\nexport ORA_CRS_HOME=$ORACLE_BASE\/product\/10.2.0\/crs\nexport TNS_ADMIN=$ORACLE_HOME\/network\/admin \nexport PATH=\/usr\/sbin:$PATH \nexport PATH=$ORA_CRS_HOME\/bin:$ORACLE_HOME\/bin:$PATH \nexport LD_LIBRARY_PATH=$ORACLE_HOME\/lib:\/lib:\/usr\/lib \nexport CLASSPATH=$ORACLE_HOME\/JRE:$ORACLE_HOME\/jlib:$ORACLE_HOME\/rdbms\/jlib \numask 022<\/code><\/pre>\n<h2>4.5 \u914d\u7f6ehangcheck-timer\u5185\u6838\u6a21\u5757\uff08\u4e24\u53f0\uff09<\/h2>\n<pre><code class=\"language-sql\">[root@node-rac1 ~]# vi \/etc\/modprobe.conf \u540e\u9762\u589e\u52a0\noptions hangcheck-timer hangcheck_tick=30 hangcheck_margin=180\n\u542f\u52a8hangcheck\n[root@node-rac1 ~]# \/sbin\/modprobe hangcheck_timer\n\u628a\/sbin\/modprobe hangcheck_timer\u589e\u52a0\u5230\/etc\/rc.local\u81ea\u52a8\u52a0\u8f7d\n\u67e5\u770b\u662f\u5426\u6210\u529f\n[root@node-rac1 ~]# grep hangcheck \/var\/log\/messages | tail -2\nJul 29 20:39:28 node-rac1 kernel: Hangcheck: starting hangcheck timer 0.9.0 (tick is 30 seconds, margin is 180 seconds).\n\u4e0a\u9762\u663e\u793a\u6210\u529f\u4e86\u3002<\/code><\/pre>\n<h2>4.6 \u5efa\u7acb\u4e92\u4fe1<\/h2>\n<pre><code class=\"language-sql\">ssh\u751f\u6210\u516c\u94a5\/\u79c1\u94a5 \uff08oracle\u7528\u6237\u4e0b\uff09\nssh-keygen -t rsa -P &#039;&#039;\n\u8f93\u5165\u5185\u5bb9\u76f4\u63a5\u6309\u56de\u8f66\ncd ~\/.ssh\nvi id_rsa.pub\n\u5c062\u4e2a\u8282\u70b9id_rsa.pub\u7684\u5185\u5bb9\uff0c\u590d\u5236\u51fa\u6765\u5199\u5165\u52302\u4e2a\u8282\u70b9\u7684authorized_keys\u6587\u4ef6\u4e2d\ncd ~\/.ssh\nvi authorized_keys<\/code><\/pre>\n<h2>4.7\u4fee\u6539\u7248\u672c<\/h2>\n<pre><code class=\"language-sql\">vi \/etc\/redhat-release\n\u628a5.7\u6539\u62104.8\u5373\u53ef<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>RAC\u7684host\u4fe1\u606f\uff1a 192.168.0.31 <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,36],"tags":[],"class_list":["post-497","post","type-post","status-publish","format-standard","hentry","category-oracle-10g","category-36"],"_links":{"self":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/497","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=497"}],"version-history":[{"count":3,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/497\/revisions"}],"predecessor-version":[{"id":501,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/497\/revisions\/501"}],"wp:attachment":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=497"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=497"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=497"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}