0级表空间后,又有0级全库备份,再1级表空间备份,xtts还认吗?

2023-12-17 23:41:16

0级表空间后,又有0级全库备份,再1级表空间备份,xtts还认吗?

不认。此时需要根据提示报错的scn号再做备份再做恢复:

backup incremental from SCN 1041682 tablespace DATA,USERS filesperset 300 format '/bak/hisdb1_05' tag=hisdb1;

0级表空间后,又1级全库增备份,再1级表空间备份,xtts还认吗?

认。

完整的测试代码:

会话1:

会话1:

SQL> !vi r.sql
set serveroutput on size 1000000
DECLARE
v_dev varchar2(50);
v_done boolean:=FALSE;
type t_fileTable is table of varchar2(255) index by binary_integer;
v_fileTable t_fileTable;
type t_dataTable is table of varchar2(4000) index by binary_integer;
v_dataTable t_dataTable;

v_maxPieces number:=1;
v_maxFiles number:=1;
v_restore_from varchar2(4);
v_file_no number:=0;
v_file_name varchar2(513);
v_debug boolean:=FALSE; -- Optional Change to TRUE to Debug PL/SQL.
v_msr boolean;

BEGIN
-- CHANGE 1.
-- Populate the file table below with datafiles to be restored.
-- This matches the output from logs.

v_dataTable(1):='fno=4 name=/home/db/oracle/oradata/hisdb/users01.dbf';
v_dataTable(2):='fno=9 name=/home/db/oracle/oradata/hisdb/data03.dbf';
v_dataTable(3):='fno=7 name=/home/db/oracle/oradata/hisdb/data01.dbf';
v_dataTable(4):='fno=8 name=/home/db/oracle/oradata/hisdb/data02.dbf';
v_dataTable(5):='fno=5 name=/home/db/oracle/oradata/hisdb/users02.dbf';
v_dataTable(6):='fno=10 name=/home/db/oracle/oradata/hisdb/data04.dbf';
v_dataTable(7):='fno=6 name=/home/db/oracle/oradata/hisdb/users03.dbf';

--
-- CHANGE 2.
-- Set the below to the max number of files to be restored from above table.

v_maxFiles := 7;

-- CHANGE 3.
-- Set the Below To the name of the backup pieces you wish to reference.
-- Use backup.log if available to locate all backup pieces for a backup.
-- If backup is on Disk ensure you have directories as well,
-- If tape then just use the backup piece name.

v_fileTable(1):='/bak/hisdb0_012e3g99_1_1';
v_fileTable(2):='/bak/hisdb0_022e3g99_1_1';
v_fileTable(3):='/bak/hisdb0_032e3g99_1_1';
v_fileTable(4):='/bak/hisdb0_042e3g99_1_1';

-- CHANGE 4.
-- Set the below to the total number of backup pieces in Backup to restore.
--

v_maxPieces:=4;

-- CHANGE 5. (Optional If Tape)
-- Set the below to TAPE if RESTORE FROM TAPE.
--
v_restore_from := 'DISK';

-- CHANGE 6 - change this to TRUE for multi-section backup
--v_msr := TRUE;
v_msr := FALSE;
IF (v_msr) THEN
v_maxFiles := 1;
END IF;

dbms_output.put_line('Restoring All Data Files :');
set serveroutput on size 1000000
DECLARE
v_dev varchar2(50);
v_done boolean:=FALSE;
type t_fileTable is table of varchar2(255) index by binary_integer;
v_fileTable t_fileTable;
type t_dataTable is table of varchar2(4000) index by binary_integer;
v_dataTable t_dataTable;

v_maxPieces number:=1;
v_maxFiles number:=1;
v_restore_from varchar2(4);
v_file_no number:=0;
v_file_name varchar2(513);
v_debug boolean:=FALSE; -- Optional Change to TRUE to Debug PL/SQL.
v_msr boolean;

BEGIN
-- CHANGE 1.
-- Populate the file table below with datafiles to be restored.
-- This matches the output from logs.

v_dataTable(1):='fno=4 name=/home/db/oracle/oradata/hisdb/users01.dbf';
v_dataTable(2):='fno=9 name=/home/db/oracle/oradata/hisdb/data03.dbf';
v_dataTable(3):='fno=7 name=/home/db/oracle/oradata/hisdb/data01.dbf';
v_dataTable(4):='fno=8 name=/home/db/oracle/oradata/hisdb/data02.dbf';
v_dataTable(5):='fno=5 name=/home/db/oracle/oradata/hisdb/users02.dbf';
v_dataTable(6):='fno=10 name=/home/db/oracle/oradata/hisdb/data04.dbf';
v_dataTable(7):='fno=6 name=/home/db/oracle/oradata/hisdb/users03.dbf';

--
-- CHANGE 2.
-- Set the below to the max number of files to be restored from above table.

v_maxFiles := 7;

-- CHANGE 3.
-- Set the Below To the name of the backup pieces you wish to reference.
-- Use backup.log if available to locate all backup pieces for a backup.
-- If backup is on Disk ensure you have directories as well,
-- If tape then just use the backup piece name.

"r.sql" 125L, 3870C written

SQL> @r.sql
Restoring All Data Files :
-----------------
Attempting To Restore :/home/db/oracle/oradata/hisdb/users01.dbf
----------------
Trying : /bak/hisdb0_0k2e9r3e_1_1 From : DISK
Data File : Found
----------------
RESTORED Data File To: /home/db/oracle/oradata/hisdb/users01.dbf
Attempting To Restore :/home/db/oracle/oradata/hisdb/data03.dbf
----------------
Trying : /bak/hisdb0_0k2e9r3e_1_1 From : DISK
Data File : Found
----------------
RESTORED Data File To: /home/db/oracle/oradata/hisdb/data03.dbf
Attempting To Restore :/home/db/oracle/oradata/hisdb/data01.dbf
----------------
Trying : /bak/hisdb0_0k2e9r3e_1_1 From : DISK
Data File: Not Found
----------------
Trying : /bak/hisdb0_0m2e9r3e_1_1 From : DISK
Data File : Found
----------------
RESTORED Data File To: /home/db/oracle/oradata/hisdb/data01.dbf
Attempting To Restore :/home/db/oracle/oradata/hisdb/data02.dbf
----------------
Trying : /bak/hisdb0_0k2e9r3e_1_1 From : DISK
Data File: Not Found
----------------
Trying : /bak/hisdb0_0m2e9r3e_1_1 From : DISK
Data File : Found
----------------
RESTORED Data File To: /home/db/oracle/oradata/hisdb/data02.dbf
Attempting To Restore :/home/db/oracle/oradata/hisdb/users02.dbf
----------------
Trying : /bak/hisdb0_0k2e9r3e_1_1 From : DISK
Data File: Not Found
----------------
Trying : /bak/hisdb0_0m2e9r3e_1_1 From : DISK
Data File: Not Found
----------------
Trying : /bak/hisdb0_0l2e9r3e_1_1 From : DISK
Data File : Found
----------------
RESTORED Data File To: /home/db/oracle/oradata/hisdb/users02.dbf
Attempting To Restore :/home/db/oracle/oradata/hisdb/data04.dbf
----------------
Trying : /bak/hisdb0_0k2e9r3e_1_1 From : DISK
Data File: Not Found
----------------
Trying : /bak/hisdb0_0m2e9r3e_1_1 From : DISK
Data File: Not Found
----------------
Trying : /bak/hisdb0_0l2e9r3e_1_1 From : DISK
Data File : Found
----------------
RESTORED Data File To: /home/db/oracle/oradata/hisdb/data04.dbf
Attempting To Restore :/home/db/oracle/oradata/hisdb/users03.dbf
----------------
Trying : /bak/hisdb0_0k2e9r3e_1_1 From : DISK
Data File: Not Found
----------------
Trying : /bak/hisdb0_0m2e9r3e_1_1 From : DISK
Data File: Not Found
----------------
Trying : /bak/hisdb0_0l2e9r3e_1_1 From : DISK
Data File: Not Found
----------------
Trying : /bak/hisdb0_0n2e9r3e_1_1 From : DISK
Data File : Found
----------------
RESTORED Data File To: /home/db/oracle/oradata/hisdb/users03.dbf

PL/SQL procedure successfully completed.

SQL> !ls -l /home/db/oracle/oradata/hisdb/
total 1919116
-rw-r-----. 1 oracle oinstall   9748480 Dec 17 22:34 control01.ctl
-rw-r-----  1 oracle oinstall   1056768 Dec 17 22:34 data01.dbf
-rw-r-----  1 oracle oinstall   1056768 Dec 17 22:34 data02.dbf
-rw-r-----  1 oracle oinstall   1056768 Dec 17 22:34 data03.dbf
-rw-r-----  1 oracle oinstall   1056768 Dec 17 22:34 data04.dbf
-rw-r-----. 1 oracle oinstall 209715712 Dec 17 22:32 redo01.log
-rw-r-----. 1 oracle oinstall 209715712 Dec 17 22:30 redo02.log
-rw-r-----. 1 oracle oinstall 209715712 Dec 17 22:30 redo03.log
-rw-r-----. 1 oracle oinstall 513810432 Dec 17 22:30 sysaux01.dbf
-rw-r-----. 1 oracle oinstall 713039872 Dec 17 22:30 system01.dbf
-rw-r-----. 1 oracle oinstall  30416896 Dec 17 22:31 temp01.dbf
-rw-r-----. 1 oracle oinstall  83894272 Dec 17 22:30 undotbs01.dbf
-rw-r-----  1 oracle oinstall   2105344 Dec 17 22:34 users01.dbf
-rw-r-----  1 oracle oinstall   2105344 Dec 17 22:34 users02.dbf
-rw-r-----  1 oracle oinstall   2105344 Dec 17 22:34 users03.dbf

SQL> !vi recover.sql
set serveroutput on;
DECLARE
outhandle varchar2(512) ;
outtag varchar2(30) ;
done boolean ;
failover boolean ;
devtype VARCHAR2(512);
BEGIN
DBMS_OUTPUT.put_line('Entering RollForward');
devtype := sys.dbms_backup_restore.deviceAllocate;
sys.dbms_backup_restore.applySetDatafile(check_logical => FALSE, cleanup => FALSE) ;
DBMS_OUTPUT.put_line('After applySetDataFile');
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>4,toname=>'/home/db/oracle/oradata/hisdb/users01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>9,toname=>'/home/db/oracle/oradata/hisdb/data03.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>7,toname=>'/home/db/oracle/oradata/hisdb/data01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>8,toname=>'/home/db/oracle/oradata/hisdb/data02.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>5,toname=>'/home/db/oracle/oradata/hisdb/users02.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>10,toname=>'/home/db/oracle/oradata/hisdb/data04.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>6,toname=>'/home/db/oracle/oradata/hisdb/users03.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
DBMS_OUTPUT.put_line('Done: applyDataFileTo');
sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb1_05',tag => null,fromdisk => true, recid => 0,stamp => 0) ;
DBMS_OUTPUT.put_line('Done: RestoreSetPiece');
sys.dbms_backup_restore.restoreBackupPiece(done => done,params => null,outhandle => outhandle,outtag => outtag, failover => failover);
DBMS_OUTPUT.put_line('Done: RestoreBackupPiece');
sys.dbms_backup_restore.restoreCancel(TRUE);
sys.dbms_backup_restore.deviceDeallocate;
END;
/

