标签:ini run data llb localhost database using sequence connect
环境:
OS:Centos 7
DB:12.2.0.1
1.备份数据库
run
{
allocate channel ch1 device type disk;
backup as compressed backupset full filesperset 5 database format ‘/u01/rman_backup/db_fullbackup_%d_%s_%p_%T‘;
sql ‘alter system archive log current‘;
backup current controlfile format ‘/u01/rman_backup/ctl_%d_%s_%p_%T‘;
backup spfile format ‘/u01/rman_backup/spfile_%d_%s_%p_%T‘;
release channel ch1;
crosscheck backup;
crosscheck archivelog all;
delete noprompt expired backup;
delete noprompt obsolete;
}
2.切换生成多个logfile
SQL> connect / as sysdba
Connected.
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/app/oracle/archive_log
Oldest online log sequence 1
Next log sequence to archive 3
Current log sequence 3
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
3.模拟手工删除数据一个归档日志
[oracle@localhost archive_log]$ ls -al
total 4672
drwxr-xr-x. 2 oracle oinstall 136 Dec 11 03:27 .
drwxr-xr-x. 11 oracle oinstall 151 Dec 6 04:18 ..
-rw-r-----. 1 oracle oinstall 4765696 Dec 11 03:25 1_2_1026700907.dbf
-rw-r-----. 1 oracle oinstall 3072 Dec 11 03:27 1_3_1026700907.dbf
-rw-r-----. 1 oracle oinstall 1024 Dec 11 03:27 1_4_1026700907.dbf
-rw-r-----. 1 oracle oinstall 1024 Dec 11 03:27 1_5_1026700907.dbf
-rw-r-----. 1 oracle oinstall 1024 Dec 11 03:27 1_6_1026700907.dbf
[oracle@localhost archive_log]$ rm 1_4_1026700907.dbf
这里我们删除了4这个归档日志
4.可恢复性检查
RMAN> run{ 说明可以恢复,2和3归档都存在,下面我们验证恢复到归档日志5看下什么情况
|
标签:ini run data llb localhost database using sequence connect
原文地址:https://www.cnblogs.com/hxlasky/p/12023501.html