If you are using an Oracle database with AutoCAD Map 3D 2012 or later, this article may help you to make your first foray into the world of Oracle's Data Pump utilities. It's not intended to be an exhaustive "how to" but it will perhaps break the back of your learning experience.
And it's a fairly long topic even when trimmed down, so this is part 1 of 2 parts:
- Using the Oracle tools
- Using the Autodesk Tools
Background
Over the years, many of us have found Oracle's EXP and IMP utilities useful in moving database content between Oracle instances and installations. There was a time when Autodesk Topobase Administrator made use of IMP to Import what were then called Topobase 'Documents'.
With the release of Oracle 10g, Oracle Data Pump (including EXPDP and IMPDP) was announced as the heir-apparent to the IMP and EXP throne. Since that time, users of Autodesk's Topobase Administrator will possibly have noticed that this utility now insisted that IMPDP and EXPDP be used. There were fairly simple workarounds (there always seem to be!) for those that hadn't yet taken the plunge into the Oracle Data Pump world, but nonetheless the writing was on the wall.
In 2011 what was formerly Autodesk Topobase was incorporated into Autodesk's AutoCAD Map 3D 2012 Enterprise and Infrastructure Map Server 2012 (formerly Autodesk MapGuide Enterprise) products. As part of this evolution, Autodesk Topobase Administrator was renamed Autodesk Infrastructure Administrator.
In 2012 there was a further consolidation – AutoCAD Map 3D 2013 now was a single product, with no 'Enterprise' version now needed to access and use the enterprise functionality.
This product consolidation puts extremely powerful and affordable enterprise GIS software into the hands of a much, much wider range of customers. A lot of bang for your consumer buck!
Using Oracle Data Pump – Simply
When it comes to using Oracle Data Pump, a web search will yield many, many hits. My goal here is to help the user of out-of-the-box Autodesk technology to use this Oracle out-of-the-box Information Technology – to get up to speed quickly and get their information backed up or flowing smoothly between systems.
There are many EXPDP and IMPDP parameters and many variations in their application. If you have the need, you can put these parameters in a parameter file and have the utilities refer to this file at runtime.
However, my purpose here is to simplify and highlight the relevance for Autodesk Industry Models – formerly Topobase 'Documents'. Each of these Industry Models is stored in an Oracle Schema, so the examples that follow assume that we have an Oracle 11gR1 Schema set named "WATER", "SEWER", ELECTRIC" and "LAND", and that we need to use EXPDP to dump the contents for migration to an 11gR2 system (or perhaps we are taking a snapshot during a project delivery cycle).
What you should do first
IMPDP and EXPDP can use a defined a physical location (folder) referred to by a logical name and that the location is available; this location is where your hexported data will be placed, or where your imported data will be available. To define this location:
SQL> CREATE OR REPLACE DIRECTORY dmpdir AS 'E:\DBLOAD\Dump';
Note: you will require particular Oracle System Privilege – "CREATE ANY DIRECTORY" – to complete this step.
What you should do second
If you are migrating an entire Autodesk Industry Model (AutoCAD Map 3D and/or Autodesk Infrastructure Map Server) enterprise environment then Industry Model Settings might also need to be exported. The exported XML file will enable the transport of your custom (and Oracle-resident) Form and Report definitions, for example, to your target system:
A the risk of being pedantic, I should state that you will need to have installed and run your Autodesk Industry Model Setup on your target environment. I don't propose to reproduce the product documentation here.
Using EXPDP
As noted above, EXPDP enables many, many options. Here's a sample command line (assuming your Oracle Service Name is "ORCL").
E:\> EXPDP sys/<password>@ORCL as sysdba SCHEMAS=water DUMPFILE=water.dmp DIRECTORY=DMPDIR LOGFILE=water_expdp.log VERSION=11.1.0.7
Most of this is pretty obvious. I tend to run a BAT file that enables the export of multiple schemas using multiple 'cloned' commands because it provides individual LOG files and DMP files e.g.
EXPDP \"sys/<password>@ORCL as sysdba\" SCHEMAS=water DUMPFILE=water.dmp DIRECTORY=dmpdir LOGFILE=water_expdp.log VERSION=11.1.0.7
EXPDP \"sys/<password>@ORCL as sysdba\" SCHEMAS=sewer DUMPFILE=sewer.dmp DIRECTORY=dmpdir LOGFILE=sewer_expdp.log VERSION=11.1.0.7
EXPDP \"sys/<password>@ORCL as sysdba\" SCHEMAS=land DUMPFILE=land.dmp DIRECTORY=dmpdir LOGFILE=land_expdp.log VERSION=11.1.0.7
And so on. There are many ways to get a slick file-processing pipeline happing via a BAT file.
What's not so obvious is the VERSION keyword; I have found invaluable for ensuring compatibility between 11gR1 and 11gR2 systems. Also note the "\" as an escape character.
The log will look something like this:
Also note that the syntax of the command could be modified to match the following example, where the logical name "dmpdir" is embedded in the file paths, replacing the need for the DIRECTORY keyword:
EXPDP \"sys/<password>@ORCL as sysdba\" SCHEMAS=land DUMPFILE=dmpdir:land.dmp LOGFILE=dmpdir:land_expdp.log VERSION=11.1.0.7
Note: If you are attempting to export data from another schema (unless you are the SYS user for example), then you will need EXP_FULL_DATABASE system Privilege.
Using IMPDP
Having moved the EXPDP DMP file to the target machine, using IMPDP is pretty similar to EXPDP.
Assuming our current DIRECTORY is set (see "What you should do first" above), we can issue a command from the Command Line like this:
E:\> IMPDP \"sys/<password>@ORCL as sysdba\" VERSION=11.1.0.7 DIRECTORY=dmpdir DUMPFILE=water.dmp LOGFILE=water_impdp.log
Note: If you are attempting to export data from another schema (unless you are the SYS user for example), then you will need EXP_FULL_DATABASE system Privilege.
Using Oracle SQL Developer
I'm going to assume you know (and love?) SQL Developer, then you will notice that your Industry Model Schema has been imported:
(You may find that there are Oracle Views which need correcting or recompiling. I'm assuming that you can handle this one on your own! J)
In Part 2 we'll look at using Autodesk Infrastructure Administrator to do your post-import housekeeping.