ORACLE incomplete backup series
the
Incomplete recovery based on log sequence with rman
the
sql> select * from test;
a
—–
1
2
3
4
5
6
sql>host
ramn target/
rman>run
{
allocate channel c1 type disk;
bakup full tag & # 39; dbful & # 39; format & # 39; d:\backup\full_%u_%s_%p' database
include current controlfile;
sql & # 39; alter system archive log current & # 39;
release channel c1;
} www.2cto.com
rman>exit;
sql>insert into test values(16);
sql>commit;
sql>alter system switch logfile;
sql>insert into test values(17);
sql>alter system switch logfile;
sql>archive log list;
….
oldest onlie log sequence 14
next log sequence to archive 16
current log sequence 16
sql>select group#,sequence#,archived,status from v$log
group# sequence# archived status
———————————–
1 16 yes yes active
2 17 no current
3 15 yes yes active
It can be seen from this that the backup data file contains the 14th archived log. The online log v$log is using the 17th sequence of logs, and 15 and 16 have been archived.
When we did not back up the 15 and 16 logs. 15 and 16 contained the new data 16 and 17 of the table test.
To achieve incomplete recovery is to only restore the log data under the archived log. Instance recovery cannot be performed, that is to say, the online log is regarded as gone!
The data in the online log 17 cannot be restored, the logs 15 and 16 have been archived, and if they are not backed up, they can be restored if they are not deleted.
the
sql> shutdown immediate;
sql>startup nomount;
sql>alter database monut;
sql>host www.2cto.com
rman target/
rman> run{
allocate channel c1 type disk;
set until logsseq 14 thread 1;
restore database;
recover database;
sql ‘alter database open resetlogs’;
}
Time-based incomplete recovery with rman
the
sql> insert into test values(100);
commit;
sql> alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';
sql> select sysdate from dual;
sysdate
———-
2012-06-15 10:36:14
sql> host
rman target /
rman>run
{
allocate channel c1 type disk;
bakup full tag & # 39; dbful & # 39; format & # 39; d:\backup\full_%u_%s_%p' database
include current controlfile;
sql & # 39; alter system archive log current & # 39;
release channel c1;
}
rman> exit
sql> insert into test values(150);
sql>commit;
sql> select sysdate from dual;
sysdate
———-
2012-06-15 10:46:14
sql>alter system switch logfile;
sql> insert into test values(250);
sql> commit;
sql> select sysdate from dual;
sysdate
———-
2012-06-15 10:50:14
sql> shutdown immediate;
sql> startup mount;
sql> exit;
set nls_date_format=yyyy-mm-dd hh24:mi:ss
rman target/ www.2cto.com
rman>run{
allocate channel c1 type disk;
set until time '2012-06-15 10:46:14';
restore database;
recover database;
sql & # 39; alter database open reset logs & # 39;
release channel c1;
}
–recover database until time & # 39; 2008-04-10 10:36:14 & # 39;; You can directly follow the recover database without using set until
–set until time “to_date('2008042115:00:00','yyyymmdd hh24:mi:ss')” You can set the time format without operating system
the
Incomplete recovery based on scn in rman mode
the
sqlplus “/as sysda”
sql>select dbms_flashback.get_system_change_number from dual;
xxxxx345
sql>insert into test values(400);
sql>commit;
sql>select dbms_flashback.get_system_change_number from dual;
xxxxx356;
sql> host;
rman target/
rman>run
{
allocate channel c1 type disk;
bakup full tag & # 39; dbful & # 39; format & # 39; d:\backup\full_%u_%s_%p' database
include current controlfile;
sql & # 39; alter system archive log current & # 39;
release channel c1;
}
rman>exit;
sql>insert into test values(450);
sql>commit;
sql>select dbms_flashback.get_system_change_number from dual;
xxxxx368 www.2cto.com
sql>shutdown immediate;
sql>startup mount;
sql>exit;
rman target/
rman> run{
allocate channel c1 type disk;
restore database;
recover database until scn xxxx356;
sql & # 39; alter database open reset logs & # 39;
release channel c1;
}
the
the
Author ZengMuAnSha
ORACLE incomplete backup series
This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/oracle-incomplete-backup-series/