{"id":93,"date":"2018-09-29T14:48:39","date_gmt":"2018-09-29T14:48:39","guid":{"rendered":"http:\/\/kabiliravi.com\/?page_id=93"},"modified":"2019-07-21T13:47:53","modified_gmt":"2019-07-21T13:47:53","slug":"installing-uninstalling-oracle-db","status":"publish","type":"page","link":"http:\/\/kabiliravi.com\/index.php\/software\/databases\/oracle-db\/installing-uninstalling-oracle-db\/","title":{"rendered":"Installing\/Uninstalling Oracle DB"},"content":{"rendered":"<h1>Installing Oracle 18c<\/h1>\n<h2>Prepare Installation<\/h2>\n<h3>Install Prerequisite Technologies and Libraries&nbsp;<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-title=\"Install Prerequisites Technologies \">[nasim@mymacos ~]$ ssh root@192.168.x.x\r\n[root@mycentos ~]$ yum -y install oracle-database-preinstall-18c lvm2 unzip gcc\r\n<\/pre>\n<h3>Verify <em>oracle<\/em> User Creation<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">[root@mycentos ~]$ groups oracle\r\noracle : oinstall dba oper backupdba dgdba kmdba racdba<\/pre>\n<p>You should be able to see above groups assigned<\/p>\n<h3>Reset <em>oracle<\/em> User Password<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">[root@mycentos ~]$ passwd oracle\r\nChanging password for user oracle.\r\nNew password:\r\nRetype new password:\r\npasswd: all authentication tokens updated successfully.<\/pre>\n<h3>Oracle Location Permission<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">[root@mycentos ~]$ chown -R oracle:oinstall \/u01\r\n[root@mycentos ~]$ chmod -R ug+xrw \/u01\r\n[root@mycentos ~]$ su - oracle\r\n[oracle@mycentos ~]$ mkdir \/u01\/app\/oracle\/distr\/\r\n[oracle@mycentos ~]$ exit\r\n[root@mycentos ~]$ exit<\/pre>\n<p>Assign oracle user and install group to \/u01 installation&nbsp;<\/p>\n<h3>Download<\/h3>\n<p>I could not find a way to download the Oracle DB installation bundle using CLI. I had to download it with by browser and copy it into CentOS VM using <strong>scp<\/strong> command.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">[nasim@mymacos ~]$ scp ~\/packages\/LINUX.X64_180000_db_home.zip oracle@default.centos:\/u01\/app\/oracle\/distr\/<\/pre>\n<h3>Extract and Setup Installer<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">[nasim@mymacos ~]$ ssh oracle@192.168.x.x\r\n[oracle@mycentos ~]$ unzip -q  \/u01\/app\/oracle\/distr\/LINUX.X64_180000_db_home.zip -d \/u01\/app\/oracle\/product\/18.0.0\/dbhome_1\/<\/pre>\n<h3>Install<\/h3>\n<p>Create soft_only.rsp by following commands:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">[oracle@mycentos ~]$ cd \/u01\/app\/oracle\/product\/18.0.0\/dbhome_1\/\r\n[oracle@mycentos dbhome_1]$ sed -e '\/\\s*#.*$\/d' -e '\/^\\s*$\/d' install\/response\/db_install.rsp &gt; install\/response\/soft_only.rsp\r\n[oracle@mycentos dbhome_1]$ vi install\/response\/soft_only.rsp<\/pre>\n<p>Edit <strong>soft_only.rsp<\/strong> using <strong>vi&nbsp;<\/strong>or other cli editor as follow:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">oracle.install.responseFileVersion=\/oracle\/install\/rspfmt_dbinstall_response_schema_v18.0.0\r\noracle.install.option=INSTALL_DB_SWONLY\r\nUNIX_GROUP_NAME=oinstall\r\nINVENTORY_LOCATION=\/u01\/app\/oraInventory\r\nORACLE_HOME=\/u01\/app\/oracle\/product\/18.0.0\/dbhome_1\r\nORACLE_BASE=\/u01\/app\/oracle\r\noracle.install.db.InstallEdition=EE\r\noracle.install.db.OSDBA_GROUP=dba\r\noracle.install.db.OSOPER_GROUP=dba\r\noracle.install.db.OSBACKUPDBA_GROUP=dba\r\noracle.install.db.OSDGDBA_GROUP=dba\r\noracle.install.db.OSKMDBA_GROUP=dba\r\noracle.install.db.OSRACDBA_GROUP=dba<\/pre>\n<p>Run following command:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">[oracle@mycentos dbhome_1]$ .\/runInstaller -silent -responseFile install\/response\/soft_only.rsp\r\nLaunching Oracle Database Setup Wizard...\r\n \r\n[WARNING] [INS-13014] Target environment does not meet some optional requirements.\r\n   CAUSE: Some of the optional prerequisites \r\n\r\n...\r\n \r\nSuccessfully Setup Software with warning(s).\r\nMoved the install session logs to:\r\n \/u01\/app\/oraInventory\/logs\/InstallActionsYYYY-MM-dd...\r\n[oracle@mycentos dbhome_1]$<\/pre>\n<h3>Create Database<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">[oracle@mycentos dbhome_1]$ dbca -createDatabase -silent -createAsContainerDatabase true -pdbName pdb1 -templateName General_Purpose.dbc -gdbName orcl -sysPassword 123456 -systemPassword 123456 -pdbAdminPassword 123456 -dbsnmpPassword 123456 -datafileDestination \/u01\/app\/oracle\/oradata -storageType FS -sampleSchema true\r\n[WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.\r\n   CAUSE:\r\n...\r\n100% complete\r\nDatabase creation complete. For details check the logfiles at:\r\n \/u01\/app\/oracle\/cfgtoollogs\/dbca\/orcl.\r\nDatabase Information:\r\nGlobal Database Name:orcl\r\nSystem Identifier(SID):orcl\r\nLook at the log file \"\/u01\/app\/oracle\/cfgtoollogs\/dbca\/orcl\/orcl.log\" for further details.[oracle@mycentos dbhome_1]$\r\n<\/pre>\n<h3>Setup <em>oracle<\/em> user Environment Vairable<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">[oracle@nasimcentos dbhome_1]$ vi ~\/.bash_profile<\/pre>\n<p>Export ORACLE_HOME\/bin folder in .bash_profile file so that when you login with <strong>oracle<\/strong> user, all oracle CLI commands will be accessible everywhere:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\"># .bash_profile\r\n\r\n# Get the aliases and functions\r\nif [ -f ~\/.bashrc ]; then\r\n        . ~\/.bashrc\r\nfi\r\n\r\n# User specific environment and startup programs\r\n\r\nPATH=$PATH:$HOME\/.local\/bin:$HOME\/bin\r\n\r\n\r\nORACLE_HOME=\/u01\/app\/oracle\/product\/18.0.0\/dbhome_1\r\n\r\nexport ORACLE_HOME\r\n\r\nPATH=$ORACLE_HOME\/bin:$PATH\r\n\r\nexport PATH\r\n\r\nORACLE_SID=kerp;\r\nexport ORACLE_SID<\/pre>\n<p>&nbsp;<\/p>\n<h3>Create the First DBA Admin User<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">[oracle@mycentos dbhome_1]$ sqlplus \/ as sysdba\r\n\r\nSQL*Plus: Release 18.0.0.0.0 - Production on Sat Sep 29 13:48:50 2018\r\nVersion 18.3.0.0.0\r\n\r\nCopyright (c) 1982, 2018, Oracle.  All rights reserved.\r\n\r\n\r\nConnected to:\r\nOracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production\r\nVersion 18.3.0.0.0\r\n\r\nSQL&gt;\r\n\r\n<\/pre>\n<p>Refer to <a href=\"http:\/\/kabiliravi.com\/index.php\/software\/databases\/oracle-db\/user-management\/\">User Management<\/a> to see how to create an Oracle DBA Admin user<\/p>\n<h1>Uninstalling Oracle 18c<\/h1>\n<p>Use&nbsp;<strong>deinstall<\/strong> to uninstall oracle 18c<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">[oracle@mycentos dbhome_1]$ .\/dbhome_1\/deinstall\r\n[oracle@mycentos dbhome_1]$ .\/deinstall\/deinstall\r\nChecking for required files and bootstrapping ...\r\nLocation of logs \/tmp\/deinstall2018-09-29_12-25-48PM\/logs\/\r\n\r\n############ ORACLE DECONFIG TOOL START ############\r\n\r\n\r\n######################### DECONFIG CHECK OPERATION START #########################\r\n## [START] Install check configuration ##\r\n\r\n\r\nChecking for existence of the Oracle home location \/u01\/app\/oracle\/product\/18.0.0\/dbhome_1\r\nOracle Home type selected for deinstall is: Oracle Single Instance Database\r\nOracle Base selected for deinstall is: \/u01\/app\/oracle\r\nChecking for existence of central inventory location \/u01\/app\/oraInventory\r\n\r\n## [END] Install check configuration ##\r\n\r\n\r\nNetwork Configuration check config START\r\n\r\nNetwork de-configuration trace file location: \/tmp\/deinstall2018-09-29_12-25-48PM\/logs\/netdc_check2018-09-29_12-26-02PM.log\r\n\r\nNetwork Configuration check config END\r\n\r\nDatabase Check Configuration START\r\n\r\nDatabase de-configuration trace file location: \/tmp\/deinstall2018-09-29_12-25-48PM\/logs\/databasedc_check2018-09-29_12-26-02PM.log\r\n\r\nUse comma as separator when specifying list of values as input\r\n\r\nSpecify the list of database names that are configured in this Oracle home [orcl]:\r\n\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Installing Oracle 18c Prepare Installation Install Prerequisite Technologies and Libraries&nbsp; [nasim@mymacos ~]$ ssh root@192.168.x.x [root@mycentos ~]$ yum -y install oracle-database-preinstall-18c lvm2 unzip gcc Verify oracle User Creation [root@mycentos ~]$ groups oracle oracle : oinstall dba oper backupdba dgdba kmdba racdba You should be able to see above groups assigned Reset oracle User Password [root@mycentos ~]$ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":88,"menu_order":1,"comment_status":"open","ping_status":"closed","template":"","meta":{"ngg_post_thumbnail":0,"footnotes":""},"class_list":["post-93","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"http:\/\/kabiliravi.com\/index.php\/wp-json\/wp\/v2\/pages\/93","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/kabiliravi.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/kabiliravi.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/kabiliravi.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/kabiliravi.com\/index.php\/wp-json\/wp\/v2\/comments?post=93"}],"version-history":[{"count":17,"href":"http:\/\/kabiliravi.com\/index.php\/wp-json\/wp\/v2\/pages\/93\/revisions"}],"predecessor-version":[{"id":116,"href":"http:\/\/kabiliravi.com\/index.php\/wp-json\/wp\/v2\/pages\/93\/revisions\/116"}],"up":[{"embeddable":true,"href":"http:\/\/kabiliravi.com\/index.php\/wp-json\/wp\/v2\/pages\/88"}],"wp:attachment":[{"href":"http:\/\/kabiliravi.com\/index.php\/wp-json\/wp\/v2\/media?parent=93"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}