4 Replies Latest reply: Mar 28, 2013 11:31 PM by Adeesh Fulay RSS

    EM12c: emcli add_target RAC Database

    964829
      Hi all,

      I am trying to a RAC Database to EM 12c. Currently I am getting an error:
      oracle@testnode1:/emcli12c $ ./emcli add_target -name="TEST11G" \
      -type="rac_database" \
      -host="testnode1.local" \
      -monitor_mode="1" \
      -properties="ServiceName:TEST11G_service;ClusterName:testrac;OracleHome:/u01/app/oracle/product/11.2.0.3" \
      -credentials="UserName:dbsnmp;password:xxxx;Role:Normal" \
      -instances="TEST11G_TEST11G1:oracle_database;TEST11G_TEST11G2:oracle_database" 
      Error: Instance target "TEST11G1:oracle_database" does not exist
      I got the parameters from Oracle documentation. The Instance does exist. If I add that Database using the webgui everything works as expected. Is there anything wrong with the syntax? Do I have to add that instance manually before the RAC database?

      Thanks in advance

      Edited by: 961826 on Mar 19, 2013 10:58 AM
        • 1. Re: EM12c: emcli add_target RAC Database
          991744
          Just an idea: shouldn't you add RAC_database targets first (do add-target for each) and then refer then in instances
          • 2. Re: EM12c: emcli add_target RAC Database
            Davewolf-Oracle
            Yes, you must add the DB instances before adding the RAC. You must also have added the Cluster itself which creates the High Availability Services (HAS) as well. The EM Extensibility guide covers the add_target verb pretty well showing examples of adding a DB instance and RAC. To see example of adding the Cluster, see MOS note "How To Add a Cluster Target to Enterprise Manager Using EMCLI [ID 1448276.1]".

            Here is a complete example for adding a 2 node 2 instance setup:

            emcli add_target -name="host1-c" -type="cluster" -host="host1.company.com" -monitor_mode="1" -properties="OracleHome:/CRS/11.2.0/gridhome;scanName:scan-r;scanPort:1521" -instances="host1.company.com:host;host2.company.com:host"

            emcli add_target –name=db.company.com_db1” –type=”oracle_database” –host=”host1.company.com” –credentials=”UserName:dbsnmp;password:password;Role:Normal” –properties=”SID:db1;Port:1521;OracleHome:/RAC/product/11.2.0/dbhome_1;MachineName:host1.company.com”

            emcli add_target -name="db.company.com_db2" -type="oracle_database" -host="host2.company.com" -credentials="UserName:dbsnmp;password:password;Role:Normal" -properties="SID:db2;Port:1521;OracleHome:/RAC/product/11.2.0/dbhome_1;MachineName:host2.company.com"

            emcli add_target –name=”db.company.com” –type=”rac_database” –host=”host1.company.com” –monitor_mode=”1” –properties=”ServiceName:db.company.com;ClusterName:host1-c” –instances=”db.company.com_db1:oracle_database; db.company.com_db2:oracle_database”

            Hope this helps,
            Dave
            • 3. Re: EM12c: emcli add_target RAC Database
              964829
              Yes, thanks. I got that working. The only thing that I emcli doesnt add is the database_system. Does anybody know how to add that?

              Thanks
              • 4. Re: EM12c: emcli add_target RAC Database
                Adeesh Fulay
                You will have to execute the EMCLI verb 'create_system`.

                Documentation:
                http://docs.oracle.com/cd/E24628_01/em.121/e17786/cli_verb_ref.htm#CACHJHGI