{"id":1173,"date":"2026-07-30T13:37:39","date_gmt":"2026-07-30T11:37:39","guid":{"rendered":"https:\/\/anjo.pt\/keyword-oracle\/?p=1173"},"modified":"2026-07-30T13:37:39","modified_gmt":"2026-07-30T11:37:39","slug":"copy-audit-and-unified-audit-across-databases","status":"publish","type":"post","link":"https:\/\/anjo.pt\/keyword-oracle\/2026\/07\/30\/copy-audit-and-unified-audit-across-databases\/","title":{"rendered":"Copy Audit and unified audit across databases"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The client had a special request: copy the audit data to another database &#8211; once -, for compliance reasons.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The Audit data does not let it copy so easily. Before was usually in SYS schema, now it belongs to a special AUDSYS user. None allows to export data by default.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To copy the audit data from one database to another, there is special expdp argument: &#8220;include=audit_trails&#8221;. This only works in full export mode:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nexpdp system@server.domain.ch\\pdb_service \\\n  DIRECTORY=expdp \\\n  DUMPFILE=audit_data_$(date +%Y%m%d_%H%M).dmp  \\\n  FULL=Y \\\n  INCLUDE=AUDIT_TRAILS \n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">On the new database, I&#8217;ve imported to a new user &#8220;old_audit&#8221; and specific tablespace, which I created before the import<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSYS@DB1.PDB1&gt; create tablespace unified_audit_ts;\nSYS@DB1.PDB1&gt; alter user system quota unlimited on unified_audit_ts;\n\nSYS@DB1.PDB1&gt; create user old_audit no authentication \n    default tablespace unified_audit_ts \n    quota unlimited on unified_audit_ts;\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">At the end I&#8217;ve imported the data, using remap_schema and remove the segment attributes, so all go to the new default tablespace:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nimpdp system@server.domain.ch\\new_pdb \\\n  DIRECTORY=expdp \n  DUMPFILE=$(ls -tr audit_data*.dmp | tail -n1) \n  REMAP_SCHEMA=sys:old_audit \n  REMAP_SCHEMA=audsys:old_audit \n  TRANSFORM=SEGMENT_ATTRIBUTES:N\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>The client had a special request: copy the audit data to another database &#8211; once -, for compliance reasons. The Audit data does not let it copy so easily. Before was usually in SYS schema, now it belongs to a special AUDSYS user. None allows to export data by default. To copy the audit data [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32,36,6,9],"tags":[],"class_list":["post-1173","post","type-post","status-publish","format-standard","category-audit","category-cloning","category-oracle","category-security","czr-hentry"],"_links":{"self":[{"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/posts\/1173","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/comments?post=1173"}],"version-history":[{"count":2,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/posts\/1173\/revisions"}],"predecessor-version":[{"id":1183,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/posts\/1173\/revisions\/1183"}],"wp:attachment":[{"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/media?parent=1173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/categories?post=1173"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/tags?post=1173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}