Home » RDBMS Server » Server Utilities » Taking a backup in batches (Oracle version 9.2.0.1.0)
Taking a backup in batches [message #334280] Wed, 16 July 2008 01:21 Go to next message
manoj12
Messages: 185
Registered: March 2008
Location: India
Senior Member
Dear Sir

I have 20 users into my database.Now I wanted to create a batch file that will help me to take the backup of each user and will be generating individual dump for each user as well as log file at one shot.Could you please tell me how to do that?

Regards

[Updated on: Wed, 16 July 2008 01:22]

Report message to a moderator

Re: Taking a backup in batches [message #334281 is a reply to message #334280] Wed, 16 July 2008 01:23 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Where are you stuck?
Just write a script.

Regards
Michel
Re: Taking a backup in batches [message #334285 is a reply to message #334281] Wed, 16 July 2008 01:40 Go to previous messageGo to next message
manoj12
Messages: 185
Registered: March 2008
Location: India
Senior Member
Dear Sir

This is what the script I have written

exp &username/&pasword@manoj_test file=userid_sysdate.dmp log=userid_sysdate.log
This command I have saved with .bat extension
The file has been saved.But I dont want it should again and again the username from me
Now I dont want It should ask again and again the user name.I wanted to take this backup in one shot.Any help sir

Regards
Re: Taking a backup in batches [message #334306 is a reply to message #334285] Wed, 16 July 2008 02:40 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
I don't think &... works in .bat file.
Do you really test it?

Regards
Michel
Re: Taking a backup in batches [message #334329 is a reply to message #334306] Wed, 16 July 2008 03:56 Go to previous messageGo to next message
manoj12
Messages: 185
Registered: March 2008
Location: India
Senior Member
Dear Sir

I have tested it.But it is asking me for the username and password again and again.I dont want username and password to write each and every time for each and every user.But I can do one thing.I can write a script like this
Quote:

for e.g
Suppose there three users manoj_test,manoj_dev,proposal_user with host string as manoj_test
Now I wanted to create a batch file.What I will do is I will write the below scripts in a notepad and save this script on a respective path with .bat extension like

exp manoj_test/manoj_test@manoj_test file=manoj_test_manoj_test_%bakdate.dmp log=manoj_test_manoj_test_%bakdate.log

exp manoj_dev/manoj_dev@manoj_test file=manoj_Dev_manoj_test_%bakdate.dmp log=manoj_dev_manoj_test_%bakdate.log

exp proposal_user/proposal_user@manoj_test file=proposal_user_manoj_test_%bakdate.dmp log=proposal_user_manoj_test_%bakdate.log

and then run the script

This is one way we can do.



Is there any other easiest method that oracle suggests?.Also This thing is not at all generating log file.?


[Updated on: Wed, 16 July 2008 04:39] by Moderator

Report message to a moderator

Re: Taking a backup in batches [message #334342 is a reply to message #334329] Wed, 16 July 2008 04:42 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
SQL> select username from dba_users where username in ('MICHEL','SCOTT');
USERNAME
------------------------------
MICHEL
SCOTT

2 rows selected.

SQL> select 'host exp / owner='||username||'.... other parameters' 
  2  from dba_users where username in ('MICHEL','SCOTT');
'HOSTEXP/OWNER='||USERNAME||'....OTHERPARAMETERS'
--------------------------------------------------------------------
host exp / owner=MICHEL.... other parameters
host exp / owner=SCOTT.... other parameters

2 rows selected.

Do you follow me?

Regards
Michel
Re: Taking a backup in batches [message #334353 is a reply to message #334342] Wed, 16 July 2008 05:02 Go to previous messageGo to next message
manoj12
Messages: 185
Registered: March 2008
Location: India
Senior Member
Dear Sir

Do you think by running this query will help me to take the back up activity.The select statement will only retrieve the output in this ' ' format.But I wanted a dump of all the 20 users in one shot.How I should do it.This was the first method I suggested.What about the second method.As per Michel Mail provided it will only select the statement mention in singles cotes.But How to take a dump for all the 20 users in one shot.Any Help please.

Regards
Re: Taking a backup in batches [message #334384 is a reply to message #334353] Wed, 16 July 2008 06:13 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You can change "where" clause as you want.
I gave a list.
You can put in it your criteria.

Regards
Michel
Re: Taking a backup in batches [message #334437 is a reply to message #334353] Wed, 16 July 2008 08:16 Go to previous message
joy_division
Messages: 4640
Registered: February 2005
Location: East Coast USA
Senior Member
manoj12 wrote on Wed, 16 July 2008 06:02
Dear Sir

Do you think by running this query will help me to take the back up activity.



Yes, I believe it is called adaptive reasoning.
Previous Topic: IMPDP oracle8 dmp
Next Topic: Exporting two tables
Goto Forum:
  


Current Time: Sat Dec 03 18:08:14 CST 2016

Total time taken to generate the page: 0.12263 seconds