Wither you use a single OEM and migrating to a new OEM or have multiple OEMs, the need to move templates between environments will arise. I had this exact problem come up recently at a customer site between an OEM 11g and OEM 12c. In order to move the templates, I needed to export the multiple monitoring templates using EMCLI. The command that I used to do individual exports was the following:
./emcli export_template -name="<template name>" -target_type="<target_type>" -output_file="/tmp/<template name>.xml"
If you have only one template to move, the EMCLI command above will work. If you have more than one template to move, the easiest thing to do is to have the EMCLI command run in a script. This is the beauty of EMCLI; the ability to interact with OEM at the command line and use it in scripts for repeated executions. Below is a script that I wrote to export templates based on target_types.
Note: If you need to identify the target_types that are supported by OEM, they can be found in SYSMAN.EM_TARGET_TYPES in the repository.
#!/usr/bin/perl -w # #Author: Bobby Curtis, Oracle ACE #Copyright: 2014 # use strict; use warnings; #Parameters my $oem_home_bin = "/opt/oracle/app/product/12.1.0.4/middleware/oms/bin"; my @columns = ("", 0, 0, 0, 0); my @buf; my $target_type = $ARGV[0]; #Program if (scalar @ARGV != 1) { print "\nUsage:\n"; print "perl ./emcli_export_templates.pl <target_type>\n\n"; print "<target_type> = target type for template being exported\n"; print "refer to sysman.em_target_types in repository for more info."; print "\n"; exit; } system($oem_home_bin.'/emcli login -username=<userid> -password=<password>'); system($oem_home_bin.'/emcli sync'); @buf = `$oem_home_bin/emcli list_templates`; foreach (@buf) { @columns = split (/ {2,}/, $_); if ($columns[2] eq $target_type ) { my $cmd = 'emcli export_template -name="'.$columns[0].'" -target_type="'.$columns[2].'" -output_file="/tmp/'.$columns[0].'.xml"'; system($oem_home_bin.'/'.$cmd); print "Finished export of: $columns[0] template\n"; } } system($oem_home_bin.'/emcli logout');
If you would like to learn more about EMCLI and other ways to use it have a look at these other blogs:
Ray Smith: https://oramanageability.wordpress.com/
Kellyn Pot’Vin: http://dbakevlar.com/
Seth Miller: http://sethmiller.org/
Enjoy!
twitter: @dbasolved
blog: http://dbasolved.com
Bobby Curtis
I’m Bobby Curtis and I’m just your normal average guy who has been working in the technology field for awhile (started when I was 18 with the US Army). The goal of this blog has changed a bit over the years. Initially, it was a general blog where I wrote thoughts down. Then it changed to focus on the Oracle Database, Oracle Enterprise Manager, and eventually Oracle GoldenGate.
If you want to follow me on a more timely manner, I can be followed on twitter at @dbasolved or on LinkedIn under “Bobby Curtis MBA”.
Hi Dear, are you actually visiting this web page on a regular basis,
if so then you will absolutely get nice knowledge.
my blog post :: check my reference
Good day! Do you know iff tney maske anyy plugins to assist with
Search Engie Optimization? I’m trying to get my blog to rahk for some targeted
keywordfs bbut I’m not seering very good success.
If you know of any please share. Appreciate it! http://boyarka-Inform.com/
I think that everything published made a ton of sense. However, what about this?
suppose you composed a catchier post title? I am not suggesting your information is
not solid, but what if you added something that makes people desire more?
I mean Speedy #em12c template export – DBASolved is a little
vanilla. You might glance at Yahoo’s front page and see how they write news titles to get viewers to open the links.
You might add a video or a related picture or two to
grab people interested about everything’ve written. In my opinion, it could make your posts a little bit more interesting.
My webpage: try this web-site
Write more, thats all I have to say. Literally, it seems as though you relied
on the video to make your point. You definitely know what youre
talking about, why throw away your intelligence on just posting videos to your site when you could
be giving us something enlightening to read?
My web blog address
Hey There. I found your blog using msn. This is an extremely well written article.
I will be sure to bookmark it and return to read more of your useful
info. Thanks for the post. I’ll certainly comeback.
Also visit my blog; like it
I’ve learn several just right stuff here. Certainly price bookmarking for
revisiting. I wonder how much effort you set
to make such a magnificent informative website.
Feel free to visit my blog post: see it here
Ein Casino im Internet ist eine plattform, auf
der nutzer verschiedene casino-spiele wiee tischsppiele und roulette
genießen können. Ob Sie gerne ab und zu spielen, Online-Casinos biedten vielfältige
optionen für alle artten von spielern.
Viele plattformen bieten willkommensboni, um spieler zu motivieren. Zusätzlich können loyalitätssysteme den Spielern weitere vorteile bieten.
Transaktionen in online-casinos sind sicher, mit optionen wie kreditkarten, die schnelle einzahlungen ermöglichen. Vertrauenswürdige anbieter sorgen für die sicherheit
der spieler.
Spielen im online-casino macht spaß für spieler, die viel spaß beim glücksspiel haben. https://de.trustpilot.com/review/nine-onlinecasino.top
Thanks for sharing. I read many of your blog posts, cool, your blog is very good.
hey there and thank you for your information – I’ve definitely picked up something
new from right here. I did however expertise several technical points using
this web site, as I experienced to reload the site a lot of times
previous to I could get it to load correctly. I had been wondering if your
hosting is OK? Not that I’m complaining, but sluggish loading
instances times will sometimes affect your placement in google and
can damage your high quality score if ads and
marketing with Adwords. Well I am adding this RSS to my
e-mail and could look out for much more of your respective fascinating content.
Ensure that you update this again soon.
Have a look at my site – best site
Hi there, this weekend is fastidious designed for me, for the
reason that this moment i am reading this enormous informative piece of writing here at my home.
Here is my blog post continued
I’m really enjoying the design and layout of your website.
It’s a very easy on the eyes which makes it
much more enjoyable for me to come here and visit more
often. Did you hire out a developer to create your theme?
Outstanding work!
my web page :: blog here
Thank you for the auspicious writeup. It actually
was once a amusement account it. Glance complicated to more added
agreeable from you! However, how can we be in contact?
Also visit my web page: pop over to this site
Great beat ! I would like to apprentice whilst you amend your web site,
how could i subscribe for a weblog web site? The account helped me a acceptable deal.
I had been a little bit acquainted of this your broadcast provided shiny transparent concept
My webpage: you can find out more
This blog was… how do I say it? Relevant!!
Finally I have found something that helped me. Thank
you!
my page … visit this page
I think the admin of this web page is in fact working hard
for his web site, since here every stuff is quality based information.
Have a look at my website; read more
Hi my family member! I wish to say that this post is amazing, nice written and come
with approximately all significant infos. I would like to peer more posts like this
.
Also visit my page have a peek at this website