~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
set serveroutput on;
DECLARE
outhandle varchar2(512) ;
outtag varchar2(30) ;
done boolean ;
failover boolean ;
devtype VARCHAR2(512);
BEGIN
DBMS_OUTPUT.put_line('Entering RollForward');
devtype := sys.dbms_backup_restore.deviceAllocate;
sys.dbms_backup_restore.applySetDatafile(check_logical => FALSE, cleanup => FALSE) ;
DBMS_OUTPUT.put_line('After applySetDataFile');
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>4,toname=>'/home/db/oracle/oradata/hisdb/users01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>9,toname=>'/home/db/oracle/oradata/hisdb/data03.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>7,toname=>'/home/db/oracle/oradata/hisdb/data01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>8,toname=>'/home/db/oracle/oradata/hisdb/data02.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>5,toname=>'/home/db/oracle/oradata/hisdb/users02.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>10,toname=>'/home/db/oracle/oradata/hisdb/data04.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>6,toname=>'/home/db/oracle/oradata/hisdb/users03.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
DBMS_OUTPUT.put_line('Done: applyDataFileTo');
sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb1_05',tag => null,fromdisk => true, recid => 0,stamp => 0) ;
DBMS_OUTPUT.put_line('Done: RestoreSetPiece');
sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/isdb1_05',tag => null,fromdisk => true, recid => sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/sdb1_05',tag => null,fromdisk => true, recid => 0sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/db1_05',tag => null,fromdisk => true, recid => 0,sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/b1_05',tag => null,fromdisk => true, recid => 0,ssys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/1_05',tag => null,fromdisk => true, recid => 0,stsys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/_05',tag => null,fromdisk => true, recid => 0,stasys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/05',tag => null,fromdisk => true, recid => 0,stamsys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/5',tag => null,fromdisk => true, recid => 0,stampsys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/',tag => null,fromdisk => true, recid => 0,stamp sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb0_0o2e9r7g_1_1',tag => null,fromdisk => true"recover.sql" 29L, 2056C written

SQL> @recover.sql
Entering RollForward
After applySetDataFile
Done: applyDataFileTo
Done: RestoreSetPiece
DECLARE
*
ERROR at line 1:
ORA-19624: operation failed, retry possible
ORA-19870: error while restoring backup piece /bak/hisdb0_0o2e9r7g_1_1
ORA-19626: backup set type is full datafile - can not be processed by this conversation
ORA-06512: at "SYS.DBMS_BACKUP_RESTORE", line 2335
ORA-06512: at line 22


SQL> conn / as sysdba
Connected.
SQL> !vi recover.sql
set serveroutput on;
DECLARE
outhandle varchar2(512) ;
outtag varchar2(30) ;
done boolean ;
failover boolean ;
devtype VARCHAR2(512);
BEGIN
DBMS_OUTPUT.put_line('Entering RollForward');
devtype := sys.dbms_backup_restore.deviceAllocate;
sys.dbms_backup_restore.applySetDatafile(check_logical => FALSE, cleanup => FALSE) ;
DBMS_OUTPUT.put_line('After applySetDataFile');
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>4,toname=>'/home/db/oracle/oradata/hisdb/users01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>9,toname=>'/home/db/oracle/oradata/hisdb/data03.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>7,toname=>'/home/db/oracle/oradata/hisdb/data01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>8,toname=>'/home/db/oracle/oradata/hisdb/data02.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>5,toname=>'/home/db/oracle/oradata/hisdb/users02.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>10,toname=>'/home/db/oracle/oradata/hisdb/data04.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>6,toname=>'/home/db/oracle/oradata/hisdb/users03.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
DBMS_OUTPUT.put_line('Done: applyDataFileTo');
sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb0_0o2e9r7g_1_1',tag => null,fromdisk => true, recid => 0,stamp => 0) ;
DBMS_OUTPUT.put_line('Done: RestoreSetPiece');
sys.dbms_backup_restore.restoreBackupPiece(done => done,params => null,outhandle => outhandle,outtag => outtag, failover => failover);
DBMS_OUTPUT.put_line('Done: RestoreBackupPiece');
sys.dbms_backup_restore.restoreCancel(TRUE);
sys.dbms_backup_restore.deviceDeallocate;
END;
/

~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
set serveroutput on;
DECLARE
outhandle varchar2(512) ;
outtag varchar2(30) ;
done boolean ;
failover boolean ;
devtype VARCHAR2(512);
BEGIN
DBMS_OUTPUT.put_line('Entering RollForward');
devtype := sys.dbms_backup_restore.deviceAllocate;
sys.dbms_backup_restore.applySetDatafile(check_logical => FALSE, cleanup => FALSE) ;
DBMS_OUTPUT.put_line('After applySetDataFile');
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>4,toname=>'/home/db/oracle/oradata/hisdb/users01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>9,toname=>'/home/db/oracle/oradata/hisdb/data03.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>7,toname=>'/home/db/oracle/oradata/hisdb/data01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>8,toname=>'/home/db/oracle/oradata/hisdb/data02.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>5,toname=>'/home/db/oracle/oradata/hisdb/users02.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>10,toname=>'/home/db/oracle/oradata/hisdb/data04.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>6,toname=>'/home/db/oracle/oradata/hisdb/users03.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
DBMS_OUTPUT.put_line('Done: applyDataFileTo');
sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb0_0o2e9r7g_1_1',tag => null,fromdisk => true, recid => 0,stamp => 0) ;
sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/isdb0_0o2e9r7g_1_1',tag => null,fromdisk => true,sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/sdb0_0o2e9r7g_1_1',tag => null,fromdisk => true, sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/db0_0o2e9r7g_1_1',tag => null,fromdisk => true, rsys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/b0_0o2e9r7g_1_1',tag => null,fromdisk => true, resys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/0_0o2e9r7g_1_1',tag => null,fromdisk => true, recsys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/_0o2e9r7g_1_1',tag => null,fromdisk => true, recisys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/0o2e9r7g_1_1',tag => null,fromdisk => true, recidsys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/o2e9r7g_1_1',tag => null,fromdisk => true, recid sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/2e9r7g_1_1',tag => null,fromdisk => true, recid =sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/e9r7g_1_1',tag => null,fromdisk => true, recid =>sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/9r7g_1_1',tag => null,fromdisk => true, recid => sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/r7g_1_1',tag => null,fromdisk => true, recid => 0sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/7g_1_1',tag => null,fromdisk => true, recid => 0,sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/g_1_1',tag => null,fromdisk => true, recid => 0,ssys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/_1_1',tag => null,fromdisk => true, recid => 0,stsys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/1_1',tag => null,fromdisk => true, recid => 0,stasys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/_1',tag => null,fromdisk => true, recid => 0,stamsys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/1',tag => null,fromdisk => true, recid => 0,stampsys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/',tag => null,fromdisk => true, recid => 0,stamp sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb0_0q2e9r9a_1_1',tag => null,fromdisk => true"recover.sql" 29L, 2056C written

SQL> @recover.sql
Entering RollForward
After applySetDataFile
Done: applyDataFileTo
Done: RestoreSetPiece
DECLARE
*
ERROR at line 1:
ORA-19624: operation failed, retry possible
ORA-19870: error while restoring backup piece /bak/hisdb0_0q2e9r9a_1_1
ORA-19638: file /home/db/oracle/oradata/hisdb/users01.dbf is not current enough to apply this incremental backup
ORA-19642: start SCN of incremental backup is 1047813
ORA-19641: backup datafile checkpoint is SCN 1047878 time 12/17/2023 22:26:50
ORA-19640: datafile checkpoint is SCN 1047630 time 12/17/2023 22:23:42
ORA-06512: at "SYS.DBMS_BACKUP_RESTORE", line 2335
ORA-06512: at line 22


SQL> !vi recover.sql
set serveroutput on;
DECLARE
outhandle varchar2(512) ;
outtag varchar2(30) ;
done boolean ;
failover boolean ;
devtype VARCHAR2(512);
BEGIN
DBMS_OUTPUT.put_line('Entering RollForward');
devtype := sys.dbms_backup_restore.deviceAllocate;
sys.dbms_backup_restore.applySetDatafile(check_logical => FALSE, cleanup => FALSE) ;
DBMS_OUTPUT.put_line('After applySetDataFile');
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>4,toname=>'/home/db/oracle/oradata/hisdb/users01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>9,toname=>'/home/db/oracle/oradata/hisdb/data03.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>7,toname=>'/home/db/oracle/oradata/hisdb/data01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>8,toname=>'/home/db/oracle/oradata/hisdb/data02.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>5,toname=>'/home/db/oracle/oradata/hisdb/users02.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>10,toname=>'/home/db/oracle/oradata/hisdb/data04.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>6,toname=>'/home/db/oracle/oradata/hisdb/users03.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
DBMS_OUTPUT.put_line('Done: applyDataFileTo');
sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb0_0q2e9r9a_1_1',tag => null,fromdisk => true, recid => 0,stamp => 0) ;
DBMS_OUTPUT.put_line('Done: RestoreSetPiece');
sys.dbms_backup_restore.restoreBackupPiece(done => done,params => null,outhandle => outhandle,outtag => outtag, failover => failover);
DBMS_OUTPUT.put_line('Done: RestoreBackupPiece');
sys.dbms_backup_restore.restoreCancel(TRUE);
sys.dbms_backup_restore.deviceDeallocate;
END;
/

~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/isdb0_0q2e9r9a_1_1',tag => null,fromdisk => true,sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/sdb0_0q2e9r9a_1_1',tag => null,fromdisk => true, sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/db0_0q2e9r9a_1_1',tag => null,fromdisk => true, rsys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/b0_0q2e9r9a_1_1',tag => null,fromdisk => true, resys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/0_0q2e9r9a_1_1',tag => null,fromdisk => true, recsys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/_0q2e9r9a_1_1',tag => null,fromdisk => true, recisys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/0q2e9r9a_1_1',tag => null,fromdisk => true, recidsys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/q2e9r9a_1_1',tag => null,fromdisk => true, recid sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/2e9r9a_1_1',tag => null,fromdisk => true, recid =sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/e9r9a_1_1',tag => null,fromdisk => true, recid =>sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/9r9a_1_1',tag => null,fromdisk => true, recid => sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/r9a_1_1',tag => null,fromdisk => true, recid => 0sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/9a_1_1',tag => null,fromdisk => true, recid => 0,sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/a_1_1',tag => null,fromdisk => true, recid => 0,ssys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/_1_1',tag => null,fromdisk => true, recid => 0,stsys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/1_1',tag => null,fromdisk => true, recid => 0,stasys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/_1',tag => null,fromdisk => true, recid => 0,stamsys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/1',tag => null,fromdisk => true, recid => 0,stampsys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/',tag => null,fromdisk => true, recid => 0,stamp sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb1_07',tag => null,fromdisk => true, recid =>"recover.sql" 29L, 2046C written

SQL> @recover.sql
Entering RollForward
DECLARE
*
ERROR at line 1:
ORA-19568: a device is already allocated to this session
ORA-06512: at "SYS.DBMS_BACKUP_RESTORE", line 232
ORA-06512: at "SYS.DBMS_BACKUP_RESTORE", line 207
ORA-06512: at line 9


SQL> conn / as sysdba
Connected.
SQL> @recover.sql
Entering RollForward
After applySetDataFile
Done: applyDataFileTo
Done: RestoreSetPiece
DECLARE
*
ERROR at line 1:
ORA-19624: operation failed, retry possible
ORA-19870: error while restoring backup piece /bak/hisdb1_07
ORA-19638: file /home/db/oracle/oradata/hisdb/users01.dbf is not current enough to apply this incremental backup
ORA-19642: start SCN of incremental backup is 1047878
ORA-19641: backup datafile checkpoint is SCN 1047951 time 12/17/2023 22:28:22
ORA-19640: datafile checkpoint is SCN 1047630 time 12/17/2023 22:23:42
ORA-06512: at "SYS.DBMS_BACKUP_RESTORE", line 2335
ORA-06512: at line 22


