Job Seekers   Employers
dbapool: Authors | Submissions | Contact Us
   Forgot password? | Sign up
  Home   Discussion Forum   Articles   Interview Questions   FAQs   Scripts   Rewards   Analyzer   White Papers   Blog   Certification   Downloads   Tools
 

Topic: Database Administration >> try to solve this query

Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property. You may review the entire Oracle Certification Program Candidate Agreement online Here.



  


 Title: try to solve this query
 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

  




Forum Rules & Description


Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user




 








Get FREE Magazines

Top 10 Forum User

  Murtuja Khokhar857
  Mohammed Taj746
  positive fanatic483
  Jayanta Sur479
  Vigyan Kaushik386
  Gopu Gopi333
  Gitesh Trivedi322
  Vinoth Kumar264
  neeraj sharma258
  Ramesh Jois246






oracle Mag



  About Us Advertise Terms of Use Privacy Newsletters Contact Us    

Home   Discussion Forum   FAQs  Articles  Jobs   Newsletters  Directory  Downloads 

Our Premium Sponsor
Confio Software