The other day…no, not that day, the OTHER day, I got a call if it was possible to restore some tables from a database backup. This was no issue, until I saw the list of tables that where needed..
Table_a10.. table19,table_bcd0…table_bcd9 etc…
So I could do two things:
Create parameter file in the form of
directory=DUMPME dumpfile=DumpFile01.dmp tables=(tablexx,tablexx,tablexx)
Possible, would work…but this involved a separate sql session, get the table names, cut and paste them in a file, do some editing..This has to be able to be done a lot smarter!
And yes, it is..The other way of doing this is to create a parameter File in the form of:
directory=DUMPME dumpfile=DumpFile01.dmp INCLUDE=TABLE:"IN(select table_name from user_tables where table_name like ’FOO%’ or table_name like ’BAR%’)"
The beauty of this is:
- Because of using a parameter file, no need to exclude the backslashes with all kind of escapes as should be done when running this on the command line.
- This syntax shows how to select multiple tables by using the “or”! There are enough examples on how to include a set of tables which are very similar, but this syntax shows how to select all kind of tables!
In short: This is a real gem!