SQL> !vi recover.sql
set serveroutput on;
DECLARE
outhandle varchar2(512) ;
outtag varchar2(30) ;
done boolean ;
failover boolean ;
devtype VARCHAR2(512);
BEGIN
DBMS_OUTPUT.put_line('Entering RollForward');
devtype := sys.dbms_backup_restore.deviceAllocate;
sys.dbms_backup_restore.applySetDatafile(check_logical => FALSE, cleanup => FALSE) ;
DBMS_OUTPUT.put_line('After applySetDataFile');
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>4,toname=>'/home/db/oracle/oradata/hisdb/users01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>9,toname=>'/home/db/oracle/oradata/hisdb/data03.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>7,toname=>'/home/db/oracle/oradata/hisdb/data01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>8,toname=>'/home/db/oracle/oradata/hisdb/data02.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>5,toname=>'/home/db/oracle/oradata/hisdb/users02.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>10,toname=>'/home/db/oracle/oradata/hisdb/data04.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>6,toname=>'/home/db/oracle/oradata/hisdb/users03.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
DBMS_OUTPUT.put_line('Done: applyDataFileTo');
sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb1_07',tag => null,fromdisk => true, recid => 0,stamp => 0) ;
DBMS_OUTPUT.put_line('Done: RestoreSetPiece');
sys.dbms_backup_restore.restoreBackupPiece(done => done,params => null,outhandle => outhandle,outtag => outtag, failover => failover);
DBMS_OUTPUT.put_line('Done: RestoreBackupPiece');
sys.dbms_backup_restore.restoreCancel(TRUE);
sys.dbms_backup_restore.deviceDeallocate;
END;
/

~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
set serveroutput on;
DECLARE
outhandle varchar2(512) ;
outtag varchar2(30) ;
done boolean ;
failover boolean ;
devtype VARCHAR2(512);
BEGIN
DBMS_OUTPUT.put_line('Entering RollForward');
devtype := sys.dbms_backup_restore.deviceAllocate;
sys.dbms_backup_restore.applySetDatafile(check_logical => FALSE, cleanup => FALSE) ;
DBMS_OUTPUT.put_line('After applySetDataFile');
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>4,toname=>'/home/db/oracle/oradata/hisdb/users01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>9,toname=>'/home/db/oracle/oradata/hisdb/data03.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>7,toname=>'/home/db/oracle/oradata/hisdb/data01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>8,toname=>'/home/db/oracle/oradata/hisdb/data02.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>5,toname=>'/home/db/oracle/oradata/hisdb/users02.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>10,toname=>'/home/db/oracle/oradata/hisdb/data04.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>6,toname=>'/home/db/oracle/oradata/hisdb/users03.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
DBMS_OUTPUT.put_line('Done: applyDataFileTo');
sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb1_0',tag => null,fromdisk => true, recid => sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb1_08',tag => null,fromdisk => true, recid =>"recover.sql" 29L, 2046C written

SQL> @recover.sql
Entering RollForward
DECLARE
*
ERROR at line 1:
ORA-19568: a device is already allocated to this session
ORA-06512: at "SYS.DBMS_BACKUP_RESTORE", line 232
ORA-06512: at "SYS.DBMS_BACKUP_RESTORE", line 207
ORA-06512: at line 9


SQL> conn / as sysdba
Connected.
SQL> @recover.sql
Entering RollForward
After applySetDataFile
Done: applyDataFileTo
Done: RestoreSetPiece
DECLARE
*
ERROR at line 1:
ORA-19624: operation failed, retry possible
ORA-19870: error while restoring backup piece /bak/hisdb1_08
ORA-19638: file /home/db/oracle/oradata/hisdb/users01.dbf is not current enough to apply this incremental backup
ORA-19642: start SCN of incremental backup is 1047951
ORA-19641: backup datafile checkpoint is SCN 1048074 time 12/17/2023 22:31:43
ORA-19640: datafile checkpoint is SCN 1047630 time 12/17/2023 22:23:42
ORA-06512: at "SYS.DBMS_BACKUP_RESTORE", line 2335
ORA-06512: at line 22


SQL> !vi recover.sql
set serveroutput on;
DECLARE
outhandle varchar2(512) ;
outtag varchar2(30) ;
done boolean ;
failover boolean ;
devtype VARCHAR2(512);
BEGIN
DBMS_OUTPUT.put_line('Entering RollForward');
devtype := sys.dbms_backup_restore.deviceAllocate;
sys.dbms_backup_restore.applySetDatafile(check_logical => FALSE, cleanup => FALSE) ;
DBMS_OUTPUT.put_line('After applySetDataFile');
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>4,toname=>'/home/db/oracle/oradata/hisdb/users01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>9,toname=>'/home/db/oracle/oradata/hisdb/data03.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>7,toname=>'/home/db/oracle/oradata/hisdb/data01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>8,toname=>'/home/db/oracle/oradata/hisdb/data02.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>5,toname=>'/home/db/oracle/oradata/hisdb/users02.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>10,toname=>'/home/db/oracle/oradata/hisdb/data04.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>6,toname=>'/home/db/oracle/oradata/hisdb/users03.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
DBMS_OUTPUT.put_line('Done: applyDataFileTo');
sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb1_08',tag => null,fromdisk => true, recid => 0,stamp => 0) ;
DBMS_OUTPUT.put_line('Done: RestoreSetPiece');
sys.dbms_backup_restore.restoreBackupPiece(done => done,params => null,outhandle => outhandle,outtag => outtag, failover => failover);
DBMS_OUTPUT.put_line('Done: RestoreBackupPiece');
sys.dbms_backup_restore.restoreCancel(TRUE);
sys.dbms_backup_restore.deviceDeallocate;
END;
/

~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
set serveroutput on;
DECLARE
outhandle varchar2(512) ;
outtag varchar2(30) ;
done boolean ;
failover boolean ;
devtype VARCHAR2(512);
BEGIN
DBMS_OUTPUT.put_line('Entering RollForward');
devtype := sys.dbms_backup_restore.deviceAllocate;
sys.dbms_backup_restore.applySetDatafile(check_logical => FALSE, cleanup => FALSE) ;
DBMS_OUTPUT.put_line('After applySetDataFile');
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>4,toname=>'/home/db/oracle/oradata/hisdb/users01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>9,toname=>'/home/db/oracle/oradata/hisdb/data03.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>7,toname=>'/home/db/oracle/oradata/hisdb/data01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>8,toname=>'/home/db/oracle/oradata/hisdb/data02.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>5,toname=>'/home/db/oracle/oradata/hisdb/users02.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>10,toname=>'/home/db/oracle/oradata/hisdb/data04.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>6,toname=>'/home/db/oracle/oradata/hisdb/users03.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
DBMS_OUTPUT.put_line('Done: applyDataFileTo');
sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb1_8',tag => null,fromdisk => true, recid => sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb1_',tag => null,fromdisk => true, recid => 0sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb1_s',tag => null,fromdisk => true, recid => sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb1_sc',tag => null,fromdisk => true, recid =>sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb1_scn',tag => null,fromdisk => true, recid ="recover.sql" 29L, 2047C written

SQL> @recover.sql
Entering RollForward
DECLARE
*
ERROR at line 1:
ORA-19568: a device is already allocated to this session
ORA-06512: at "SYS.DBMS_BACKUP_RESTORE", line 232
ORA-06512: at "SYS.DBMS_BACKUP_RESTORE", line 207
ORA-06512: at line 9


SQL> conn / as sysdba
Connected.
SQL> @recover.sql
Entering RollForward
After applySetDataFile
Done: applyDataFileTo
Done: RestoreSetPiece
Done: RestoreBackupPiece

PL/SQL procedure successfully completed.

SQL> @o.sql

OWNER                          OBJECT_TYPE           COUNT(*)
------------------------------ ------------------- ----------
J1                             DATABASE LINK                1
J1                             INDEX                        1
J1                             SYNONYM                      1
J1                             TABLE                       11
J2                             DATABASE LINK                1
J2                             SEQUENCE                     2
J2                             SYNONYM                      1
J2                             TABLE                        8
J2                             VIEW                         1
PUBLIC                         DATABASE LINK                2
PUBLIC                         SYNONYM                  27699

OWNER                          OBJECT_TYPE           COUNT(*)
------------------------------ ------------------- ----------
SCOTT                          INDEX                        2
SCOTT                          TABLE                        4

13 rows selected.

SQL> 
SQL> 
SQL> 
SQL> startup mount force;
ORACLE instance started.

Total System Global Area 1603411968 bytes
Fixed Size                  2213776 bytes
Variable Size             452986992 bytes
Database Buffers         1140850688 bytes
Redo Buffers                7360512 bytes
Database mounted.
SQL> flashback database hisdb to restore point before_imp_xtts;

Flashback complete.

SQL> alter database open resetlogs;

Database altered.

SQL> @tbs.sql
SP2-0310: unable to open file "tbs.sql"
SQL> @/home/oracle/tbs.sql

TABLESPACE_NAME                SUM_SPACE(M) SUM_BLOCKS USED_SPACE(M) USED_RATE(%) FREE_SPACE(M)
------------------------------ ------------ ---------- ------------- ------------ -------------
SYSTEM                                  680      87040        674.25        99.15          5.75
UNDOTBS1                                 80      10240            78         97.5             2
SYSAUX                                  490      62720        466.06        95.11         23.94
TEMP                                     29       3712             2          6.9            27

SQL> @o.sql

OWNER                          OBJECT_TYPE           COUNT(*)
------------------------------ ------------------- ----------
J1                             DATABASE LINK                1
J1                             SYNONYM                      1
J2                             DATABASE LINK                1
J2                             SEQUENCE                     2
J2                             SYNONYM                      1
J2                             TABLE                        2
J2                             VIEW                         1
PUBLIC                         DATABASE LINK                2
PUBLIC                         SYNONYM                  27699

9 rows selected.

SQL> @r.sql
Restoring All Data Files :
-----------------
Attempting To Restore :/home/db/oracle/oradata/hisdb/users01.dbf
----------------
Trying : /bak/hisdb0_0k2e9r3e_1_1 From : DISK
Data File : Found
----------------
RESTORED Data File To: /home/db/oracle/oradata/hisdb/users01.dbf
Attempting To Restore :/home/db/oracle/oradata/hisdb/data03.dbf
----------------
Trying : /bak/hisdb0_0k2e9r3e_1_1 From : DISK
Data File : Found
----------------
RESTORED Data File To: /home/db/oracle/oradata/hisdb/data03.dbf
Attempting To Restore :/home/db/oracle/oradata/hisdb/data01.dbf
----------------
Trying : /bak/hisdb0_0k2e9r3e_1_1 From : DISK
Data File: Not Found
----------------
Trying : /bak/hisdb0_0m2e9r3e_1_1 From : DISK
Data File : Found
----------------
RESTORED Data File To: /home/db/oracle/oradata/hisdb/data01.dbf
Attempting To Restore :/home/db/oracle/oradata/hisdb/data02.dbf
----------------
Trying : /bak/hisdb0_0k2e9r3e_1_1 From : DISK
Data File: Not Found
----------------
Trying : /bak/hisdb0_0m2e9r3e_1_1 From : DISK
Data File : Found
----------------
RESTORED Data File To: /home/db/oracle/oradata/hisdb/data02.dbf
Attempting To Restore :/home/db/oracle/oradata/hisdb/users02.dbf
----------------
Trying : /bak/hisdb0_0k2e9r3e_1_1 From : DISK
Data File: Not Found
----------------
Trying : /bak/hisdb0_0m2e9r3e_1_1 From : DISK
Data File: Not Found
----------------
Trying : /bak/hisdb0_0l2e9r3e_1_1 From : DISK
Data File : Found
----------------
RESTORED Data File To: /home/db/oracle/oradata/hisdb/users02.dbf
Attempting To Restore :/home/db/oracle/oradata/hisdb/data04.dbf
----------------
Trying : /bak/hisdb0_0k2e9r3e_1_1 From : DISK
Data File: Not Found
----------------
Trying : /bak/hisdb0_0m2e9r3e_1_1 From : DISK
Data File: Not Found
----------------
Trying : /bak/hisdb0_0l2e9r3e_1_1 From : DISK
Data File : Found
----------------
RESTORED Data File To: /home/db/oracle/oradata/hisdb/data04.dbf
Attempting To Restore :/home/db/oracle/oradata/hisdb/users03.dbf
----------------
Trying : /bak/hisdb0_0k2e9r3e_1_1 From : DISK
Data File: Not Found
----------------
Trying : /bak/hisdb0_0m2e9r3e_1_1 From : DISK
Data File: Not Found
----------------
Trying : /bak/hisdb0_0l2e9r3e_1_1 From : DISK
Data File: Not Found
----------------
Trying : /bak/hisdb0_0n2e9r3e_1_1 From : DISK
Data File : Found
----------------
RESTORED Data File To: /home/db/oracle/oradata/hisdb/users03.dbf

