Oracle 11g XE – How to Install and Use Data Files from Another Instance

installationoracle-11goracle-xe

I installed Oracle 11g XE in Windows 7 x64, then Windows 8.1 (install new OS, not perform an upgrade of the previously Windows 7 x64 installation). Can be possible to install Oracle 11g XE over the existing directory to use the database that was created with Windows 7 like Postgres do when the Data Directory exists?

Best Answer

I see no reason you can't do this.

Typically, you would perform the following steps.

  1. Move the *.dbf files found in %ORACLE_BASE%\oradata\ to a safe place.
  2. Move the files found in %ORACLE_BASE%\fast_recovery_area\ to a safe place.
  3. Move the spfile found in %ORACLE_HOME%\database\spfileXE.ora to a safe place.
  4. Install a new Oracle instance and
  5. Configure it with oracle-xe configure command.
  6. Shut the instance down.
  7. Move the data files, control file, spfile and online redo log files back to their previous locations.
  8. Star the instance.

You would also need to make sure that you specified the same settings during installation as you used with your previous database (ORACLE_HOME, ORACLE_SID, listener port etc.), otherwise your instance won't start. Ideally I would recommend you doing silent installation with response files (described in Oracle Database Express Edition Installation Guide for Microsoft Windows). This would ensure that you've used the same settings across operating system upgrades/reinstall.