| Neeraj |
Posted: Feb 25, 2008 12:33:01 AM |
Total Post: 258
Joined: Jan, 2007
|
hi,
i m using this query to backyp my database.
can anyone tell me how can i get date -2
means 24022008 -2 =22022008
how can i get this output
dbdump_%date:~7,2%%date:~4,2%%date:~10%.dmp
it returns dbdump_24022008 how can i get 2 dya before date from this kinda query. |
|
|
Mohammed Taj |
| Posted: Feb 25, 2008 01:29:52 AM | |
|
Total Post: 746
Joined: Jul, 2007
|
use sqlplus (select sysdate-2 from dual) before that define one variable and using "host" command execute export command with date on sqlplus.
hope you got my point.
|
|
|
|
|
Neeraj |
| Posted: Feb 25, 2008 01:54:56 AM | |
|
Total Post: 258
Joined: Jan, 2007
|
hi,
let me tell u wt i wanna do.
i m using a bat file to export backup & its running fine by given script in bat file ,i hav contain only 2 days backup so i hav to delte 2 days b4 backup that i do manually so i want to do is that thw way this script get the current date for backup so if its can get day b4 4 days so i can delete automatically 2 day b4 dump file
export ...........(current date dump)
del ...............(delete older dump)
that i wanna do , i hope u got wt i mean.
thxs
|
|
|
|
|
Mohammed Taj |
| Posted: Feb 25, 2008 02:10:24 AM | |
|
Total Post: 746
Joined: Jul, 2007
|
i understood your command.
for that again use sqlplus and variable then get date before two days from sysdate and using "del" OS command delete that dump file first and export new one.
hope you can do it.
1. sqlplus
2. define variable
3. get date from dual
4. use Host with del command for delete files first
5. use host with export command for export new dump file.
Regards
Taj
|
|
|
|
|
Neeraj |
| Posted: Feb 25, 2008 02:18:43 AM | |
|
Total Post: 258
Joined: Jan, 2007
|
thxs for yr help but can u tell me the script how to do it ?
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |