Link to home
Start Free TrialLog in
Avatar of StephenCairns
StephenCairns

asked on

Oracle Management server 9i

Hi
I have submitted some jobs to the management server, however these are remaining as submitted and not proceeding to scheduled. According to the help this is because either the intelligent agent is down (its not as far as I can see) or the node was defined manually (without the intelligent agent) It suggests that I need to deregister the jobs remove the node from the console navigator and then rediscover the node while running the intelligent agent.

Despite deleting the jobs (status set to deleting) when I attempt to remove the node it tells me there are jobs still registered.

How do I deregister jobs and events?

Thanks

Avatar of Kong
Kong

Stephen,

You'll need to discover the nodes automatically, you'll also need to setup the management server (OMS). Assuming you've set up the OMS already:

- Log into OMS as superuser (eg sysman)
- Drop all manually added nodes
- Make sure agent is running on all nodes (including OMS machine) use agentctl start if not started
- In OEM console, right-click on nodes -> discover nodes
- Enter names of nodes (machines) or IP address
- Only after 'automatically' discovering nodes can you submit & run jobs...

Good luck!

K
Avatar of StephenCairns

ASKER

Hi Kong
I cant get that far.

I've logged into OMS as sysman
attemped to delete the node ( I only have one)
I then get an error saying the  'the following jobs are still registered against ...' and listing databases and the jobs.
The status of all the jobs is 'Deleting'
I am assuming that deleting and deregistering is not the same thing.
So how do I 'deregister' a job?

Cheers
Stephen,

Yep, that's fine, when you try to delete the node, it'll remove all jobs & events for that node. What'll happen is you get that warning message & when you answer in the affirmative the OEM console will appear to "hang". This is because it's trying to communicate with the agent on that node to make sure things are in sync. Just leave it and after a little while (maybe more than a little while) another message will come up warning you that things will be out of sync because the agent was uncontactable etc... That's ok, answer in the affirmative and your node will be deleted!

K
Hi Kong
I get the warning message but there is nothing to answer in the affirmative just 'Errors were encountered in attempting to remove the target. Review and remove all the problems before attempting to remove the target again' with a list of the errors  and a cancel button.
Could there be a difference in the version  you are using to the one I am? I'm using 9i
any ideas?
Cheers
Steve

check what's jobs in your queue?

select * from dba_jobs;

find out the job id.

then usee dbms_job.remove to remove the job. but you must log in as the owner of the job. then you can delete the job.

 dbms_job.remove(job_id);

Avatar of seazodiac
In the OMS JOB window, you should ABORT the job first, and then DELETE the job.
then delete the nodes.

you can also do this brute force. Log in as SYSDBA, issue "delete from dba_jobs"
Danielzt's solution also works
There shouldn't be anything in the dba_jobs table because no jobs were successfully submitted...

Have you got a firewall setup?

Are you able to log into the OMS? Have you configured the agents to connect to the correct OMS using oemctl utility?

- Check that there are no jobs in the job history pane (unlikely), if so delete them.
- Stop agent on node to be deleted
- Expand Nodes folder
- Select target node, right-click -> remove/delete
- several boxes will pop up, answer yes/ok to all
- after a little while because we're forcing a node deletion and communication with the agent needs to timeout and the repository's referential integrity is cleaned up
Hi
Sorry I got desperate and rebuilt the repository, as nothing above seemed to help. However what I did find was this...


To remove "stale" job and events from the Oracle Enterprise Manager Repository:

1.Shutdown the Management Server.
$ oemctrl stop oms <username>/<password>

2.Logon into the OEM Repository database using SQL*Plus. Logon as the OEM Repository owner.
$ sqlplus <user_name>/<user_pwd>@<repository_database>

NOTE:
To verify the OEM Repository owner account, run the Oracle Configuration Assistant (OCA)
and click on Edit to view the username.

3.Execute the following SQL statement:
execute smp_maintenance.delete_operations_on_node('<target nodename>');

NOTE:
The target nodename is the hostname of the server where the "Pending Deletion" status
exists. The name must be entered identical to how it appears in the OEM Console Navigator.

For example, to delete a node called sun123.oracle.com:
execute smp_delete_operations_on_node('sun123.oracle.com');

4. Restart the Oracle Management Server.
$ oemctrl start oms

This will remove all currently active jobs/events against the specified node. No historical data will be affected. The node itself will not be deleted.
To remove the node, log on to the Management Server through the Console and remove the
node from the Navigator.


EXPLANATION:
===========
When the OEM Console Administrator needs to remove a job or event that is scheduled
against a server, the OEM Console sends the request to the OMS. The OMS contacts the
Agent on the server and tells it to remove the job from its work queues. While the OMS is
attempting to contact the Agent, it sets the job or event to a status of "Pending Deletion".
When the Agent is contacted, this status and the object is
However, if the Intelligent Agent goes down or cannot be contacted by the OMS, the Pending
Deletion status remains in the OEM Repository. Manually removing the data for that agent is
the only work around in OEM 2.0.4.
--------
The only problem is this was designed for Oracle 8 not 9.2 so the functions mentioned in this do not exist.
So can anyone tell me the equivalent function ( smp_maintenance.delete_operations_on_node)  for 9i?