PL/SQL procedure successfully completed.

SQL> !ls -lt /home/db/oracle/oradata/hisdb/*
-rw-r-----. 1 oracle oinstall   9748480 Dec 17 22:47 /home/db/oracle/oradata/hisdb/control01.ctl
-rw-r-----  1 oracle oinstall   2105344 Dec 17 22:46 /home/db/oracle/oradata/hisdb/users03.dbf
-rw-r-----  1 oracle oinstall   1056768 Dec 17 22:46 /home/db/oracle/oradata/hisdb/data04.dbf
-rw-r-----  1 oracle oinstall   2105344 Dec 17 22:46 /home/db/oracle/oradata/hisdb/users02.dbf
-rw-r-----  1 oracle oinstall   1056768 Dec 17 22:46 /home/db/oracle/oradata/hisdb/data02.dbf
-rw-r-----  1 oracle oinstall   1056768 Dec 17 22:46 /home/db/oracle/oradata/hisdb/data01.dbf
-rw-r-----  1 oracle oinstall   1056768 Dec 17 22:46 /home/db/oracle/oradata/hisdb/data03.dbf
-rw-r-----  1 oracle oinstall   2105344 Dec 17 22:46 /home/db/oracle/oradata/hisdb/users01.dbf
-rw-r-----. 1 oracle oinstall 209715712 Dec 17 22:45 /home/db/oracle/oradata/hisdb/redo01.log
-rw-r-----. 1 oracle oinstall  30416896 Dec 17 22:43 /home/db/oracle/oradata/hisdb/temp01.dbf
-rw-r-----. 1 oracle oinstall 513810432 Dec 17 22:43 /home/db/oracle/oradata/hisdb/sysaux01.dbf
-rw-r-----. 1 oracle oinstall 713039872 Dec 17 22:43 /home/db/oracle/oradata/hisdb/system01.dbf
-rw-r-----. 1 oracle oinstall  83894272 Dec 17 22:43 /home/db/oracle/oradata/hisdb/undotbs01.dbf
-rw-r-----. 1 oracle oinstall 209715712 Dec 17 22:43 /home/db/oracle/oradata/hisdb/redo03.log
-rw-r-----. 1 oracle oinstall 209715712 Dec 17 22:43 /home/db/oracle/oradata/hisdb/redo02.log

SQL> @recover.sql
Entering RollForward
After applySetDataFile
Done: applyDataFileTo
Done: RestoreSetPiece
Done: RestoreBackupPiece

PL/SQL procedure successfully completed.

SQL> !vi recover.sql
set serveroutput on;
DECLARE
outhandle varchar2(512) ;
outtag varchar2(30) ;
done boolean ;
failover boolean ;
devtype VARCHAR2(512);
BEGIN
DBMS_OUTPUT.put_line('Entering RollForward');
devtype := sys.dbms_backup_restore.deviceAllocate;
sys.dbms_backup_restore.applySetDatafile(check_logical => FALSE, cleanup => FALSE) ;
DBMS_OUTPUT.put_line('After applySetDataFile');
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>4,toname=>'/home/db/oracle/oradata/hisdb/users01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>9,toname=>'/home/db/oracle/oradata/hisdb/data03.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>7,toname=>'/home/db/oracle/oradata/hisdb/data01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>8,toname=>'/home/db/oracle/oradata/hisdb/data02.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>5,toname=>'/home/db/oracle/oradata/hisdb/users02.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>10,toname=>'/home/db/oracle/oradata/hisdb/data04.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>6,toname=>'/home/db/oracle/oradata/hisdb/users03.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
DBMS_OUTPUT.put_line('Done: applyDataFileTo');
sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb1_scn',tag => null,fromdisk => true, recid => 0,stamp => 0) ;
DBMS_OUTPUT.put_line('Done: RestoreSetPiece');
sys.dbms_backup_restore.restoreBackupPiece(done => done,params => null,outhandle => outhandle,outtag => outtag, failover => failover);
DBMS_OUTPUT.put_line('Done: RestoreBackupPiece');
sys.dbms_backup_restore.restoreCancel(TRUE);
sys.dbms_backup_restore.deviceDeallocate;
END;
/

~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
set serveroutput on;
DECLARE
outhandle varchar2(512) ;
outtag varchar2(30) ;
done boolean ;
failover boolean ;
devtype VARCHAR2(512);
BEGIN
DBMS_OUTPUT.put_line('Entering RollForward');
devtype := sys.dbms_backup_restore.deviceAllocate;
sys.dbms_backup_restore.applySetDatafile(check_logical => FALSE, cleanup => FALSE) ;
DBMS_OUTPUT.put_line('After applySetDataFile');
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>4,toname=>'/home/db/oracle/oradata/hisdb/users01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>9,toname=>'/home/db/oracle/oradata/hisdb/data03.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>7,toname=>'/home/db/oracle/oradata/hisdb/data01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>8,toname=>'/home/db/oracle/oradata/hisdb/data02.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>5,toname=>'/home/db/oracle/oradata/hisdb/users02.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>10,toname=>'/home/db/oracle/oradata/hisdb/data04.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>6,toname=>'/home/db/oracle/oradata/hisdb/users03.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
DBMS_OUTPUT.put_line('Done: applyDataFileTo');
sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb1_cn',tag => null,fromdisk => true, recid =>sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb1_n',tag => null,fromdisk => true, recid => sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb1_',tag => null,fromdisk => true, recid => 0sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/isdb1_',tag => null,fromdisk => true, recid => 0,sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/sdb1_',tag => null,fromdisk => true, recid => 0,ssys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/db1_',tag => null,fromdisk => true, recid => 0,stsys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/b1_',tag => null,fromdisk => true, recid => 0,stasys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/1_',tag => null,fromdisk => true, recid => 0,stamsys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/_',tag => null,fromdisk => true, recid => 0,stampsys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/',tag => null,fromdisk => true, recid => 0,stamp sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb0_102e9scs_1_1',tag => null,fromdisk => true"recover.sql" 29L, 2056C written

SQL> @recover.sql
Entering RollForward
After applySetDataFile
Done: applyDataFileTo
Done: RestoreSetPiece
Done: RestoreBackupPiece

PL/SQL procedure successfully completed.

SQL> conn / as sysdba
Connected.
SQL> !vi recover.sql
set serveroutput on;
DECLARE
outhandle varchar2(512) ;
outtag varchar2(30) ;
done boolean ;
failover boolean ;
devtype VARCHAR2(512);
BEGIN
DBMS_OUTPUT.put_line('Entering RollForward');
devtype := sys.dbms_backup_restore.deviceAllocate;
sys.dbms_backup_restore.applySetDatafile(check_logical => FALSE, cleanup => FALSE) ;
DBMS_OUTPUT.put_line('After applySetDataFile');
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>4,toname=>'/home/db/oracle/oradata/hisdb/users01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>9,toname=>'/home/db/oracle/oradata/hisdb/data03.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>7,toname=>'/home/db/oracle/oradata/hisdb/data01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>8,toname=>'/home/db/oracle/oradata/hisdb/data02.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>5,toname=>'/home/db/oracle/oradata/hisdb/users02.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>10,toname=>'/home/db/oracle/oradata/hisdb/data04.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>6,toname=>'/home/db/oracle/oradata/hisdb/users03.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
DBMS_OUTPUT.put_line('Done: applyDataFileTo');
sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb0_102e9scs_1_1',tag => null,fromdisk => true, recid => 0,stamp => 0) ;
DBMS_OUTPUT.put_line('Done: RestoreSetPiece');
sys.dbms_backup_restore.restoreBackupPiece(done => done,params => null,outhandle => outhandle,outtag => outtag, failover => failover);
DBMS_OUTPUT.put_line('Done: RestoreBackupPiece');
sys.dbms_backup_restore.restoreCancel(TRUE);
sys.dbms_backup_restore.deviceDeallocate;
END;
/

~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
set serveroutput on;
DECLARE
outhandle varchar2(512) ;
outtag varchar2(30) ;
done boolean ;
failover boolean ;
devtype VARCHAR2(512);
BEGIN
DBMS_OUTPUT.put_line('Entering RollForward');
devtype := sys.dbms_backup_restore.deviceAllocate;
sys.dbms_backup_restore.applySetDatafile(check_logical => FALSE, cleanup => FALSE) ;
DBMS_OUTPUT.put_line('After applySetDataFile');
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>4,toname=>'/home/db/oracle/oradata/hisdb/users01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>9,toname=>'/home/db/oracle/oradata/hisdb/data03.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>7,toname=>'/home/db/oracle/oradata/hisdb/data01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>8,toname=>'/home/db/oracle/oradata/hisdb/data02.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>5,toname=>'/home/db/oracle/oradata/hisdb/users02.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>10,toname=>'/home/db/oracle/oradata/hisdb/data04.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>6,toname=>'/home/db/oracle/oradata/hisdb/users03.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
DBMS_OUTPUT.put_line('Done: applyDataFileTo');
sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb_102e9scs_1_1',tag => null,fromdisk => true,sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb102e9scs_1_1',tag => null,fromdisk => true, sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb02e9scs_1_1',tag => null,fromdisk => true, rsys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb2e9scs_1_1',tag => null,fromdisk => true, resys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdbe9scs_1_1',tag => null,fromdisk => true, recsys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb9scs_1_1',tag => null,fromdisk => true, recisys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdbscs_1_1',tag => null,fromdisk => true, recidsys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdbcs_1_1',tag => null,fromdisk => true, recid sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdbs_1_1',tag => null,fromdisk => true, recid =sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb_1_1',tag => null,fromdisk => true, recid =>sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb1_1',tag => null,fromdisk => true, recid => sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb_1',tag => null,fromdisk => true, recid => 0sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb1',tag => null,fromdisk => true, recid => 0,sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb1_',tag => null,fromdisk => true, recid => 0sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb1_0',tag => null,fromdisk => true, recid => sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb1_09',tag => null,fromdisk => true, recid =>"recover.sql" 29L, 2046C written

SQL> @recover.sql
Entering RollForward
After applySetDataFile
Done: applyDataFileTo
Done: RestoreSetPiece
Done: RestoreBackupPiece

PL/SQL procedure successfully completed.

SQL> !vi recover.sql
set serveroutput on;
DECLARE
outhandle varchar2(512) ;
outtag varchar2(30) ;
done boolean ;
failover boolean ;
devtype VARCHAR2(512);
BEGIN
DBMS_OUTPUT.put_line('Entering RollForward');
devtype := sys.dbms_backup_restore.deviceAllocate;
sys.dbms_backup_restore.applySetDatafile(check_logical => FALSE, cleanup => FALSE) ;
DBMS_OUTPUT.put_line('After applySetDataFile');
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>4,toname=>'/home/db/oracle/oradata/hisdb/users01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>9,toname=>'/home/db/oracle/oradata/hisdb/data03.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>7,toname=>'/home/db/oracle/oradata/hisdb/data01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>8,toname=>'/home/db/oracle/oradata/hisdb/data02.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>5,toname=>'/home/db/oracle/oradata/hisdb/users02.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>10,toname=>'/home/db/oracle/oradata/hisdb/data04.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>6,toname=>'/home/db/oracle/oradata/hisdb/users03.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
DBMS_OUTPUT.put_line('Done: applyDataFileTo');
sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb1_09',tag => null,fromdisk => true, recid => 0,stamp => 0) ;
DBMS_OUTPUT.put_line('Done: RestoreSetPiece');
sys.dbms_backup_restore.restoreBackupPiece(done => done,params => null,outhandle => outhandle,outtag => outtag, failover => failover);
DBMS_OUTPUT.put_line('Done: RestoreBackupPiece');
sys.dbms_backup_restore.restoreCancel(TRUE);
sys.dbms_backup_restore.deviceDeallocate;
END;
/

~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
set serveroutput on;
DECLARE
outhandle varchar2(512) ;
outtag varchar2(30) ;
done boolean ;
failover boolean ;
devtype VARCHAR2(512);
BEGIN
DBMS_OUTPUT.put_line('Entering RollForward');
devtype := sys.dbms_backup_restore.deviceAllocate;
sys.dbms_backup_restore.applySetDatafile(check_logical => FALSE, cleanup => FALSE) ;
DBMS_OUTPUT.put_line('After applySetDataFile');
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>4,toname=>'/home/db/oracle/oradata/hisdb/users01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>9,toname=>'/home/db/oracle/oradata/hisdb/data03.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>7,toname=>'/home/db/oracle/oradata/hisdb/data01.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>8,toname=>'/home/db/oracle/oradata/hisdb/data02.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>5,toname=>'/home/db/oracle/oradata/hisdb/users02.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>10,toname=>'/home/db/oracle/oradata/hisdb/data04.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
sys.dbms_backup_restore.applyDatafileTo(dfnumber=>6,toname=>'/home/db/oracle/oradata/hisdb/users03.dbf',fuzziness_hint=>0,max_corrupt=>0,islevel0=>0,recid=>0,stamp=>0);
DBMS_OUTPUT.put_line('Done: applyDataFileTo');
sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb1_9',tag => null,fromdisk => true, recid => sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb1_',tag => null,fromdisk => true, recid => 0sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb1_1',tag => null,fromdisk => true, recid => sys.dbms_backup_restore.restoreSetPiece(handle =>'/bak/hisdb1_10',tag => null,fromdisk => true, recid =>"recover.sql" 29L, 2046C written

SQL> @recover.sql
Entering RollForward
After applySetDataFile
Done: applyDataFileTo
Done: RestoreSetPiece
Done: RestoreBackupPiece

PL/SQL procedure successfully completed.

SQL> @o.sql

OWNER                          OBJECT_TYPE           COUNT(*)
------------------------------ ------------------- ----------
J1                             DATABASE LINK                1
J1                             INDEX                        1
J1                             SYNONYM                      1
J1                             TABLE                       12
J2                             DATABASE LINK                1
J2                             SEQUENCE                     2
J2                             SYNONYM                      1
J2                             TABLE                       10
J2                             VIEW                         1
PUBLIC                         DATABASE LINK                2
PUBLIC                         SYNONYM                  27699

OWNER                          OBJECT_TYPE           COUNT(*)
------------------------------ ------------------- ----------
SCOTT                          INDEX                        2
SCOTT                          TABLE                        4

13 rows selected.

SQL> @/home/oracle/tbs.sql

TABLESPACE_NAME                SUM_SPACE(M) SUM_BLOCKS USED_SPACE(M) USED_RATE(%) FREE_SPACE(M)
------------------------------ ------------ ---------- ------------- ------------ -------------
SYSTEM                                  680      87040        675.25         99.3          4.75
UNDOTBS1                                 80      10240            78         97.5             2
SYSAUX                                  490      62720        467.44         95.4         22.56
USERS                                     6        768          4.19        69.83          1.81
DATA                                      4        512           .75        18.75          3.25
TEMP                                     29       3712                          0

6 rows selected.

会话2:

[oracle@11g bak]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Sun Dec 17 22:23:30 2023

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

connected to target database: JYCDB (DBID=592598178)

RMAN> run {
2> allocate channel t1 type disk;
3> allocate channel t2 type disk;
4> allocate channel t3 type disk;
5> allocate channel t4 type disk;
6> backup as backupset incremental level=0 tablespace DATA,USERS format '/bak/hisdb0_%U' tag=hisdb0;
7> release channel t1;
8> release channel t2;
9> release channel t3;
10> release channel t4;
11> }

using target database control file instead of recovery catalog
allocated channel: t1
channel t1: SID=22 device type=DISK

allocated channel: t2
channel t2: SID=149 device type=DISK

allocated channel: t3
channel t3: SID=133 device type=DISK

allocated channel: t4
channel t4: SID=24 device type=DISK

Starting backup at 2023-12-17 22:23:42
channel t1: starting incremental level 0 datafile backup set
channel t1: specifying datafile(s) in backup set
input datafile file number=00004 name=/home/db/oracle/oradata/jycdb/users01.dbf
input datafile file number=00009 name=/home/db/oracle/oradata/jycdb/data03.dbf
channel t1: starting piece 1 at 2023-12-17 22:23:42
channel t2: starting incremental level 0 datafile backup set
channel t2: specifying datafile(s) in backup set
input datafile file number=00005 name=/home/db/oracle/oradata/jycdb/users02.dbf
input datafile file number=00010 name=/home/db/oracle/oradata/jycdb/data04.dbf
channel t2: starting piece 1 at 2023-12-17 22:23:42
channel t3: starting incremental level 0 datafile backup set
channel t3: specifying datafile(s) in backup set
input datafile file number=00007 name=/home/db/oracle/oradata/jycdb/data01.dbf
input datafile file number=00008 name=/home/db/oracle/oradata/jycdb/data02.dbf
channel t3: starting piece 1 at 2023-12-17 22:23:42
channel t4: starting incremental level 0 datafile backup set
channel t4: specifying datafile(s) in backup set
input datafile file number=00006 name=/home/db/oracle/oradata/jycdb/users03.dbf
channel t4: starting piece 1 at 2023-12-17 22:23:42
channel t1: finished piece 1 at 2023-12-17 22:23:42
piece handle=/bak/hisdb0_0k2e9r3e_1_1 tag=HISDB0 comment=NONE
channel t1: backup set complete, elapsed time: 00:00:00
channel t2: finished piece 1 at 2023-12-17 22:23:43
piece handle=/bak/hisdb0_0l2e9r3e_1_1 tag=HISDB0 comment=NONE
channel t2: backup set complete, elapsed time: 00:00:01
channel t3: finished piece 1 at 2023-12-17 22:23:43
piece handle=/bak/hisdb0_0m2e9r3e_1_1 tag=HISDB0 comment=NONE
channel t3: backup set complete, elapsed time: 00:00:01
channel t4: finished piece 1 at 2023-12-17 22:23:43
piece handle=/bak/hisdb0_0n2e9r3e_1_1 tag=HISDB0 comment=NONE
channel t4: backup set complete, elapsed time: 00:00:01
Finished backup at 2023-12-17 22:23:43

released channel: t1

released channel: t2

released channel: t3

released channel: t4

RMAN> exit


Recovery Manager complete.
[oracle@11g bak]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 17 22:23:59 2023

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> create table t0 as select * from t2;

Table created.

SQL> drop table t0 purge;

Table dropped.

SQL> create table j1.t0 as select * from j1.t2;

Table created.

SQL> drop table t2;
drop table t2
           *
ERROR at line 1:
ORA-00942: table or view does not exist


SQL> show users;
SP2-0158: unknown SHOW option "users"
SQL> show user;
USER is "SYS"
SQL> create table j2.t0 as select * from j2.t2;

Table created.

SQL> select count(*) from j2.t0;

  COUNT(*)
----------
         1

SQL> select count(*) from j1.t0;

  COUNT(*)
----------
         1

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@11g bak]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Sun Dec 17 22:25:39 2023

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

connected to target database: JYCDB (DBID=592598178)

RMAN> backup as backupset incremental level=0 database format '/bak/hisdb0_%U' tag=hisdb_full0;

Starting backup at 2023-12-17 22:25:51
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=24 device type=DISK
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/home/db/oracle/oradata/jycdb/system01.dbf
input datafile file number=00002 name=/home/db/oracle/oradata/jycdb/sysaux01.dbf
input datafile file number=00003 name=/home/db/oracle/oradata/jycdb/undotbs01.dbf
input datafile file number=00004 name=/home/db/oracle/oradata/jycdb/users01.dbf
input datafile file number=00005 name=/home/db/oracle/oradata/jycdb/users02.dbf
input datafile file number=00006 name=/home/db/oracle/oradata/jycdb/users03.dbf
input datafile file number=00007 name=/home/db/oracle/oradata/jycdb/data01.dbf
input datafile file number=00008 name=/home/db/oracle/oradata/jycdb/data02.dbf
input datafile file number=00009 name=/home/db/oracle/oradata/jycdb/data03.dbf
input datafile file number=00010 name=/home/db/oracle/oradata/jycdb/data04.dbf
channel ORA_DISK_1: starting piece 1 at 2023-12-17 22:25:52
channel ORA_DISK_1: finished piece 1 at 2023-12-17 22:25:59
piece handle=/bak/hisdb0_0o2e9r7g_1_1 tag=HISDB_FULL0 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting incremental level 0 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 2023-12-17 22:26:00
channel ORA_DISK_1: finished piece 1 at 2023-12-17 22:26:01
piece handle=/bak/hisdb0_0p2e9r7n_1_1 tag=HISDB_FULL0 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2023-12-17 22:26:01

RMAN> exit


Recovery Manager complete.
[oracle@11g bak]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 17 22:26:10 2023

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> create table j2.t01 as select * from j2.t2;

Table created.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@11g bak]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Sun Dec 17 22:26:36 2023

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

connected to target database: JYCDB (DBID=592598178)

RMAN> backup as backupset incremental level=1 database format '/bak/hisdb0_%U' tag=hisdb_full0;

Starting backup at 2023-12-17 22:26:49
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=24 device type=DISK
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/home/db/oracle/oradata/jycdb/system01.dbf
input datafile file number=00002 name=/home/db/oracle/oradata/jycdb/sysaux01.dbf
input datafile file number=00003 name=/home/db/oracle/oradata/jycdb/undotbs01.dbf
input datafile file number=00004 name=/home/db/oracle/oradata/jycdb/users01.dbf
input datafile file number=00005 name=/home/db/oracle/oradata/jycdb/users02.dbf
input datafile file number=00006 name=/home/db/oracle/oradata/jycdb/users03.dbf
input datafile file number=00007 name=/home/db/oracle/oradata/jycdb/data01.dbf
input datafile file number=00008 name=/home/db/oracle/oradata/jycdb/data02.dbf
input datafile file number=00009 name=/home/db/oracle/oradata/jycdb/data03.dbf
input datafile file number=00010 name=/home/db/oracle/oradata/jycdb/data04.dbf
channel ORA_DISK_1: starting piece 1 at 2023-12-17 22:26:50
channel ORA_DISK_1: finished piece 1 at 2023-12-17 22:26:51
piece handle=/bak/hisdb0_0q2e9r9a_1_1 tag=HISDB_FULL0 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 2023-12-17 22:26:52
channel ORA_DISK_1: finished piece 1 at 2023-12-17 22:26:53
piece handle=/bak/hisdb0_0r2e9r9b_1_1 tag=HISDB_FULL0 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2023-12-17 22:26:53

RMAN> exit


Recovery Manager complete.
[oracle@11g bak]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 17 22:27:07 2023

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> create table j1.t01 as select * from j2.t2;.t01 as select * from j2.t2;.t01 as select * from j2SQL> create table j1.t01 as select * from j2.t2;                                                  j create table j1.t01 as select * from j2.t2;
                                          *
ERROR at line 1:
ORA-00911: invalid character


SQL> create table j1.t01 as select * from j2.t2;

Table created.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@11g bak]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Sun Dec 17 22:27:33 2023

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

connected to target database: JYCDB (DBID=592598178)

RMAN> backup incremental level=1 tablespace DATA,USERS filesperset 300 format '/bak/hisdb1_07' tag=hisdb1;

Starting backup at 2023-12-17 22:28:22
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=24 device type=DISK
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=/home/db/oracle/oradata/jycdb/users01.dbf
input datafile file number=00005 name=/home/db/oracle/oradata/jycdb/users02.dbf
input datafile file number=00006 name=/home/db/oracle/oradata/jycdb/users03.dbf
input datafile file number=00007 name=/home/db/oracle/oradata/jycdb/data01.dbf
input datafile file number=00008 name=/home/db/oracle/oradata/jycdb/data02.dbf
input datafile file number=00009 name=/home/db/oracle/oradata/jycdb/data03.dbf
input datafile file number=00010 name=/home/db/oracle/oradata/jycdb/data04.dbf
channel ORA_DISK_1: starting piece 1 at 2023-12-17 22:28:22
channel ORA_DISK_1: finished piece 1 at 2023-12-17 22:28:23
piece handle=/bak/hisdb1_07 tag=HISDB1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2023-12-17 22:28:23

RMAN> exit


Recovery Manager complete.
[oracle@11g bak]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 17 22:28:31 2023

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>  create table j1.t02 as select * from j2.t2;

Table created.

SQL> @o.sql

OWNER                          OBJECT_TYPE           COUNT(*)
------------------------------ ------------------- ----------
J1                             DATABASE LINK                1
J1                             INDEX                        1
J1                             SYNONYM                      1
J1                             TABLE                       11
J2                             DATABASE LINK                1
J2                             SEQUENCE                     2
J2                             SYNONYM                      1
J2                             TABLE                        8
J2                             VIEW                         1
PUBLIC                         DATABASE LINK                2
PUBLIC                         SYNONYM                  27699

OWNER                          OBJECT_TYPE           COUNT(*)
------------------------------ ------------------- ----------
SCOTT                          INDEX                        2
SCOTT                          TABLE                        4

13 rows selected.

SQL> alter tablespace user read only;
alter tablespace user read only
                 *
ERROR at line 1:
ORA-02140: invalid tablespace name


SQL> alter tablespace users read only;

Tablespace altered.

SQL> alter tablespace data read only;

Tablespace altered.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@11g bak]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Sun Dec 17 22:31:54 2023

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

connected to target database: JYCDB (DBID=592598178)

RMAN> backup incremental level=1 tablespace DATA,USERS filesperset 300 format '/bak/hisdb1_08' tag=hisdb1;

Starting backup at 2023-12-17 22:32:17
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=24 device type=DISK
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=/home/db/oracle/oradata/jycdb/users01.dbf
input datafile file number=00005 name=/home/db/oracle/oradata/jycdb/users02.dbf
input datafile file number=00006 name=/home/db/oracle/oradata/jycdb/users03.dbf
input datafile file number=00007 name=/home/db/oracle/oradata/jycdb/data01.dbf
input datafile file number=00008 name=/home/db/oracle/oradata/jycdb/data02.dbf
input datafile file number=00009 name=/home/db/oracle/oradata/jycdb/data03.dbf
input datafile file number=00010 name=/home/db/oracle/oradata/jycdb/data04.dbf
channel ORA_DISK_1: starting piece 1 at 2023-12-17 22:32:17
channel ORA_DISK_1: finished piece 1 at 2023-12-17 22:32:18
piece handle=/bak/hisdb1_08 tag=HISDB1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2023-12-17 22:32:18

RMAN> exit


Recovery Manager complete.
[oracle@11g bak]$ ls -lt|head
total 3060476
-rw-r-----  1 oracle oinstall     139264 Dec 17 22:32 hisdb1_08
-rw-r-----  1 oracle oinstall     139264 Dec 17 22:28 hisdb1_07
-rw-r-----  1 oracle oinstall    9830400 Dec 17 22:26 hisdb0_0r2e9r9b_1_1
-rw-r-----  1 oracle oinstall     368640 Dec 17 22:26 hisdb0_0q2e9r9a_1_1
-rw-r-----  1 oracle oinstall    9830400 Dec 17 22:26 hisdb0_0p2e9r7n_1_1
-rw-r-----  1 oracle oinstall 1023377408 Dec 17 22:25 hisdb0_0o2e9r7g_1_1
-rw-r-----  1 oracle oinstall    1089536 Dec 17 22:23 hisdb0_0n2e9r3e_1_1
-rw-r-----  1 oracle oinstall    1335296 Dec 17 22:23 hisdb0_0l2e9r3e_1_1
-rw-r-----  1 oracle oinstall     163840 Dec 17 22:23 hisdb0_0m2e9r3e_1_1
[oracle@11g bak]$ ls -lt|head -30
total 3060476
-rw-r-----  1 oracle oinstall     139264 Dec 17 22:32 hisdb1_08
-rw-r-----  1 oracle oinstall     139264 Dec 17 22:28 hisdb1_07
-rw-r-----  1 oracle oinstall    9830400 Dec 17 22:26 hisdb0_0r2e9r9b_1_1
-rw-r-----  1 oracle oinstall     368640 Dec 17 22:26 hisdb0_0q2e9r9a_1_1
-rw-r-----  1 oracle oinstall    9830400 Dec 17 22:26 hisdb0_0p2e9r7n_1_1
-rw-r-----  1 oracle oinstall 1023377408 Dec 17 22:25 hisdb0_0o2e9r7g_1_1
-rw-r-----  1 oracle oinstall    1089536 Dec 17 22:23 hisdb0_0n2e9r3e_1_1
-rw-r-----  1 oracle oinstall    1335296 Dec 17 22:23 hisdb0_0l2e9r3e_1_1
-rw-r-----  1 oracle oinstall     163840 Dec 17 22:23 hisdb0_0m2e9r3e_1_1
-rw-r-----  1 oracle oinstall    1875968 Dec 17 22:23 hisdb0_0k2e9r3e_1_1
-rw-r--r--  1 oracle oinstall        456 Dec 17 22:11 o.sql
-rw-r--r--  1 oracle oinstall        991 Dec 17 22:07 tts-imp1.log
-rw-r--r--. 1 oracle oinstall        831 Dec 17 22:06 tts-imp.log
-rw-r-----  1 oracle oinstall     270336 Dec 17 22:05 tts1.dmp
-rw-r--r--. 1 oracle oinstall       1691 Dec 17 22:05 tts-exp.log
-rw-r--r--  1 oracle oinstall       2046 Dec 17 22:03 recover.sql
-rw-r-----  1 oracle oinstall     204800 Dec 17 22:02 hisdb1_05
-rw-r-----  1 oracle oinstall     139264 Dec 17 21:54 hisdb1_06
-rw-r-----  1 oracle oinstall     409600 Dec 17 21:52 hisdb1_05_full
-rw-r-----  1 oracle oinstall    9830400 Dec 17 21:50 hisdb0_0e2e9p5n_1_1
-rw-r-----  1 oracle oinstall 1029693440 Dec 17 21:50 hisdb0_0d2e9p5g_1_1
-rw-r-----  1 oracle oinstall     139264 Dec 17 21:21 hisdb1_04
-rw-r-----  1 oracle oinstall    9830400 Dec 17 21:18 hisdb0_0b2e9n94_1_1
-rw-r-----  1 oracle oinstall    5292032 Dec 17 21:18 hisdb0_0a2e9n93_1_1
-rw-r-----  1 oracle oinstall    9830400 Dec 17 21:15 hisdb0_092e9n44_1_1
-rw-r-----  1 oracle oinstall 1014603776 Dec 17 21:15 hisdb0_082e9n3l_1_1
-rw-r-----. 1 oracle oinstall     233472 Dec 15 15:21 tts.dmp
-rw-r-----. 1 oracle oinstall     221184 Dec 15 15:18 hisdb1_03
-rw-r--r--. 1 oracle oinstall       1429 Dec 15 14:25 meta.log
[oracle@11g bak]$ echo $ORACLE_SID
jycdb
[oracle@11g bak]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Sun Dec 17 22:37:46 2023

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

connected to target database: JYCDB (DBID=592598178)

RMAN> backup incremental from scn 1047630 tablespace DATA,USERS filesperset 300 format '/bak/hisdb1_scn' tag=hisdb1;

Starting backup at 2023-12-17 22:38:34

using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=24 device type=DISK
backup will be obsolete on date 2023-12-24 22:38:34
archived logs will not be kept or backed up
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=/home/db/oracle/oradata/jycdb/users01.dbf
input datafile file number=00005 name=/home/db/oracle/oradata/jycdb/users02.dbf
input datafile file number=00006 name=/home/db/oracle/oradata/jycdb/users03.dbf
input datafile file number=00007 name=/home/db/oracle/oradata/jycdb/data01.dbf
input datafile file number=00008 name=/home/db/oracle/oradata/jycdb/data02.dbf
input datafile file number=00009 name=/home/db/oracle/oradata/jycdb/data03.dbf
input datafile file number=00010 name=/home/db/oracle/oradata/jycdb/data04.dbf
channel ORA_DISK_1: starting piece 1 at 2023-12-17 22:38:34
channel ORA_DISK_1: finished piece 1 at 2023-12-17 22:38:35
piece handle=/bak/hisdb1_scn tag=HISDB1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

using channel ORA_DISK_1
backup will be obsolete on date 2023-12-24 22:38:35
archived logs will not be kept or backed up
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 2023-12-17 22:38:36
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 12/17/2023 22:38:37
ORA-19504: failed to create file "/bak/hisdb1_scn"
ORA-27038: created file already exists
Additional information: 1

RMAN> exit


Recovery Manager complete.
[oracle@11g bak]$ impdp \'sys/"abcd1234" as sysdba\' dumpfile=tts1.dmp logfile=tts-imp1.log director[oracle@11g bak]$ impdp \'sys/"abcd1234" as sysdba\' dumpfile=tts.dmp logfile=tts-imp.log directory=[oracle@11g bak]$ export ORACLE_SID=hisdb
[oracle@11g bak]$ expdp \'/ as sysdba\' directory=acfsdmp dumpfile=tts1.dmp logfile=tts-exp.log clus[oracle@11g bak]$ expdp \'/ as sysdba\' directory=acfsdmp dumpfile=tts.dmp logfile=tts-exp.log clust[oracle@11g bak]$ expdp \'/ as sysdba\' directory=acfsdmp dumpfile=tts2.dmp logfile=tts-exp.log clus[oracle@11g bak]$ expdp \'/ as sysdba\' directory=acfsdmp dumpfile=tts2.dmp logfile=tts-exp2.log clu[oracle@11g bak]$ expdp \'/ as sysdba\' directory=acfsdmp dumpfile=tts2.dmp logfile=tts-exp2.log cluster=n transport_tablespaces=DATA,USERS EXCLUDE=TABLE_STATISTICS,INDEX_STATISTICS 

Export: Release 11.2.0.1.0 - Production on Sun Dec 17 22:39:37 2023

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

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SYS"."SYS_EXPORT_TRANSPORTABLE_01":  "/******** AS SYSDBA" directory=acfsdmp dumpfile=tts2.dmp logfile=tts-exp2.log cluster=n transport_tablespaces=DATA,USERS EXCLUDE=TABLE_STATISTICS,INDEX_STATISTICS 
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
Processing object type TRANSPORTABLE_EXPORT/TABLE
Processing object type TRANSPORTABLE_EXPORT/INDEX
Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/CONSTRAINT
Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/REF_CONSTRAINT
Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
Master table "SYS"."SYS_EXPORT_TRANSPORTABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYS.SYS_EXPORT_TRANSPORTABLE_01 is:
  /bak/tts2.dmp
******************************************************************************
Datafiles required for transportable tablespace DATA:
  /home/db/oracle/oradata/jycdb/data01.dbf
  /home/db/oracle/oradata/jycdb/data02.dbf
  /home/db/oracle/oradata/jycdb/data03.dbf
  /home/db/oracle/oradata/jycdb/data04.dbf
Datafiles required for transportable tablespace USERS:
  /home/db/oracle/oradata/jycdb/users01.dbf
  /home/db/oracle/oradata/jycdb/users02.dbf
  /home/db/oracle/oradata/jycdb/users03.dbf
Job "SYS"."SYS_EXPORT_TRANSPORTABLE_01" successfully completed at 22:39:47

[oracle@11g bak]$ expdp \'/ as sysdba\' directory=acfsdmp dumpfile=tts2.dmp logfile=tts-exp2.log clu[oracle@11g bak]$ rman target /
[oracle@11g bak]$ export ORACLE_SID=hisdb
[oracle@11g bak]$ expdp \'/ as sysdba\' directory=acfsdmp dumpfile=tts2.dmp logfile=tts-exp2.log clu[oracle@11g bak]$ rman target /
[oracle@11g bak]$ expdp \'/ as sysdba\' directory=acfsdmp dumpfile=tts2.dmp logfile=tts-exp2.log clu[oracle@11g bak]$ rman target /
[oracle@11g bak]$ impdp \'sys/"abcd1234" as sysdba\' dumpfile=tts1.dmp logfile=tts-imp1.log director[oracle@11g bak]$ impdp \'sys/"abcd1234" as sysdba\' dumpfile=tts1.dmp logfile=tts-imp.log directory[oracle@11g bak]$ impdp \'sys/"abcd1234" as sysdba\' dumpfile=tts1.dmp logfile=tts-imp2.log director[oracle@11g bak]$ impdp \'sys/"abcd1234" as sysdba\' dumpfile=tts.dmp logfile=tts-imp2.log directory[oracle@11g bak]$ impdp \'sys/"abcd1234" as sysdba\' dumpfile=tts2.dmp logfile=tts-imp2.log director[oracle@11g bak]$ impdp \'sys/"abcd1234" as sysdba\' dumpfile=tts2.dmp logfile=tts-imp2.log directory=acfsdmp PARFILE=impdp-par.txt

Import: Release 11.2.0.1.0 - Production on Sun Dec 17 22:41:01 2023

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

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "SYS"."SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded
Starting "SYS"."SYS_IMPORT_TRANSPORTABLE_01":  "sys/******** AS SYSDBA" dumpfile=tts2.dmp logfile=tts-imp2.log directory=acfsdmp PARFILE=impdp-par.txt 
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
Processing object type TRANSPORTABLE_EXPORT/TABLE
Processing object type TRANSPORTABLE_EXPORT/INDEX
Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/CONSTRAINT
Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/REF_CONSTRAINT
Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
Job "SYS"."SYS_IMPORT_TRANSPORTABLE_01" successfully completed at 22:41:03

[oracle@11g bak]$ impdp \'sys/"abcd1234" as sysdba\' dumpfile=tts2.dmp logfile=tts-imp2.log director[oracle@11g bak]$ export ORACLE_SID=hisdb
[oracle@11g bak]$ export ORACLE_SID=jycdb
[oracle@11g bak]$ impdp \'sys/"abcd1234" as sysdba\' dumpfile=tts2.dmp logfile=tts-imp2.log director[oracle@11g bak]$ export ORACLE_SID=hisdb
[oracle@11g bak]$ expdp \'/ as sysdba\' directory=acfsdmp dumpfile=tts2.dmp logfile=tts-exp2.log clu[oracle@11g bak]$ rman target /
[oracle@11g bak]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 17 22:41:30 2023

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> @o.sql

OWNER                          OBJECT_TYPE           COUNT(*)
------------------------------ ------------------- ----------
J1                             DATABASE LINK                1
J1                             INDEX                        1
J1                             SYNONYM                      1
J1                             TABLE                       11
J2                             DATABASE LINK                1
J2                             SEQUENCE                     2
J2                             SYNONYM                      1
J2                             TABLE                        8
J2                             VIEW                         1
PUBLIC                         DATABASE LINK                2
PUBLIC                         SYNONYM                  27699

OWNER                          OBJECT_TYPE           COUNT(*)
------------------------------ ------------------- ----------
SCOTT                          INDEX                        2
SCOTT                          TABLE                        4

13 rows selected.

SQL> 
SQL> 
SQL> 
SQL> alter tablespace users read only;
alter tablespace users read only
*
ERROR at line 1:
ORA-01644: tablespace 'USERS' is already read-only


SQL> alter tablespace users read write;

Tablespace altered.

SQL> alter tablespace data read write;

Tablespace altered.

SQL> create table j1.t03 as select * from j1.t2;

Table created.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@11g bak]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Sun Dec 17 22:45:17 2023

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

connected to target database: JYCDB (DBID=592598178)

RMAN> backup as backupset incremental level=1 database format '/bak/hisdb0_%U' tag=hisdb_full0;

Starting backup at 2023-12-17 22:45:48
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=24 device type=DISK
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/home/db/oracle/oradata/jycdb/system01.dbf
input datafile file number=00002 name=/home/db/oracle/oradata/jycdb/sysaux01.dbf
input datafile file number=00003 name=/home/db/oracle/oradata/jycdb/undotbs01.dbf
input datafile file number=00004 name=/home/db/oracle/oradata/jycdb/users01.dbf
input datafile file number=00005 name=/home/db/oracle/oradata/jycdb/users02.dbf
input datafile file number=00006 name=/home/db/oracle/oradata/jycdb/users03.dbf
input datafile file number=00007 name=/home/db/oracle/oradata/jycdb/data01.dbf
input datafile file number=00008 name=/home/db/oracle/oradata/jycdb/data02.dbf
input datafile file number=00009 name=/home/db/oracle/oradata/jycdb/data03.dbf
input datafile file number=00010 name=/home/db/oracle/oradata/jycdb/data04.dbf
channel ORA_DISK_1: starting piece 1 at 2023-12-17 22:45:48
channel ORA_DISK_1: finished piece 1 at 2023-12-17 22:45:49
piece handle=/bak/hisdb0_102e9scs_1_1 tag=HISDB_FULL0 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 2023-12-17 22:45:51
channel ORA_DISK_1: finished piece 1 at 2023-12-17 22:45:52
piece handle=/bak/hisdb0_112e9scu_1_1 tag=HISDB_FULL0 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2023-12-17 22:45:52

RMAN> exit


Recovery Manager complete.
[oracle@11g bak]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 17 22:45:59 2023

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> create table jcreate table j2.t03 as select * from j1.t2;
create table jcreate table j2.t03 as select * from j1.t2
                     *
ERROR at line 1:
ORA-00922: missing or invalid option


SQL> create table j2.t03 as select * from j1.t2;

Table created.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@11g bak]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Sun Dec 17 22:46:19 2023

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

connected to target database: JYCDB (DBID=592598178)

RMAN> backup incremental level=1 tablespace DATA,USERS filesperset 300 format '/bak/hisdb1_09' tag=hisdb1;

Starting backup at 2023-12-17 22:46:32
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=24 device type=DISK
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=/home/db/oracle/oradata/jycdb/users01.dbf
input datafile file number=00005 name=/home/db/oracle/oradata/jycdb/users02.dbf
input datafile file number=00006 name=/home/db/oracle/oradata/jycdb/users03.dbf
input datafile file number=00007 name=/home/db/oracle/oradata/jycdb/data01.dbf
input datafile file number=00008 name=/home/db/oracle/oradata/jycdb/data02.dbf
input datafile file number=00009 name=/home/db/oracle/oradata/jycdb/data03.dbf
input datafile file number=00010 name=/home/db/oracle/oradata/jycdb/data04.dbf
channel ORA_DISK_1: starting piece 1 at 2023-12-17 22:46:32
channel ORA_DISK_1: finished piece 1 at 2023-12-17 22:46:33
piece handle=/bak/hisdb1_09 tag=HISDB1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2023-12-17 22:46:33

RMAN> exit


Recovery Manager complete.
[oracle@11g bak]$ ls -lt|head
total 3073660
-rw-r-----  1 oracle oinstall     139264 Dec 17 22:46 hisdb1_09
-rw-r-----  1 oracle oinstall    9830400 Dec 17 22:45 hisdb0_112e9scu_1_1
-rw-r-----  1 oracle oinstall    2883584 Dec 17 22:45 hisdb0_102e9scs_1_1
-rw-r--r--  1 oracle oinstall        991 Dec 17 22:41 tts-imp2.log
-rw-r-----  1 oracle oinstall     335872 Dec 17 22:39 tts2.dmp
-rw-r--r--  1 oracle oinstall       1692 Dec 17 22:39 tts-exp2.log
-rw-r--r--  1 oracle oinstall       2047 Dec 17 22:39 recover.sql
-rw-r-----  1 oracle oinstall     303104 Dec 17 22:38 hisdb1_scn
-rw-r--r--  1 oracle oinstall       3870 Dec 17 22:34 r.sql
[oracle@11g bak]$ ls -lt|more
total 3073660
-rw-r-----  1 oracle oinstall     139264 Dec 17 22:46 hisdb1_09
-rw-r-----  1 oracle oinstall    9830400 Dec 17 22:45 hisdb0_112e9scu_1_1
-rw-r-----  1 oracle oinstall    2883584 Dec 17 22:45 hisdb0_102e9scs_1_1
-rw-r--r--  1 oracle oinstall        991 Dec 17 22:41 tts-imp2.log
-rw-r-----  1 oracle oinstall     335872 Dec 17 22:39 tts2.dmp
-rw-r--r--  1 oracle oinstall       1692 Dec 17 22:39 tts-exp2.log
-rw-r--r--  1 oracle oinstall       2047 Dec 17 22:39 recover.sql
-rw-r-----  1 oracle oinstall     303104 Dec 17 22:38 hisdb1_scn
-rw-r--r--  1 oracle oinstall       3870 Dec 17 22:34 r.sql
-rw-r-----  1 oracle oinstall     139264 Dec 17 22:32 hisdb1_08
-rw-r-----  1 oracle oinstall     139264 Dec 17 22:28 hisdb1_07
-rw-r-----  1 oracle oinstall    9830400 Dec 17 22:26 hisdb0_0r2e9r9b_1_1
-rw-r-----  1 oracle oinstall     368640 Dec 17 22:26 hisdb0_0q2e9r9a_1_1
-rw-r-----  1 oracle oinstall    9830400 Dec 17 22:26 hisdb0_0p2e9r7n_1_1
-rw-r-----  1 oracle oinstall 1023377408 Dec 17 22:25 hisdb0_0o2e9r7g_1_1
-rw-r-----  1 oracle oinstall    1089536 Dec 17 22:23 hisdb0_0n2e9r3e_1_1
-rw-r-----  1 oracle oinstall    1335296 Dec 17 22:23 hisdb0_0l2e9r3e_1_1
-rw-r-----  1 oracle oinstall     163840 Dec 17 22:23 hisdb0_0m2e9r3e_1_1
-rw-r-----  1 oracle oinstall    1875968 Dec 17 22:23 hisdb0_0k2e9r3e_1_1
-rw-r--r--  1 oracle oinstall        456 Dec 17 22:11 o.sql
-rw-r--r--  1 oracle oinstall        991 Dec 17 22:07 tts-imp1.log
-rw-r--r--. 1 oracle oinstall        831 Dec 17 22:06 tts-imp.log
-rw-r-----  1 oracle oinstall     270336 Dec 17 22:05 tts1.dmp
-rw-r--r--. 1 oracle oinstall       1691 Dec 17 22:05 tts-exp.log
-rw-r-----  1 oracle oinstall     204800 Dec 17 22:02 hisdb1_05
-rw-r-----  1 oracle oinstall     139264 Dec 17 21:54 hisdb1_06
-rw-r-----  1 oracle oinstall     409600 Dec 17 21:52 hisdb1_05_full
-rw-r-----  1 oracle oinstall    9830400 Dec 17 21:50 hisdb0_0e2e9p5n_1_1
-rw-r-----  1 oracle oinstall 1029693440 Dec 17 21:50 hisdb0_0d2e9p5g_1_1
-rw-r-----  1 oracle oinstall     139264 Dec 17 21:21 hisdb1_04
-rw-r-----  1 oracle oinstall    9830400 Dec 17 21:18 hisdb0_0b2e9n94_1_1
-rw-r-----  1 oracle oinstall    5292032 Dec 17 21:18 hisdb0_0a2e9n93_1_1
-rw-r-----  1 oracle oinstall    9830400 Dec 17 21:15 hisdb0_092e9n44_1_1
-rw-r-----  1 oracle oinstall 1014603776 Dec 17 21:15 hisdb0_082e9n3l_1_1
-rw-r-----. 1 oracle oinstall     233472 Dec 15 15:21 tts.dmp
-rw-r-----. 1 oracle oinstall     221184 Dec 15 15:18 hisdb1_03
-rw-r--r--. 1 oracle oinstall       1429 Dec 15 14:25 meta.log
-rw-r-----. 1 oracle oinstall     172032 Dec 15 14:23 meta.dmp
-rw-r--r--. 1 oracle oinstall        324 Dec 15 13:43 impdp-par.txt
-rw-r-----. 1 oracle oinstall     212992 Dec 15 13:37 tts.bakdmp
-rw-r-----. 1 oracle oinstall     139264 Dec 15 13:28 hisdb1_02
-rw-r-----. 1 oracle oinstall       6350 Dec 15 13:20 imp-full_meta.log
-rw-r-----. 1 oracle oinstall     360448 Dec 15 13:13 full_meta.dmp
-rw-r--r--. 1 oracle oinstall       2540 Dec 15 13:13 full_meta.log
-rw-r-----. 1 oracle oinstall     139264 Dec 15 13:02 hisdb1_01
-rw-r--r--. 1 oracle oinstall         16 Dec 15 12:54 h.ora
-rw-r-----. 1 oracle oinstall    1089536 Dec 15 12:42 hisdb0_042e3g99_1_1
-rw-r-----. 1 oracle oinstall    1187840 Dec 15 12:42 hisdb0_022e3g99_1_1
-rw-r-----. 1 oracle oinstall     163840 Dec 15 12:42 hisdb0_032e3g99_1_1
-rw-r-----. 1 oracle oinstall    1564672 Dec 15 12:42 hisdb0_012e3g99_1_1
[oracle@11g bak]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 17 22:49:19 2023

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> show parameter name;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_file_name_convert                 string
db_name                              string      jycdb
db_unique_name                       string      jycdb
global_names                         boolean     FALSE
instance_name                        string      jycdb
lock_name_space                      string
log_file_name_convert                string
service_names                        string      jycdb
SQL> create table j2.ttt as select * from j2.t2;

Table created.

SQL> alter tablespace users read only;

Tablespace altered.

SQL> alter tablespace data read only;

Tablespace altered.

SQL> @o.sql

OWNER                          OBJECT_TYPE           COUNT(*)
------------------------------ ------------------- ----------
J1                             DATABASE LINK                1
J1                             INDEX                        1
J1                             SYNONYM                      1
J1                             TABLE                       12
J2                             DATABASE LINK                1
J2                             SEQUENCE                     2
J2                             SYNONYM                      1
J2                             TABLE                       10
J2                             VIEW                         1
PUBLIC                         DATABASE LINK                2
PUBLIC                         SYNONYM                  27699

OWNER                          OBJECT_TYPE           COUNT(*)
------------------------------ ------------------- ----------
SCOTT                          INDEX                        2
SCOTT                          TABLE                        4

13 rows selected.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@11g bak]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Sun Dec 17 22:50:11 2023

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

connected to target database: JYCDB (DBID=592598178)

RMAN> backup incremental level=1 tablespace DATA,USERS filesperset 300 format '/bak/hisdb1_10' tag=hisdb1;

Starting backup at 2023-12-17 22:50:23
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=24 device type=DISK
channel ORA_DISK_1: starting incremental level 1 datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=/home/db/oracle/oradata/jycdb/users01.dbf
input datafile file number=00005 name=/home/db/oracle/oradata/jycdb/users02.dbf
input datafile file number=00006 name=/home/db/oracle/oradata/jycdb/users03.dbf
input datafile file number=00007 name=/home/db/oracle/oradata/jycdb/data01.dbf
input datafile file number=00008 name=/home/db/oracle/oradata/jycdb/data02.dbf
input datafile file number=00009 name=/home/db/oracle/oradata/jycdb/data03.dbf
input datafile file number=00010 name=/home/db/oracle/oradata/jycdb/data04.dbf
channel ORA_DISK_1: starting piece 1 at 2023-12-17 22:50:23
channel ORA_DISK_1: finished piece 1 at 2023-12-17 22:50:24
piece handle=/bak/hisdb1_10 tag=HISDB1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2023-12-17 22:50:24

RMAN> exit


Recovery Manager complete.
[oracle@11g bak]$ impdp \'sys/"abcd1234" as sysdba\' dumpfile=tts2.dmp logfile=tts-imp2.log director[oracle@11g bak]$ export ORACLE_SID=hisdb
[oracle@11g bak]$ expdp \'/ as sysdba\' directory=acfsdmp dumpfile=tts2.dmp logfile=tts-exp2.log clu[oracle@11g bak]$ rman target /
[oracle@11g bak]$ expdp \'/ as sysdba\' directory=acfsdmp dumpfile=tts2.dmp logfile=tts-exp2.log clu[oracle@11g bak]$ expdp \'/ as sysdba\' directory=acfsdmp dumpfile=tts.dmp logfile=tts-exp2.log clus[oracle@11g bak]$ expdp \'/ as sysdba\' directory=acfsdmp dumpfile=tts3.dmp logfile=tts-exp2.log clu[oracle@11g bak]$ expdp \'/ as sysdba\' directory=acfsdmp dumpfile=tts3.dmp logfile=tts-exp.log clus[oracle@11g bak]$ expdp \'/ as sysdba\' directory=acfsdmp dumpfile=tts3.dmp logfile=tts-exp3.log clu[oracle@11g bak]$ expdp \'/ as sysdba\' directory=acfsdmp dumpfile=tts3.dmp logfile=tts-exp3.log cluster=n transport_tablespaces=DATA,USERS EXCLUDE=TABLE_STATISTICS,INDEX_STATISTICS 

Export: Release 11.2.0.1.0 - Production on Sun Dec 17 22:51:07 2023

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

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SYS"."SYS_EXPORT_TRANSPORTABLE_01":  "/******** AS SYSDBA" directory=acfsdmp dumpfile=tts3.dmp logfile=tts-exp3.log cluster=n transport_tablespaces=DATA,USERS EXCLUDE=TABLE_STATISTICS,INDEX_STATISTICS 
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
Processing object type TRANSPORTABLE_EXPORT/TABLE
Processing object type TRANSPORTABLE_EXPORT/INDEX
Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/CONSTRAINT
Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/REF_CONSTRAINT
Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
Master table "SYS"."SYS_EXPORT_TRANSPORTABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYS.SYS_EXPORT_TRANSPORTABLE_01 is:
  /bak/tts3.dmp
******************************************************************************
Datafiles required for transportable tablespace DATA:
  /home/db/oracle/oradata/jycdb/data01.dbf
  /home/db/oracle/oradata/jycdb/data02.dbf
  /home/db/oracle/oradata/jycdb/data03.dbf
  /home/db/oracle/oradata/jycdb/data04.dbf
Datafiles required for transportable tablespace USERS:
  /home/db/oracle/oradata/jycdb/users01.dbf
  /home/db/oracle/oradata/jycdb/users02.dbf
  /home/db/oracle/oradata/jycdb/users03.dbf
Job "SYS"."SYS_EXPORT_TRANSPORTABLE_01" successfully completed at 22:51:17

[oracle@11g bak]$ export ORACLE_SID=hisdb
[oracle@11g bak]$ expdp \'/ as sysdba\' directory=acfsdmp dumpfile=tts3.dmp logfile=tts-exp3.log clu[oracle@11g bak]$ rman target /
[oracle@11g bak]$ impdp \'sys/"abcd1234" as sysdba\' dumpfile=tts2.dmp logfile=tts-imp2.log director[oracle@11g bak]$ impdp \'sys/"abcd1234" as sysdba\' dumpfile=tts2.dmp logfile=tts-imp.log directory[oracle@11g bak]$ impdp \'sys/"abcd1234" as sysdba\' dumpfile=tts2.dmp logfile=tts-imp3.log director[oracle@11g bak]$ impdp \'sys/"abcd1234" as sysdba\' dumpfile=tts.dmp logfile=tts-imp3.log directory[oracle@11g bak]$ impdp \'sys/"abcd1234" as sysdba\' dumpfile=tts3.dmp logfile=tts-imp3.log director[oracle@11g bak]$ impdp \'sys/"abcd1234" as sysdba\' dumpfile=tts3.dmp logfile=tts-imp3.log directory=acfsdmp PARFILE=impdp-par.txt

Import: Release 11.2.0.1.0 - Production on Sun Dec 17 22:51:41 2023

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

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "SYS"."SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded
Starting "SYS"."SYS_IMPORT_TRANSPORTABLE_01":  "sys/******** AS SYSDBA" dumpfile=tts3.dmp logfile=tts-imp3.log directory=acfsdmp PARFILE=impdp-par.txt 
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
Processing object type TRANSPORTABLE_EXPORT/TABLE
Processing object type TRANSPORTABLE_EXPORT/INDEX
Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/CONSTRAINT
Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/REF_CONSTRAINT
Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
Job "SYS"."SYS_IMPORT_TRANSPORTABLE_01" successfully completed at 22:51:43

[oracle@11g bak]$ impdp \'sys/"abcd1234" as sysdba\' dumpfile=tts3.dmp logfile=tts-imp3.log director[oracle@11g bak]$ export ORACLE_SID=hisdb
[oracle@11g bak]$ expdp \'/ as sysdba\' directory=acfsdmp dumpfile=tts3.dmp logfile=tts-exp3.log clu[oracle@11g bak]$ rman target /
[oracle@11g bak]$ export ORACLE_SID=jycdb
[oracle@11g bak]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sun Dec 17 22:52:13 2023

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> @o.sql

OWNER                          OBJECT_TYPE           COUNT(*)
------------------------------ ------------------- ----------
J1                             DATABASE LINK                1
J1                             INDEX                        1
J1                             SYNONYM                      1
J1                             TABLE                       12
J2                             DATABASE LINK                1
J2                             SEQUENCE                     2
J2                             SYNONYM                      1
J2                             TABLE                       10
J2                             VIEW                         1
PUBLIC                         DATABASE LINK                2
PUBLIC                         SYNONYM                  27699

OWNER                          OBJECT_TYPE           COUNT(*)
------------------------------ ------------------- ----------
SCOTT                          INDEX                        2
SCOTT                          TABLE                        4

13 rows selected.

SQL> @/home/oracle/tbs.sql

TABLESPACE_NAME                SUM_SPACE(M) SUM_BLOCKS USED_SPACE(M) USED_RATE(%) FREE_SPACE(M)
------------------------------ ------------ ---------- ------------- ------------ -------------
SYSTEM                                  680      87040        675.44        99.33          4.56
SYSAUX                                  500      64000        471.62        94.32         28.38
USERS                                     6        768          4.12        68.67          1.88
UNDOTBS1                                 75       9600         25.75        34.33         49.25
DATA                                      4        512           .75        18.75          3.25
TEMP                                     29       3712                          0

6 rows selected.

文章来源:https://blog.csdn.net/jycjyc/article/details/135052135
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。