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
Current Oracle Certs
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”.
With havin so much written content do you ever run into any problems of plagorism or copyright infringement? My blog has a lot of completely unique content I’ve either created myself or outsourced but it appears a lot of it is popping it up all over the internet without my agreement. Do you know any methods to help protect against content from being stolen? I’d truly appreciate it.
안전한 문카지노는 어디인가요?
After I initially left a comment I appear to have clicked the -Notify me when new comments are added- checkbox and now every time a comment is added I get four emails with the same comment. There has to be a way you are able to remove me from that service? Thanks a lot.
Heya i’m for the first time here. I found this board and I find It really useful
Wow, superb blog format! How long have you ever been running a blog for? you made blogging glance easy. The full look of your web site is wonderful, let alone the content!
Thank you for the sensible critique. Me
Great content! This is really insightful for anyone looking to start a startup. I found a lot of actionable advice that I’ll be able to implement in my personal business. Thanks for sharing such valuable information. Looking forward to reading more articles from you! Well done! For more insights on startup strategies, check out this useful guide: this page.
Excellent article! This is extremely insightful for anyone aiming to launch a venture. I came across several useful tips that I’ll be able to implement in my personal enterprise. Thank you for providing such valuable content. Excited to checking out more articles from you! Well done! To learn more insights on financial management, check out this great resource: this page.
Starting a enterprise can be overwhelming, but with the right guide, you can simplify your process. This comprehensive guide provides advice on how to build a successful startup and avoid common mistakes. Check out this link for further details and to learn more about unlocking growth.
Your point of view caught my eye and was very interesting. Thanks. I have a question for you.
Really appreciated going through this article. It’s highly informative and structured. Fantastic effort!
Thank you for the sensible critique. Me
Excellent article. It’s highly articulate and filled with valuable details. Thanks for providing this post.
I would like to thank you for the efforts you’ve put in writing this web site. I’m hoping the same high-grade blog post from you in the upcoming also. Actually your creative writing abilities has inspired me to get my own site now. Really the blogging is spreading its wings rapidly. Your write up is a great example of it.
Really liked it. Simple to use.
Based in the most prestigious areas of Crete, these sumptuous villas provide the optimal setting for an unforgettable holiday. Find your perfect escape.
Situated in the most prestigious areas of Crete, these opulent villas provide the ideal setting for an unforgettable holiday. Find your perfect escape.
Nice article this is going to help my chinese mandarin tutoring service!
Going to use this for my SEO agency!
Thsi will help with my chinese online tutoring lessons.
Thsi will help with my Google Entity Stacking service.
Thsi will help with my Google Entity Stacking service.
Thsi will help with my Google Entity Stacking service.
Thsi will help with my Google Entity Stacking service.
Thsi will help with my Estrogen Blocker Supplements!
Thsi will help with my Estrogen Blocker Supplements!
Thsi will help with my Estrogen Blocker Supplements!
Thsi will help with my Estrogen Blocker Supplements!
When grooming your French bulldog, watch out not to get water and shampoo down the ear canal.
Technology and Tools: Look for brokers that offer robust trading platforms and research tools.
Thsi will help with my Estrogen Blocker Supplements!
Great investment. Satisfied.