|
If you invoke the IMP utility with no command line
options, then IMP will prompt you for more
information. This is the dialog that you are hoping to
avoid so that you can script running IMP from within
your VB program. This can be done quite simply by
providing all of the options on the command line for
IMP. For instance, a call to IMP might look like the
following:
imp.exe userid=system/manager file=exp.dmp full=y
If you provide these options on the command line, IMP
will not prompt you for them.
Getting the current status of IMP is much harder. You
can force IMP to write information to a log file with
the 'log=filename.log' option on the command line. And
you can read this log file at any time. The
unfortunate problem with this is that the IMP utility
will store the log in a small buffer and only write to
that log once this buffer fills up. So reading the log
file can be behind.
If you know which tables are being imported, then you
can query DBA_TABLES to see if they have been created.
The last table that is being imported, that is also in
DBA_TABLES, is the table that IMP is currently working
on. This assumes that you have not precreated the
tables and are importing with IGNORE=Y.
If the table that is being imported is very large, you
can query V$SESSION_LONGOPS for the import session.
This isn't always accurate as short running operations
(i.e. importing small tables) won't appear in this
list of long operations.
Finally, depending on how you code your VB program,
you may be able to capture the output of the IMP
utility similar to capturing the utilities output to
standard out. This way, you can get the information as
it would appear on your screen.
Unfortunately, there is no quick and easy way for your
VB program to see the current status of the IMP
utility.
For More Information
|