1 2 Previous Next 22 Replies Latest reply: May 25, 2011 8:57 PM by 864194 RSS

    Database Recovery issue

    864194
      Good evening,

      Too make a long story short, on one of out servers we are running Windows 2008 Enterprise 64 bit with the Oracle 11g database. We almost lost the data but luckily the only thing that was corrupted was the OS. We reinstall the OS and the data from the database is still intact. but of course the windows registry was completely wiped out. When reinstalling the database it changed the Data drive on the server from E: to D:

      I am only a Sys Admin and clearly they have me doing DBA work. What I am trying to find out is if it is possible for me to take the old database files (oradata folder, dbs, etc) and just copy then into the new 11g database. I only did the install software only since I want to see if I can copy the files over the server recognize the information. Any help would be greatly appreciated because I am clearly out of my league but willing to learn. Thank you for your help.
        • 1. Re: Database Recovery issue
          AliD
          No. Changing the path requires changing the metadata and control file. It's not hard to do but why bother? Just leave the oracle directories where they were.
          • 2. Re: Database Recovery issue
            864194
            Well I renamed the old folder and installed the new database. Since the drive lettering has changed I figure I will have to modify something because if the old files were point to E:\... and are now pointing to D:\... then I will have to modify something I just have no clue on what.
            • 3. Re: Database Recovery issue
              sb92075
              When reinstalling the database it changed the Data drive on the server from E: to D:
              start again but this time mount the Oracle drive as D:\
              • 4. Re: Database Recovery issue
                AliD
                The binaries are not important as long as you set up the registry correctly. What matters is the path to control files/datafiles/log files are not what was before. As such, you must change the pfile to fix controlfiles location, then startup mount the database and rename all datafiles and redo logs. Then you can open the database.

                It's not easy for someone without experience. Just leave the drive letters and folders as they were before.
                • 5. Re: Database Recovery issue
                  Hemant K Chitale
                  When reinstalling the database it changed the Data drive on the server from E: to D:
                  I think that you created the database. Creating the database is different from installing the software (which is the binaries).

                  What you need is only installation of the software followed by restoration of the previous database. (On Windows, you also have to create the Oracle Service to startup the database instance).

                  RDBMS Software is what files are copied into the %ORACLE_HOME% (Executables, parameter files, configuration files etc).
                  The Database is the actual datafiles (normally created with a .DBF extension or .ORA extension) and control files (.DBF or .ORA or .CTL normally) and Redo Log files (.DBF or .ORA or .LOG).
                  You need to restore the database back to the location it was originally present in.
                  You also need the database parameter file (initSID.ora or spfileSID.ora {where SID is the database instance name} in %ORACLE_HOME%\database) to be restored or manually recreated if it wasn't available in the backups.


                  Hemant K Chitale
                  • 6. Re: Database Recovery issue
                    NikolayIvankin
                    In few words - you want to start DB with old files, but at different location?

                    Edited by: Skalny on 25.05.2011 9:34
                    • 7. Re: Database Recovery issue
                      864194
                      I never mounted anything for the database. Is this something in one of the utilities that I will have to use to perform this?
                      • 8. Re: Database Recovery issue
                        864194
                        Correct. I figure I would just move over the file that I need so I can bring up the database and delete the old location since there will be no relocation in the windows registry.
                        • 9. Re: Database Recovery issue
                          864194
                          Hey Hemant,


                          I did not create the database. I only did the "install software only" option since my data is still on the hard drive. Is this restoration tool in an application that comes with 11g?
                          • 10. Re: Database Recovery issue
                            NikolayIvankin
                            861191 wrote:
                            Correct. I figure I would just move over the file that I need so I can bring up the database and delete the old location since there will be no relocation in the windows registry.
                            Do you have PFILE of this DB?

                            If yes:
                            - Modify it to point to new locations of controlfiles.
                            - STARTUP MOUNT PFILE='..';
                            - get datafile names by queriing v$datafile
                            - modify them by ALTER DATABASE RENAME FILE 'old_name' to 'new_name';
                            - get logfile names by queriing v$logfile;
                            - modify them by ALTER DATABASE RENAME FILE 'old_name' to 'new_name';
                            - open database;

                            If no:
                            - use 'dumb' pfile, edit it to meet your parameters and point to required controlfiles;
                            and do the same procedure.


                            Use this link to get more info about moving datafiles http://www.oracle-base.com/articles/misc/RenamingOrMovingOracleFiles.php


                            Don't forget to modify DB_RECOVERY_FILE_DEST parameter!!!

                            Edited by: Skalny on 25.05.2011 14:33
                            • 11. Re: Database Recovery issue
                              12cdb
                              Presuming the database data files, control file and redo logs are intact.

                              1. You need to install the oracle binaries ( Same version as earlier).
                              2. Create the same directory structure and copy all database data files, control files and online redo log to their previous location.
                              3. Take the old init<SID>.ora file and copy it to the new ORACLE_HOME/dbs/ location.
                              4. Start the database with SQL>Startup pfile=ORACLE_HOME\dbs\init.ora

                              HTH.
                              • 12. Re: Database Recovery issue
                                864194
                                Presuming the database data files, control file and redo logs are intact.


                                2. Create the same directory structure and copy all database data files, control files and online redo log to their previous location.

                                This part doesn't make any sense. You mean that once I install the software, that I have to move the oradata files, recovery files, etc to the NEW location FROM the previous location? Doesn't make sense for them to stay in the old folder location.
                                • 13. Re: Database Recovery issue
                                  Hemant K Chitale
                                  I wonder why you keep saying that you "installed the database". You installed the software only. Again, there was no reason to install the software in a different directory.


                                  You can just restore the database as long as they are from a consistent backup. How you restore depends on how the backup was done. OS copy commands ? RMAN ? Third party utilities ?


                                  Hemant K Chitale
                                  • 14. Re: Database Recovery issue
                                    864194
                                    Sorry Hemant,

                                    I meant to say install the software only. As for backups..we didn't really have backups setup yet since this was a dev box which is why I have to result in reloading the data files.

                                    I thought I would have to install it into a different directory since the root of the drive changed. So you think that if I uninstall and reinstall back over the same directory I might be able to recover the data?
                                    1 2 Previous Next