Restore Tablespace using RMAN

SQL> select name from v$tablespace;

NAME
------------------------------
SYSAUX
SYSTEM
UNDOTBS1
USERS
TEMP
TEST

6 rows selected.
SQL> alter tablespace users offline;

Tablespace altered.

SQL> exit

[oratest@oracle dbs]$ date
Wed Sep  8 22:15:37 IST 2021

Connect RMAN and backup tablespace 

[oratest@oracle dbs]$  rman target/

Recovery Manager: Release 19.0.0.0.0 - Production on Wed Sep 8 22:16:02 2021
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database: TEST (DBID=2378581000)

RMAN> restore tablespace users until time "to_date
('08-SEP-2021 22:15:37','DD-MON-YYYY:HH24:MI:SS')"; Starting restore at 08-SEP-21 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=66 device type=DISK channel ORA_DISK_1: starting datafile backup set restore channel ORA_DISK_1: specifying datafile(s) to restore from backup set channel ORA_DISK_1: restoring datafile 00007 to
/u01/app/oracle/oradata/TEST/users01.dbf channel ORA_DISK_1: reading from backup piece
/u01/app/oracle/oradata/TEST/backup/1408j583_1_1 channel ORA_DISK_1: piece handle=
/u01/app/oracle/oradata/TEST/backup/1408j583_1_1 tag=TAG20210908T221323 channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: restore complete, elapsed time: 00:00:01 Finished restore at 08-SEP-21
[oracle@oracle ~]$ rman target/

RMAN> restore tablespace users;
Starting restore at 08-SEP-21
using channel ORA_DISK_1
skipping datafile 5; already restored to file 
/u01/app/oracle/oradata/TEST/datafile/users.dbf restore not done; all files read only, offline, excluded, or already restored Finished restore at 08-SEP-21
RMAN> recover tablespace users;
Starting recover at 08-SEP-21
using channel ORA_DISK_1
starting media recovery
archived log for thread 1 with sequence 32 is already on disk as file 
/u01/app/oracle/fast_recovery_area/TEST/archivelog/2021_09_02/o1_mf_1_32_jlzwlxjb_.arc media recovery complete, elapsed time: 00:00:12 Finished recover at 08-SEP-21 RMAN> exit Recovery Manager complete.
[oratest@oracle ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Sep 8 22:51:07 2021
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/TEST/system01.dbf
/u01/app/oracle/oradata/TEST/test03.dbf
/u01/app/oracle/oradata/TEST/sysaux01.dbf
/u01/app/oracle/oradata/TEST/undotbs01.dbf
/u01/app/oracle/oradata/TEST/test01.dbf
/u01/app/oracle/oradata/TEST/users01.dbf

6 rows selected.

Thank you for giving your valuable time to read the above information.

If you want to be updated with all our articles send us the Invitation or Follow us:

Ramkumar’s LinkedIn: https://www.linkedin.com/in/ramkumardba/
LinkedIn Group: https://www.linkedin.com/in/ramkumar-m-0061a0204/
Facebook Page: https://www.facebook.com/Oracleagent-344577549964301
Ramkumar’s Twitter: https://twitter.com/ramkuma02877110
Ramkumar’s Telegram: https://t.me/oracleageant
Ramkumar’s Facebook: https://www.facebook.com/ramkumarram8

One thought on “Restore Tablespace using RMAN