{"id":744,"date":"2020-09-21T16:26:34","date_gmt":"2020-09-21T08:26:34","guid":{"rendered":"http:\/\/www.821121.com\/?p=744"},"modified":"2020-12-11T09:52:42","modified_gmt":"2020-12-11T01:52:42","slug":"oracle12-2-0-1%e5%8d%95%e5%ae%9e%e4%be%8b%e5%9c%a8linux6%e4%b8%8a%e7%9a%84%e9%83%a8%e7%bd%b2%e6%96%87%e6%a1%a3","status":"publish","type":"post","link":"http:\/\/www.821121.com\/?p=744","title":{"rendered":"Oracle12.2.0.1\u5355\u5b9e\u4f8b\u5728linux6\u4e0a\u7684\u90e8\u7f72\u6587\u6863"},"content":{"rendered":"<pre><code class=\"language-sql\">\u5b9e\u9a8c\u73af\u5883\uff1aRedhat 6.8(12c\u5728linux\u4e0a\u6700\u4f4e\u8fd0\u884c\u7248\u672c\u4e3a6.4\u4ee5\u4e0a)   Oracle 12c 12.2.0.1\n\nip\uff1a192.168.0.10   hostname\uff1aoracle        <\/code><\/pre>\n<h1>1\u3001\u5b89\u88c5rpm\u5305\uff082\u4e2a\u8282\u70b9\u90fd\u8981\u914d\u7f6e\uff09\uff0c\u914d\u7f6eyum\u6e90<\/h1>\n<pre><code class=\"language-sql\">mount  \/dev\/cdrom \/mnt\n\nvi \/etc\/yum.repos.d\/ol.repo\n[local-source]\nname=ol\nbaseurl=file:\/\/\/mnt\/\nenabled=1\ngpgcheck=0\ngpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-oracle\n\n\u5b89\u88c5rpm\n\nyum install xterm bc* binutils* compat-l* e2fsprog*  glibc-2.*  glibc-de*  ksh* libgcc-4*  libstdc+*  libaio-0* libaio-d* libXtst-* libX11-1*  libXau-1* libxcb-1* libXi-1.*  make-3.8* net-tool* nfs-util* sysstat-* smartmontools* gcc-c++* xorg-x11-xauth<\/code><\/pre>\n<pre><code class=\"language-sql\">\u5177\u4f53\u89c1\u5b98\u65b9\u6587\u6863\uff1a\nhttps:\/\/docs.oracle.com\/en\/database\/oracle\/oracle-database\/12.2\/cwlin\/operating-system-requirements-for-x86-64-linux-platforms.html#GUID-3F647617-7FF5-4EE4-BBA8-9A5E3EEC888F\n\u5305\u542b\nbc\nbinutils-2.20.51.0.2-5.36.el6 (x86_64)\ncompat-libcap1-1.10-1 (x86_64)\ncompat-libstdc++-33-3.2.3-69.el6 (x86_64)\ncompat-libstdc++-33-3.2.3-69.el6 (i686)\ne2fsprogs-1.41.12-14.el6 (x86_64)\ne2fsprogs-libs-1.41.12-14.el6 (x86_64)\nglibc-2.12-1.7.el6 (i686)\nglibc-2.12-1.7.el6 (x86_64)\nglibc-devel-2.12-1.7.el6 (x86_64)\nglibc-devel-2.12-1.7.el6 (i686)\nksh\nlibgcc-4.4.4-13.el6 (i686)\nlibgcc-4.4.4-13.el6 (x86_64)\nlibstdc++-4.4.4-13.el6 (x86_64)\nlibstdc++-4.4.4-13.el6 (i686)\nlibstdc++-devel-4.4.4-13.el6 (x86_64)\nlibstdc++-devel-4.4.4-13.el6 (i686)\nlibaio-0.3.107-10.el6 (x86_64)\nlibaio-0.3.107-10.el6 (i686)\nlibaio-devel-0.3.107-10.el6 (x86_64)\nlibaio-devel-0.3.107-10.el6 (i686)\nlibXtst-1.0.99.2 (x86_64)\nlibXtst-1.0.99.2 (i686)\nlibX11-1.5.0-4.el6 (i686)\nlibX11-1.5.0-4.el6 (x86_64)\nlibXau-1.0.6-4.el6 (i686)\nlibXau-1.0.6-4.el6 (x86_64)\nlibxcb-1.8.1-1.el6 (i686)\nlibxcb-1.8.1-1.el6 (x86_64)\nlibXi-1.3 (x86_64)\nlibXi-1.3 (i686)\nmake-3.81-19.el6\nnet-tools-1.60-110.el6_2.x86_64 (for Oracle RAC and Oracle Clusterware)\nnfs-utils-1.2.3-15.0.1 (for Oracle ACFS)\nsysstat-9.0.4-11.el6 (x86_64)\nsmartmontools-5.43-1.el6.x86_64<\/code><\/pre>\n<h1>2\u3001\u521b\u5efa\u7528\u6237\u3001\u76ee\u5f55\uff082\u4e2a\u8282\u70b9\u90fd\u8981\u914d\u7f6e\uff09<\/h1>\n<pre><code class=\"language-sql\">groupadd -g 54321 oinstall\ngroupadd -g 54322 dba\ngroupadd -g 54323 oper\nuseradd -u 54321 -g oinstall -G dba,oper oracle\nmkdir -p \/u01\/app\/oracle\/product\/12.2.0\/db_1\nchown -R oracle:oinstall \/u01\/app\nchmod -R 775 \/u01\/app<\/code><\/pre>\n<h1>3\u3001\u4fee\u6539\u4e3b\u673a\u540d\u3001ip<\/h1>\n<pre><code class=\"language-sql\">vi \/etc\/hosts\n192.168.0.10 oracle\nvi \/etc\/sysconfig\/network\noracle\nhostname oracle<\/code><\/pre>\n<h1>4\u3001\u914d\u7f6e\u7cfb\u7edf\u53c2\u6570<\/h1>\n<pre><code class=\"language-sql\">\u4fee\u6539\u5185\u6838\u53c2\u6570\nvi \/etc\/sysctl.conf\n# for oracle\nfs.aio-max-nr = 1048576\nfs.file-max = 6815744\nkernel.shmall = 1364702 #\u7269\u7406\u5185\u5b58\/4k,See Note: 301830.1 for more information.\nkernel.shmmax = 2794909696 #\u7269\u7406\u5185\u5b58*0.6 (or higher at customer&#039;s discretion - see Note:567506.1)\nkernel.shmmni = 4096\nkernel.sem = 250 32000 100 128\nkernel.panic_on_oops = 1\nnet.ipv4.ip_local_port_range = 9000 65500\nnet.core.rmem_default = 262144\nnet.core.rmem_max = 4194304\nnet.core.wmem_default = 262144\nnet.core.wmem_max = 1048586\nvm.swappiness=10\n\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u751f\u6548\uff1a\nsysctl -p\n\n\u52a0\u8f7dpam_limits.so\u6a21\u5757\nvi \/etc\/pam.d\/login\nsession required pam_limits.so\n\n\u4fee\u6539\u7528\u6237\u53c2\u6570\nvi \/etc\/profile\nif [ $USER = &quot;oracle&quot; ] || [ $USER = &quot;grid&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\n\nvi \/etc\/security\/limits.conf\noracle soft nofile 1024\noracle hard nofile 65536\noracle soft stack 10240\noracle hard stack 32768\noracle soft nproc 2047\noracle hard nproc 16384\nroot soft nproc 2047\n\n* soft memlock 157286400  #90% RAM FOR HUGEPAGES \u5355\u4f4d\u662fk\n* hard memlock 157286400  #90% RAM FOR HUGEPAGES \u5355\u4f4d\u662fk<\/code><\/pre>\n<h1>5\u3001\u5173\u95ed\u9632\u706b\u5899<\/h1>\n<pre><code class=\"language-sql\">vi \/etc\/selinux\/config\nSELINUX=disabled\n\u9700\u8981\u91cd\u542f\u3002\nservice iptables stop\nchkconfig iptables off<\/code><\/pre>\n<h1>6\u3001\u5173\u95edNTP<\/h1>\n<pre><code class=\"language-sql\">service ntpd stop\nchkconfig ntpd off\nrm -rf \/etc\/ntpd.conf \nrm -rf \/var\/run\/ntpd.pid<\/code><\/pre>\n<h1>7\u3001\u4e0a\u4f20\u8f6f\u4ef6\u5305\u5230\/u01\u4e0b\u89e3\u538b<\/h1>\n<h2>7.1\u3001\u89e3\u538b\u8f6f\u4ef6(12cD\u7684\u8f6f\u4ef6\u90fd\u76f4\u63a5\u89e3\u538b\u5728oracle_home\u76ee\u5f55\u4e0b)<\/h2>\n<pre><code class=\"language-sql\">chown -R oracle:oinstall linuxx64_12201_database.zip\nchmod -R 775 linuxx64_12201_database.zip\nunzip \/u01\/\/linuxx64_12201_database.zip -d \/u01\/app\/oracle\/product\/12.2.0\/db_1\/<\/code><\/pre>\n<h2>7.2\u3001\u6267\u884c\u5b89\u88c5<\/h2>\n<pre><code class=\"language-sql\">[oracle@RmanDB ~]$ \/u01\/app\/tmp\/database\/runInstaller\nStarting Oracle Universal Installer...\n\nChecking Temp space: must be greater than 500 MB. Actual 175476 MB Passed\nChecking swap space: must be greater than 150 MB. Actual 81019 MB Passed\nChecking monitor: must be configured to display at least 256 colors\n>&gt;&gt; Could not execute auto check for display colors using command \/usr\/bin\/xdpyinfo. Check if the DISPLAY variable is set. Failed &lt;&lt;&lt;&lt;\n\nSome requirement checks failed. You must fulfill these requirements before\n\ncontinuing with the installation,\n\nContinue? (y\/n) [n] y<\/code><\/pre>\n<p>\u56fe\u5f62\u5982\u4e0b\u6240\u793a\uff1a<br \/>\n<img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/12\/image-1607069652850.png\" alt=\"file\" \/><br \/>\n<img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/12\/image-1607069664147.png\" alt=\"file\" \/><br \/>\n<img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/12\/image-1607069688881.png\" alt=\"file\" \/><br \/>\n<img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/12\/image-1607069720631.png\" alt=\"file\" \/><br \/>\n<img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/12\/image-1607069784811.png\" alt=\"file\" \/><br \/>\n<img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/12\/image-1607069793291.png\" alt=\"file\" \/><br \/>\n<img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/12\/image-1607069800250.png\" alt=\"file\" \/><br \/>\n<img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/12\/image-1607069806545.png\" alt=\"file\" \/><br \/>\n\u5982\u679c\u68c0\u67e5\u51fa\u95ee\u9898\uff0c\u8bf7\u5148\u89e3\u51b3\u518d\u884c\u5b89\u88c5\u5426\u5219\u53ef\u80fd\u5b89\u88c5\u5931\u8d25<br \/>\n<img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/12\/image-1607069820658.png\" alt=\"file\" \/><br \/>\n<img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/12\/image-1607069827719.png\" alt=\"file\" \/><br \/>\n\u6839\u636e\u63d0\u793a\uff0croot\u7528\u6237\u6267\u884c\u811a\u672c<\/p>\n<h1>8\u3001\u5f00\u542f\u76d1\u542c\uff0c\u521b\u5efa\u5b9e\u4f8b<\/h1>\n<p>lsnrctl start<br \/>\n\u56fe\u5f62\u5316\u521b\u5efa\u5b9e\u4f8b\uff0c\u5e76\u521b\u5efapdb\uff1a<br \/>\ndbca<br \/>\n<img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/12\/image-1607070136357.png\" alt=\"file\" \/><br \/>\n<img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/12\/image-1607070160305.png\" alt=\"file\" \/><br \/>\n<img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/12\/image-1607070176376.png\" alt=\"file\" \/><br \/>\n<img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/12\/image-1607070182785.png\" alt=\"file\" \/><br \/>\n<img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/12\/image-1607070189413.png\" alt=\"file\" \/><br \/>\n<img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/12\/image-1607070195013.png\" alt=\"file\" \/><br \/>\n<img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/12\/image-1607070201646.png\" alt=\"file\" \/><br \/>\n<img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/12\/image-1607070207097.png\" alt=\"file\" \/><br \/>\n<img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/12\/image-1607070212400.png\" alt=\"file\" \/><br \/>\n<img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/12\/image-1607070217326.png\" alt=\"file\" \/><br \/>\n<img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/12\/image-1607070222137.png\" alt=\"file\" \/><br \/>\n<img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/12\/image-1607070243888.png\" alt=\"file\" \/><br \/>\n<img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/12\/image-1607070251295.png\" alt=\"file\" \/><br \/>\n<img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/12\/image-1607070255943.png\" alt=\"file\" \/><\/p>\n<h1>9\u3001\u68c0\u67e5\u5b9e\u4f8b\u662f\u5426\u5b89\u88c5\u6210\u529f<\/h1>\n<pre><code class=\"language-sql\">select name,cdb from v$database;\nNAME CDB\n--------- ---\nANDYCDB YES\nSQL&gt; show pdbs\nCON_ID CON_NAME OPEN MODE RESTRICTED\n---------- ------------------------------ ---------- ----------\n2 PDB$SEED READ ONLY NO\n3 PDB01 READ WRITE NO\n\nselect * from dual;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5b9e\u9a8c\u73af\u5883\uff1aRedhat 6.8(12c\u5728linux<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,38,39],"tags":[],"class_list":["post-744","post","type-post","status-publish","format-standard","hentry","category-oracle-12c","category--oracle-12c","category-39"],"_links":{"self":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/744","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=744"}],"version-history":[{"count":2,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/744\/revisions"}],"predecessor-version":[{"id":843,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/744\/revisions\/843"}],"wp:attachment":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=744"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=744"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=744"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}