Home » RDBMS Server » Backup & Recovery » automate import dumpfile
automate import dumpfile [message #198589] Tue, 17 October 2006 19:36 Go to next message
Omer1981
Messages: 2
Registered: October 2006
Location: Netherlands
Junior Member
Hello all,

I have a questionn regarding a backup procedure with oracle.

the situation is as follows:

I have a main server which is running oracle 10g, and an identicly configured backup server.

Those servers have 2 networkcards. one is a crosslink between, and the otherone is on the company network. (Only one is connected
to the companynetwork).
Via the crosslink cable, there is a backup created from the database from a certain user in of database with the following
script:
exp USERID=<USER>/<PASSWORD>@orcl FILE=D:\...\...\%1.DMP COMPRESS=Y GRANTS=N INDEXES=Y ROWS=Y TABLESPACES=<TABLESPACE>


Now if I want to restore a database, I have to manually remove the original tablespace with the console and create a new empty table space,
and then I can restore the dmp file I have created.

Is there a way I can do the restore automated, with a batchfile?



Regards,

Omer

[Updated on: Tue, 17 October 2006 20:01]

Report message to a moderator

Re: automate import dumpfile [message #198801 is a reply to message #198589] Wed, 18 October 2006 10:37 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10672
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
export/import is not "real backup". It is "like" a backup which is primary meant to move data around.
>>exp USERID=<USER>/<PASSWORD>@orcl FILE=D:\...\...\%1.DMP COMPRESS=Y GRANTS=N INDEXES=Y ROWS=Y TABLESPACES=<TABLESPACE>
You may not want to use COMPRESS=y . It is bad.

>>Is there a way I can do the restore automated, with a batchfile?

Assume you lost some data in those tables.
You want to *restore* them back.
So first, you must clean those/all tables in that tablespace.
If you proceed without that , oracle will complain that those objects are already existing.
If you use IGNORE=y, import will proceed but the data will get appended.
So, you NEED to clean up those tables(drop all tables in that tablespace) or
drop the tablespace and startover.

So in your batch script/shell script, do this.

sql>drop tablespace mytablespace including contents and tablespace;
sql> host imp user/pass.......
Re: automate import dumpfile [message #198886 is a reply to message #198589] Thu, 19 October 2006 00:22 Go to previous messageGo to next message
Omer1981
Messages: 2
Registered: October 2006
Location: Netherlands
Junior Member
Hello,

thank you for your reply.


Basicly what I mean is that from one server there will be a backup made, every 15 minutes from 2 users via a scheduled task.

Then that dumpfile will copied via a mapping to an the backup server (with a batchfile).

There it has to be restored via a scheduled task in windows, with a batchfile.

My question is is that possible to make that backup with a batchfile / sql script, which removes the certain tablespaces, create new tablespace, and imports it??


Thanks,

regards,

Omer
Re: automate import dumpfile [message #198945 is a reply to message #198886] Thu, 19 October 2006 05:03 Go to previous message
Mahesh Rajendran
Messages: 10672
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
You need into look into replication/materialized views.
>> is is that possible to make that backup with a batchfile / sql script, which removes the certain tablespaces, create new tablespace, and imports it??
Yes.
A combination of sql scripts and export/import command line commands
Previous Topic: Backup a particular partition
Next Topic: rman configuration issue
Goto Forum:
  


Current Time: Sun Dec 04 06:28:23 CST 2016

Total time taken to generate the page: 0.04619 seconds