This content has been marked as final. Show 1 reply
You can create an XML template of a cube by right-clicking on the cube and choosing "Save Cube <name> To Template" and saving the file. You can do the same thing for a dimension, multiple objects, or an entire analytic workspace. Then you can import the template to create the objects in a new environment. This can be done via script using dbms_cube.import_xml.
Pass a clob data type into the procedure like this, using to_clob:
If the length of the XML is too long, as might be the case for an entire analytic workspace, you can use a clob variable and concatenate each line to it:
begin dbms_cube.import_xml(to_clob('<Metadata Version="1.3" MinimumDatabaseVersion="220.127.116.11"> <Cube . . . </ConsistentSolve> </Cube> </Metadata>')); end; /
Just be aware that the spacing matters in the imported XML, so don't remove the white space (the indentation).
declare v_clob clob; begin v_clob := q'~<Metadata~'; v_clob := v_clob || q'~ Version="1.3"~'; v_clob := v_clob || q'~ MinimumDatabaseVersion="18.104.22.168">~'; . . . v_clob := v_clob || q'~</Metadata>~'; dbms_cube.import_xml(v_clob); end; /
Also, just so you know, if you go into AWM to Tools -> Configuration there is a Preference under Logging called Application Logging File. Put a directory and file name in there and it will record every action you take in AWM. If you open the log file, you will see XML commands that can be imported with dbms_cube.import_xml. However, each action will be a separate command, so if you consider the number of actions it takes to build an entire cube, it is much easier to just import a template than it would be to execute the dozens of commands again.