• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 450
  • Last Modified:

Recover Oracle data without a backup

Hi all. We have a working database that accidentally had some data changed and was committed. Is there any way to restore a system archive from yesterday without any proper backup in place - i.e. relying on inherent Oracle saving.

System is Oracle 10g on Solaris
0
mgferg
Asked:
mgferg
  • 3
  • 2
  • 2
  • +2
1 Solution
 
jerrypdCommented:
not that I am aware of - - the transaction logs have probably already been applied at this point, and even if you were to delete them, the data would become "inconsistent".
0
 
jgiordanoCommented:
when you say no backup, no offsite or enterprise backup? what about exports? or snapshots? All would be configured and are not automatic so you would know if they are configured.

If the answer is no, then you are up a creek... sorry
0
 
slightwv (䄆 Netminder) Commented:
Had you caught this early enough you might have been able to use flashback query.  You can try it but I doubt it will work.

I cannot remember if logminer shows before images or not but if you have the archived redo logs around you might check it out.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
mgfergAuthor Commented:
thanks - how can I check was is possibly available?

next option is to restore the db somewhere else and save the data from their - any pointers on how thi sis done please - ie copy the db file to a different location then what?
0
 
slightwv (䄆 Netminder) Commented:
To restore the database somewhere else you need a backup.

There might be some low level queries to see the last available SCN or timestamp the the online redo logs but I don't know of it.

Easiest way is to try a flashback query from the time before the delete/commit.  It will either work or it won't.

To see what logminer provides, check the docs.
0
 
mgfergAuthor Commented:
So what I want to know is - if I restore the db directory somewhere else- how can I load this in conjunction with the db that is currently running?

i.e. the directoy with all the .ctl, .log, .dbf - the main db file is in this dir, call it mydata.dbf - how can this be "mounted" so I can retrieve the valid data, that can then be used to update the current productionon one?

Worst case I could replace this file with the backup, but not sure if I should restore all files, or just the db file is ok (?). Assuming all files ...

Thanks - this is a production system, so would really appreciate some help that I'm out of my depth with.

Regards,
Mark
0
 
jgiordanoCommented:
I am not sure if i understand but you DO have a backup? It would help to understand what kind of backup you have.

 If you want to clone the current db there are a few ways. 1) shut production db, fully copy all the files onto another box.
2) install on a new box and apply exports of the data you want.
3) If your prod db is running in archival log mode you can back it up, take the DBFs and apply the archive logs.

Then you can restore your backup. But again depending on your backup strategy it may be as simple as installing oracle somewhere and importing your backup then grabbing the data.
0
 
Praveen Kumar ChandrashekatrDatabase Analysist Senior Commented:
>>>Worst case I could replace this file with the backup, but not sure if I should restore all files

if you have a backup you can restore the database using until time and and open it with reset logs.

1) copy backup file to temporay location in the new host.
2) rman TARGET / NOCATALOG
3)rman>CATALOG START WITH 'new_loc/backup/temp/';
4)rman>RUN
{
  ALLOCATE CHANNEL c1
  RESTORE SPFILE TO PFILE '?/oradata/test/inittrgta.ora' FROM AUTOBACKUP;
  SHUTDOWN ABORT;
}
4) Change any location-specific parameters, for example, those ending in _DEST and _PATH, to reflect the new directory structure.
5) STARTUP FORCE NOMOUNT PFILE='?/oradata/test/inittrgta.ora';
6) rman> RUN
{
  ALLOCATE CHANNEL c1
  RESTORE CONTROLFILE FROM AUTOBACKUP;
  ALTER DATABASE MOUNT;
}
7) execute the recovery script.
rman>
RUN
{
  # allocate a channel to the tape device
  ALLOCATE CHANNEL c1
  # rename the datafiles and online redo logs
  SET NEWNAME FOR DATAFILE 1 TO '?/oradata/test/system01.dbf';
  SET NEWNAME FOR DATAFILE 2 TO '?/oradata/test/undotbs01.dbf';
  SET NEWNAME FOR DATAFILE 3 TO '?/oradata/test/cwmlite01.dbf';
  SET NEWNAME FOR DATAFILE 4 TO '?/oradata/test/drsys01.dbf';
  SET NEWNAME FOR DATAFILE 5 TO '?/oradata/test/example01.dbf';
  SET NEWNAME FOR DATAFILE 6 TO '?/oradata/test/indx01.dbf';
  SET NEWNAME FOR DATAFILE 7 TO '?/oradata/test/tools01.dbf';
  SET NEWNAME FOR DATAFILE 8 TO '?/oradata/test/users01.dbf';
  SQL "ALTER DATABASE RENAME FILE ''/dev3/oracle/dbs/redo01.log''
      TO ''?/oradata/test/redo01.log'' ";
  SQL "ALTER DATABASE RENAME FILE ''/dev3/oracle/dbs/redo02.log''
      TO ''?/oradata/test/redo02.log'' ";
SET UNTIL TIME 'Nov 15 2002 09:00:00';
RESTORE DATABASE;
  SWITCH DATAFILE ALL;
  # recover the database
  RECOVER DATABASE;
}
EXIT
7) last and final step
RMAN> ALTER DATABASE OPEN RESETLOGS;
 hope this helps you..........


check this doc for more info...........

http://download.oracle.com/docs/cd/B12037_01/server.101/b10734/rcmrecov.htm
0
 
mgfergAuthor Commented:
It does, thanks so much for the help. We've managed in the interim to recover data a different way. I would like to test this though (and document), should this happen again.

(btw, the backup we have is the entire db directory with all the file extensions as listed above)
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now