Introduction After the release of EM13c and there were various bugs I have seen personally and many of them of course resolved with the patches. Based on my experience provide information here as many of the users might face same issues and I hope this step by step action plan will simplify the job. In brief when trying to add the database discovery it is failed with error “exact fetch returns more than requested number of rows”, we will see now with the errors and also how to fix them by using the relevant patch. Database Discovery When the agent is installed on the new host and then the database targets have to be promoted manually from “Setup | Add Target | Auto Discovery Results”, after we promote the targets and then it allows us to save the configuration after the changes are performed. If the targets are not visible in the list of targets can be promoted then we have to go with the Guided process to add target manually. Now if we see below image the target “CANADA” we have selected and also the LISTENER related to the database, next we can click to “configure” if you want to change the username from DBSNMP to SYS and also you can provide other details such as host, port information and sid so on. After crosschecking the configuration now we can click on “next”, so that we can review the entire configuration before going to submit. Modify the properties of the target Review of the properties. Overall Summary of the targets we are adding to EM. Now in this section we will submit the configuration and usually it takes minimal time and will be added successfully to the repository but in our case if we see below unable to save the target and failed with the error “ORA-01422 - exact fetch returns more than requested number of rows”. Troubleshooting Part So the error is 1422 when adding the target and of course by default we will use the oerr inbuilt utility to check what the error is saying and it is… -bash-4.2$ oerr ora 1422 01422, 00000, "exact fetch returns more than requested number of rows" // *Cause: The number specified in exact fetch is less than the rows returned. // *Action: Rewrite the query or change number of rows requested -bash-4.2$ Really the information is not related to what we are doing here, we have no option to rewrite the query and we just submitted the request to add the targets tried bouncing the OMS and again added but again same issues, next upon research found that this is declared as bugs with EM 13.1 - Base Bug 22985211 - Unable to discover Fusion target on EM13.1 with BP1 and also seen same behavior and confirmed as Bug 23562355. Explore the Bug From the diagnostic analysis if we see the target_type used with the two values 1) target_type=oracle_emd 2) target_type=oracle_database and hence the query unable to parse the conditions and thus failed to save the target as well. AND tgt.target_type = 'oracle_emd' AND tgt.emd_url = AND mtt.target_type = 'oracle_database' AND gcdpa.content_type = 'Discovery Usually this behavior seen after applying the Bundle patches and hence development team provided the new one-off patch to fix this issue as fix and this bug is also fixed in EM 13.2. Fix the Bug We have answer to the question “Fix the bug” by applying the patch “Oracle Management Service 13c Release 1 (13.1.0.0.0) System Patch for Bug# 22985211”, I’ve included patching part as there are few changes in patching starting from EM13c, Oracle introduced single unified command OMSPatcher this helps in automating the process of applying system patches on OMS. We will see how to perform patching on EM13c OMS. Prerequisites: The SWL – Software library should be configured Ensure the OMS is up and running without any issues. -bash-4.2$ emctl status oms Oracle Enterprise Manager Cloud Control 13c Release 1 Copyright (c) 1996, 2015 Oracle Corporation. All rights reserved. WebTier is Up Oracle Management Server is Up JVMD Engine is Up BI Publisher Server is Up -bash-4.2$ Ensure database services (database, listener)s are running. -bash-4.2$ ps -ef|grep pmon oracle 3326 1 0 12:10 ? 00:00:00 ora_pmon_ccrep oracle 26343 3176 0 13:49 pts/0 00:00:00 grep --color=auto pmon -bash-4.2$ ps -ef|grep tns root 15 2 0 12:07 ? 00:00:00 [netns] oracle 3519 1 0 12:10 ? 00:00:01 /u01/app/oracle/product/rdbms_12.1.0.2/db_1/bin/tnslsnr LISTENER -inherit oracle 26356 3176 0 13:49 pts/0 00:00:00 grep --color=auto tns -bash-4.2$ This patch is applicable if the OMS is on 13.1.0.0.0 -bash-4.2$ emcli version Oracle Enterprise Manager 13c EM CLI Version 13.1.0.0.0 -bash-4.2$ As usual the opatch version should be the latest one. To update the latest opatch please download from 224346.1 -bash-4.2$ opatch version OPatch Version: 13.6.0.0.0 OPatch succeeded. -bash-4.2$ Export the OMS core home to the ORACLE_HOME and also update the PATH variable. Ensure OMSPatcher is able to access after setting the environment -bash-4.2$ pwd /u01/app/oracle/product/middleware -bash-4.2$ export PATH=/u01/app/oracle/product/middleware/OMSPatcher:$PATH -bash-4.2$ omspatcher version OMSPatcher Version: 13.6.0.0.1 OPlan Version: 12.1.0.2.2 OsysModel build: Wed Oct 14 06:21:23 PDT 2015 OMSPatcher succeeded. -bash-4.2$ Extract the patch into storage location. -bash-4.2$ unzip p22985211_131000_Generic.zip Archive: p22985211_131000_Generic.zip creating: 22985211/ creating: 22985211/22985211/ inflating: 22985211/22985211/README.txt creating: 22985211/22985211/files/ creating: 22985211/22985211/files/oracle.sysman.top.oms/ . . . . . creating: 22985211/automation/ inflating: 22985211/automation/rollback_automation.xml inflating: 22985211/automation/apply_automation.xml inflating: 22985211/automation/messages.properties inflating: 22985211/README.txt -bash-4.2$ -bash-4.2$ ls -ltr total 148 -rw-r--r-- 1 oracle oinstall 1608 Jun 27 04:59 em_info.txt drwxr-x--- 4 oracle oinstall 72 Jul 8 12:10 22985211 -rw-r--r-- 1 oracle oinstall 147291 Sep 10 18:03 p22985211_131000_Generic.zip -bash-4.2$ cd 22985211/ -bash-4.2$ pwd /home/oracle/working/22985211 -bash-4.2$ Analyze the Patch – Conflict Detection After extracting the patch zip file, we can run the patch analyze to crosscheck whether the patching will be successful or not on OMS home. -bash-4.2$ pwd /home/oracle/working/22985211 -bash-4.2$ omspatcher apply -analyze OMSPatcher Automation Tool Copyright (c) 2015, Oracle Corporation. All rights reserved. OMSPatcher version : 13.6.0.0.1 OUI version : 13.6.0.0.0 Running from : /u01/app/oracle/product/middleware Log file location : /u01/app/oracle/product/middleware/cfgtoollogs/omspatcher/opatch2016-09-10_18-13-04PM_1.log OMSPatcher log file: /u01/app/oracle/product/middleware/cfgtoollogs/omspatcher/22985211/omspatcher_2016-09-10_18-13-13PM_analyze.log Please enter OMS weblogic admin server URL(t3s://ora-ccrep.localdomain:7102):> Please enter OMS weblogic admin server username(weblogic):> Please enter OMS weblogic admin server password:> Configuration Validation: Success Running apply prerequisite checks for sub-patch(es) "22985211" and Oracle Home "/u01/app/oracle/product/middleware"... Sub-patch(es) "22985211" are successfully analyzed for Oracle Home "/u01/app/oracle/product/middleware" Complete Summary ================ All log file names referenced below can be accessed from the directory "/u01/app/oracle/product/middleware/cfgtoollogs/omspatcher/2016-09-10_18-13-04PM_SystemPatch_22985211_1" Prerequisites analysis summary: ------------------------------- The following sub-patch(es) are applicable: Featureset Sub-patches Log file ---------- ----------- -------- oracle.sysman.top.oms 22985211 22985211_ApplyPrereq2016-09-10_18-13-29PM_2.log Log file location: /u01/app/oracle/product/middleware/cfgtoollogs/omspatcher/22985211/omspatcher_2016-09-10_18-13-13PM_analyze.log OMSPatcher succeeded. -bash-4.2$ Stop the OMS Now we are into the stage of applying patch, hence we will stop the OMS first. -bash-4.2$ emctl stop oms Oracle Enterprise Manager Cloud Control 13c Release 1 Copyright (c) 1996, 2015 Oracle Corporation. All rights reserved. Stopping Oracle Management Server... Oracle Management Server Successfully Stopped Oracle Management Server is Down JVMD Engine is Down -bash-4.2$ Apply the Patch using omspatcher. (Trimming the output) -bash-4.2$ omspatcher apply OMSPatcher Automation Tool Copyright (c) 2015, Oracle Corporation. All rights reserved. OMSPatcher version : 13.6.0.0.1 OUI version : 13.6.0.0.0 Running from : /u01/app/oracle/product/middleware Log file location : /u01/app/oracle/product/middleware/cfgtoollogs/omspatcher/opatch2016-09-10_18-14-08PM_1.log OMSPatcher log file: /u01/app/oracle/product/middleware/cfgtoollogs/omspatcher/22985211/omspatcher_2016-09-10_18-14-19PM_deploy.log Please enter OMS weblogic admin server URL(t3s://ora-ccrep.localdomain:7102):> Please enter OMS weblogic admin server username(weblogic):> Please enter OMS weblogic admin server password:> Configuration Validation: Success . . . . . Patching summary: ----------------- Binaries of the following sub-patch(es) have been applied successfully: Featureset Sub-patches Log file ---------- ----------- -------- oracle.sysman.top.oms_13.1.0.0.0 22985211 22985211_opatch2016-09-10_18-14-40PM_3.log Deployment summary: ------------------- The following artifact(s) have been successfully deployed: Artifacts Log file --------- -------- SQL rcu_applypatch_original_patch_2016-09-10_18-15-06PM.log Log file location: /u01/app/oracle/product/middleware/cfgtoollogs/omspatcher/22985211/omspatcher_2016-09-10_18-14-19PM_deploy.log OMSPatcher succeeded. -bash-4.2$ Start the OMS now after successful Patching. -bash-4.2$ emctl start oms Oracle Enterprise Manager Cloud Control 13c Release 1 Copyright (c) 1996, 2015 Oracle Corporation. All rights reserved. Starting Oracle Management Server... WebTier Successfully Started Oracle Management Server Successfully Started Oracle Management Server is Up JVMD Engine is Up Starting BI Publisher Server ... BI Publisher Server Already Started BI Publisher Server is Up -bash-4.2$ - Check the status of OMS after starting it. -bash-4.2$ emctl status oms Oracle Enterprise Manager Cloud Control 13c Release 1 Copyright (c) 1996, 2015 Oracle Corporation. All rights reserved. WebTier is Up Oracle Management Server is Up JVMD Engine is Up BI Publisher Server is Up -bash-4.2$ Post Patching We’ve performed patching the OMS home and also we checked the OMS status as all the services are up. Now we will retry the add target operation again. In this example the target database was created on server after the agent installation, hence we will go through with guided process as “Setup | Add target | Add Target’s manually | Add Using Guided Process”. Firs we will select the type of the Target as “Oracle Database” related and then click for “Add”. From the Database Discovery: Search criteria, we have to select the host which was already added where the database is located. EM can fetch the list of the targets which are not promoted yet, so we can select the same target “CANADA” which we are unable to add earlier. Skipping the few images to update the configuration as we already discussed above. Enter all the required fields or update if any changes required and same time we can test the connection whether EM able to connect database using the provided string, after successful test then we can save the configuration. After saving configuration, we can see the overall review/summary of the targets which we are adding. At the same step earlier we are unable to add the target and if we see in below image without issues the target information saved successfully with the confirmation status. After the agent automatic upload we can see that database instance from the “Database Targets”. Summary This article explains how to deal if there is same issue with adding target specific to this EM 13.1 and later we can see the brief on the target discovery and more with the troubleshooting information. After proper troubleshooting we have entered into the actual steps on how to perform patching OMS home using the new tool OMSPatcher including with all step by step procedure. Finally we have added the target successfully after the patching without any issues. References Base Bug 22985211 - Unable to discover Fusion target on EM13.1 with BP1
↧