Cheers


Errrm, never did it that way...

My understanding is that OEM 9.2 is a different kettle of fish to the OEM 8 days...

What I did in my instructions worked for me - I was able to connect to the OMS repository correctly (after configuring the agent via agentctl utility).

So what's status quo? Are you able to submit jobs?
Hi  Kong
Well the status is that I can now submit Jobs.
As I could not find anyway to remove the jobs I had submitted, possibly removing it from DBA_JOBS might have worked  but as there was no indication of where the dba_jobs table is, (in the repository I have now found) I gave up on that avenue.  I think I did try it but could not locate it.
As I said I ended up dropping the repository and building a new one, (bit of a sledge hammer for a nut I know), but it worked.

I would still like to know if there is an equivalent to smp_maintenance.delete_operations_on_node in Oracle 9i ???
I have just run a little test to see if jobs that have been created and deleted while the agent is of appear in the dba_jobs view of the repository. They dont.
So it looks like that would not have helped anyway.

Those points are still going.
The jobs won't appear in the dba_jobs view of the OMS repository...

Is your OEM client connecting to the OMS or standalone?

Are your agents configured to connect to the OMS repository ie have you run emca on each machine?

Are you able to discover nodes automatically? What's the error message?

Do you have a firewall setup, or ports blocked? ie try the following from both OMS machine & node you want to "discover":

tnsping "(address=(protocol=tcp)(host=<hostnameofagentmachine>)(port=1748))"
tnsping "(address=(protocol=tcp)(host=<hostnameofagentmachine>)(port=1754))"
tnsping "(address=(protocol=tcp)(host=<ipaddressofagentmachine>)(port=1748))"
tnsping "(address=(protocol=tcp)(host=<ipaddressofagentmachine>)(port=1754))"

I run the OEM either standalone or connected to the OMS depending on what I am attempting to do.
The databases, repositories , management servers all run on the same server
there is no firewall.

run these from a dos prompt?
Stephen:

I think I found what you have been lookin' for.

In oracle9i, the equivalent to SMP_MAINTENANCE.delete_operations_on_node for oRacle8i has been moved to
another package, which makes this all confusing.

the new package is called SMP_VDJ

PROCEDURE DELETEJOBSAGAINSTTARGETS
 Argument Name                  Type                    In/Out Default?
 ------------------------------ ----------------------- ------ --------
 USERNAME                       VARCHAR2                IN
 ISSUPERUSER                    NUMBER(38)              IN
 JOBIDS                         SMP_VD_INTEGERARRAY     IN
 TIMESTAMPVAL                   NUMBER(38)              IN
 TIMESTAMPVALASDATE             DATE                    IN
 TIMEZONEVAL                    NUMBER(38)              IN
 DOMAINVAL                      VARCHAR2                IN
 TARGETNAMES                    SMP_VD_STRINGARRAY      IN
 ALLTARGETS                     VARCHAR2                IN
 TARGETCOUNT                    SMP_VD_INTEGERARRAY     IN
 NOPERMISSIONSARRAY             SMP_VD_INTEGERARRAY     OUT
 ACTIVEFIXITJOBSARRAY           SMP_VD_INTEGERARRAY     OUT
 INVALIDJOBIDSARRAY             SMP_VD_INTEGERARRAY     OUT


And the corresponding SMP_maintenance package is trimmed off down to a single procedure left "RESET_SYSMAN".

As for the usage of that procedure, you have to fill in all the necessary parameters.

good luck.
Yes you can run tnsping on a DOS prompt.

Do you get an error message (eg Agent out of sync) when you try to refresh or discover the node? Make sure you're logging in as sysman (or super user).
Kong
the tns pings worked fine , no errors. As I say I have now resolved the problem, just interested in a better slution than droping and building a new repository.

seazodiac
Is there any documentation available for this function?

Cheers
Glad to hear you resolved your problem.

I agree, dropping repositories isn't really a clean solution. Like I said, the steps
I recommended worked for me.

Just a hint for the future, if you have multiple oracle homes, make sure the right agent is started otherwise you'll get "agent out of sync" issues. What I do, on unix, is link the agent directory to one location.

Happy OEM'ing =)
I have not actually requested this to be deleted.
My query to community_support was how to grade the question as I am not in a position to verify the answer (thanks seazodiac)
I accept I should however of reposted this question as a new question rather than continue and I do apologise for that.

regards
Steve
ASKER CERTIFIED SOLUTION
Avatar of SpazMODic
SpazMODic

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks everyone for your help.
Cheers