5 Replies Latest reply: Jan 7, 2013 3:47 PM by Vite DBA RSS

    Restore an APEX app from full exp or from db files.


      Since 20 days, I'm trying to find a way to recover my APEX application that I built during 10 months.

      In the first time, I tried to recover, repair, restore...etc. my corrupted database 11g1 without success, in the end with nerves, I delete everything and reinstalled 11g2.
      Before to delete, I copied all db files including the corrupted one (system01.dbf).

      I had wrote a script in order to export after any big change in my DB, a full database (using exp tool).

      So now, What I have is :

      1 - New and clean database.
      2 - Last full export from the older one.
      3 - All db files of the old database (noarchivelog).

      I can import my schema that I used in my APEX app to contain data and objects (tables, sequences, triggers, views, packages, functions and procedures).
      But, I can't restore the APEX app.

      Is there any way to recover my app from the export or from dbfiles ?

      Best regards,
        • 1. Re: Restore an APEX app from full exp or from db files.
          Vite DBA

          I'm a little confused. It seems from your post that you were previously working on Oracle 11.1 and since you did a reinstall you have moved to version 11.2. Is this correct? Also, can you confirm that your export was done using the old export/import tool or using data pump.

          Some points to note.

          <li> when recovering a database, its best to keep the same exact versions. This applies to both db file based recoveries as well as export.
          <li> if it is your system tablespace that was corrupted then recovering from the corrupted files will probably not work.
          <li> It is possible to recover a database from a full export (legacy export or data pump). As stated, you should be using the same version. Basically you create a bare bones database with no applications or Apex and do a full import into that. The area that you do this into should have the same file paths etc available. I'm sure you can find some resources on the internet around that will explain more explicitly how to do this.

          • 2. Re: Restore an APEX app from full exp or from db files.
            Hi Andre,

            thank you for your response.

            Yes, it's right. I was working with 11g1 before the crash.
            When I deleted everything, at this moment, I did'nt find the 11g1 in my workstation and in oracle download too.
            So, I just reloaded the 11g2.
            That's why.

            Yes again for the export. I just used 'exp' command. It's was the first thing on my mind where I decided to export.

            I tried to recover the datbase without success. I searched during all this period in the internet. Nothing helped me.
            So, I deleted everything.

            I tried also to import the full export into new database.

            I will try to create a bare bones database as you said, in 11g2.
            I don't know if the full export will work with this version.

            Best regards,
            • 3. Re: Restore an APEX app from full exp or from db files.
              Vite DBA

              I'm not confident this will work. I would prefer that a full database import is done against he same version.

              11.1 isn't available for download any more but you can get it if you have a valid support license.

              Apart from that I don't think you have any options.

              • 4. Re: Restore an APEX app from full exp or from db files.
                No, I don't have license. It's for my private use (private apps, learning...etc).

                Thanks for you.
                • 5. Re: Restore an APEX app from full exp or from db files.
                  Vite DBA

                  it's probably too late now, but for future reference you should keep the following points in mind.

                  <li> The export and import utilities have been deprecated and are only kept for backwards compatability. They have been replaced by data pump.
                  <li> Export/import/data pump have never been considered a robust solution for database backups. They are primarily used for moving data between oracle databases and for taking snapshots of data, mainly at the table or schema level.
                  <li> For database backup and recovery, Oracle supplies a tool called RMAN (Recovery MANager). If you are using standard OS files for DB files, then you can backup a database by copying the files at the OS level, but RMAN gives you many more options.
                  <li> Apex gives you options for exporting individual applications and workspaces.

                  For a setup like yours, where you are using it primarily for investigation and learning purposes on Apex, you can probably get away with not backing up the database in full and instead rely on schema exports and Apex application and workspace exports. They are simpler to implement and are the only elements you can't rebuild should you lose your whole database, as in your case. Of course, if you wish to learn more about database administration and backup/recovery, then go ahead and learn how to use RMAN as well. I say "as well" because RMAN is primarily used for backing up databases at the physical level, at the logical level of individual tables, schemas, Apex applications and workspaces, it is useful to have other forms of backups as well. For example, if you are working on an Apex application and you accidentally delete a page, then it is much simpler and less disruptive on other users to simply import a backup of the application than it is to recover the database to a point in time before you deleted the page.

                  Hope this helps.