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”.
Thanks for sharing. I read many of your blog posts, cool, your blog is very good.
Hello there! Do you know if they make any plugins to assist with SEO?
I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good gains.
If you know of any please share. Thank you! I saw similar blog
here: Eco blankets
We’ll see how effective employee management can have a a lot larger impact on employee productiveness than whether a worker is paid by the hour or by the month.
You’ve made some decent points there. I looked on the net for more information about the issue and found most people will go along with your views on this website.
Having read this I thought it was really enlightening. I appreciate you taking the time and effort to put this article together. I once again find myself personally spending a significant amount of time both reading and leaving comments. But so what, it was still worth it!
I enjoy looking through an article that can make people think. Also, thank you for allowing for me to comment.
Next time I read a blog, Hopefully it doesn’t fail me as much as this one. After all, Yes, it was my choice to read through, nonetheless I actually believed you would probably have something useful to say. All I hear is a bunch of complaining about something you could fix if you weren’t too busy looking for attention.
온라인 사òng에서 돈을 이기는 技巧이 있나요?
온라인 카지노의 다양한 매력을 경험하고 싶으신 분들, 지금 바로 최고의 카지노 플랫폼을 방문해보세요. 최고의 베팅 사이트에서 특별한 경험를 경험하실 수 있습니다.
I blog often and I seriously thank you for your content. This great article has really peaked my interest. I am going to book mark your blog and keep checking for new details about once per week. I opted in for your Feed too.