oracle.sysman.emSDK.emd.comm.OperationException: could not write to targets.xml.bak file

I had some trouble adding a new database to an OEM Grid installation this weekend.

I didn't find too many references to the above error so I wanted to post about it here. Of course Metalink was all doom and gloom. Note 745795.1 says to stop the agent, run fsck on the AGENT_HOME filesystem, then start the agent. After that you should be able to add new targets.

targets.xml lives in AGENT_HOME/sysman/emd. At the OS prompt I changed to that directory I was able to create new files there but for some reason the above error kept popping up when Grid tried to save a new target.

Don't believe the fsck'ng hype. Bring the agent down and back up and try again, worked for me. It is possible there was an issue with writing to the AGENT_HOME directory at some point but the Agent didn't recover nicely. An agent restart seemed to solve this for me.

-Dave

Comments

Thanks! Restarting the agent just worked for me.

I ran into a similar problem. I want to change the credentials of a database. It throws the same error.
I tried your solution. It failed.
But, I stopped the agent.Edited the file, put the password with ENCRYPTION=FALSE and started the agent.
OEM encrypted the password after the restart and I am able to monitor the DB again.

I'm getting the same problem. The database is discovered. But Grid can't save the details. Is this file on the Target database server or on the Grid server?

Tim: The file is part of the Oracle Agent install so it lives on the machine where the databases are being monitored.

Rama: Sounds like you may also be having security issues. You might try "emctl secure agent" command which will reset the security between the OEM Client and the OEM Server.

Jacob: Glad it worked for you!

Thanks! Restarting the agent just worked for me.
4files

That worked Dave! Awesome blog.

It worked for me as well. Thanks for the tip.

That's nicely going!

312-92

Add new comment