Re: emcli

From: Gerry Miller <gerry_at_millerandbowman.com>
Date: Mon, 06 Aug 2012 20:16:10 +1000
Message-ID: <501F996A.2040200_at_millerandbowman.com>



 Hi Robert,  

Funny you should say that as that is exactly what I did:

   echo 1
   emctl start blackout Blackout_xxx_Maint -nodeLevel xxx.glk.xxx.int:host echo 2 emctl stop agent echo3
but didn't mention it in order to not complicate things. The first echo worked but that was it.
Thanks

Gerry

Robert Hanuschke wrote: Hi Gerry,
should work generally. Obviously the environment is set correctly, the blackout creation works. Have you tried adding echo commands to see if the execution gets that far? so:
emctl start blackout Blackout_xxx_Maint -nodeLevel xxx.glk.xxx.int:host echo one emctl stop agent echo two

Best regards, Robert http://robertvsoracle.blogspot.com[1]

On Mon, Aug 6, 2012 at 2:19 AM, Gerry Miller <gerry_at_millerandbowman.com[2]> wrote:
Hi Robert

It is a windows batch script is and is as follows:

    emctl start blackout Blackout_xxx_Maint -nodeLevel xxx.glk.xxx.int:host     emctl stop agent

and the output:

    emctl start blackout Blackout_xxx_Maint -nodeLevel xxx.glk.xxx.int:host     Oracle Enterprise Manager 12c Cloud Control 12.1.0.1.0     Copyright (c) 1996, 2012 Oracle Corporation. All rights reserved.     Blackout Blackout_xxx_Maint added successfully     EMD reload completed successfully

Executing 'emctl status agent' shows that the agent is still running.

Regards

Gerry

Robert Hanuschke wrote: Hi Gerry, we have to separate here between emcli and emctl. emcli ... is a standalone command line interface that you can install e.g. on your desktop pc without having any other kind of oracle software there. you can control your whole environment using it. lots of things (by far not all but a very useful subset of functionalities) that can be done in the web console can also be done via the emcli, affecting lots of targets. emtcl ... is part of the enterprise manager agent, so will typically reside on your database server. you can only control targets that reside on the samemachine as the agent. limited functionality compared to the emcli, but itcomes with every agent and you don't have to configure it specifically. theemcli "talks" to the oms and commands it to execute whatever you told it to. emctl "talks" to the oms via uploading xml and dat files. the oms loader processes read those files and execute whatever you told emctl to do. you cantest that by going to $AGENT_HOME/sysman/emd/upload and issuing "watch -n 1 'ls -ltrh | tail' (assuming you do have a linux environment somewhere) in one window and creating a blackout for a target in another one. you'll see the the files being created for that task for a very brief time, they get uploaded instantly after creation. about the other question: may I see the script or the relevant parts of it? never had an issue like that. Best regards, Robert http://robertvsoracle.blogspot.com[3] On Fri, Aug 3, 2012 at 1:19 AM, Gerry Miller <gerry_at_millerandbowman.com>[4]wrote: ** Hi Robert Thanks for that. Good point. I was assuming that because tables such as EM_BLACKOUT were updated that it was happening from the emcli command, but now realise that it is the agent that performs these database transactions. Or I am I assuming erroneously again? Another question along the same lines: I am trying to execute two emctl commands sequentially within a windows batchscript, namely to create an immediate blackout and then stop the agent, but find that the script exits after the first command. The emcli command hasa parameter, 'argfile', that overcomes this but I can't find an equivalentin emctl. Is there any way of doing this? Thanks and Regards Gerry Robert Hanuschke wrote: Hi Gerry, a note on the redundancy part: It is not redundant. The emcli does in no way use any of the rdbms binaries, let alone anything inside the database itself. You can install an emcli on any computerin your network and use it to create a blackout on a database that runs on another computer/server. So have no worries doing it as OS process - in fact, that would be LESS redundant. A hint from my experience in using emcli in scripts: Be sure to to set the JAVA_HOME variable (to the correct java version directory) and put that one into the PATH as well before actually calling the emcli. Most of the errors I've seen and fixed had to do with those two environment variables. Best regards, Roberthttp://robertvsoracle.blogspot.com[5] On Tue, Jul 24, 2012 at 1:50 AM, Gerry Miller <gerry_at_millerandbowman.com>[6] <gerry_at_millerandbowman.com>[7]wrote: Hi, I am looking for way to create a blackout in EM 12c Cloud Control from within the database. I am currently doing it using a perl script but am having problems running it as a scheduledtask on windows. I am thinking of using Java or external procedures but would much prefer to run the whole thing from within. It seems redundant to have a database procedure that calls an OS script that calls the database.Any suggestions welcome. Regards Gerry Miller
--http://www.freelists.org/webpage/oracle-l[8]
--http://www.freelists.org/webpage/oracle-l[9] --
http://www.freelists.org/webpage/oracle-l[10]

Received on Mon Aug 06 2012 - 05:16:10 CDT

Original text of this message