Previous Topic: Review the PrerequisitesNext Topic: Restore Control Files


Restore Tablespaces

If a database tablespace is lost or corrupted, you can restore it by performing a File-Level Recovery. After the file-level recovery is successful, you have to manually recover the tablespace.

Follow these steps:

  1. Log in to the target machine as a root user.
  2. Make sure that the database is available.
  3. Take the required tablespace offline.

    Example: Consider that the name of the tablespace is MYTEST_DB. Enter the following command to take the tablespace offline:

    $ sqlplus "/ as sysdba"
    SQL> alter tablespace MYTEST_DB offline;
    
  4. List all data files for the specified tablespace MYTEST_DB.
    SQL> select file_name, tablespace_name from dba_data_files where tablespace_name='MYTEST_DB';
    
    FILE_NAME
    
    --------------------------------------------------------------------------------
    
    TABLESPACE_NAME
    
    ------------------------------
    
    /opt/oracle/oradata/lynx/MYTEST_DATA01.dbf
    
    MYTEST_DB
    
  5. Restore the data files of tablespaces using the Restore Wizard. For more information on the restore process, see How to Perform a File-Level Recovery on Linux Nodes.
  6. Specify the following information on the Restore Wizard and submit the job:
    1. When you select the files and folders, enter the required data file name of the tablespace and search.

      Example: Enter "MYTEST_DATA01.dbf" of the tablespace "MYTEST_DB" and search.

    2. On the Target Machine page, enter the following information:
      • Select Restore to original location.
      • Enter the hostname or IP address of the target Oracle Server.
      • Enter the root user name and the password of the target Oracle Server.
      • Select Overwrite existing files for the Resolving Conflicts option.
  7. After the data file is restored, recover the tablespace of the Oracle database.
    SQL>recover tablespace MYTEST_DB;
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    Auto
    
  8. Make the specified table space online.
    SQL>alter tablespace MYTEST_DB online;
    

The tablespace is successfully recovered.