{"id":27,"date":"2020-02-02T08:28:38","date_gmt":"2020-02-02T08:28:38","guid":{"rendered":"http:\/\/ictbank.ir\/blog\/?p=27"},"modified":"2020-03-26T00:53:04","modified_gmt":"2020-03-26T00:53:04","slug":"grid-infrastructure-oracle-database-12c-preinstallation-tasks","status":"publish","type":"post","link":"https:\/\/ictbank.ir\/blog\/grid-infrastructure-oracle-database-12c-preinstallation-tasks\/","title":{"rendered":"Grid Infrastructure &#038; Oracle Database 12c &#8211; Preinstallation tasks"},"content":{"rendered":"<p>To install Oracle Grid Infrastructure &amp; Oracle Database on Oracle Linux 7, you need to prepare your OS. To do so, you have to follow these commands:<\/p>\n<p>First of all, you have to install required packages in the OS:<\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\nyum install -y cloog-ppl libXxf86misc\nyum install -y compat-libcap1 libXxf86vm\nyum install -y compat-libstdc++-33 libaio-devel\nyum install -y cpp libdmx\nyum install -y gcc libstdc++-devel\nyum install -y gcc-c++ mpfr\nyum install -y glibc-devel make\nyum install -y glibc-headers ppl\nyum install -y kernel-headers xorg-x11-utils\nyum install -y libXmu xorg-x11-xauth\nyum install -y libXt libXv\nyum install -y ksh libXxf86dga\nyum install -y elfutils-libelf-devel\nyum install -y sysstat\nyum install -y smartmontools\nyum install -y nfs-utils\nyum install -y unzip\nyum install -y net-tools\nyum install -y kmod-oracleasm \nyum install -y oracleasm-support\n\n<\/pre><\/div>\n\n<p>then, you have to edit \/etc\/hosts file and add the appropariate record as bellow:<\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\necho &quot;IP hostname hostname.domain&quot; &gt; \/etc\/hosts\n\n<\/pre><\/div>\n\n<p>you may change <strong>IP, hostname and domain<\/strong> based on your enviroment.<\/p>\n<p>after that, you should calculate 3 parameters like this:<\/p>\n<ul>\n<li>SHMALL = TOTAL RAM IN BYTES \/ PAGE_SIZE<\/li>\n<li>SHMMAX = HALF OF TOTAL RAM IN BYTES\n<\/li>\n<li>SHMMNI = PAGE_SIZE\n<\/li>\n<\/ul>\n<p>to determine RAM size in bytes, you can use free command:<\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\nfree -b\n\n<\/pre><\/div>\n\n<p>then you will edit \/etc\/sysctl.conf file and add these lines:<\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\nvi \/etc\/sysctl.conf\n\nvm.swappiness = 0\nvm.dirty_background_ratio = 3\nvm.dirty_ratio = 80\nvm.dirty_expire_centisecs = 500\nvm.dirty_writeback_centisecs = 100\nkernel.shmmax = &lt;strong&gt;SHMMAX &lt;\/strong&gt;\nkernel.shmall = &lt;strong&gt;SHMALL &lt;\/strong&gt;\nkernel.shmmni = &lt;strong&gt;SHMMNI &lt;\/strong&gt;\nkernel.sem = 250 32000 100 128\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 = 1048576\nfs.aio-max-nr = 1048576\nfs.file-max = 6815744\n\n<\/pre><\/div>\n\n<p>and use this command to apply these changes:<\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\nsysctl -p\n\n<\/pre><\/div>\n\n<p>then, you should add users and groups in OS:<\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\ngroupadd oinstall\ngroupadd dba\ngroupadd asmdba\ngroupadd asmoper\ngroupadd asmadmin\ngroupadd oper\nuseradd -g oinstall -G dba,oper,asmdba,asmoper oracle\nuseradd -g oinstall -G dba,asmadmin,asmdba,asmoper grid\n\n<\/pre><\/div>\n\n<p>if oracle or grid users exist, we can use these command instead of useradd:<\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\nusermod -g oinstall -G dba,oper,asmdba,asmoper oracle\nusermod -g oinstall -G dba,asmadmin,asmdba,asmoper grid\n\n<\/pre><\/div>\n\n<p>after that, you have to change password of these users:<\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\npasswd oracle\npasswd grid\n\n<\/pre><\/div>\n\n<p>then, you should make directories for database and grid app and set permissions:<\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\nmkdir \/u01\nchown -R oracle:oinstall \/u01 \nmkdir \/u01\/crs\nmkdir \/u01\/crs\/grid\nchown -R grid:oinstall \/u01\/crs \nmkdir \/u01\/app\nchown -R oracle:oinstall \/u01\/app\n\n<\/pre><\/div>\n\n<p>if you downloaded sources from oracle web site, you can upload V840012-01.zip and V839960-01.zip to a directory (example: \/source) and then extract then in their destinations:<\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\nunzip \/source\/V840012-01.zip -d \/u01\/crs\/grid\nunzip \/source\/V839960-01.zip -d \/home\/oracle\n\n<\/pre><\/div>\n\n<p>then, you have to install an rpm file:<\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\nrpm -ivh \/u01\/crs\/grid\/cv\/rpm\/cvuqdisk-1.0.10-1.rpm\n\n<\/pre><\/div>\n\n<p>and edit \/etc\/security\/limits.d\/99-grid-oracle-limits.conf file and add records as below:<\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\nvi \/etc\/security\/limits.d\/99-grid-oracle-limits.conf\n\noracle soft nproc 2047\noracle hard nproc 16384\noracle soft nofile 1024\noracle hard nofile 65536\noracle soft stack 10240\noracle hard stack 32768\ngrid soft nproc 2047\ngrid hard nproc 16384\ngrid soft nofile 1024\ngrid hard nofile 65536\ngrid soft stack 10240\ngrid hard stack 32768\n\n<\/pre><\/div>\n\n<p>to apply these changes, you have to use this command:<\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\nulimit -a \n\n<\/pre><\/div>\n\n<p>the next step is oracleasm configuration:<\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\n\/usr\/sbin\/oracleasm configure -i\nConfiguring the Oracle ASM library driver.\n\nThis will configure the on-boot properties of the Oracle ASM library\ndriver.  The following questions will determine whether the driver is\nloaded on boot and what permissions it will have.  The current values\nwill be shown in brackets (&#039;&#x5B;]&#039;).  Hitting &lt;ENTER&gt; without typing an\nanswer will keep that current value.  Ctrl-C will abort.\n\nDefault user to own the driver interface &#x5B;grid]: &lt;strong&gt;grid&lt;\/strong&gt;\nDefault group to own the driver interface &#x5B;asmadmin]: &lt;strong&gt;asmadmin&lt;\/strong&gt;\nStart Oracle ASM library driver on boot (y\/n) &#x5B;y]: &lt;strong&gt;y&lt;\/strong&gt;\nScan for Oracle ASM disks on boot (y\/n) &#x5B;y]: &lt;strong&gt;y&lt;\/strong&gt;\nWriting Oracle ASM library driver configuration: done\n\n<\/pre><\/div>\n\n<p>now, you have to start oracleasm service and make it available on startup:<\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\nsystemctl enable oracleasm.service\nsystemctl start oracleasm.service\n\n<\/pre><\/div>\n\n<p>to make asm disks from raw devices (example: \/dev\/sdb*) you have to use this command:<\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\n\/usr\/sbin\/oracleasm createdisk DATA101 \/dev\/sdb1\n\/usr\/sbin\/oracleasm createdisk DATA102 \/dev\/sdb2\n\/usr\/sbin\/oracleasm createdisk DATA103 \/dev\/sdb3\n\n<\/pre><\/div>\n\n<p>then you run these commands:<\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\n\/usr\/sbin\/oracleasm scandisks\n\/usr\/sbin\/oracleasm listdisks\n\n<\/pre><\/div>\n\n<p>and you have to config .bash_profile file of grid user:<\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\nvi \/home\/grid\/.bash_profile\n\n<\/pre><\/div>\n\n<p>and insert these records in it:<\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\n# .bash_profile\n# Get the aliases and functions\nif &#x5B; -f ~\/.bashrc ]; then\n        . ~\/.bashrc\nfi\n# User specific environment and startup programs\nexport ORACLE_BASE=\/u01\/crs\/oracle\nexport ORACLE_HOME=\/u01\/crs\/grid\nexport ORA_NLS33=$ORACLE_HOME\/ocommon\/nls\/admin\/data\nexport TNS_ADMIN=$ORACLE_HOME\/network\/admin\nexport ORACLE_DOC=$ORACLE_HOME\/doc\nexport NLS_LANG=AMERICAN_AMERICA.AR8MSWIN1256\nexport TMPDIR=\/tmp\nexport TMP=\/tmp.\nexport TZ=Asia\/Tehran\nexport ORACLE_SID=+ASM\nexport LD_LIBRARY_PATH=$ORACLE_HOME\/lib:$ORACLE_HOME\/gg\nexport ORACLE_UNQNAME=dbtest12\nexport ORACLE_HOSTNAME=S1VLDbCOraT01.enb.local\nexport PATH=$PATH:\/bin:\/usr\/bin:\/usr\/local\/bin\/OPatch:$ORACLE_HOME\/bin:\/usr\/bin\/X11:\/usr\/local\/bin:\/usr\/sbin::\/sbin:.\nexport OWB_HOME=$ORACLE_HOME\nunset USERNAME\necho &quot;.profile has been DONE successfully&quot;\n\n<\/pre><\/div>\n\n<p>finally, you should go to grid software location and start oracle universal installer:<\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\ncd \/u01\/crs\/grid\n.\/gridSetup.sh\n\n<\/pre><\/div> ","protected":false},"excerpt":{"rendered":"<p>To install Oracle Grid Infrastructure &amp; Oracle Database on Oracle Linux 7, you need to prepare your OS. To do so, you have to follow these commands: First of all, you have to install required packages in the OS: then, you have to edit \/etc\/hosts file and add the appropariate record as bellow: you may [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"templates\/template-full-width.php","format":"standard","meta":{"footnotes":""},"categories":[8,1,9],"tags":[],"class_list":["post-27","post","type-post","status-publish","format-standard","hentry","category-database","category-installation","category-oracle"],"_links":{"self":[{"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/posts\/27","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/comments?post=27"}],"version-history":[{"count":20,"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/posts\/27\/revisions"}],"predecessor-version":[{"id":143,"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/posts\/27\/revisions\/143"}],"wp:attachment":[{"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/media?parent=27"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/categories?post=27"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/tags?post=27"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}