Home » RDBMS Server » Server Utilities » Backup Automation. (Oracle10g, Widnows2003 server)
Backup Automation. [message #320817] Fri, 16 May 2008 06:24 Go to next message
weekend79
Messages: 198
Registered: April 2005
Location: Islamabad
Senior Member

Hi

I have to automate my backup (Dumps not physical).
What is the simplest yet reliable way to implement it i.e. OS scripts, OS scheduler or Oracle Scheduler. And how can I accomplish it?

Wishes
Re: Backup Automation. [message #320827 is a reply to message #320817] Fri, 16 May 2008 06:44 Go to previous messageGo to next message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Use OS script and scheduler, just my opinion but others might prefer use Oracle scheduler.

Regards
Michel
Re: Backup Automation. [message #320836 is a reply to message #320827] Fri, 16 May 2008 07:12 Go to previous messageGo to next message
weekend79
Messages: 198
Registered: April 2005
Location: Islamabad
Senior Member

Thanks Michel

Oracle10g, Widnows2003 server
Can you give me some sample scripts so i will change them according to my need, or there is no easy fish Smile

Wish
Re: Backup Automation. [message #320843 is a reply to message #320836] Fri, 16 May 2008 07:33 Go to previous messageGo to next message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Writing it on the fly:
set ORACLE_HOME=...
set ORACLE
set PATH=%ORACLE_HOME%\BIN;%PATH%
exp mydba/mypsw file=mydb.dmp log=mydb.log full=y

Regards
Michel
Re: Backup Automation. [message #320855 is a reply to message #320843] Fri, 16 May 2008 08:03 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Michel Cadot wrote on Fri, 16 May 2008 08:33

set ORACLE


I think Michel meant ORACLE_SID. This will be needed if you don't have ORACLE_SID set in the registry.
Re: Backup Automation. [message #320861 is a reply to message #320855] Fri, 16 May 2008 08:28 Go to previous messageGo to next message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Yes, I was interrupted when writing and didn't see I didn't finish the line before continuing on the next one!
It was indeed set ORACLE_SID.

By default, ORACLE_SID is not set in registry and in my opinion it is always a good idea to explicitly set it in batch script to prevent from an unwanted change in registry.

Regards
Michel
Re: Backup Automation. [message #320862 is a reply to message #320861] Fri, 16 May 2008 08:37 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Michel Cadot wrote on Fri, 16 May 2008 09:28

By default, ORACLE_SID is not set in registry and in my opinion it is always a good idea to explicitly set it in batch script to prevent from an unwanted change in registry.

Actually, for the first (default) database installed on Windows the ORACLE_SID gets set in the Windows registry.
Re: Backup Automation. [message #321662 is a reply to message #320862] Wed, 21 May 2008 00:04 Go to previous messageGo to next message
weekend79
Messages: 198
Registered: April 2005
Location: Islamabad
Senior Member

Thanks Michel

And how can i change this script in a way that my script generate a file with unique file name i.e. didn't override the last one.

Wishes
Re: Backup Automation. [message #321676 is a reply to message #321662] Wed, 21 May 2008 00:43 Go to previous messageGo to next message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Use date/time
For instance:
P:\>for /F "tokens=1-3 delims=/ " %A in ('date/t') do set MYDATE=%C%B%A

P:\>set MYDATE=080521

P:\>for /F "tokens=1-2 delims=: " %D in ('time/t') do set MYTIME=%D%E

P:\>set MYTIME=0741

P:\>set MYFILE=MYFILE_%MYDATE%_%MYTIME%

P:\>echo %MYFILE%
MYFILE_080521_0741

Regards
Michel
Re: Backup Automation. [message #321856 is a reply to message #321676] Wed, 21 May 2008 10:26 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Just another option:
C:\>set dt=%date:/=%%time: =0%

C:\>echo %dt:~4,8%_%dt:~12,2%%dt:~15,2%
05212008_1125

Re: Backup Automation. [message #321862 is a reply to message #321856] Wed, 21 May 2008 10:41 Go to previous message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
I didn't know about %date and %time variables.

@OP,
Take care it depends on your territory, the (about) same thing in France is:
C:\>set dt=%date:/=%%time::=%

C:\>echo %dt:~0,8%_%dt:~8,4%
21052008_1739

Regards
Michel
Previous Topic: how to import an encrypted export file
Next Topic: problem : import partition wise -- import has been done successfully withe now rows
Goto Forum:
  


Current Time: Tue Dec 24 23:35:12 CST 2024