-
Importing an exported file into an existing db
I run nightly exports in our production 9i database. I have several testing databases that are setup just like our production one. I need to refresh one of our test db's from our production db as of last night. I was going to use the export file. I export the entire schema that our application uses. Do I need to trucate all the tables in the test db's schema before I do the import? If I do is there a command to truncate all tables in a schema rather then doing it one table at a time? Can I just run the import and tell it to over-write the data allready there?
-
why not just drop the user and do a full user import?
but yes you woul dhave to truncate all the tables or drop them, and no there is no one command to do that, you would have to use a plsql loop
-
If you cant script the plsql loop, then TOAD will do it for you.
Best is to drop the schema and import.
"What is past is PROLOGUE"
-
Thanks, but I ended up not doing the import. I recovered the db from a backup of production. DBASAN, I looked in toad just so I know in the future, and is there anyother way to do it in toad other then highlighting all the tables right clicking and choosing truncate? That is the only way I could see doing this in toad.
-
Or even simpler:
spool trunc_tbls.sql
select 'truncate table '|| table_name|| ';' from user_tables;
spoolf off;
then run the script, trunc_tbls.sql... Well of course this means that you must have disabled all FK's... But you could do that using the same technique.
-
Originally Posted by jayjabour
That is the only way I could see doing this in toad.
"What is past is PROLOGUE"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|