RMAN> report schema;
using target database control file instead of recovery catalog Report of database schema for database with db_unique_name TESTDB
List of Permanent Datafiles =========================== File Size(MB) Tablespace RB segs Datafile Name ---- -------- -------------------- ------- ------------------------ 1 4190 SYSTEM *** /alidata/oracle/oradata/testdb/system01.dbf 2 820 SYSAUX *** /alidata/oracle/oradata/testdb/sysaux01.dbf 3 325 UNDOTBS1 *** /alidata/oracle/oradata/testdb/undotbs01.dbf 4 5 USERS *** /alidata/oracle/oradata/testdb/users01.dbf 5 100 DATA01 *** /alidata/oracle/oradata/testdb/data01_01.dbf
List of Temporary Files ======================= File Size(MB) Tablespace Maxsize(MB) Tempfile Name ---- -------- -------------------- ----------- -------------------- 1 254 TEMP 32767 /alidata/oracle/oradata/testdb/temp01.dbf
RMAN> copy datafile 4 to '/home/oracle/users01.dbf';
Starting backup at 26-OCT-20 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=215 device type=DISK channel ORA_DISK_1: starting datafile copy input datafile file number=00004 name=/alidata/oracle/oradata/testdb/users01.dbf output file name=/home/oracle/users01.dbf tag=TAG20201026T152814 RECID=2 STAMP=1054826895 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01 Finished backup at 26-OCT-20
Starting Control File and SPFILE Autobackup at 26-OCT-20 piece handle=/alidata/oracle/flash_recovery_area/TESTDB/autobackup/2020_10_26/o1_mf_s_1054826896_hsdynkkd_.bkp comment=NONE Finished Control File and SPFILE Autobackup at 26-OCT-20
RMAN> list copy of datafile 4;
List of Datafile Copies =======================
Key File S Completion Time Ckp SCN Ckp Time ------- ---- - --------------- ---------- --------------- 2 4 A 26-OCT-20 164681024 26-OCT-20 Name: /home/oracle/users01.dbf Tag: TAG20201026T152814
SYS@testdb>select host_name,version,status from v$instance;
HOST_NAME VERSION STATUS ---------------------------------------------------------------- ----------------- ------------ NB-flexgw1 11.2.0.1.0 OPEN SYS@testdb>!rm -rf /alidata/oracle/oradata/testdb/users01.dbf
SYS@testdb>select FILE
FILE ---------- NAME ---------------------------------------------------------------------------------------------------- STATUS ------- 1 /alidata/oracle/oradata/testdb/system01.dbf SYSTEM
2 /alidata/oracle/oradata/testdb/sysaux01.dbf ONLINE
3 /alidata/oracle/oradata/testdb/undotbs01.dbf ONLINE
4 /alidata/oracle/oradata/testdb/users01.dbf ONLINE
5 /alidata/oracle/oradata/testdb/data01_01.dbf ONLINE
SYS@testdb>conn scott/tiger; Connected. SCOTT@testdb>select * from tab;
TNAME TABTYPE CLUSTERID ------------------------------ ------- ---------- 123 TABLE BIN$nBsJv4MgoCrgUMgKNQYMIQ==$0 TABLE BIN$nBsJv4MhoCrgUMgKNQYMIQ==$0 TABLE BIN$nBsJv4MioCrgUMgKNQYMIQ==$0 TABLE BIN$sFrr2JVeiX/gUMgKNQZ/Tg==$0 TABLE DEPT TABLE EMP TABLE PROMOTIONS TABLE T1 TABLE TEMP_EMP TABLE TEST02 TABLE ZYADMIN TABLE
12 rows selected.
SCOTT@testdb>select * from t1 where rownum < 10; select * from t1 where rownum < 10 * ERROR at line 1: ORA-01116: error in opening database file 4 ORA-01110: data file 4: '/alidata/oracle/oradata/testdb/users01.dbf' ORA-27041: unable to open file Linux-x86_64 Error: 2: No such file or directory Additional information: 3
SCOTT@testdb>conn / as sysdba Connected.
SYS@testdb>ALTER TABLESPACE users OFFLINE; ALTER TABLESPACE users OFFLINE * ERROR at line 1: ORA-01116: error in opening database file 4 ORA-01110: data file 4: '/alidata/oracle/oradata/testdb/users01.dbf' ORA-27041: unable to open file Linux-x86_64 Error: 2: No such file or directory Additional information: 3
SYS@testdb>ALTER TABLESPACE users OFFLINE IMMEDIATE;
Tablespace altered.
SYS@testdb>select host_name,version,status from v$instance;
HOST_NAME VERSION STATUS ---------------------------------------------------------------- ----------------- ------------ NB-flexgw1 11.2.0.1.0 OPEN SYS@testdb>select FILE
FILE ---------- NAME ---------------------------------------------------------------------------------------------------- STATUS ------- 1 /alidata/oracle/oradata/testdb/system01.dbf SYSTEM
2 /alidata/oracle/oradata/testdb/sysaux01.dbf ONLINE
3 /alidata/oracle/oradata/testdb/undotbs01.dbf ONLINE
4 /alidata/oracle/oradata/testdb/users01.dbf RECOVER
5 /alidata/oracle/oradata/testdb/data01_01.dbf ONLINE
[oracle@NB-flexgw1 ~]$ rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Mon Oct 26 15:40:48 2020
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: TESTDB (DBID=2803324215)
RMAN> restore datafile 4;
Starting restore at 26-OCT-20 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=82 device type=DISK
channel ORA_DISK_1: restoring datafile 00004 input datafile copy RECID=2 STAMP=1054826895 file name=/home/oracle/users01.dbf destination for restore of datafile 00004: /alidata/oracle/oradata/testdb/users01.dbf channel ORA_DISK_1: copied datafile copy of datafile 00004 output file name=/alidata/oracle/oradata/testdb/users01.dbf RECID=0 STAMP=0 Finished restore at 26-OCT-20
RMAN> recover datafile 4;
Starting recover at 26-OCT-20 using channel ORA_DISK_1
starting media recovery media recovery complete, elapsed time: 00:00:02
Finished recover at 26-OCT-20
SYS@testdb>select FILE
FILE ---------- NAME ---------------------------------------------------------------------------------------------------- STATUS ------- 1 /alidata/oracle/oradata/testdb/system01.dbf SYSTEM
2 /alidata/oracle/oradata/testdb/sysaux01.dbf ONLINE
3 /alidata/oracle/oradata/testdb/undotbs01.dbf ONLINE
4 /alidata/oracle/oradata/testdb/users01.dbf OFFLINE
5 /alidata/oracle/oradata/testdb/data01_01.dbf ONLINE
SYS@testdb>ALTER TABLESPACE users online;
Tablespace altered.
SYS@testdb>select FILE
FILE ---------- NAME ---------------------------------------------------------------------------------------------------- STATUS ------- 1 /alidata/oracle/oradata/testdb/system01.dbf SYSTEM
2 /alidata/oracle/oradata/testdb/sysaux01.dbf ONLINE
3 /alidata/oracle/oradata/testdb/undotbs01.dbf ONLINE
4 /alidata/oracle/oradata/testdb/users01.dbf ONLINE
5 /alidata/oracle/oradata/testdb/data01_01.dbf ONLIN
|