> For the complete documentation index, see [llms.txt](https://documentation.atempo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.atempo.com/tina-4.9.5/tina-4.9.5-en/administration-guide/restore/oracle.md). Agents can also search and read this documentation through its [MCP server](https://documentation.atempo.com/~gitbook/mcp).

# Oracle

### Restoring a Partial Clone

Tina for Oracle lets you restore a partial clone of a production database. Available for Unix and Linux systems, Oracle partial clone restore works on both 32-bit and 64-bit platforms. Key features include:

* Full and incremental hot backup to tape or virtual tape without an additional export procedure.
* Display of all non-system user tables and indexes with their associated tablespaces.
* Visual selection of the clone scope using the user's schema.
* Simplified redirection of database objects to a single directory on the clone.
* Automatic generation of restore and recovery scripts.
* Two-step procedure offering optional fine-tuning.
* Cloned database available online to recover tables or rows from a previous point in time, letting you:
  * Deal with incidents without losing recent transactions.
  * Calculate and report offline data aggregates at a specific point in time.

### Configuring Partial Clone Restore

To use partial clone restore, you must configure Tina as described below. This additional configuration can only be performed once the initial Tina for Oracle configuration for creating backups has been completed, as described in [<mark style="color:blue;">Create an Oracle Application</mark>](#create-an-oracle-application) with the appropriate environment variables based on the source database. Before continuing, make sure you can open and view the full tree using the Restore and Archive Interface. See <mark style="color:blue;">Connecting to the Restore and Archive Interface.</mark>

#### Spfile

> **Note**: The Oracle database must be started with the spfile in order to use partial clone restore.

If the Oracle database is started with the spfile, the \_SPARAMS meta-directory appears in the Oracle meta-tree. Otherwise, this means the database was started with the pfile, in which case you cannot use partial clone restore. You can create an spfile using sqlplus commands, but you will need to restart the database for the file change to take effect:

<kbd>SQL> CONNECT SYS/SECRET AS SYSDBA;</kbd>

<kbd>SQL> CREATE SPFILE FROM PFILE;</kbd>

<kbd>SQL> STARTUP FORCE;</kbd>

You must be connected with sysdba rights to run these commands.

> **Note**: If you are unable to run the database in production mode using its spfile, you can manually generate a pfile from the spfile, and then restart the database by specifying the location of this pfile. To specify the pfile location in Tina, set the TINA\_ORA\_STARTUP\_PFILE variable.

#### Displaying Contents

The next step is to enable a new feature in the Oracle application's meta-tree that displays all user tables and indexes in the database, sorted by schema or user name, then by table or index name, then by partition name, if applicable.

To do this, set the TINA\_ORA\_SHOW\_CONTENTS environment variable to <kbd>Yes</kbd> or <kbd>True</kbd>. Edit this variable in the Information meta-directory of the Restore and Archive Interface. Check that user objects and their associated tablespaces now appear in the CONTENTS meta-directory. Perform a full or incremental backup of the database after this change. The meta-links inside the meta-directory and their associated tablespaces must be backed up in the application folder.

#### Destination Application

The last step is to create a second Oracle application on the\
destination system. You can associate the source and destination applications with the same system, but two separate applications are required. Partial clone restore is based on cross-restore, in which two application backup folders must be specified: one for the source, one for the destination.\
Both systems must use the same versions of Oracle, Tina, and the operating\
system. The absolute directory paths and disk configuration can differ between the two systems.

**Create and Configure the Destination Application**

1. Log in to the Web Administration and open your catalog in the Tina explorer.
2. Choose Platforms Applications. The Applications panel opens.
3. Click the New Application button to launch the Application Creation Wizard.
4. Define the Oracle application's settings. This table describes the settings you can define to create a destination Oracle application:

<table><thead><tr><th width="250.66668701171875">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>System Selection</strong></td><td>Enter the name of the destination system, for example <code>lambda.ora</code>.</td></tr><tr><td><strong>Application Type</strong></td><td>Select the Oracle application.</td></tr><tr><td><strong>Owner and Password</strong></td><td>Enter the owner's name, for example <code>oracle</code>, and their password.</td></tr><tr><td><strong>Access User and Password</strong></td><td>Enter the user's name, for example <code>SYS</code>, and their password.</td></tr><tr><td><strong>Environment Variables</strong></td><td>Edit the <code>Path</code> environment variable for the Oracle dynamic library (<code>TINA_APP_LIB_PATH</code>) with the appropriate Connect DLL name, for example <code>libtina_ora_101.so</code>.</td></tr></tbody></table>

See [<mark style="color:blue;">Create an Oracle Application</mark>](#create-an-oracle-application) for more information on all the settings to define.

5. Carefully review the Application Settings Summary and click Finish to create the application.
6. Launch the Restore and Archive Interface as the oracle user on the newly created application. This tests the connection between the server hosting the catalog and the lambda destination system, as well as the loading of the Connect DLL, which in turn loads the Oracle DLLs. If the Restore and Archive Interface does not open, check the events as well as the local Tina service environment.
7. Edit the following environment variables in the <kbd>Information</kbd> meta-directory of the Restore and Archive Interface:

This table describes the environment variables you can set in the <kbd>Information</kbd> meta-directory:

<table><thead><tr><th width="229.66668701171875">Variable</th><th>Description</th></tr></thead><tbody><tr><td><strong>ORACLE_BASE</strong></td><td>Optional.</td></tr><tr><td><strong>ORACLE_HOME</strong></td><td>Defines the Oracle installation path on the destination system. This path can differ from that of the source system.</td></tr><tr><td><strong>ORACLE_SID</strong></td><td>Defines the instance name for the new database as well as the database name. The variable's value must differ from the value used on the source system.</td></tr><tr><td><strong>TINA_ORA_DEST_DIR</strong></td><td>Defines the absolute path of a directory with enough disk space to restore the datafiles, archived logs, and other objects to. Do not use <code>/tmp</code> or <code>/var/tmp</code>. The directory will be created during the restore if necessary. The Oracle access user must have write permissions on this directory.</td></tr></tbody></table>

Connection attempts will always fail during this phase because the database has not yet been created.\
For more details on creating the clone, see [<mark style="color:blue;">Restore and Recovery of an Oracle Partial Clone</mark>](#restore-and-recovery-of-an-oracle-partial-clone)<mark style="color:blue;">.</mark>

## Restore and Recovery

This topic describes how to perform restore and recovery of backed-up\
data.

### Prerequisite

Check that the Oracle database is active using the command:

<kbd>ps -ef | grep ora</kbd>

You will see several processes with the appropriate Oracle SID.

#### Create an Oracle Application

1. Log in to the Web Administration and open your catalog in the Tina explorer.
2. Choose Platforms Applications. The Applications panel opens.
3. Click the New Application button to launch the Application Creation Wizard.
4. Define the Oracle application's settings. This table describes the settings you can define to create an Oracle application:

<table><thead><tr><th width="219.6666259765625">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>System Selection</strong></td><td>Select the system on which the Oracle server is installed.</td></tr><tr><td><strong>General Information</strong></td><td>—</td></tr><tr><td><strong>Application Name</strong></td><td>Enter the name of the new application. The application name corresponds to the name assigned to the application's backup folder. This name can be changed later without losing backups.Each application must have a unique name.</td></tr><tr><td><strong>Application Type</strong></td><td>Select the Oracle application.</td></tr><tr><td><strong>Comment</strong></td><td>Optional. Enter a comment describing the application.</td></tr><tr><td><strong>User Information</strong></td><td>—</td></tr><tr><td><strong>Owner</strong></td><td><p>Enter the name of the operating system user under which the Oracle software was installed and under which the database creation script was run. It can be different from the DBA account.This is the user who owns the datafiles, control files, and redo logs.Examples:</p><p>• Windows: <code>administrator</code></p><p>• Unix: <code>oracle</code>The owner does not need any special rights in Tina. Even if it does not exist as a Tina user, it inherits the default rights.For Oracle 9i on HP-UX: the <code>dba</code> group must have the MLOCK privilege. As <code>root</code>, run: <code>setprivgrp dba MLOCK</code>.</p></td></tr><tr><td><strong>Password and Confirmation (owner)</strong></td><td>Enter the owner's password and confirm it.</td></tr><tr><td><strong>Access User</strong></td><td>Enter the name of the Oracle user to use to connect to the database. This is usually <code>SYS</code>.</td></tr><tr><td><strong>Password and Confirmation (access)</strong></td><td>Enter the access user's password and confirm it.</td></tr><tr><td><strong>Environment Variables</strong></td><td>—</td></tr><tr><td><strong>Oracle Installation Directory</strong></td><td><p>Enter the directory where Oracle is installed.Examples:</p><p>• Windows: <code>d:\oracle\product\9.0.1d:\oracle\product\10.2.0\db_1</code></p><p>• Unix: <code>/export/home/oracle/product/9.0.1/export/home/oracle/product/10.2.0\db_1</code>Make sure the path does not end with <code>/</code>.The directory must be identical to the <code>ORACLE_HOME</code> variable (case-sensitive). This is an Oracle prerequisite.</p></td></tr><tr><td><strong>Optional Environment Variables</strong></td><td><p>To add an optional variable:</p><p>1. Click Add and select Add an Optional Environment Variable.</p><p>2. Select the variable in the Name tab. The definition appears in the Details tab.</p><p>3. Click Apply and Close.</p><p>4. Enter the value in the Value column (e.g., <code>Optionnelle (3/13)</code>).</p><p>If you do not remember the value you can enter, hover your mouse over the variable name to display a popup with information about this variable.<br>To edit an optional variable, click the variable's value in the list and enter the new value.<br>To remove an optional variable, select the variable in the list and click Remove.<br>For a detailed list of the environment variables available<br>for the Oracle application, see <a href="https://documentation.atempo.com/tina-4.9.5/tina-4.9.5-en/administration-guide/settings/environment-variables.md"><mark style="color:blue;">Tina for Oracle Environment Variables.</mark></a><br>You can also set environment variables using<br>the Restore and Archive Interface.</p></td></tr><tr><td><strong>User-Defined Environment Variables</strong></td><td><p>A user-defined variable does not appear in the existing list.To add one:</p><p>5. Click Add → user-defined variable.</p><p>6. Enter the name in the Name column.</p><p>7. Enter the value in the Value column.</p></td></tr></tbody></table>

### Loss of Datafiles

If you free up disk space, you may accidentally delete files you need to keep. A disk failure can also require you to restore datafiles.

#### Loss of a Non-Critical Datafile, Hot Restore

A non-critical datafile is a datafile that can be out of service without the database itself being out of service.\
You can restore and recover the datafile in the Present, without needing to stop the database. This process is called hot restore.\
To test the restore procedures, simulate the loss of a datafile from a non-essential tablespace, that is, not a system tablespace and not a tablespace containing active rollback segments. Simply remove it from the database, rename it, or compress it while the database is running.

> **Note**: Windows. The operating system may prevent a file from being deleted if the database is running. You must therefore take the datafile or its tablespace offline:\
> stop the database, delete the datafile, then restart the database.

**Restore and Recover a Non-Critical Datafile**

1. Open the Restore and Archive Interface. Set a browsing period and check the Show Missing Files box.
2. Open the appropriate tablespace. The datafile and its meta-link appear hatched, meaning the datafile is missing. An orange alert message appears above the hatched datafile, indicating that a datafile was not found. At the same time, a warning message appears in the Web Administration events. This image shows a browsing period set in the past in the Restore and Archive Interface. A datafile and its meta-link appear hatched to indicate that the datafile is missing:

<figure><img src="https://137371609-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HOI4mniMS7pDfClN83G%2Fuploads%2Fgit-blob-a1385eb0b285395ce09d03c252a7f5482773e3ec%2Fimage%20(280).png?alt=media" alt=""><figcaption></figcaption></figure>

3. Check the datafile and its destination meta-link (or simply the tablespace) and choose Restore Run to restore the most recent backup of the datafile from the catalog.

> **Note**: The datafile and its meta-link are no longer hatched but display the orange status. This color indicates that the restored datafile requires media recovery to be synchronized with the rest of the database.

Meanwhile, an activity report in the events shows that Tina automatically took the datafile offline to notify Oracle of the change (unless you have already done so yourself). Oracle does not take a datafile offline even if it is informed that the datafile is missing when an application needs it.

4. Using a file manager or any other appropriate tool, check that the datafile was restored to its original location with the date of the previous backup.
5. Perform a recovery of the datafile or tablespace using SQL*Plus. Refresh the meta-tree by choosing Tree Refresh to display the offline (red) status of the datafile.*
6. *Use SQL*Plus to bring the datafile or tablespace online. Refresh the meta-tree by choosing Tree Refresh to obtain the online (green) status.

**Example**. These are the commands used by Oracle9i to recover the datafiles. In this case, the Oracle9i version needs the archived logs:

```
calvin.oracle(6) [ ~ ] compress /appli/oradata/TEST901/tools01.dbf
calvin.oracle(7) [ ~ ] sqlplus /nolog

SQL*Plus: Release 9.0.1.0.0 - Production on Mon Dec 10 11:37:27 2001
(c) Copyright 2001 Oracle Corporation.  All rights reserved.

SQL> connect sys as sysdba
Enter password:
Connected.
SQL> alter tablespace tools online;
alter tablespace tools online
*
ERROR at line 1:
ORA-01113: file 6 needs media recovery
ORA-01110: data file 6: '/appli/oradata/TEST901/tools01.dbf'

SQL> recover tablespace tools;
ORA-00279: change 243957 generated at 11/22/2001 21:50:07 needed for thread 1
ORA-00289: suggestion : /cache3/oradata/TEST901/archive/arch1_0000001933.dbf
ORA-00280: change 243957 for thread 1 is in sequence #1933

Specify log: {=suggested | filename | AUTO | CANCEL}
AUTO
ORA-00279: change 244886 generated at 11/23/2001 23:31:43 needed for thread 1
ORA-00289: suggestion : /cache3/oradata/TEST901/archive/arch1_0000001934.dbf
ORA-00280: change 244886 for thread 1 is in sequence #1934
ORA-00278: log file '/cache3/oradata/TEST901/archive/arch1_0000001933.dbf' no longer needed for this recovery

ORA-00279: change 245886 generated at 11/25/2001 03:57:13 needed for thread 1
ORA-00289: suggestion : /cache3/oradata/TEST901/archive/arch1_0000001935.dbf
ORA-00280: change 245886 for thread 1 is in sequence #1935
ORA-00278: log file '/cache3/oradata/TEST901/archive/arch1_0000001934.dbf' no longer needed for this recovery

ORA-00279: change 246886 generated at 11/26/2001 08:22:43 needed for thread 1
ORA-00289: suggestion : /cache3/oradata/TEST901/archive/arch1_0000001936.dbf
ORA-00280: change 246886 for thread 1 is in sequence #1936
ORA-00278: log file '/cache3/oradata/TEST901/archive/arch1_0000001935.dbf' no longer needed for this recovery

Log applied.
Media recovery complete.

SQL> alter tablespace tools online;
Tablespace altered.

SQL>
```

#### Corrupted Datafile, Hot Restore

If a datafile is corrupted but still exists, additional steps are required to restore it. Using the Restore and Archive Interface in the Present, you can only restore objects that are missing, hence the need to synchronize in the past to overwrite an existing object. Tina prevents you from hot-restoring an object that is currently online: only offline objects can be overwritten. The datafile must therefore be explicitly taken offline by the administrator. This protection would not be effective if the datafile were missing. You do not need to stop the database before restoring and recovering a raw datafile in the Present. This is a hot restore. To test the restore procedures, simulate the corruption of a datafile by simply overwriting it while the database is running. Choose a datafile whose tablespace is not essential, that is, avoid using a system tablespace or a tablespace containing active rollback segments.

**Restore and Recover a Corrupted Datafile**

1. Take the corrupted datafile or the tablespace it belongs to offline (with the immediate option in the case of a tablespace) so Oracle does not attempt to write to it.
2. Open the Restore and Archive Interface to display the application's meta-tree. Open the appropriate tablespace: the datafile and its meta-link should be displayed in orange, meaning the datafile requires media recovery.
3. Select the datafile and choose Tree Version Selection to view the versions known in the catalog.
4. Select the most recent available backup and synchronize the meta-tree to its backup date by clicking Synchronize. This image shows the meta-tree displayed in the Restore and Archive Interface, now matching the objects known and backed up at that date:

<figure><img src="https://137371609-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HOI4mniMS7pDfClN83G%2Fuploads%2Fgit-blob-06951fc6e0bf4e137882c337ead97b9e88fb8892%2Fimage%20(58).png?alt=media" alt=""><figcaption></figcaption></figure>

5. Check the datafile and the meta-link's destination and choose Restore Run to restore the datafile.

   > **Note**: Once the restore is complete, the Restore and Archive Interface remains synchronized in the Past. Click Present to return to the present.
6. Using a file manager or any other appropriate tool, check that the datafile was restored with the date of the previous backup.
7. Perform a recovery of the datafile or tablespace using Oracle SQL\*Plus.
8. Refresh the meta-tree by choosing Tree Refresh to display the offline (red) status of the datafile.
9. Use Oracle SQL\*Plus to bring the datafile or tablespace online.
10. Refresh the meta-tree by choosing Tree Refresh to obtain the online (green) status.

**Example**. These are the commands used to restore and recover a corrupted datafile:

```bash
[oracle@cesar oracle]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Oct 19 17:12:09 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.

SQL> connect / as sysdba
Connected.

SQL> alter database datafile
'/Appli/oracle/oradata/TEST102/TEST102/users01.dbf' offline;
Database altered.

SQL> alter database datafile ERROR at line 1:
ORA-01113: file 4 needs media recovery
ORA-01110: data file 4: '/Appli/oracle/oradata/TEST102/TEST102/users01.dbf'

SQL> recover datafile '/Appli/oracle/oradata/TEST102/TEST102/users01.dbf'
Media recovery complete.

SQL> alter database datafile
'/Appli/oracle/oradata/TEST102/TEST102/users01.dbf' online;
Database altered.

'/Appli/oracle/oradata/TEST102/TEST102/users01.dbf' online;
alter database datafile '/Appli/oracle/oradata/TEST102/TEST102/users01.dbf'
online
*
```

#### Loss of a System Datafile, Cold Restore

To test the restore procedures, simulate the loss of a system datafile by removing it from the database, renaming it, or compressing it while the database is running.

> **Note: Windows.** The operating system may prevent you from deleting a file if the database is running, so you must stop the database to delete the datafile.

However, it is not possible to hot-restore a system datafile because the system tablespace is critical to the database's operation (it contains, among other things, the data dictionary). You must therefore stop the database and cold-restore the missing file.\
The Restore and Archive Interface cannot connect to the Oracle database, so the meta-tree is empty in the Present. You must enable the display of missing files and expand the meta-tree, which then displays the information stored in the Tina catalog. You can then browse the meta-tree in the same way as in the Present. However, all objects are hatched, as if the entire contents of the meta-tree were missing.

**Restore and Recover a System Datafile**

1. Use SQL\*Plus to stop the database.
2. Check that the system datafile is indeed missing. The database is mounted (to prepare for recovery) but cannot be opened.
3. Open the Restore and Archive Interface. Set a browsing period and check the Show Missing Files box. A warning icon appears at the top of the meta-tree and a message indicates that the connection failed.
4. Open the system tablespace and check the physical address of the missing datafile from its meta-link.

This image shows the tablespace and the physical address of the missing datafile:

<figure><img src="https://137371609-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HOI4mniMS7pDfClN83G%2Fuploads%2Fgit-blob-81f5cf26c32885c8a169078c3608b32bce0f7c83%2Fimage%20(59).png?alt=media" alt=""><figcaption></figcaption></figure>

5. Check the datafile and its destination meta-link (or simply the system tablespace if it only has one datafile) and choose Restore Run to restore the most recent backup of the datafile available in the catalog.
6. Using a file manager or any other appropriate tool, check that the datafile was restored to its location with the date of the previous backup.
7. Recover the datafile using SQL\*Plus. Oracle will not let you specify a recovery tablespace command if the database is closed.
8. Open the database and refresh the meta-tree by choosing Tree Refresh to reconnect to the database and view the online (green) status of the system tablespace.

**Example**. These are the commands used to restore and recover a system datafile:

```sql
SQL> shutdown abort
ORACLE instance shut down.

SQL> startup
ORACLE instance started.
Total System Global Area 281018368 bytes
Fixed Size 1218944 bytes
Variable Size 83887744 bytes
Database Buffers 188743680 bytes
Redo Buffers 7168000 bytes

/Appli/oracle/oradata/TEST102/archives/1_40_579977159.dbf
ORA-00280: change 1728245 for thread 1 is in sequence #40
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

ORA-00279: change 1728305 generated at 10/19/2006 16:24:07 needed for thread 1
ORA-00289: suggestion :
/Appli/oracle/oradata/TEST102/archives/1_41_579977159.dbf
ORA-00280: change 1728305 for thread 1 is in sequence #41
ORA-00278: log file '/Appli/oracle/oradata/TEST102/archives/1_40_579977159.dbf'
no longer needed for this recovery
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

ORA-00279: change 1729077 generated at 10/19/2006 16:46:11 needed for thread 1
ORA-00289: suggestion :
/Appli/oracle/oradata/TEST102/archives/1_42_579977159.dbf
ORA-00280: change 1729077 for thread 1 is in sequence #42
ORA-00278: log file '/Appli/oracle/oradata/TEST102/archives/1_41_579977159.dbf'
no longer needed for this recovery
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

Log applied.
Media recovery complete.

SQL> alter database open;
Database altered.

Database mounted.
ORA-01157: cannot identify/lock data file 1 - see DBWR trace file
ORA-01110: data file 1: '/Appli/oracle/oradata/TEST102/TEST102/system01.dbf'

SQL> recover datafile '/Appli/oracle/oradata/TEST102/TEST102/system01.dbf'
ORA-00279: change 1728245 generated at 10/19/2006 16:23:45 needed for thread 1
ORA-00289: suggestion :
```

#### Loss of Multiple Datafiles, Cold Restore

If several datafiles are lost or corrupted, it is often faster to restore the tablespaces they were in rather than waste time trying to figure out exactly which datafiles need to be restored.\
If you use the cold restore method for a datafile, you will perform a restore and a recovery. The recovery can take a long time if there are many archived redo logs. You then need to open the database, and Oracle will warn you that a datafile is missing. You must then restore it and apply all the archived redo logs a second time.\
To test the restore procedures, simulate the loss of several datafiles by removing them from the database, renaming them, or compressing them while the database is running.

> **Note: Windows.** The operating system may prevent you from deleting a file if the database is running, so you must stop the database to delete the datafile.

**Restore and Recover Multiple Datafiles**

1. Use SQL\*Plus to stop the database.
2. Check that at least one datafile is indeed missing or corrupted. The database is mounted (to prepare for recovery) but cannot be opened.
3. Open the Restore and Archive Interface. Set a browsing period and check the Show Missing Files box. A warning icon appears at the top of the meta-tree and a message indicates that the connection failed.
4. Check the <kbd>TABLESPACES</kbd> meta-directory (and therefore all tablespaces and datafiles) and choose Restore Run to restore the most recent backup of each datafile available in the catalog.

   > **Note**: In the events (Current Activity Events of the Web Administration), Tina calculated the oldest redo log that will be required by Oracle to perform a recovery.
5. Recover the entire database using SQL\*Plus.
6. Open the database and refresh the meta-tree by choosing Tree Refresh to reconnect to the database and see the online (green) status of the tablespaces.

**Example**. These are the commands used to restore and recover multiple datafiles:

```sql
SQL> select name from v$datafile;
NAME
------------------------------------------------------------------
/Appli/oracle/oradata/TEST102/TEST102/system01.dbf
/Appli/oracle/oradata/TEST102/TEST102/undotbs01.dbf
/Appli/oracle/oradata/TEST102/TEST102/sysaux01.dbf
/Appli/oracle/oradata/TEST102/TEST102/users01.dbf
/Appli/oracle/oradata/TEST102/TEST102/users02.dbf
/Appli/oracle/oradata/TEST102/TEST102/rcvcat.dbf

6 rows selected.

SQL> host
[oracle]$ compress /Appli/oracle/oradata/TEST102/TEST102/system01.dbf
[oracle]$ compress /Appli/oracle/oradata/TEST102/TEST102/users02.dbf
[oracle]$ exit
exit

SQL> shutdown abort
ORACLE instance shut down.

SQL> startup
ORACLE instance started.
Total System Global Area 281018368 bytes
Fixed Size 1218944 bytes
Variable Size 83887744 bytes
Database Buffers 188743680 bytes
Redo Buffers 7168000 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 1 - see DBWR trace file
ORA-01110: data file 1: '/Appli/oracle/oradata/TEST102/TEST102/system01.dbf'
SQL> recover database;
Media recovery complete.
SQL> alter database open;
Database altered.

```

### Loss of an Archived Redo Log

This topic contains the following information:

* [Hot Restore](#hot-restore)
* [<mark style="color:blue;">Replacement with an Active Redo Log</mark>](#replacement-with-an-active-redo-log)

#### Hot Restore

If one or more archived redo log files are lost from disk, you can restore them without stopping the database.\
To test the restore procedures, simulate the loss of a recent archived redo log by removing it from the database or renaming it. You must also delete a datafile that is not essential, that is, not from a system tablespace, nor from a tablespace containing active rollback segments, for which recovery will require the missing redo log file.

> **Note: Windows**. The operating system may prevent a file from being deleted if the database is active. You must therefore take the datafile or its tablespace offline: stop the database, delete the datafile, then restart the database.

**Restore and Recover an Archived Redo Log**

1. Open the Restore and Archive Interface. Set a browsing period and check the Show Missing Files box.
2. Open the tablespace containing the missing datafile. It appears hatched, as does its meta-link.
3. Select the missing datafile and choose Tree Version Selection to view the versions known in the catalog.
4. Select a backup version and synchronize the meta-tree to its backup date by clicking Synchronize.
5. Check the datafile and the meta-link's destination and choose Restore Run to restore the datafile. The datafile now displays the orange status to indicate it needs media recovery.

> **Note**: The Restore and Archive Interface remains synchronized in the Past. Click Present to return to the present.

> **Note**: If you attempt to recover the datafile or tablespace, Oracle asks for the missing redo log file. The recovery therefore fails.

6. Open the \_ARCHIVE\_LOGS meta-directory and check the missing, hatched archived redo log file, as well as its destination collector meta-link (located in the first position of the meta-directory).

   You may need to extend the browsing period to find the missing archived redo log file, if the database was backed up after the loss of the archived redo log.
7. Choose Restore Run to restore the archived redo log file.
8. Using a file manager or any other appropriate tool, check that the archived redo log file was restored to its original location.
9. Use Oracle Server Manager or SQL\*Plus to perform a proper recovery of the datafile or tablespace. Bring the datafile or tablespace online.
10. Refresh the meta-tree by choosing Tree Refresh to see the online (green) status.

**Example**. These are the Server Manager commands used to restore and recover an archived redo log:

```
Server Manager Commands
SVRMGR> host
charlie.oracle(1) [ ~ ] rm admin/DB73/arch/arch_179.log
charlie.oracle(2) [ ~ ] compress /export/home/oradata/DB73/ tools01.dbf
charlie.oracle(3) [ ~ ] exit

SVRMGR> recover tablespace tools;
ORA-00279: Change 8200 generated at 07/16/98 19:24:19 needed for thread 1
ORA-00289: Suggestion : /export/home/oracle/admin/DB73/arch/arch_179.log
ORA-00280: Change 8200 for thread 1 is in sequence #179
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
AUTO
ORA-00308: cannot open archived log
‘/export/home/oracle/admin/DB73/arch/arch_179.log’
ORA-07360: sfifi: stat error, unable to obtain information about file.
SVR4 Error: 2: No such file or directory

SVRMGR> host
charlie.oracle(1) [ ~ ] ls admin/DB73/arch/
arch_179.log arch_180.log arch_181.log arch_182.log
charlie.oracle(2) [ ~ ] exit

SVRMGR> recover tablespace tools;
ORA-00279: Change 8200 generated at 07/16/98 19:24:19 needed for thread 1
ORA-00289: Suggestion : /export/home/oracle/admin/DB73/arch/arch_179.log
ORA-00280: Change 8200 for thread 1 is in sequence #179
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
AUTO
Log applied.
ORA-00279: Change 8202 generated at 07/16/98 19:33:32 needed for thread 1
ORA-00289: Suggestion : /export/home/oracle/admin/DB73/arch/arch_180.log
ORA-00280: Change 8202 for thread 1 is in sequence #180
ORA-00278: Logfile ‘/export/home/oracle/admin/DB73/arch/arch_179.log’ no
longer needed for this recovery
Log applied.
Media recovery complete.

SVRMGR> alter tablespace tools online;
Statement processed.
SVRMGR>
```

#### Replacement with an Active Redo Log

> **Important**: Replacement with an active redo log file must only be performed by experienced Oracle and Tina users.

If you purge the destination directory for archived redo logs at the time of a log switch, you lose an archived redo log file on disk that has not been backed up.

The backup history can be seriously compromised as a result.\
A gap in an archived redo log sequence is a serious problem, because a recovery from a datafile backup version taken before the gap can no longer be performed to a point in time after the gap. Media recovery cannot skip a gap. It is therefore possible to lose all transactions made from the lost redo log onward in the event of an incident, until a new full backup is taken into account.

However, a complete active redo log file can be substituted for the archived version. Tina for Oracle backs up both, providing you with useful redundancy in this case.\
To test the restore procedures, simulate the loss of a recent archived redo log by removing it from the database or renaming it. You must then also delete a datafile that is not essential, that is, not from a system tablespace, nor from a tablespace containing active rollback segments, for which recovery will require the missing redo log file.

> **Note: Windows**. The operating system may prevent a file from being deleted if the database is running. You must therefore take the datafile or its tablespace offline: stop the database, delete the datafile, then restart the database.

**Restore and Recover with a Completed Active Redo Log**

1. Open the Restore and Archive Interface. Set a browsing period and check the Show Missing Files box.
2. Select the hatched redo log in the \_REDO\_LOGS meta-directory and choose Tree Version Selection to check that the last backed-up version has two non-empty SCN values in its attributes. When the second SCN value is empty, this means the redo log was the current log when the backup was taken and is still incomplete. Media recovery could not proceed beyond such a redo log, any more than beyond a gap.
3. Open the tablespace containing the missing datafile. The datafile and its meta-link appear hatched.
4. Select the missing datafile and choose Tree Version Selection to view the versions known in the catalog.
5. Select a version that will require the deleted redo log file during recovery and synchronize the meta-tree to its backup date by clicking Synchronize.
6. Check the datafile and its meta-link's destination and choose Restore Run to restore the datafile.
7. Open the \_REDO\_LOGS meta-directory in the Present and check the missing, hatched active redo log file, as well as the destination collector meta-link (in the first position of the meta-directory), which also points to the destination directory for archived redo logs.
8. Choose Restore Run to restore the substitute active redo log file.
9. Using a file manager or any other appropriate tool, check that the active redo log file was restored to the archive destination.
10. Use Oracle Server Manager or SQL\*Plus to perform a proper recovery of the datafile or tablespace. Bring the datafile or tablespace online.
11. Refresh the meta-tree by choosing Tree Refresh to see the online (green) status.

### Loss of Control Files

This topic contains the following information:

* [Loss of a Control File, Cold Restore](#loss-of-a-control-file-cold-restore)
* [Loss of All Control Files, Cold Restore](#loss-of-all-control-files-cold-restore)

#### Loss of a Control File, Cold Restore

If a control file is lost, the situation can easily be restored, provided the control file is mirrored. This happens, for example, after a failure of one of the disks containing a mirror of the control file.

If your control file is mirrored but on the same disk, you will need to recreate it.

> **Note**: It is best for your control file to be mirrored on separate disks, preferably with different controllers.

This involves restoring the mirror of a lost control file by copying a healthy control file\
from another disk.\
To test the restore procedures, simulate the loss of a control file by removing it from the database or renaming it.

**Restore and Recover a Control File**

1. Open the Restore and Archive Interface. Set a browsing period and check the Show Missing Files box.
2. Check that the missing control file appears hatched in the \_ CONTROL\_FILES meta-directory. An error message in the Web Administration events and in the event log indicates that a control file was not found.

   > **Important**: Do not restore the control file from the Restore and Archive Interface. The backed-up control file you would restore would not be synchronized with the other control files, and Oracle would not accept it.
3. Stop the database again and simply copy a healthy control file to the location where the lost control file was, using an appropriate operating system command, such as cp or dd.
4. Start the database and reconnect the Restore and Archive Interface to the database by choosing Backup View. The control file's meta-links now display the green (online) status.

**Example**. These are the Server Manager commands used to restore and recover a control file:

```sql
SVRMGR> select * from v$controlfile;
STATUS NAME
/home01/oradata/DBORA/control01.ctl
/home02/oradata/DBORA/control02.ctl
/home03/oradata/DBORA/control03.ctl
3 rows selected.

SVRMGR> host
charlie.oracle(1) [~] compress /home03/oradata/DBORA/control03.ctl
charlie.oracle(2) [~] exit

SVRMGR> shutdown abort
ORACLE instance shut down.

SVRMGR> startup
ORACLE instance started.
Total System Global Area 4438012 bytes
Fixed Size 48260 bytes
Variable Size 3971960 bytes
Database Buffers 409600 bytes
Redo Buffers 8192 bytes

ORA-00205: error in identifying control file '/home03/oradata/DBORA/control03.ctl’
ORA-07360: sfifi: stat error, unable to obtain information about file.
SVR4 Error: 2: No such file or directory

SVRMGR> shutdown abort
ORACLE instance shut down.

SVRMGR> host
charlie.oracle(1) [~] cp -p /home01/oradata/DBORA/control01.ctl /home03/oradata/DBORA/control03.ctl
charlie.oracle(2) [~] exit

SVRMGR> startup
ORACLE instance started.
Total System Global Area 4438012 bytes
Fixed Size 48260 bytes
Variable Size 3971960 bytes
Database Buffers 409600 bytes
Redo Buffers 8192 bytes
Database mounted.
Database opened.

SVRMGR>
```

#### Loss of All Control Files, Cold Restore

If all control file mirrors are lost, you can easily recreate them if all datafiles and active redo log files are intact.\
You may also want to recreate your control file to change certain sizing parameters that determine the size of a control file. For example, if you want to increase the maximum number of datafiles allowed in the database or change the size of the archived log history, perform a full hot backup of the database, close it properly, and then use the method described in Restore and Recover All Control Files.\
To test the restore procedures, simulate the loss of all your control files by removing them from the database or renaming them.

**Restore and Recover All Control Files**

1. Use Oracle Server Manager or SQL\*Plus to stop the database, since it cannot be closed properly if control files are missing.
2. Open the Restore and Archive Interface. Set a browsing period and check the Show Missing Files box. All objects in the \_CONTROL\_FILES meta-directory appear hatched because the database is no longer running. A warning icon appears at the top of the meta-tree and a message indicates that the connection failed. This image shows the meta-tree warning icon and the *CONTROL* FILES meta-directory with its hatched objects:

<figure><img src="https://137371609-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HOI4mniMS7pDfClN83G%2Fuploads%2Fgit-blob-d9d903d302290525c8f3ef05ce3829f60882151a%2Fimage%20(281).png?alt=media" alt=""><figcaption></figcaption></figure>

3. Select the control.sql meta-file and its destination collector meta-link (user dump) in the first position of the meta-directory, and choose Restore Run to restore the most recent backup of this script available in the catalog.
4. Change the directory to the udump destination directory.
5. View the control.sql script that was just restored. Edit the file if you want to change one of the values, for example, the sizing parameters.
6. Using Oracle Server Manager or SQL\*Plus, run the control.sql script. This script recreates the control file, recovers the database, and then opens it, automatically handling the specifics of read-only datafiles and tempfiles.
7. Reconnect the Restore and Archive Interface to the database by choosing Tree Refresh. The control file's meta-links now display the green (online) status, and the database opens.

> **Note**: The connection message in the events indicates that the archived log history in the control file has been lost. The events may also display alert messages until log switches result in all redo logs being active again.

**Example**. These are the Server Manager commands used to restore and recover all control files:

```
SVRMGR> select * from v$controlfile; STATUS NAME
/home01/oradata/DB73/control01.ctl /home02/oradata/DB73/control02.ctl /home03/oradata/DB73/control03.ctl 3 rows selected. 
SVRMGR> host charlie.oracle(1) \[ \~/admin/DB73/udump ] compress /home0?/oradata/DB73/control0?.ctl 
charlie.oracle(2) \[ \~/admin/DB73/udump ] exit 
SVRMGR> shutdown immediate 
ORA-00210: cannot open control file ‘/home01/oradata/DB73/control01.ctl’ 
ORA-07368: sfofi: open error, unable to open database file. 
SVR4 Error: 2: No such file or directory 
SVRMGR> shutdown abort 
ORACLE instance shut down. 
SVRMGR> host charlie.oracle(1) \[ \~/admin/DB73/udump ] ls 
control.sql db73\_ora\_16464.trc db73\_ora\_20360.trc tina\_cold\_DB73.txt 
charlie.oracle(2) \[ \~/admin/DB73/udump ] exit 
SVRMGR> @control 
ORACLE instance started. 
Total System Global Area 7283904 bytes 
Fixed Size 39732 bytes 
Variable Size 6826380 bytes 
Database Buffers 409600 bytes 
Redo Buffers 8192 bytes 
Statement processed. 
Media recovery complete. 
Statement processed. 
Statement processed. 
Statement processed. 
Statement processed. 
Statement processed. 
SVRMGR>
```

### Loss of Active Redo Logs

This topic contains the following information:

* [<mark style="color:blue;">Loss of Active Redo Log Members, Hot Restore</mark>](#loss-of-active-redo-log-members-hot-restore)
* [<mark style="color:blue;">Loss of All Active Redo Logs, Cold Restore</mark>](#loss-of-all-active-redo-logs-cold-restore)

#### Loss of Active Redo Log Members, Hot Restore

If you lose a set of active redo log members, you can restore the situation easily if the active redo log files are copied to different disks.\
If they are not copied to another disk, you must perform a full restore of the database. You may therefore lose transactions, unless you have only lost a member that is not the active log, that has already been archived, and that can be deleted using Oracle Server Manager or SQL\*Plus. In this case, do not try to restore it — simply delete it.

> **Note**: If the database is transactional, check that the active redo log files are copied simultaneously to separate disks, preferably with different controllers, to avoid any loss.

Here, you restore a lost set of active redo logs by copying a healthy set from another disk.

To test the restore procedures, simulate the loss of active redo log members by removing them from the database or renaming them.

**Restore a Set of Active Redo Log Members**

1. Stop the database, then restart it. The set of missing redo logs now has INVALID status, but the database is running.
2. Open the Restore and Archive interface. Set a browsing period and select the Show missing files checkbox. All the meta-links of the active redo log members located in the \_REDO\_LOGS meta-directory are hatched. An alert message in the Web Administration events and in the event log indicates that redo log members were not found.
3. Simply copy the active redo log files, group by group, to the correct destination using an operating system command such as cp or dd.
4. Refresh the meta-tree by selecting Tree Refresh. The meta-links of the invalid redo log members now display red status (offline). When the current redo log file is switched, Oracle makes the mirrored copies usable again, as shown by the meta-tree refresh.

**Example**. These are the Server Manager commands used to restore and perform recovery of a set of active redo log members:

```
SVRMGR> select * from v$logfile;
GROUP# STATUS MEMBER2 /export/home/oradata/DB73/redoDB7302.log
2 /home04/oradata/DB73/redoDB7302.log
1 /export/home/oradata/DB73/redoDB7301.log
1 /home04/oradata/DB73/redoDB7301.log
3 /export/home/oradata/DB73/redoDB7303.log
3 /home04/oradata/DB73/redoDB7303.log
6 rows selected.
SVRMGR> host
charlie.oracle(1) [ ~ ] compress /home04/oradata/DB73
/redoDB730?.log
charlie.oracle(2) [ ~ ] exit
SVRMGR> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SVRMGR> startup
ORACLE instance started.
Total System Global Area 7283904 bytes
Fixed Size 39732 bytes
Variable Size 6826380 bytes
Database Buffers 409600 bytes
Redo Buffers 8192 bytes
Database mounted.
Database opened.
SVRMGR> select * from v$logfile;
GROUP# STATUS MEMBER
---------- ------- --
---------- ------- --------------------------------------------
2 /export/home/oradata/DB73/redoDB7302.log
2 INVALID /home04/oradata/DB73/redoDB7302.log
1 /export/home/oradata/DB73/redoDB7301.log
1 INVALID /home04/oradata/DB73/redoDB7301.log
3 /export/home/oradata/DB73/redoDB7303.log
3 INVALID /home04/oradata/DB73/redoDB7303.log
6 rows selected.
SVRMGR> host
charlie.oracle(1) [ ~ ] cp -p /export/home/oradata/DB73/redoDB7301.log
/home04/oradata/DB73/redoDB7301.log
charlie.oracle(2) [ ~ ] cp -p /export/home/oradata/DB73/redoDB7303.log
/home04/oradata/DB73/redoDB7303.log
charlie.oracle(3) [ ~ ] cp -p /export/home/oradata/DB73/redoDB7302.log
/home04/oradata/DB73/redoDB7302.log
charlie.oracle(4) [ ~ ] exit
SVRMGR> alter system switch logfile;
Statement processed.
SVRMGR> select * from v$logfile;
GROUP# STATUS MEMBER
---------- ------- --------------------------------------------
2 /export/home/oradata/DB73/redoDB7302.log
2 INVALID /home04/oradata/DB73/redoDB7302.log
1 /export/home/oradata/DB73/redoDB7301.log
1 INVALID /home04/oradata/DB73/redoDB7301.log
3 /export/home/oradata/DB73/redoDB7303.log
3 /home04/oradata/DB73/redoDB7303.log
6 rows selected.
SVRMGR>
```

#### Loss of All Active Redo Logs, Cold Restore

If you lose all the active redo logs, you have lost the database. You must therefore perform a full restore and recovery of the database.

> **Note**: If the database is transactional in nature, check that your active redo log files are copied simultaneously to separate disks, preferably with different controllers, to avoid the loss of transactions.

This table describes the two methods of fully restoring the database that you can use in Tina for Oracle:

<table><thead><tr><th width="185">Method</th><th>Explanation</th></tr></thead><tbody><tr><td><strong>First method</strong></td><td>Restores the database as it was at the time of one of the full or incremental backups. This is the simplest and most commonly used method because the backup history remains valid. However, it can lead to a loss of transactions, since transactions performed after the selected backup will be lost.</td></tr><tr><td><strong>Second method</strong></td><td>Restores the database as it was at a specific point in time, defined by an archived log number, an SCN value, or a date value. This method can preserve more transactions than the first if the archived redo log files on disk have not been lost, but the required RESETLOGS operation invalidates your backup history, which means you must back up the database immediately to avoid a significant loss of transactions in the event of a second incident.</td></tr></tbody></table>

**First Method - Cold Restore of the Last Backup**

The first method consists of restoring the entire database as it was before the incident. You must first synchronize the meta-tree to a point in time defined by the backup of a control file, then restore a complete set of tablespaces using backup versions of datafiles whose backups precede this point in time. You must then perform a recovery of the database by positioning yourself at the point in time and recreating the control files.\
To test the restore procedures, simulate the loss of a table by removing it from the database, or renaming it, after performing a full backup of your database.

**Perform a Restore and Recovery of the Active Redo Logs and the Database**

1. Stop the database using the SHUTDOWN command in preparation for a full restore.
2. Open the Restore and Archive interface. Set a browsing period and select the Show missing files checkbox.
3. Open the \_CONTROL\_FILES and \_REDO\_LOGS meta-directories. All the objects are hatched because the database is unusable. The objects displayed have been backed up.
4. Select the control.sql meta-file and choose Tree Selection Versions to view its backup versions known to the catalog.

   > **Important**: The control.sql meta-file is a synchronizer that lets you view all the backup versions (full and incremental) of the database.
5. Select a backup version corresponding to the desired date. Synchronize the Oracle meta-tree to this backup by clicking Synchronize. This date becomes your point in time. All transactions performed after this date will be lost.
6. Clear the Show missing files checkbox to disable the time browsing period. All hatched objects disappear. You want to restore a complete set of redo log files and datafiles, but none of those that no longer existed when the backup was performed.
7. Select the TABLESPACES and \_ARCHIVE\_LOGS meta-directories. Also select the control.sql meta-file and its collector destination meta-link (user dump) in the first position of the meta-directory.
8. Select the \_REDO\_LOGS meta-directory to select all its components, then clear the collector destination meta-link (archive log) located in the first position of its meta-directory to indicate that you really want to overwrite the redo log files. Otherwise, their restore destination remains ambiguous. This image shows the TABLESPACES and \_ARCHIVE\_LOGS meta-directories and the control.sql meta-file that you have selected:

<figure><img src="https://137371609-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HOI4mniMS7pDfClN83G%2Fuploads%2Fgit-blob-c3479b61f11e04909154f1a7254de5719605d953%2Fimage%20(282).png?alt=media" alt=""><figcaption></figcaption></figure>

9. Choose Restore Execute to restore the entire database, except the control files.
10. Change to the udump destination directory and view the control.sql script that was just restored. Edit the file if you want to change one of the values, for example, the sizing parameters.
11. Using Oracle Server Manager or SQL\*Plus, connect as the internal user or system administrator and run the control.sql script. This script recreates the control file, performs a recovery of the database, and opens it, automatically handling the specifics of read-only datafiles and tempfiles.
12. Reconnect the Restore and Archive interface to the database in the Present by choosing Backup View. The database opens.

    > **Note**: The events indicate that the history of archived logs in the control file has been lost. This has no consequences. The events may also display alert messages until all the redo logs are active again.
13. Check that the damaged table has been restored.

    > **Note**: The new current redo log file is a file in sequence beyond those you restored. Your backup history is still valid. It is not necessary to perform an immediate backup of the database.

**Example 1.** These are the Server Manager commands used to perform a restore and recovery of the active redo logs and the database:

```
SVRMGR> connect scott/tiger
Connected.
SVRMGR> select * from dept;
DEPTNO DNAME LOC
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
4 rows selected.
SVRMGR> delete from dept;
4 rows processed.
SVRMGR> commit
Statement processed.
SVRMGR> select * from dept;
DEPTNO DNAME LOC
0 rows selected.
SVRMGR> connect internal
Connected.
SVRMGR> shutdown abort
ORACLE instance shut down.
SVRMGR> exit
Server Manager complete.
charlie.oracle(4) [ ~ ] cd admin/DB73/udump
charlie.oracle(5) [ ~/admin/DB73/udump ] ls
control.sql db73_ora_16464.trc db73_ora_20360.trc tina_cold_DB73.txt
charlie.oracle(6) [ ~/admin/DB73/udump ] svrmgrl
Oracle Server Manager Release 2.3.2.0.0 - Production
Copyright (c) Oracle Corporation 1994, 1995. All rights reserved.
Oracle7 Server Release 7.3.2.3.0 - Production Release
With the distributed option
PL/SQL Release 2.3.2.3.0 - Production
SVRMGR> connect internal
Connected to an idle instance.
SVRMGR> @control
ORACLE instance started.
Total System Global Area 7283904 bytes
Fixed Size 39732 bytes
Variable Size 6826380 bytes
Database Buffers 409600 bytes
Redo Buffers 8192 bytes
Statement processed.
Media recovery complete.
Statement processed.
Statement processed.
Statement processed.
Statement processed.
Statement processed.
SVRMGR> connect scott/tiger
Connected.
SVRMGR> select * from dept;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
4 rows selected.
SVRMGR>
```

**Example 2**. These are the SQL\*Plus commands used to perform a restore and recovery of the active redo logs and the database:

```sql
calvin.oracle(3) ~ sqlplus scott/tiger
SQL*Plus: Release 9.0.1.0.0 - Production on Mon Dec 10 13:16:16 2001
(c) Copyright 2001 Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.0.1.0.0 - Production
With the Partitioning option
JServer Release 9.0.1.0.0 - Production
SQL> select * from dept;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
SQL> drop table emp;
Table dropped.
SQL> drop table dept;
Table dropped.
SQL> commit;
Commit complete.
SQL> select * from dept;
select * from dept
*
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> connect sys as sysdba
Enter password:
Connected.
SQL> shutdown abort
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.0.1.0.0 - Production
With the Partitioning option
JServer Release 9.0.1.0.0 - Production
calvin.oracle(4) [ ~ ] cd admin/TEST901/udump
calvin.oracle(5) [ ~/admin/TEST901/udump ] ls
control.sql test901_ora_2764.trc test901_ora_29919.trc tina_cold_TEST901.txt
calvin.oracle(6) [ ~/admin/TEST901/udump ] sqlplus /nolog
SQL*Plus: Release 9.0.1.0.0 - Production on Mon Dec 10 13:41:55 2001
(c) Copyright 2001 Oracle Corporation. All rights reserved.
SQL> connect sys as sysdba
Enter password:
Connected to an idle instance.
SQL> @control
ORACLE instance started.
Total System Global Area 72123504 bytes
Fixed Size 279664 bytes
Variable Size 50331648 bytes
Database Buffers 20971520 bytes
Redo Buffers 540672 bytes
Control file created.
ORA-00279: change 243923 generated at 11/22/2001 21:47:50 needed for thread
1
ORA-00289: suggestion : /cache3/oradata/TEST901/archive/arch1_0000001933.dbf
ORA-00280: change 243923 for thread 1 is in sequence #1933
ORA-00279: change 263990 generated at 12/10/2001 12:46:42 needed for thread
1
ORA-00289: suggestion : /cache3/oradata/TEST901/archive/arch1_0000001934.dbf
ORA-00280: change 263990 for thread 1 is in sequence #1934
ORA-00278: log file '/cache3/oradata/TEST901/archive/arch1_0000001933.dbf'
no
longer needed for this recovery
Log applied.
Media recovery complete.
System altered.
Database altered.
Tablespace altered.
SQL> connect scott/tiger
Connected.
SQL> select * from dept;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
SQL>
```

**Second Method - Cold Restore with RESETLOGS**

If several disks are lost, except for the one containing the archived logs, you can restore the entire database by replaying as many archived logs as possible, to minimize the loss of transactions.\
You must synchronize to a control file backup date and thus restore a complete set of tablespaces using the backup versions of the datafiles that precede this date. You can then perform the recovery of the database using the RESETLOGS command.\
To test the restore procedures, simulate the loss of all active redo logs, including their mirrors, by removing them from the database or renaming them, while the database is active and in service, after performing a full backup.

**Perform a Restore and Recovery of All the Archived Redo Logs and the Database**

1. Stop the database using the SHUTDOWN command in preparation for a full restore.
2. Open the Restore and Archive interface. Set a browsing period and select the Show missing files checkbox.
3. Open the \_ARCHIVE\_LOGS and \_CONTROL\_FILES meta-directories. All the objects are hatched because the database is no longer running. All the objects you view have been backed up.
4. Select the control.ctl meta-file and choose Tree Selection Versions to view its backup versions known to the catalog.
5. Select the most recent backup version and synchronize by clicking Synchronize. This becomes your point in time.
6. Clear the Show missing files checkbox to disable the time browsing period. All hatched objects disappear. You want to restore a complete set of datafiles, but none of those that no longer existed when the backup was performed.
7. Select the TABLESPACES and \_ARCHIVE\_LOGS meta-directories (some datafiles may need older archived logs that have been purged). Also select the \_CONTROL\_FILES meta-directory to select all its components, then clear its collector destination meta-link (in the first position of the meta-directory), above its meta-directory, to indicate that you really want to overwrite the control files. Otherwise, their restore destination remains ambiguous.
8. Also clear the control.sql meta-file, which is not needed in this scenario, and, if present, the standby.ctl objects. This image shows the TABLESPACES and \_ARCHIVE\_LOGS meta-directories and the files (including control.ctl) in the \_CONTROL\_FILES meta-directory that you have selected:

<figure><img src="https://137371609-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HOI4mniMS7pDfClN83G%2Fuploads%2Fgit-blob-5c75b554578c58f5eb3295dbe456994b3c3e682c%2Fimage%20(283).png?alt=media" alt=""><figcaption></figcaption></figure>

9. Choose **Restore > Execute** to restore the entire database, except the active redo log files.
10. Using Oracle Server Manager or SQL\*Plus, connect as the internal user or system administrator. Mount the database, perform a recovery until cancel, taking into account the specifics of read-only datafiles, then open the database. Since no script can help you, you must read the Example of a Cold Restore with RESETLOGS carefully, where you will find several corrected errors.

> **Important**: You must take the read-only datafiles offline before starting the recovery.

> **Note**: You can select certain data dictionary views such as v$datafile without the database being open. Note that a recovery session cannot be canceled unless this is specified in the recovery command.\
> Some Oracle messages can be confusing. You must perform a RESETLOGS after using the backup control file.

11. Reconnect the Restore and Archive interface to the database in the Present by choosing Backup View. The database opens. The events indicate that the history of archived logs in the control file has been lost. This has no consequences. The events may also display alert messages warning you that Tina will delete expired archived logs during the next backup.
12. Perform a full backup of the database. Indeed, the sequence of the current redo log file has been reset (Tina may switch logs once to create a log history, depending on the Oracle version), and your backup portfolio is no longer valid.

**Example of a Cold Restore with RESETLOGS**

This example shows the Server Manager commands used to perform a restore and recovery of the archived redo logs and the database:

```sql
SVRMGR> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /export/home/oracle/admin/DB73/arch
Oldest online log sequence 188
Next log sequence to archive 190
Current log sequence 190
SVRMGR> connect scott/tiger
Connected.
SVRMGR> select * from dept;
DEPTNO DNAME LOC10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
4 rows selected.
SVRMGR> insert into dept values (50,’FASHION’,’PARIS’);
1 row processed.
SVRMGR> commit
Statement processed.
SVRMGR> select * from dept;
DEPTNO DNAME LOC10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
50 FASHION PARIS
5 rows selected.
SVRMGR> connect internal
Connected.
SVRMGR> alter system switch logfile;
Statement processed.
SVRMGR> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /export/home/oracle/admin/DB73/arch
Oldest online log sequence 189
Next log sequence to archive 191
Current log sequence 191
SVRMGR> select * from v$logfile;
GROUP# STATUS MEMBER
---------- ------- -----------------------------------------------
3 /export/home/oradata/DB73/redoDB7303.log
3 /home04/oradata/DB73/redoDB7303.log
2 /export/home/oradata/DB73/redoDB7302.log
2 /home04/oradata/DB73/redoDB7302.log
1 /export/home/oradata/DB73/redoDB7301.log
1 /home04/oradata/DB73/redoDB7301.log
6 rows selected.
SVRMGR> host
charlie.oracle(1) [ ~ ] compress /export/home/oradata/DB73
/redoDB730?.log
charlie.oracle(2) [ ~ ] compress /home04/oradata/DB73
/redoDB730?.log
charlie.oracle(3) [ ~ ] exit
SVRMGR> shutdown abort
ORACLE instance shut down.
SVRMGR> startup mount
ORACLE instance started.
Total System Global Area 7283904 bytes
Fixed Size 39732 bytes
Variable Size 6826380 bytes
Database Buffers 409600 bytes
Redo Buffers 8192 bytes
Database mounted.
SVRMGR> recover database until cancel using backup controlfile;
ORA-00283: Recovery session canceled due to errors
ORA-01233: file 5 is read only - cannot recover using backup controlfile
ORA-01110: data file 5: '/export/home/oradata/DB73/users01.dbf'
SVRMGR> select * from v$datafile;
FILE# STATUS ENABLED CHECKPOINT BYTES CREATE_BY T NAME
---------- ------- ---------- ---------- ---------- ---------- ---
1 SYSTEM READ WRITE 8445 5242880 5242880 /export
/home/oradata/DB73/system01.dbf
2 ONLINE READ WRITE 8444 2097152 2097152 /export
/home/oradata/DB73/rbs01.dbf
3 ONLINE READ WRITE 8446 563200 563200 /export
/home/oradata/DB73/temp01.dbf
4 ONLINE READ WRITE 8447 2097152 2097152 /export
/home/oradata/DB73/tools01.dbf
5 ONLINE READ ONLY 7188 1048576 1048576 /export
/home/oradata/DB73/users01.dbf
7 ONLINE READ ONLY 7188 1048576 1048576 /export
/home/oradata/DB73/users02.dbf
6 rows selected.
SVRMGR> alter database datafile '/export/home/oradata/DB73
/users01.dbf' offline;
Statement processed.
SVRMGR> alter database datafile '/export/home/oradata/DB73
/users02.dbf' offline;
Statement processed.
SVRMGR> recover database until cancel using backup controlfile;
ORA-00279: Change 8444 generated at 09/26/98 15:42:05 needed for thread 1
ORA-00289: Suggestion : /export/home/oracle/admin/DB73/arch/arch_189.log
ORA-00280: Change 8444 for thread 1 is in sequence #189
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
AUTO
Log applied.
ORA-00279: Change 8449 generated at 09/26/98 16:51:22 needed for thread 1
ORA-00289: Suggestion : /export/home/oracle/admin/DB73/arch
/arch_190.log
ORA-00280: Change 8449 for thread 1 is in sequence #190
ORA-00278: Logfile '/export/home/oracle/admin/DB73/arch/arch_189.log' no
longer needed for this recovery
Log applied.
ORA-00279: Change 8467 generated at 09/28/98 11:43:55 needed for thread 1
ORA-00289: Suggestion : /export/home/oracle/admin/DB73/arch
/arch_191.log
ORA-00280: Change 8467 for thread 1 is in sequence #191
ORA-00278: Logfile '/export/home/oracle/admin/DB73/arch/arch_190.log' no
longer needed for this recovery
ORA-00308: cannot open archived log '/export/home/oracle/admin
/DB73/arch/arch_191.log'
ORA-07360: sfifi: stat error, unable to obtain information about
file.
SVR4 Error: 2: No such file or directory
SVRMGR> alter database open;
alter database open
*
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
SVRMGR> alter database open NORESETLOGS;
alter database open NORESETLOGS
*
ORA-01588: must use RESETLOGS option for database open
SVRMGR> alter database open RESETLOGS;
Statement processed.
SVRMGR> alter tablespace users online;
Statement processed.
SVRMGR> connect scott/tiger
Connected.
SVRMGR> select * from dept;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
50 FASHION PARIS
5 rows selected.
```

Oracle 10g and 11g versions include the Easier Recovery through resetlogs feature. The corresponding parameter is used in log\_archive\_format: %R. This parameter represents an incarnation\_id (or resetlog\_id). This is an identifier for the most recent resetlogs in the database. This sequence for the archived logs is consistent for all logs having the same incarnation\_id. A resetlog operation in the database resets the current log sequence, and the new archived log sequence starts at 1.

> **Note**: In versions earlier than Oracle 10g, a resetlog prevented the restore of a data file backed up before the resetlogs, because Oracle could not recover the log sequence.

With Oracle 10g and 11g versions, the log name contains the incarnation\_id. This allows the recovery of a log sequence, even through a resetlog. As a result, it is no longer necessary to perform a full backup following a resetlog.

**Unusable Temporary Files**

During the restore, Tina recreates empty temporary files (temp) of the same size as the files that existed before the restore. If these files are unusable, you must delete them and then recreate them manually.

Perform these actions:

1. Delete the temporary files one by one using this command: ALTER DATABASE TEMPFILE 'full\_path\_of\_the\_temp\_file' DROP; For example: ALTER DATABASE TEMPFILE '/opt/oracle/product/10.2.0/oradata/db\_ jfg/temp01.dbf' DROP;
2. In the control file, copy the command that created the temporary files and run this command: ALTER TABLESPACE TEMP ADD TEMPFILE '/opt/oracle/product/10.2.0/oradata/db\_jfg/temp01.dbf' SIZE 209715200 REUSE AUTOEXTEND OFF;

### Loss of Parameter Files, Cold Restore

> **Note**: This description applies only to Oracle 9i and later versions.

If you lose one or more parameter files, you can restore them, but you must first close the database. This procedure describes restoring a missing parameter file from the graphical interface. You can also restore these files via the Command Line Interface. See [<mark style="color:blue;">Restoring via the Command Line</mark> ](#restoring-via-the-command-line)for more details.

When restoring network administration files, remember that this concerns the entire server, not just the database in which you backed them up.

**Restore a Parameter File**

1. Stop the database by running the shutdown immediate command: SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. SQL> exit
2. Open the Restore and Archive interface. Set a browsing period and select the Show missing files checkbox.
3. Open the \_SPARAMS meta-directory. The parameter file and its meta-link are displayed hatched to indicate that the file is missing or that the database is not functional.
4. Select the parameter file and choose Tree Selection Versions to view the backup versions known to the catalog.
5. Select a backup version and synchronize the meta-tree to its backup date by clicking Synchronize.
6. Select the parameter file and its private destination meta-link, then choose Restore Execute to restore the file to its original location. >

   > **Note**: To restore the file to a different location, select the parameter file and the collector meta-link, in the first position of the meta-directory.
7. Using a file manager or any other appropriate tool, verify that the parameter file has been restored to its original location.
8. Check the content of the parameter file.

**Example**. Once you have restored the Password file, check that you can connect to the database with a user who does not belong to the dba group:

```
[user@cesar Ora]$ sqlplus
SQL*Plus: Release 9.2.0.6.0 - Production on Fri Sep 23 16:46:10 2005
Copyright (c) 1982, 2002, Oracle Corporation.
All rights reserved.

Enter user-name: sys as sysdba
Enter password:<mot_de_passe>
Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area    135337540 bytes
Fixed Size                   452164 bytes
Variable Size             109051904 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.
SQL>
```

> **Note**: To restore all the parameter files, including the network administration files, to their original location, clear the collector meta-link. Otherwise, the value of the collector meta-link takes priority over the links pointing to the individual locations.

### Restoring via the Command Line

To anticipate a possible loss of the database, you can write scripts that less experienced operators can use to restore the database using the <kbd>tina\_restore</kbd> command. You must automate the restore selections described in the two previous simulations. You do not need to know the redo log numbers, but you must set the synchronization date.\
This table describes the parameters supported by the <kbd>tina\_restore</kbd> command:

<table><thead><tr><th width="318.33331298828125">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>-path_folder path1 [path2]...</strong></td><td>Specifies the absolute meta-paths in the object folder (directories and/or files) to restore (checklist).</td></tr><tr><td><strong>-ex_path_folder path1 [path2]...</strong></td><td>Specifies the absolute meta-paths in the object folder (directories and/or files) not to restore (exclusion list).</td></tr><tr><td><strong>-folder folder</strong></td><td>Specifies the source backup folder. You must specify that the folder belongs to an application <strong>[-folder app1.&#x3C;application_name>]</strong>.</td></tr><tr><td><strong>-folder_dest folder</strong></td><td>Specifies the destination backup folder. You must specify that the folder belongs to an application <strong>[-folder app1.&#x3C;application_name>]</strong>.</td></tr><tr><td><strong>-catalog catalog</strong></td><td>Specifies the working catalog. This parameter is <strong>mandatory</strong> if there are multiple catalogs.</td></tr><tr><td><strong>-date yyyymmddhhmm</strong></td><td>Specifies the synchronization date in the past (year, month, day, hour, and minute). If this option is not specified, the most recent backup version is restored.</td></tr><tr><td><strong>-strat A|B|C|D</strong></td><td>Specifies the restore of objects backed up by the specified backup strategy (<strong>A, B, C, or D</strong>). This parameter applies to backup folders and is optional.</td></tr><tr><td><strong>-help</strong></td><td>Displays the command syntax.</td></tr></tbody></table>

**Restoring the Last Backup**

This example uses the same choice as the <mark style="color:blue;">First Method - Cold Restore of the Last Backup</mark> scenario.

Run this command:

<kbd>tina\_restore -folder appl.charlie.o732 -catalog tinaora -path\_folder"/DB73/TABLESPACES" "/DB73/\_ARCHIVE\_LOGS" "/DB73/\_CONTROL\_FILES/ .00/" "DB73/\_CONTROL\_FILES/control.sql" "/DB73/\_REDO\_LOGS" -ex\_path\_folder "/DB73/\_REDO\_LOGS/ .00" -date 200101041539</kbd>

> **Note**: The -date parameter is expressed in minutes, whereas the Tina backup date or -archtime is expressed in seconds. You must therefore round up to avoid any synchronization issues. Typically, the operator simply writes, for example, -date 201501041539, meaning the last backup before January 4, 2015, 3:39 PM.

**Restoring with RESETLOGS**

This example uses the same choice as the <mark style="color:blue;">Second Method - Cold Restore with RESETLOGS</mark> scenario.

Run this command:

<kbd>tina\_restore -folder appl.charlie.o732 -catalog tinaora -path\_folder /"DB73/TABLESPACES" "/DB73/\_ARCHIVE\_LOGS" "/DB73/\_CONTROL\_FILES" -ex\_path\_folder "/DB73/\_CONTROL\_FILES/ .00" -date 200101041539</kbd>

### Cross-Platform Restore of the Database

You can use Tina for Oracle to perform a cross-platform restore from one platform to another.

#### Prerequisites

These conditions must be met to perform a cross-platform restore:

* The source and target platforms must use the same operating system.
* The source and target platforms must use the same Oracle version, at least for the first two digits of the version, for example 8.2 or 9.0.
* Tina must be installed on both platforms.
* The user must be authorized to restore objects and to perform a cross-platform restore.

For more information on defining user rights, see the Tina Administration Documentation.

#### Graphical Mode

Restore a Database from One Platform to Another

1. Create a second Oracle application folder associated with the destination machine. You must copy and, if necessary, modify the Oracle parameter files. With Oracle, the physical layout of the data must be identical on both machines. On Unix machines, this requires creating the appropriate symbolic links. Indeed, Oracle and the Tina application modules always follow these links. You must configure them before performing the restore. Otherwise, the restore fails.
2. Open the Restore and Archive interface on the destination folder.
3. Choose Backup Application Folder to view the backup folder of another application and select the application where the object you want to restore is located. The corresponding meta-tree opens.

> **Note**: If the Backup Application Folder menu is not accessible in the Restore and Archive interface, grant the user the access rights as specified in the prerequisites above.

4. Select these objects and choose Restore Execute

   • All the contents of the TABLESPACE directory.

   • All the contents of the ARCHIVE\_LOGS directory.

   • The first and last item of the CONTROL\_FILES directory.

   • All items except the first of the REDO\_LOGS directory.
5. Click OK to confirm the operation. The Restore Complete message is displayed when the operation is finished.
6. Choose Backup View to display the meta-tree of the destination platform.
7. From Oracle Server Manager or SQL\*Plus, connect as the internal user or system administrator and run the control.sql script. This script recreates the control file, restores the database, then opens it, automatically handling the specifics of read-only datafiles and tempfiles. You can now use the restored object on the destination platform.

**Command Line Interface**

You can also perform a cross-platform restore from the Command Line Interface, by running the <kbd>tina\_restore</kbd> command, whose options are described in [<mark style="color:blue;">Restoring via the Command Line.</mark>](#restoring-via-the-command-line)

Run this command:

<kbd>tina\_restore -folder appl.charlie.o732 folder\_dest appl.calvin.o73 -catalog richard -path\_folder /DB73/TABLESPACES /DB73/</kbd><kbd>*ARCHIVE\_LOGS /DB73/*</kbd> <kbd>CONTROL\_FILES/standby.ctl /DB73/\_CONTROL\_FILES/standby.ctl.00 -date 200101041539</kbd>

For more information on command mode, see the Atempo-Tina Command Line Interface User's Guide.

### Restoring a Database with Readdressing

You can use Tina for Oracle to restore data to a directory other than the original one, on the same platform or on a different platform. New addresses are assigned to the physical files. This lets you clone a database for testing, migration, or data distribution purposes.

Restoring on the same platform with readdressing lets you reproduce the database in the same environment without overwriting the source database. This is useful for Web applications or for databases located on clustered file systems that are distributed across several nodes with a single address.\
Restoring on another platform with readdressing lets you clone a database directly to a different physical location, without needing to pre-create the target symbolic links.

#### Preparing the Restore

Before performing a restore with readdressing, you must specify the new addresses of all the physical files to be restored.

Specify the New Address of the Files

1. Configure the Oracle (source) application in the standard way and perform a full backup of the database. See [<mark style="color:blue;">Hot Backup</mark> ](#hot-restore)for more information.
2. In the udump destination directory, locate the cold backup list file (cold list), generated at each full or incremental backup of the database.
3. Copy and rename this file on the destination platform or instance.
4. Edit the file, replacing each path with its new destination value, but do not change the object names.

   > **Note**: If you want to mount and use the cloned database, you must also edit the control.sql script on the destination platform to indicate the new addresses to the Oracle clone.

#### Restore

> **Note**: The Tina for Oracle protection mechanism that prevents restoring while the database is online is not compatible with readdressing. Indeed, the readdressing restore process does not attempt to connect to the database and therefore does not know its state.

**Restore a Database with Readdressing**

1. If the readdressing is performed on a different machine, create a destination Oracle application on the new machine. If the readdressing is performed on the same machine, go to step 2.
2. In the destination Oracle application, specify the path of the modified list file by editing the TINA\_ORA\_DEST\_FILE environment variable.
3. Open the Restore and Archive interface on the destination Oracle application. Any syntax error is reported in the meta-tree.
4. Perform a restore in the same way as for a standard restore. If you are performing readdressing on a different machine, you must perform a cross-platform restore; see [<mark style="color:blue;">Cross-Platform Restore of the Database</mark>](#cross-platform-restore-of-the-database)<mark style="color:blue;">.</mark> During the restore, each meta-file will be readdressed to its new path, as indicated in the events. If a directory specified in the list file does not exist, it is created, and this operation is also reported in the events.

   > **Note**: If the new destination address is not set for a given meta-file, it will be restored to a temporary directory whose name depends on the operating system: c:\ on Windows and /tmp on Unix.
5. If the data was restored on the same platform, delete the TINA\_ORA\_DEST\_FILE environment variable once the restore is complete. If this variable is set, you cannot perform a standard restore of the database.

### Restore and Recovery of an Oracle Partial Clone

> **Note**: To use partial clone restore, you must have configured Tina for Oracle as described in [<mark style="color:blue;">Configuring partial clone restore.</mark>](#configuring-partial-clone-restore)

Cross-restore and creating a partial clone of the database on the destination system involve these steps:

* Pre-restore to a given point from the graphical interface.
* Verification and optional modification by the administrator of the generated parameter files.
* Data restore launched from a generated script.
* Database recovery using a generated script.

#### Pre-restore

Perform a pre-restore of the database

1. Open the Restore and Archiving interface on the destination application, either using the graphical interface or by setting up the appropriate Tina environment via a shell window (with the $DISPLAY variable) on the target destination system, using the identity of the preferred Oracle user, by running the command tina -target\_appl lambda.ora &. The connection to the database fails because the database does not exist yet. A warning message indicates that the restore will be performed to an alternate destination.
2. Choose Backup Application Folder and select the source application folder in which you performed the backups. The application's meta-tree is displayed in the past.
3. Using one of the synchronization objects, for example control.clt, present in one of the \_CONTROL\_FILES or \_SPARAMS meta-directories, view the available backup versions, choose one, then synchronize the meta-tree to that version. Tina for Oracle does not use any backups performed after that date.
4. Open the CONTENTS meta-directory. Select for restore the system tablespaces and the temporary tablespaces that you need. Select the schema, individual tables, or indexes. Use the space bar to make a multiple selection. Selecting one or more objects within the same tablespace amounts to the same thing. There are two options for the recovery:
   1. Restore up to the chosen point in time. This option uses the backup of archived logs and redo logs.
   2. Restore up to a date that you provide when the program asks for it. This option only uses the backup of archived logs. Select the Restore to the date specified by the operator option if you want to use the second option. The specified date must be after the most recent datafile backup, because the restore does not replay logs backward, only forward (roll forward). If the chosen date is after the backup, you may need to copy additional archived logs from the source system to the destination system to complete the restore. Example. You performed a full backup of the database on Sunday. You performed incremental backups on Monday, Tuesday, and Wednesday, but without a datafile backup due to the value of <kbd>TINA\_ORA\_LOG\_INCR\_MIN.</kbd> If you want to restore to a specific time on Tuesday before a database corruption, you can either synchronize on the Monday backup and copy the archived logs necessary for the recovery.

      **Or**

      You can synchronize on the Wednesday backup. Note however that these backups do not let you restore to a time on Saturday.
5. Select all the content of the \_CONTROL\_FILES and \_SPARAMS meta-directories, which are used to generate the various scripts and parameter files. Do not select <kbd>TABLESPACES, \_ARCHIVE\_LOGS or \_REDO\_LOGS –</kbd> we are not yet at the data restore stage.
6. Choose Restore Run to perform the pre-restore and check the events associated with the restore job once it is finished.

#### Administrator Verification

In the destination directory, Tina has restored important text files and generated others with new names.\
The important restored text files whose name includes the source SID are:

* The pfile file of the source database, for example, pfile\_PROD.ora.
* The cold backup list file of the source database, for example, tina\_\
  cold\_PROD.txt.
* The recovery script, for example, control\_PROD.sql.

The generated text files whose name includes the new destination SID are:

* The pfile file of the destination database, for example, pfile\_CLONE.ora.
* The restore script for the destination database, for example, tina\_restore\_ CLONE.ksh.
* The recovery script for the destination database, for example, control\_ CLONE.sql.

Check these files and make corrections if necessary. For example, modify the destination pfile file to reduce the SGA size or other resources of the cloned database based on the values of the original.

#### Data Restore

Set up the appropriate Tina environment in a shell window on the destination system and launch the restore script. The script will restore only the datafiles that are part of the selected tablespaces, as well as the archived logs needed for recovery. Check the events associated with the restore.

Note that the oldest log sequence needed for the restore is displayed in the events at the start of the job.

Manually copy from the source system or the share the additional archived logs needed for the restore with the Restore to the date specified by the operator option. If you are restoring a block of old archived logs with Tina, do not forget to use the space bar for selection and to select the destination collector link.

#### Database Recovery

Set up the appropriate Tina environment in a shell window on the destination system and launch the recovery script from SQLplus, connecting with sysdba rights. The script performs these operations:

* Start the database in force nomount mode with the new pfile file.
* Create a controlfile from the restored redo logs, setting the name of the new database.
* Recover the datafiles using the archived logs and redo logs up to the chosen\
  point in time, or by using archived logs up to the date you will be\
  asked to specify in the format: YYYY-MM-DD:HH24:MI:SS.
* Open the database by resetting the logs and with a new incarnation.
* Attempt to remove the unwanted tablespaces from the data dictionary.

**Example**. The SQLPlus commands used to recover the database are:

```
obelix.oracle(90) \[ \~/oradata/CLON102 \~ ] sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Jan 28 13:09:11 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> connect sys/sys as sysdba
Connected to an idle instance.
SQL> @control_clon102
ORACLE instance started.
Total System Global Area 247463936 bytes
Fixed Size 2020032 bytes
Variable Size 92278080 bytes
Database Buffers 150994944 bytes
Redo Buffers 2170880 bytes
Control file created.
ORA-00279: change 11571817 generated at 01/26/2009 22:06:29 needed for
thread 1
ORA-00289: suggestion : /Applis/oracle/oradata/CLON102/arch/617798769_308.1
ORA-00280: change 11571817 for thread 1 is in sequence #308
ORA-00279: change 11572912 generated at 01/26/2009 22:09:50 needed for
thread 1
ORA-00289: suggestion : /Applis/oracle/oradata/CLON102/arch/617798769_309.1
ORA-00280: change 11572912 for thread 1 is in sequence #309
ORA-00278: log file '/Applis/oracle/oradata/CLON102/arch/617798769_308.1' no
longer needed for this recovery
Log applied.
Media recovery complete.
Database altered.
Tablespace altered.
SQL>
```

Choose Backup > View in the Restore and Archiving interface to refresh the meta-tree. The connection to the cloned database should now work.

Set the <kbd>TINA\_ORA\_SHOW\_CONTENTS</kbd> variable to see, in the CONTENTS meta-directory, only the tables and indexes belonging to the selected tablespaces. Your cloned database is ready for use.

In some cases, removing the unwanted tablespaces fails and the missing datafiles remain with the <kbd>RECOVER</kbd> status. This is due to dependencies within the original database, but will not prevent you from connecting to or using the cloned database. However, you will not be able to perform a hot backup of the cloned database. In principle, you will not need to back up the cloned database.

## Time Navigator for Oracle using Recovery Manager

### Data Restore

This topic describes how to restore backed-up data.

#### Overview

The restore is performed using scripts interpreted by RMAN. Tina feeds the communication pipe via the tina\_restore and tina\_tpl\_back\_end processes, while RMAN retrieves the restored data. This illustration shows the data flow during a restore for Time Navigator for Oracle Using Recovery Manager (RMAN):

<figure><img src="https://137371609-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HOI4mniMS7pDfClN83G%2Fuploads%2FZOaedLMkDo8yQ0vUJAD4%2Fimage.png?alt=media&amp;token=fbb8bff8-78aa-422c-909a-410268b5a091" alt=""><figcaption></figcaption></figure>

RMAN relies on the Recovery Catalog to select the backup set to restore. By default, it selects the most recent backup set.\
For more information on restores with RMAN, see the [Oracle documentation.](https://documentation.atempo.com/tina-4.9.5/tina-4.9.5-en/administration-guide/restore/oracle.md)

#### Launching a Restore

Before launching a restore, make sure that the Oracle objects to be restored are offline. Unix. Before launching a restore, perform these additional steps: Preparing a restore from RMAN on Unix

1. Open a session as the Oracle server administrator.
2. Set the ORACLE\_SID variable with the SID of the target database, that is, the database to be backed up.
3. Launch the RMAN command interpreter (rman) from the $ORACLE\_ HOME/products.x.x.x/bin directory.

**RMAN Restore Scripts**

RMAN restore scripts consist of a series of commands included in the run command. The restore scripts contain the parameters described below.

> **Note**: Before performing a restore, make sure that the target database is started with the startup mount option.

**Environment Variables**

To ensure communication between Tina and RMAN, certain Tina environment variables must be set in the RMAN restore scripts. They must appear after the parms keyword. See Environment Variables (required).\
This table describes the environment variables you can use in RMAN scripts:

<table><thead><tr><th width="283.6666259765625">Variable</th><th>Description</th></tr></thead><tbody><tr><td><strong>TINA_HOME</strong></td><td>Tina installation directory. Due to an RMAN limitation, the installation directory name must not contain a space.</td></tr><tr><td><strong>TINA_RMAN_CATALOG</strong></td><td>Name of the Tina catalog.</td></tr><tr><td><strong>TINA_RMAN_FOLDER</strong></td><td>Name of the archive folder where Oracle backups are stored.</td></tr><tr><td><strong>TINA_RMAN_USER</strong></td><td>Tina user and owner of the archive folder.</td></tr><tr><td><strong>TINA_RMAN_RST_TIMEOUT</strong></td><td><p><strong>Optional.</strong> Timeout value for opening the communication pipes between the Third-Party Layer Back-End (TPL-BE) and the Third-Party Layer Front-End (TPL-FE).</p><p>• <strong>Default:</strong> 7,200 seconds (2 hours).</p><p>• <strong>Possible values:</strong> between 1 and 86,400 seconds (24 hours).</p></td></tr><tr><td><strong>TINA_RMAN_SECURE_SESSION_ID</strong></td><td>ID required when restoring secure data via Tina Security &#x26; Compliance Manager. This value corresponds to the ID generated by the password session of the <strong>tina_scm_control</strong> command.</td></tr><tr><td><strong>TINA_RMAN_SHARE_MULTIPLE</strong></td><td><strong>Optional.</strong> If set to <strong>Yes</strong>, enables <strong>SBTBFINFO_SHARE_MULTIPLE</strong> mode to allow the use of multiple channels during a restore.Default: <strong>No</strong> → <strong>SBTBFINFO_SHARE_SINGLE</strong> mode.</td></tr><tr><td><strong>TINA_KAC_SIZE</strong></td><td><strong>Optional.</strong> Keeps the connection active between the Tina server and the Tina agent for RMAN (useful with a firewall). The value corresponds to the size of the restored stream (in MB). The agent tests the connection when this size is exceeded.</td></tr></tbody></table>

**Script Commands**

This table describes the commands or parameters you can use in the\
RMAN script commands:

<table><thead><tr><th width="285">Variable</th><th>Description</th></tr></thead><tbody><tr><td><strong>TINA_HOME</strong></td><td>Tina installation directory. Due to an RMAN limitation, the installation directory name must not contain a space.</td></tr><tr><td><strong>TINA_RMAN_CATALOG</strong></td><td>Name of the Tina catalog.</td></tr><tr><td><strong>TINA_RMAN_FOLDER</strong></td><td>Name of the archive folder where Oracle backups are stored.</td></tr><tr><td><strong>TINA_RMAN_USER</strong></td><td>Tina user and owner of the archive folder.</td></tr><tr><td><strong>TINA_RMAN_RST_TIMEOUT</strong></td><td><p><strong>Optional.</strong> Timeout value for opening the communication pipes between the Third-Party Layer Back-End (TPL-BE) and the Third-Party Layer Front-End (TPL-FE).</p><p>• <strong>Default:</strong> 7,200 seconds (2 hours).</p><p>• <strong>Possible values:</strong> between 1 and 86,400 seconds (24 hours).</p></td></tr><tr><td><strong>TINA_RMAN_SECURE_SESSION_ID</strong></td><td>ID required when restoring secure data via Tina Security &#x26; Compliance Manager. This value corresponds to the ID generated by the password session of the <strong>tina_scm_control</strong> command.</td></tr><tr><td><strong>TINA_RMAN_SHARE_MULTIPLE</strong></td><td><strong>Optional.</strong> If set to <strong>Yes</strong>, enables <strong>SBTBFINFO_SHARE_MULTIPLE</strong> mode to allow the use of multiple channels during a restore.Default: <strong>No</strong> → <strong>SBTBFINFO_SHARE_SINGLE</strong> mode.</td></tr><tr><td><strong>TINA_KAC_SIZE</strong></td><td><strong>Optional.</strong> Keeps the connection active between the Tina server and the Tina agent for RMAN (useful with a firewall). The value corresponds to the size of the restored stream (in MB). The agent tests the connection when this size is exceeded.</td></tr></tbody></table>

**Example**. This script restores the entire database using Tina with a single channel and a timeout of 14,400 seconds (4 hours):

```
RMAN> run {
    allocate channel c1 type 'sbt_tape'
        parms="ENV=(TINA_HOME=/export/home/Atempo,
              TINA_RMAN_CATALOG=cata_rman,
              TINA_RMAN_FOLDER=RMAN,
              TINA_RMAN_USER=oracle,
              TINA_RMAN_RST_TIMEOUT=14400)"
        trace=1;
    restore database;
    recover database;
    release channel c1;
}
```

> **Note**: Starting with Oracle 10g, RMAN requires the media sharing mode to be set to SBTBFINFO\_SHARE\_MULTIPLE in order to use multiple channels at the same time during a restore. To do this, set the TINA\_RMAN\_SHARE\_MULTIPLE environment variable to Yes in the restore script.

**Container Databases on Oracle 12c**

For container databases (CDB, Container Database) on Oracle 12c, use these restore commands:

* To restore the root container, run this command:\
  restore database root
* To restore a pluggable database (PDB, Pluggable Database), run\
  this command:

<kbd>restore pluggable database \<pdb\_name></kbd>

* To restore a specific tablespace of a pluggable database when you are connected to the root, run this command: restore tablespace \<pdb\_name>:\<tablespace\_name>

#### Restore Report

This table describes the trace files that RMAN and Tina generate during a restore:

| Type              | Source             | Location                                                                | Description                                                                        |
| ----------------- | ------------------ | ----------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| **RMAN Messages** | RMAN               | Standard output or file specified by the **log** command-line option    | Contains the actions and errors that occurred during script execution              |
| **RMAN Trace**    | RMAN debug command | File specified by the **trace** parameter on the Command Line Interface | Contains all traces relating to the creation and execution of PL/SQL program units |
| **alert.log**     | Oracle server      | **USER\_DUMP\_DEST** directory                                          | Contains a chronological log of errors and administration operations               |
| **Oracle Trace**  | Oracle server      | **USER\_DUMP\_DEST** directory                                          | Contains detailed traces of Oracle processes                                       |
| **sbtio.log**     | Tina               | **USER\_DUMP\_DEST** directory                                          | Contains information and errors about the progress of the restore                  |
| **event**         | Tina               | **TINA\_HOME/Adm** directory                                            | Contains Tina information and errors                                               |

**RMAN Messages**

When the restore completed successfully, RMAN displays these messages:

```
Recovery Manager: Release 10.2.0.1.0 - Production on Fri Sep 29 17:21:41 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
RMAN> connect catalog *
connect target *
run {
allocate channel c1 type 'sbt_tape'
parms="SBT_LIBRARY=/usr/atempo/tina/Lib/libtina_rman.so, ENV=(TINA_
HOME=usr/atempo/tina, TINA_RMAN_CATALOG=rman_cat,TINA_RMAN_FOLDER=rman,TINA_
RMAN_USER=oracle)";
allocate channel c2 type 'sbt_tape'
parms="SBT_LIBRARY=/usr/atempo/tina/Lib/libtina_rman.so, ENV=(TINA_
HOME=usr/atempo/tina,TINA_RMAN_CATALOG=rman_cat,TINA_RMAN_FOLDER=rman,TINA_
RMAN_USER=oracle)";
restore tablespace users;
recover tablespace users;
release channel c1;
release channel c2;
}
connected to recovery catalog database
connected to target database: TEST102 (DBID=4092454596)
starting full resync of recovery catalog
full resync complete
allocated channel: c1
channel c1: sid=139 devtype=SBT_TAPE
channel c1: Time Navigator Media Management (Tpl)
allocated channel: c2
channel c2: sid=145 devtype=SBT_TAPE
channel c2: Time Navigator Media Management (Tpl)
Starting restore at 29-SEP-06
channel c1: starting datafile backupset restore
channel c1: specifying datafile(s) to restore from backup set
restoring datafile 00004 to /Applis/oracle/oradata/TEST102/users01.dbf
channel c1: reading from backup piece 09huh1vs_1_1
channel c1: restored backup piece 1
piece handle=09huh1vs_1_1 tag=TAG20060929T165523
channel c1: restore complete, elapsed time: 00:00:15
Finished restore at 29-SEP-06
Starting recover at 29-SEP-06
starting media recovery
media recovery complete, elapsed time: 00:00:01
Finished recover at 29-SEP-06
released channel: c1
```

**sbtio.log File**

The sbtio.log file contains traces about how RMAN operates with Tina.\
This image shows how the traces are formatted in the sbtio.log file:

<figure><img src="https://137371609-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HOI4mniMS7pDfClN83G%2Fuploads%2Fgit-blob-cfda0ad83bcff3619e9c72b03b85f9c3ed7cb800%2Fimage%20(57).png?alt=media" alt=""><figcaption></figcaption></figure>

The sbtio.log file contains messages from the libtina\_rman library, while the events relating to tina\_stream and tina\_tpl\_back\_end are stored in the Tina events. To view the events, in the Web Administration choose Current Activity Events. For more information, see the Tina Administration Documentation.

### Disaster Recovery

This topic describes how to perform a disaster recovery of an Oracle database with Tina for Oracle using Recovery Manager.

#### Prerequisites

The RMAN autobackup feature (automatic backup) must be configured when backing up the database in order to be able to perform a disaster recovery of the backed-up database.

#### Disaster Recovery Procedure

The disaster recovery procedure is described in detail in Use Case for Disaster Recovery. This topic only describes the general principles for performing a disaster recovery.\
The objects required for the disaster recovery procedure are as follows:

* Backups of all data files (datafiles).
* All archived redo logs generated after the oldest backup of the data files.
* At least one automatic backup of the control file/parameter file\
  (control/parameter file autobackup).
* A record of the source database ID (DBID).\
  The steps to follow during the disaster recovery procedure are as follows
* Restore the parameter file.
* Restore the control file.
* Restore the database.
* Recover the database.

#### Use Case for Disaster Recovery

This use case describes how to perform a disaster recovery of an Oracle database backed up with Tina for Oracle using Recovery Manager. The Online Connect graphical module is only used to visually show the database. All backups and restores are performed using the RMAN module.\
To simulate a disaster recovery, the virtual machine hosting the database is shut down.\
In this topic, you will find the following information.

**Preliminary Steps**

The steps to follow before performing a disaster recovery of the ORA5 database on the frlulvc-06 system are as follows:

* Create a Linux virtual machine as the system using CentOS 6.7, called\
  frlulvc-05.
* Install Oracle 11gR2 without creating a database.
* Install a Tina agent connected to the klondike backup catalog, selecting the Oracle option (including RMAN) during installation.
* Clone the VM to create a second system called frlulvc-06.
* Create a standard 1 GB database on the frlulvc-05 system, SID ORA5, using the Database Configuration\
  Assistant (DBCA).
* Back up the database using RMAN (with the autobackup feature configured).
* Shut down the frlulvc-05 VM to simulate a disaster.

> **Note**: For this use case, you do not use an RMAN catalog. RMAN metadata is stored in the control file.

**Backing Up the Oracle Database**

The steps to follow in Tina for Oracle using Recovery Manager to back up the ORA5 database on the frlulvc-05 system are as follows:

* Check for the presence of libtina\_rman.so in $TINA\_HOME/Lib on frlulvc-05.
* Create a media set called rman in the backup catalog, and associate VLS drives with it.
* Create an archive folder called rman.ORA5 in the backup catalog, using the rman set with the sidf cartridge format, and selecting the Compressed option.
* Create a user group called dba in the backup catalog.
* Create a user called oracle in the backup catalog, associate this user with the dba user group, and assign it all rights regarding media and archiving.

The steps to follow in RMAN to back up the ORA5 database on the frlulvc-05 system are as follows:

* Start RMAN as the Oracle Linux user and connect to the database. See **Script 1: Start RMAN and Connect to the Oracle Database.**
* Write and run a script to back up the database. See **Script 2: Back Up the Oracle Database.**

**Script 1: Start RMAN and Connect to the Oracle Database**

This script starts RMAN and connects to the ORA5 database

```bash
[oracle@frlulvc-05 Rman]$ ll
total 12
-rw-r--r--. 1 oracle dba 368 Apr 7 18:57 bkp_ora5.rman
[oracle@frlulvc-05 Rman]$ rman
Recovery Manager: Release 11.2.0.1.0 - Production on Thu Apr 7 18:59:49 2016
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved
RMAN> connect target /
connected to target database: ORA5 (DBID=1894324806)
```

> **Note**: Connecting to the source database lets you find out its DBID. Please note this DBID, as you will need it later for the disaster recovery.

**Script 2: Back Up the Oracle Database**

This script, called bkp\_ora5.rman, performs a full backup of the ORA5 database. It includes the list of environment variables for the Tina agent using the parms command.

> **Note**: The list of environment variables is always the same for all backup and restore scripts, so you can create a /home/oracle/Rman directory to hold these scripts and copy them there.

> **Note**: You do not need to configure parallel backups (multi-channel) for the disaster recovery use case.

> **Note**: You must configure the RMAN autobackup feature so that every backup includes a control file and a parameter file, which is essential for disaster recovery. However, you do not need to perform this configuration for every backup.

```plaintext
RMAN> @bkp_ora5.rman
RMAN> run {
    allocate channel c1 type sbt
    parms="SBT_LIBRARY=/opt/Atempo/Tina/klondike/Lib/libtina_rman.so,
    ENV=(TINA_HOME=/opt/Atempo/Tina/klondike, TINA_RMAN_CATALOG=klondike,
    TINA_RMAN_FOLDER=rman.ORA5, TINA_SERVICE_NAME=rks,
    TINA_RMAN_USER=oracle, TINA_RMAN_TRACE_LEVEL=1)";
    
    configure controlfile autobackup on;
    backup database plus archivelog;
    
    release channel c1;
}

Using target database control file instead of recovery catalog
allocated channel: c1
channel c1: SID=40 device type=SBT_TAPE
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored

Starting backup at 07-APR-16
current log archived
channel c1: starting archived log backup set
channel c1: specifying archived log(s) in backup set
input archived log thread=1 sequence=3 RECID=1 STAMP=908558243
input archived log thread=1 sequence=4 RECID=2 STAMP=908564700
channel c1: starting piece 1 at 07-APR-16
channel c1: finished piece 1 at 07-APR-16
piece handle=01r2f66t_1_1 tag=TAG20160407T190500 comment=API Version 2.0,MM
channel c1: backup set complete, elapsed time: 00:00:15

Finished backup at 07-APR-16
Starting backup at 07-APR-16
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00001
name=/u01/app/oradata/ora5/ORA5/system01.dbf
input datafile file number=00002
name=/u01/app/oradata/ora5/ORA5/sysaux01.dbf
input datafile file number=00005
name=/u01/app/oradata/ora5/ORA5/example01.dbf
input datafile file number=00003
name=/u01/app/oradata/ora5/ORA5/undotbs01.dbf
input datafile file number=00004
name=/u01/app/oradata/ora5/ORA5/users01.dbf
channel c1: starting piece 1 at 07-APR-16
channel c1: finished piece 1 at 07-APR-16
piece handle=02r2f67c_1_1 tag=TAG20160407T190516 comment=API Version 2.0,MM
channel c1: backup set complete, elapsed time: 00:01:15
Finished backup at 07-APR-16
Starting backup at 07-APR-16
current log archived
channel c1: starting archived log backup set
channel c1: specifying archived log(s) in backup set
input archived log thread=1 sequence=5 RECID=3 STAMP=908564792
channel c1: starting piece 1 at 07-APR-16
channel c1: finished piece 1 at 07-APR-16
piece handle=03r2f69p_1_1 tag=TAG20160407T190632 comment=API Version 2.0,MM
channel c1: backup set complete, elapsed time: 00:00:15
Finished backup at 07-APR-16
Starting Control File and SPFILE Autobackup at 07-APR-16
piece handle=c-1894324806-20160407-00 comment=API Version 2.0,MMS Version 4
Finished Control File and SPFILE Autobackup at 07-APR-16
released channel: c1
RMAN> **end-of-file**
RMAN> quit
Recovery Manager complete.
[oracle@frlulvc-05 Rman]$
```

This backup created four jobs (6158 to 6161):

* Jobs 6158 and 6160 correspond to archived logs.
* Job 6159 corresponds to data files and has a large volume (995 MB).
* Job 6161 corresponds to the automatic backup of the control file and the parameter file (autobackup), and its "piece name", which is characteristic of RMAN, contains the DBID that you will find again later in the archive folder <kbd>rman.ORA5.</kbd>

This image shows the Job Manager:

<figure><img src="https://137371609-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HOI4mniMS7pDfClN83G%2Fuploads%2Fgit-blob-402b325ac09474b27fa9962fa2a14b23ebafc277%2Fimage%20(285).png?alt=media" alt=""><figcaption></figcaption></figure>

**Viewing the Backed-Up Oracle Database**

This topic describes how to configure the Online Connect graphical module, Tina for Oracle, to view the backed-up database in the Restore and Archiving interface. View the backed-up database with Tina for Oracle Step 1: In Tina for Oracle using Recovery Manager.

1. Check for the presence of libtina\_ora\_11.so in $TINA\_HOME/Lib on frlulvc-05.
2. In $TINA\_HOME/Conf, create the tina\_env.local script by copying the tina\_env.local.sample sample file. Find and remove the comment on the Oracle block on line 9, then change the value of the ORACLE\_HOME environment variable, so that the Oracle shared libraries such as libclntsh.so or libnnz11.so can be found:

```bash
Step 2: In Tina Web Administration.
Note: The Tina for Oracle module may require a separate license from the one used
for the Tina for Oracle using Recovery Manager module. Contact Atempo for more
information.
# Oracle Online Connect module environment
ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
APP_BINS=${ORACLE_HOME}/bin
APP_LIBS=${ORACLE_HOME}/lib:${ORACLE_HOME}/network/lib
PATH=${APP_BINS}:${PATH}
export PATH
LD_LIBRARY_PATH=${APP_LIBS}:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH
```

3. Restart the Tina service on frlulvc-05 as root, refreshing the environment:

   ```
   [root@frlulvc-05 klondike]# tina_stop 
   tina_stop: Time Navigator Enterprise Edition stopped on "frlulvc05.fr.atempo"
   [root@frlulvc-05 klondike]# . .tina.sh 
   [root@frlulvc-05 klondike]# env | grep PATH 
   LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/db_1/lib:/u01/app/oracle/product/11.2.0/db_1/network/lib:/opt/Atempo/Tina/klondike/Lib:/opt/Atempo/Tina/klond
   PATH=/u01/app/oracle/product/11.2.0/db_1/bin:/opt/Atempo/Tina/klondike/Bin:/usr
   [root@frlulvc-05 klondike]# tina_daemon 
   [root@frlulvc-05 klondike]#
   ```

**Step 2: In the Tina Web Administration.**

> **Note**: The Tina for Oracle module may require a separate license from the one used for the Tina for Oracle using Recovery Manager module. Contact Atempo for more information.

4. Create an Oracle application called frlulvc-05.ORA5 in the backup catalog. This table describes the parameters you must set to create the Oracle application:

<table><thead><tr><th width="269">Parameters</th><th>Description</th></tr></thead><tbody><tr><td><strong>System Selection</strong></td><td>Select the <strong>frlulvc-05</strong> system.</td></tr><tr><td><strong>General Information</strong></td><td></td></tr><tr><td><strong>Application Name</strong></td><td>Enter the application name: <strong>frlulvc-05.ORA5</strong>.</td></tr><tr><td><strong>Application Type</strong></td><td>Select the application: <strong>Oracle</strong>.</td></tr><tr><td><strong>Comment</strong></td><td><strong>Optional.</strong> Enter a comment describing the application.</td></tr><tr><td><strong>User Information</strong></td><td></td></tr><tr><td><strong>Owner</strong></td><td>Enter the owner's name: <strong>oracle</strong>.</td></tr><tr><td><strong>Password and Confirmation (owner)</strong></td><td>Enter the owner's password and confirm it.</td></tr><tr><td><strong>Access User</strong></td><td>Enter the access user's name: <strong>SYS</strong>.</td></tr><tr><td><strong>Password and Confirmation (access)</strong></td><td>Enter the access user's password and confirm it.</td></tr><tr><td><strong>Environment Variables</strong></td><td></td></tr><tr><td><strong>Oracle Installation Directory (ORACLE_HOME)</strong></td><td>Enter the directory where the Oracle version is installed: <strong>/u01/app/oracle/product/11.2.0/db_1</strong>.</td></tr><tr><td><strong>Oracle System Identifier (ORACLE_SID)</strong></td><td>Enter the Oracle system identifier of the instance to use: <strong>ORA5</strong>.</td></tr><tr><td><strong>Oracle Dynamic Library Path (TINA_APP_LIB_PATH)</strong></td><td>Enter the Tina for Oracle module's dynamic library to use: <strong>libtina_ora_11.so</strong>.</td></tr><tr><td><strong>Oracle Root Directory (ORACLE_BASE)</strong></td><td>Specify the base of the Oracle directory structure for OFA-compliant databases. This is normally the home directory of <strong>ORACLE_OWNER</strong>: <strong>/u01/app/oracle</strong>.</td></tr></tbody></table>

5. Launch the Restore and Archiving interface for the backed-up ORA5 database, which works with the spfileORA5.ora spfile, the binary version of the pfile.

   > **Note**: Sql\*Net was not configured because the sqlnet.ora and tnsnames.ora files in $ORACLE\_HOME/network/admin were not found.
   >
   > > **Note**: The database incarnation ID is 908557578 as mentioned in the archived logs or redo logs. This information is important for what follows.

   This image shows the Restore and Archiving interface for the backed-up ORA5 database:

<figure><img src="https://137371609-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HOI4mniMS7pDfClN83G%2Fuploads%2Fgit-blob-5b3f645e387a105a77225ffdb6cc072e4af4b426%2Fimage%20(286).png?alt=media" alt=""><figcaption></figcaption></figure>

For more information on environment variables, see[ <mark style="color:blue;">Tina for Oracle Environment Variables.</mark>](https://documentation.atempo.com/tina-4.9.5/tina-4.9.5-en/administration-guide/settings/environment-variables.md)

**Disaster Recovery of the Oracle Database**

Before performing a disaster recovery of the Oracle database, make sure you have the following Oracle objects:

* Backups of all data files (datafiles) (job 6159).
* All archived redo logs generated after the oldest backup of the data files (job 6160).
* At least one automatic backup of the control file/parameter file\
  (control/parameter file autobackup) (job 6161).
* A record of the source database ID (DBID).\
  RMAN disaster recovery is a "closed loop" (bootstrap) process:

  * You cannot restore the data files without a valid control file that tells you which data files to restore and their location.
  * You cannot restore the control file without a valid parameter file that tells you where to put the control file.

  The steps to follow to perform the disaster recovery of the Oracle database are as follows:
* Restore the parameter file (job 6162).
* Restore the control file (job 6163).
* Restore the database (job 6164).
* Recover the database (job 6165).

**Restoring the Parameter File**

The database is restored with the same directory structure as on frlulvc-05.

**Restore the Parameter File (Job 6162)**

1. Launch the Restore and Archiving interface and display the rman.ORA5 archive folder to retrieve the DBID of the backed-up Oracle database.

   > **Note**: You can also retrieve the DBID from the RMAN catalog, if available, with a list incarnation command.

This image shows the rman.ORA5 archive folder in the Restore and Archiving interface:

<figure><img src="https://137371609-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HOI4mniMS7pDfClN83G%2Fuploads%2Fgit-blob-8b60f9f91d236fbe5ce972fe4fa4ab3e181b6697%2Fimage%20(287).png?alt=media" alt=""><figcaption></figcaption></figure>

Each automatic backup of the control file (controlfile autobackup) has a characteristic name starting with the letter c, followed by the DBID, then a timestamp (date and time) (c-1894324806-20160407-00).

2. Start RMAN, connect to the target, and specify the DBID:

```
[oracle@frlulvc-06 Rman]$ rman nocatalog
Recovery Manager: Release 11.2.0.1.0 - Production on Thu Apr 7 20:35:05 2016
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved
RMAN> connect target /
connected to target database (not started)
RMAN> set dbid 1894324806;
executing command: SET DBID
```

3. Start Oracle without a control file using a dummy parameter file provided by RMAN:

```
RMAN> startup nomount
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file
'/u01/app/oracle/product/11.2.0/db_1/dbs/initORA5.ora'
starting Oracle instance without parameter file for retrieval of spfile
Oracle instance started
Total System Global Area 158662656 bytes
Fixed Size 2211448 bytes
Variable Size 88080776 bytes
Database Buffers 62914560 bytes
Redo Buffers 5455872 bytes
RMAN>
```

4. Create a new RMAN script, called rest\_spfile\_ora5.rman, to restore the pfile to the location shown above, and run it, which creates Tina restore job 6162:

```
RMAN> @rest_spfile_ora5.rman
RMAN> run {
2> allocate channel c1 type sbt
3> parms="SBT_LIBRARY=/opt/Atempo/Tina/klondike/Lib/libtina_rman.so,ENV=(TINA_HOME=/opt/Atempo/Tina/klondike, TINA_RMAN_CATALOG=klondike, TINA_RMAN_FOLDER=rman.ORA5, TINA_SERVICE_NAME=rks, TINA_RMAN_USER=oracle, TINA_RMAN_TRACE_LEVEL=1)";
4>
5> restore spfile to pfile '/u01/app/oracle/product/11.2.0/db_1/dbs/initORA5.ora' from autobackup;
6>
7> release channel c1;
8> }
allocated channel: c1
channel c1: SID=19 device type=SBT_TAPE
channel c1: Time Navigator Media Management (tpl-pc)
Starting restore at 07-APR-16
channel c1: looking for AUTOBACKUP on day: 20160407
channel c1: AUTOBACKUP found: c-1894324806-20160407-00
channel c1: restoring spfile from AUTOBACKUP c-1894324806-20160407-00
channel c1: SPFILE restore from AUTOBACKUP complete
Finished restore at 07-APR-16
released channel: c1
RMAN> **end-of-file**
```

The parameter file is extracted from the automatic backup of the control file.

**Restoring the Control File**

If you start the database using the parameter file you just restored without first recreating the directory structure required to support the database, the database startup fails:

```
RMAN> shutdown abort
Oracle instance shut down

RMAN> startup force nomount pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/initORA5.ora';

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of startup command at 04/07/2016 20:49:31
RMAN-04014: startup failed: ORA-09925: Unable to create audit trail file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 9925
```

Indeed, RMAN does not recreate the directory structure required to support the database, unlike the Online Connect graphical module. You must therefore do this manually.

**Restore the Control File (Job 6163)**

1. Open the initORA5.ora parameter file and check the directory structure required to support the database:

```bash
ORA5.__db_cache_size=905969664
ORA5.__java_pool_size=16777216
ORA5.__large_pool_size=16777216
ORA5.__oracle_base='/u01/app/oracle' # ORACLE_BASE set from environment
ORA5.__pga_aggregate_target=855638016
ORA5.__sga_target=1275068416
ORA5.__shared_io_pool_size=0
ORA5.__shared_pool_size=318767104
ORA5.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/ORA5/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_
files='/u01/app/oradata/ora5/ORA5/control01.ctl','/u01/app/oradata/ora5/ORA
5'
*.db_block_size=8192
*.db_domain=''
*.db_name='ORA5'
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ORA5XDB)'
*.log_archive_dest_1='LOCATION=/u01/app/oradata/ora5/arch'
*.log_archive_format='%t_%s_%r.dbf'
*.memory_target=2122317824
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
```

2. Create the missing directories as the oracle user:

```bash
[oracle@frlulvc-06 Rman]$ mkdir –p /u01/app/oracle/admin/ORA5/adump
[oracle@frlulvc-06 Rman]$ mkdir –p /u01/app/oradata/ora5/ORA5
[oracle@frlulvc-06 Rman]$ mkdir –p /u01/app/oradata/ora5/arch
[oracle@frlulvc-06 Rman]$
```

3. Restart the database using the parameter file you just restored:

```plaintext
RMAN> startup force nomount
pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/initORA5.ora';

Oracle instance started

Total System Global Area 2121183232 bytes
Fixed Size                  2215016 bytes
Variable Size            1207960472 bytes
Database Buffers         905969664 bytes
Redo Buffers                5038080 bytes
RMAN>
```

4. Create a new RMAN script, called rest\_controlfile\_ora5.rman, to restore the control file to the locations defined in the pfile, and run it. This creates Tina restore job 6163:

   ```sql
   RMAN> @rest\_controlfile\_ora5.rman
   RMAN> run {
   2> allocate channel c1 type sbt;
   3>
   parms="SBT_LIBRARY=/opt/Atempo/Tina/klondike/Lib/libtina_rman.so,ENV=(TINA_
   HOM
   E=/opt/Atempo/Tina/klondike, TINA_RMAN_CATALOG=klondike,
   TINA_RMAN_FOLDER=rman.ORA5, TINA_SERVICE_NAME=rks, TINA_RMAN_USER=oracle,
   TINA_RMAN_TRACE_LEVEL=1)";
   4>
   5> restore controlfile from autobackup;
   6>
   7> release channel c1;
   8> }
   allocated channel: c1
   channel c1: SID=19 device type=SBT_TAPE
   channel c1: Time Navigator Media Management (tpl-pc)
   Starting restore at 07-APR-16
   channel c1: looking for AUTOBACKUP on day: 20160407
   channel c1: AUTOBACKUP found: c-1894324806-20160407-00
   channel c1: restoring control file from AUTOBACKUP c-1894324806-20160407-00
   channel c1: control file restore from AUTOBACKUP complete
   output file name=/u01/app/oradata/ora5/ORA5/control01.ctl
   output file name=/u01/app/oradata/ora5/ORA5/control02.ctl
   Finished restore at 07-APR-16
   released channel: c1
   RMAN> **end-of-file**
   ```

The control file is extracted from the automatic backup of the control file\
(controlfile autobackup). Note that the same "backup piece" was restored twice from Tina for Oracle. As a result, the size of job 6163 (9 MB) is the same as that of\
job 6162.

**Restoring the Database**

**Restore the Database (Job 6164)**

1. Mount the database using the control file you just restored:

   ```sql
   RMAN> alter database mount;
   database mounted
   ```
2. Create a new RMAN script, called rest\_database\_ora5.rman, to restore the database to the locations defined in the control file, and run it. This creates Tina restore job 6164:

```rman
RMAN> @rest_database_ora5.rman
RMAN> run {
2> allocate channel c1 type sbt
3>
parms="SBT_LIBRARY=/opt/Atempo/Tina/klondike/Lib/libtina_rman.so,ENV=(TINA_
HOM
E=/opt/Atempo/Tina/klondike, TINA_RMAN_CATALOG=klondike,
TINA_RMAN_FOLDER=rman.ORA5, TINA_SERVICE_NAME=rks, TINA_RMAN_USER=oracle,
TINA_RMAN_TRACE_LEVEL=1)";
4>
5> restore database;
6>
7> release channel c1;
8> }
allocated channel: c1
channel c1: SID=19 device type=SBT_TAPE
channel c1: Time Navigator Media Management (tpl-pc)
Starting restore at 07-APR-16
channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00001 to
/u01/app/oradata/ora5/ORA5/system01.dbf
channel c1: restoring datafile 00002 to
/u01/app/oradata/ora5/ORA5/sysaux01.dbf
channel c1: restoring datafile 00003 to
/u01/app/oradata/ora5/ORA5/undotbs01.dbf
channel c1: restoring datafile 00004 to
/u01/app/oradata/ora5/ORA5/users01.dbf
channel c1: restoring datafile 00005 to
/u01/app/oradata/ora5/ORA5/example01.dbf
channel c1: reading from backup piece 02r2f67c_1_1
channel c1: piece handle=02r2f67c_1_1 tag=TAG20160407T190516
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:03:05
Finished restore at 07-APR-16
released channel: c1
RMAN> **end-of-file**
```

**Recovering the Database**

**Recover the Database (Job 6165)**

1. Create a new RMAN script, called <kbd>reco\_database\_ora5.rman</kbd>, to recover the database, and run it. This creates Tina restore job 6165 for the archived logs:

```rman
RMAN> @reco_database_ora5.rman
RMAN> run {
2> allocate channel c1 type sbt
3> parms="SBT_LIBRARY=/opt/Atempo/Tina/klondike/Lib/libtina_rman.so,ENV=(TINA_HOME=/opt/Atempo/Tina/klondike, TINA_RMAN_CATALOG=klondike, TINA_RMAN_FOLDER=rman.ORA5, TINA_SERVICE_NAME=rks, TINA_RMAN_USER=oracle, TINA_RMAN_TRACE_LEVEL=1)";
4> 
5> recover database;
6> 
7> release channel c1;
8> }

allocated channel: c1
channel c1: SID=19 device type=SBT_TAPE
channel c1: Time Navigator Media Management (tpl-pc)
Starting recover at 07-APR-16
starting media recovery
channel c1: starting archived log restore to default destination
channel c1: restoring archived log
archived log thread=1 sequence=5
channel c1: reading from backup piece 03r2f69p_1_1
channel c1: piece handle=03r2f69p_1_1 tag=TAG20160407T190632
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:00:07
archived log file name=/u01/app/oradata/ora5/arch/1_5_908557578.dbf thread=1 sequence=5
unable to find archived log
archived log thread=1 sequence=6
released channel: c1

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 04/07/2016 21:06:12
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 6 and starting SCN of 987980
RMAN> **end-of-file**
```

The recovery replays archived log sequence 5 but cannot find sequence 6! You must add an until clause for the recovery, but you cannot know which logs were available in a disaster recovery scenario!

2\. Modify the recovery script to include the until clause and run it again:

```bash
RMAN> @reco_database_ora5.rman 
RMAN> run {
  allocate channel c1 type sbt
  parms="SBT_LIBRARY=/opt/Atempo/Tina/klondike/Lib/libtina_rman.so,
  ENV=(TINA_HOME=/opt/Atempo/Tina/klondike,
  TINA_RMAN_CATALOG=klondike, TINA_RMAN_FOLDER=rman.ORA5,
  TINA_SERVICE_NAME=rks, TINA_RMAN_USER=oracle, TINA_RMAN_TRACE_LEVEL=1)";

  set until sequence 6;
  recover database;
  release channel c1;
}

allocated channel: c1
channel c1: SID=19 device type=SBT_TAPE
channel c1: Time Navigator Media Management (tpl-pc) 
executing command: SET until clause
Starting recover at 07-APR-16
starting media recovery
media recovery complete, elapsed time: 00:00:00
Finished recover at 07-APR-16
released channel: c1
RMAN> **end-of-file**
```

> **Note**: The script must be modified inside the script itself, not directly on the command line.

> **Note**: The sequence number specified is that of the next archived log sequence that does not exist in the backup folder. In this example, you recover up to 5 by specifying up to 6:

3. Open the database, and switch from one log to another to create an archived log history:

```bash
RMAN> ALTER DATABASE OPEN RESETLOGS;
database opened

RMAN> SQL 'ALTER SYSTEM SWITCH LOGFILE';
SQL statement: ALTER SYSTEM SWITCH LOGFILE

RMAN> QUIT
Recovery Manager complete.
[oracle@frlulvc-06 Rman]$
```

> **Note**: The resetlogs clause is mandatory to recreate the redo logs on the new system. This creates a new incarnation of the database, but with the same DBID.

**Viewing the Restored Oracle Database**

This topic describes how to configure the Online Connect graphical module, Tina for Oracle, to view the restored database in the Restore and Archiving interface, following the same steps as on the frlulvc-05 system.

**Viewing the Restored Database with Tina for Oracle**

**Step 1: In Tina for Oracle using Recovery Manager.**

1. Check for the presence of libtina\_ora\_11.so in $TINA\_HOME/Lib on frlulvc-06.
2. In $TINA\_HOME/Conf, create the tina\_env.local script using the sampletina\_env.local.sample file.
3. Restart the Tina service on frlulvc-06 as root, refreshing the environment.

**Step 2: In the Tina Web Administration.**

> **Note**: The Tina for Oracle module may require a separate license from the one used for the Tina for Oracle using Recovery Manager module. Contact Atempo for more information.

4\. Create an Oracle application called frlulvc-06.ORA5 in the backup catalog. This table describes the parameters you must set to create the Oracle application:

<table><thead><tr><th width="326.3333740234375">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong>System Selection</strong></td><td>Select the system: <strong>frlulvc-06</strong>.</td></tr><tr><td><strong>General Information</strong></td><td></td></tr><tr><td><strong>Application Name</strong></td><td>Enter the application name: <strong>frlulvc-06.ORA5</strong>.</td></tr><tr><td><strong>Application Type</strong></td><td>Select the application: <strong>Oracle</strong>.</td></tr><tr><td><strong>Comment</strong></td><td><strong>Optional.</strong> Enter a comment describing the application.</td></tr><tr><td><strong>User Information</strong></td><td></td></tr><tr><td><strong>Owner</strong></td><td>Enter the owner's name: <strong>oracle</strong>.</td></tr><tr><td><strong>Password and Confirmation (owner)</strong></td><td>Enter the owner's password and confirm it.</td></tr><tr><td><strong>Access User</strong></td><td>Enter the access user's name: <strong>SYS</strong>.</td></tr><tr><td><strong>Password and Confirmation (access)</strong></td><td>Enter the access user's password and confirm it.</td></tr><tr><td><strong>Environment Variables</strong></td><td></td></tr><tr><td><strong>Oracle Installation Directory (ORACLE_HOME)</strong></td><td>Enter the directory where the Oracle version is installed: <strong>/u01/app/oracle/product/11.2.0/db_1</strong></td></tr><tr><td><strong>Oracle System Identifier (ORACLE_SID)</strong></td><td>Enter the Oracle system identifier of the instance to use: <strong>ORA5</strong></td></tr><tr><td><strong>Oracle Dynamic Library Path (TINA_APP_LIB_PATH)</strong></td><td>Enter the Tina for Oracle module's dynamic library to use: <strong>libtina_ora_11.so</strong></td></tr><tr><td><strong>Oracle Root Directory (ORACLE_BASE)</strong></td><td>Specify the base of the Oracle directory (OFA). Typically: <strong>/u01/app/oracle</strong></td></tr><tr><td><strong>Pfile Startup File (TINA_ORA_STARTUP_PFILE)</strong></td><td>Specify the absolute path of the pfile used if the database cannot start with the spfile: <strong>/u01/app/oracle/product/11.2.0/db_1/dbs/initORA5.ora</strong></td></tr></tbody></table>

> **Note**: You must set the additional TINA\_ORA\_ STARTUP\_PFILE environment variable because the restored database currently works with a pfile, not an spfile.

5\. Launch the Restore and Archiving interface for the restored ORA5 database, which works with the pfileORA5.ora pfile.

> **Note**: The new incarnation ID for the database is 908630536 as mentioned in the archived logs or redo logs, whereas the restored archived log has incarnation ID 908557578 and belongs to sequence

> **Note**: RMAN does not back up network administration files, nor the file containing the passwords, unlike the Online Connect graphical module. The database administrator must therefore make other arrangements, keeping copies of these files on a different system on the network.

This image shows the Restore and Archiving interface for the restored ORA5 database:

<figure><img src="https://137371609-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HOI4mniMS7pDfClN83G%2Fuploads%2Fgit-blob-fcc492efd6c8609380246feef602d0797a251dc2%2Fimage%20(56).png?alt=media" alt=""><figcaption></figcaption></figure>

For more information on environment variables, see [<mark style="color:blue;">Tina for Oracle Environment Variables.</mark>](https://documentation.atempo.com/tina-4.9.5/tina-4.9.5-en/administration-guide/settings/environment-variables.md)

### RMAN Proxy Copy

#### Backup Process

RMAN Proxy Copy performs these actions during the backup:

1. The Oracle/RMAN server launches Tina for Oracle using Recovery Manager via the ORACLE RMAN Proxy Copy API and asks it to prepare the backup.
2. Tina for Oracle using Recovery Manager runs the command to check the availability of the volume to be copied. This command returns an error and prevents the backup from starting if the service is not available.
3. The Oracle RMAN server:

   • Puts the Oracle datafiles into consistent backup mode.

   • Sends a backup start request to Tina for Oracle using Recovery Manager via the API.

   • Assigns an instance identifier to each datafile.
4. Tina for Oracle using Recovery Manager runs the volume copy creation command. The creation command:

   • Creates a copy of the datafile volume.

   • Mounts the copy on the Tina backup agent.

   • Sends the result of the operation to Tina for Oracle using Recovery Manager.
5. Tina for Oracle using Recovery Manager informs the Oracle server that a copy has been made and that the database can be put into end-of-backup mode.
6. Tina for Oracle using Recovery Manager asks the Tina agent to start transferring the data to media.
7. The Tina backup agent archives the mounted copy of the datafiles to media and returns the status of the operation to Tina for Oracle using Recovery Manager.
8. Tina for Oracle using Recovery Manager informs the Oracle server that the datafiles have been written to media, ready to be used for a restore, and runs a command to delete the volume copy.

#### Restore Process

RMAN Proxy Copy performs these actions during the restore:

1. The Oracle RMAN server launches Tina for Oracle using Recovery Manager and provides it with the instance identifiers of the datafiles to restore via Oracle RMAN Proxy Copy.
2. Tina for Oracle using Recovery Manager starts the restore of the datafiles and creates a restore job for each media to be read.

## Time Navigation for Oracle on NetApp

### Restoring the Database

This chapter describes how to restore and recover the Oracle database stored on the Network Appliance file server. The restore procedure includes two main steps:

* **Restoring the database.** The process of reading data files, archive logs, and control files from the media and restoring them. This step is performed first via Tina Client for NDMP, then via Tina for Oracle.
* **Recovery.** The process of applying redo information to the data files to obtain a consistent database. This step is performed via Oracle Server Manager.

### Restoring the database

#### Restoring data files

1. Open "Restore and Archive" on the NDMP application.
2. Open the directory where the Oracle data files were backed up.
3. In the time navigation area, select the Show deleted files checkbox and enter a value greater than 0. The backed-up data files appear as crossed-out icons.
4. Select the data files you want to restore and select Tree Selection Versions. The Versions in Time window opens.
5. Select the backup version you want to revert to and click Synchronize. "Restore and Archive" displays the file tree in the past, as it was on the date of the backup you selected.
6. Check the data files that you need to restore.
7. Select Run Restore. The Restore window opens.
8. In the Settings tab, fill in the Other directory field with the path of the directory where you want to restore the data files, and select the restore settings.
9. Click **OK** to proceed with the restore.

*See the Tina restore documentation for more details on the restore settings.*

#### Restoring archive logs and control files

1. Stop the Oracle database.
2. Open **"Restore and Archive"** on the Oracle application.
3. Expand the meta-tree.
4. In the time navigation area, select the Show deleted files checkbox and enter a value greater than 0. The meta objects appear crossed out.
5. Select the control.sql meta-file and select Tree Selection Versions. The Versions in Time window opens.
6. Select the backup version closest to the one you previously selected for the NDMP application and click Synchronize.
7. In the time navigation area, clear the Show deleted files checkbox. "Restore and Archive" displays the meta-tree in the past, as it was on the date of the backup you selected.
8. Check the meta-files displayed in the meta-tree of the past:
   * All archive logs with their destination meta-link at the top of the \_ ARCHIVE\_LOGS meta-directory.
   * The control.sql meta-file with its user dump destination meta-link at the top of the \_CONTROL\_FILES meta-directory.
   * The \_REDO\_LOGS meta-directory, except for the dump destination meta-link.
9. Select Run Restore. The Restore window opens.
10. Select the restore settings and click OK to continue the restore.

*See the Tina restore documentation for details on the restore settings.*

### Database recovery

Database recovery involves running the control.sql script to recreate the control files and recover a consistent database.

**Example:** This example shows how the control.sql script restores and recovers the databases:

```bash
wismeril.oracle(13) [udump] pwd
/export/home/oracle/admin/FBN816/udump
wismeril.oracle(14) [udump] ls
control.sql
fbn816_ora_449.trc
tina_cold_FBN816.txt
tina_dbfs_FBN816.txt
wismeril.oracle(16) [udump] svrmgrl
Oracle Server Manager Release 3.1.6.0.0 - Production
Copyright (c) 1997, 1999, Oracle Corporation. All Rights Reserved.
Oracle8i Release 8.1.6.0.0 - Production
JServer Release 8.1.6.0.0 - Production
SVRMGR> connect internal
Connected.
SVRMGR> @/export/home/oracle/admin/FBN816/udumpcontrol.sql
ORACLE instance started.
Total System Global Area 25599984 bytes
Fixed Size 69616 bytes
Variable Size 24621056 bytes
Database Buffers 819200 bytes
Redo Buffers 90112 bytes
Statement processed.
Media recovery complete.
Statement processed.
Statement processed.
SVRMGR> exit
```

Your database has been successfully restored and recovered.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://documentation.atempo.com/tina-4.9.5/tina-4.9.5-en/administration-guide/restore/oracle.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
