Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can deleted files/ directories (rm -r) be retrieved again?

Status
Not open for further replies.

Livia8

Technical User
Oct 29, 2003
130
0
0
IE
Hi,

While I was making some room by deleting old archivelogs through asmcmd, I accidentally managed to delete the whole archivelogs directory and its contents. I'm not even sure how I did it, but I presume it was by adding an extra space after the rm -r command and the first slash (e.g. rm -r[highlight #EF2929] / [/highlight] 2021_11_02/ 2021_11_03/ instead of rm -r[highlight #73D216] /[/highlight]2021_11_02/ 2021_11_03/).

To try and salvage something, I've manually recreated the directory with mkdir ARCHIVELOGS, even though now it reads SYS N instead of SYS Y (not sure if that would have negative repercussions).

I was wondering if there was some sort of recycling bin, for lack of a better expression, where I could go to retrieve the archivelogs I deleted in error, or if there was a command I could use to recover the data.

Thankfully this was in a test environment, but I'd be very grateful if anyone had any suggestions.

Many thanks.
 
Check with your sysadmin to see if there's a backup of your files. It may be incomplete but might get you close. Also check to see if you are archiving to multiple destinations. At the very least, backup your database immediately.
 
Thanks Carp - so, that would be a no to both of my questions, then? There's no magic "undo" command, is there?
 
Thankfully this was in a test environment"
Can't you just copy the Production environment into Test [ponder]

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
Livia8 - if you don't have any system backup going on, then you are correct; the short answer is "no".
 
May I ask if you're experiencing any actual problems right now? Archive log files are not used at all in normal online database operations. They are only needed for doing forward recovery when restoring a database from backup. That suggests your database should be completly operational after recreating the archive log directory with the appropriate permissions. Did your archive log directory contain anything other than archive log files?

If your database is operational, you should immediately take a backup. That will establish a recovery point that's after the lost archive log files. You will then be able to restore your database from this backup and the archive log files that are currently being produced.

 
Thanks, everyone.

I did take backups all right, but we normally keep eight days' worth of archivelogs and delete anything older, so my accidental deletion left me with only one day's worth of files. It's not a major thing as it's not the production environment, but it would have been nice to have an "undo" function, just in case.

I'll be even more careful in the future, lesson learnt!

Enjoy the festivities, thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top