Does anyone know how - if possible- to export tables from one user but have the export file think the tables are from another user?
I need to export tables from user "A". This export file will then be imported into another database but under user "B". The issue is this will be done programmatically. Since the import process will be "activated" through a program, it has been hard coded to look at the export file and assume the tables were from user "B". But, the export file was created from under "A".
I can jump through some hoops (and script files) and accomplish this by 1) export file under user "A". 2) import the file using option touser="B" and 3) then re-export the same tables from user "B". The program will then work properly since the export file is "owned" by user "B".
I was just hoping there is an easier way than what I described.
I hope I explained this clearly enough.
Your script file would only be the way to go... Oracle is so intelligent to fake user_names
If both the users are on the same instance, then you can grant selet to user B from user A on table xyz. Then do a
drop table xyz;
create table xyz as select * from A.xyz;
Voila, you have the tables created without a necessity to export or import.
Life is a journey, not a destination!
but why cann't you change the hardcoded stuff ?
And if you go your way, after you do an import with touser=B as mentioned in step "2)", your job is done. Why do you need to carry out step "3)" and that un-mentioned "4)" ?
And as Sam has suggested, you can grant SELECTs on A's tables to B.
If A and B are on same db its simple.
If they are not, explore use of SQL's COPY command or database link.
Thanks for your suggestions. Unfortunately, there are a lot of other issues involved that prevent the code from being changed. But I do thank you all for your suggestions and comments.
Click Here to Expand Forum to Full Width