This post talks about the command used to export and importing of OAM 11g policies. OAM 11g provides this functionality through WLST scripting tool. This is the only possible approach to automatically export all policies from OAM 11g. The below steps are appropriate in linux env for exporting policies.
- Goto $ORACLE_HOME/common/bin.
- Run ./wlst.sh
- connect(‘weblogic’,'password’,'t3://weblogic_host:port’)
- exportPolicy(pathTempOAMPolicyFile,’/app/shared/home/tmweb/Oracle/Middleware_Dev2/oam_policies.xml’)
Refer the below screenshot for the output.
For importing policies into target OAM environment, follow the below steps:
- Goto $ORACLE_HOME/common/bin.
- Run ./wlst.sh
- connect(‘weblogic’,'password’,'t3://weblogic_host:port’)
- importPolicy(pathTempOAMPolicyFile,’/app/shared/home/tmweb/Oracle/Middleware_Dev2/oam_policies.xml’)
The exported policies xml file (oam_policies.xml in this case) contains the below data:
- Authentication schemes
- Host Identifiers
- Application domains: Resources, Authentication/Authorization policies etc.,
Once the policies are imported to target OAM server the application domains, authentication schemes, host identifiers will be created/updated. Please note that IAMSuiteAgent application domain will also gets imported into target OAM server and this does not harm the OAM setup.
The same policies file can be imported multiple times without any issues.
Hope this post helps.







Good hands-on exercises (installation, patching, cloning), very experienced trainer worth every penny 
12 users commented in " Exporting and importing of policies in OAM 11g "
Follow-up comment rss or Leave a TrackbackHave you seen this output before? I get the same response with multiple servers and different environments (PROD, TEST, etc)
wls:/test_sso_domain/serverConfig> exportPolicy(pathTempOAMPolicyFile=’/u01/app/oracle/admin/test_sso_domain/mserver/test_sso_domain/policy-export.xml’)
Traceback (innermost last):
File “”, line 1, in ?
NameError: exportPolicy
wls:/test_sso_domain/serverConfig>
@ Mike,
From where you are running wlst.sh ?
Please ensure to run wlst.sh from ORACLE_HOME/common/bin folder.
I am running it from the ORACLE_HOME/common/bin folder but im still getting an error:
wls:/idm_domain/serverRuntime> exportPolicy(pathTempOAMPolicyFile=’/odrive/oracle/temp/policies.xml’)
Traceback (innermost last):
File “”, line 1, in ?
NameError: exportPolicy
I have executed it just now from $ORACLE_HOME/common/bin.
Looks like you are executing some other than after connecting and before exportPolicy. In my case wls:/base_domain/serverConfig, in your case wls:/idm_domain/serverRuntime
wls:/base_domain/serverConfig> exportPolicy(pathTempOAMPolicyFile=’/app/shared/home/tmweb/Oracle/Middleware_Dev2/oam_policies_latest.xml’)
Successfully exported policies. Check log file for details.
wls:/base_domain/serverConfig>
I was trying something else in the above example. I did this and it still does not work:
bash-3.00$ /odrive/oracle/Middleware/wlserver_10.3/common/bin/wlst.sh
wls:/offline> connect(‘weblogic’,'password’,'host:port’)
Connecting to t3://www.localcorp.biz:7001 with userid weblogic …
Successfully connected to Admin Server ‘AdminServer’ that belongs to domain ‘idm_domain’.
Warning: An insecure protocol was used to connect to the
server. To ensure on-the-wire security, the SSL port or
Admin port should be used instead.
wls:/idm_domain/serverConfig> exportPolicy(pathTempOAMPolicyFile=’/odrive/oracle/temp/policies.xml’)
Traceback (innermost last):
File “”, line 1, in ?
NameError: exportPolicy
You are executing wlst.sh from WL_HOME/common/bin. It should be executed from ORACLE_HOME/common/bin.
[...] have covered export and import of policies in previous post . The export and import partners also entail in similar steps using WLST [...]
[...] OAM 11g Policies are stored in database and this needs to be exported to an XML file, read this post for more details. The policies in target environment should have URLs (such as Authentication [...]
When we do a export of policy data, we get multiple files. For example, if we run:
exportPolicy(pathTempOAMPolicyFile=’/tmp/oam_policies.xml’);
we get 5 additional files with names of the form:
oam_policies.xml.@.1
through
oam_policies.xml.@.5
What are these additional files and are they needed for the import?
Thanks
Aspi Engineer
The formatting for my last post was lost.
The 5 files have the naming convention:
oam_policies.xml.NNN@MACHINE-NAME.1
through
oam_policies.xml.NNN@MACHINE-NAME.5
@Aspi Engineer,
Those files are not required for import.
Leave A Reply