博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
RMAN 异机恢复
阅读量:5076 次
发布时间:2019-06-12

本文共 18490 字,大约阅读时间需要 61 分钟。

RMAN异机恢复,本次实验的恢复机(B)与备份机(A)的控制、数据、归档、重做日志的文件路径都不同

大步骤:

1 A机进行RMAN热备(参数、控制、归档日志、数据文件)
2 B机准备好控制、重做日志、数据文件、归档日志目录并让Oracle用户有读写权限
3 将A机RMAN备份文件复制至B机
4 B机进行还原、恢复

 

一、A机RMAN热备

RMAN备份方式

冷备 --> 数据库正常关闭,控制文件、数据文件、redo文件的SCN一致
热备 --> 数据库运行中,可单独备份控制、表空间、数据、归档文件(密码与redo不能备份)

备份控制文件:

自动备份 -> 备份SYSTEM的数据文件,即1#数据文件会自动备份控制文件

设置RMAN默认参数 -> configure controlfile autobackup on;

                               再用RMAN备份都会自动备份控制、系统参数(spfile.ora)文件
                               但不会备份初始化参数文件(initSID.ora)

手动RMAN -> backup current controlfile;

手动输出 -> alter database backup controlfile to trace;

                会在user_dump_dest路径下生成sid_orcl_xxxx.trc的文件

手动copy -> 直接将控制文件另存一份

 

 

1、编写备份脚本为文件:backfczldb.rman

RMAN> run
2> {
3> allocate channel ch1 type disk --手动一个到磁盘的通道
4> maxpiecesize=100m; --单个备份片最大为100M,超出则另起备份片
5> configure controlfile autobackup on; --自动恢复控制文件
6> backup as compressed backupset --压缩备份
7> database plus archivelog format '/ora/oradata_2/backup/fczldb_%d_%U'; --备份归档日志
8> release channel ch1; --备份完释放通道
9> }

2、执行备份

RMAN> @/ora/oradata_2/backfczldb.rman

RMAN> run

2> {
3> allocate channel ch1 type disk
4> maxpiecesize=100m;
5> configure controlfile autobackup on;
6> backup as compressed backupset
7> database plus archivelog format '/ora/oradata_2/backup/fczldb_%d_%U';
8> release channel ch1;
9> }
released channel: ORA_DISK_1
allocated channel: ch1
channel ch1: sid=142 devtype=DISK

old RMAN configuration parameters:

CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored

Starting backup at 15-JUL-13
--由于plus archivelog会在备份归档前自动归档一次,以保证下面备份的归档日志为最新
current log archived
channel ch1: starting compressed archive log backupset
channel ch1: specifying archive log(s) in backup set
input archive log thread=1 sequence=5 recid=4 stamp=819885623
input archive log thread=1 sequence=6 recid=5 stamp=819886830
input archive log thread=1 sequence=7 recid=6 stamp=820127039
input archive log thread=1 sequence=8 recid=7 stamp=820127290
input archive log thread=1 sequence=9 recid=8 stamp=820321745
input archive log thread=1 sequence=10 recid=9 stamp=820331689
input archive log thread=1 sequence=11 recid=10 stamp=820829291
input archive log thread=1 sequence=12 recid=11 stamp=820829538
input archive log thread=1 sequence=13 recid=12 stamp=820831932
input archive log thread=1 sequence=14 recid=13 stamp=820832510
input archive log thread=1 sequence=15 recid=14 stamp=820832612
input archive log thread=1 sequence=16 recid=15 stamp=820835883
input archive log thread=1 sequence=17 recid=16 stamp=820835966
input archive log thread=1 sequence=18 recid=17 stamp=820837942
input archive log thread=1 sequence=19 recid=18 stamp=820838117
input archive log thread=1 sequence=20 recid=19 stamp=820840710
input archive log thread=1 sequence=21 recid=20 stamp=820840994
input archive log thread=1 sequence=22 recid=21 stamp=820841988
channel ch1: starting piece 1 at 15-JUL-13
channel ch1: finished piece 1 at 15-JUL-13
--第一个备份片(归档日志)
piece handle=/ora/oradata_2/backup/fczldb_FCZL_17oeq3g4_1_1 tag=TAG20130715T113948 comment=NONE
channel ch1: backup set complete, elapsed time: 00:00:37
Finished backup at 15-JUL-13

Starting backup at 15-JUL-13

channel ch1: starting compressed full datafile backupset
channel ch1: specifying datafile(s) in backupset
input datafile fno=00001 name=/ora/oradata_2/fczldb/fczl/system01.dbf
input datafile fno=00003 name=/ora/oradata_2/fczldb/fczl/sysaux01.dbf
input datafile fno=00005 name=/ora/oradata_2/fczldb/fczl/example01.dbf
input datafile fno=00002 name=/ora/oradata_2/fczldb/fczl/undotbs01.dbf
input datafile fno=00004 name=/ora/oradata_2/fczldb/fczl/users01.dbf
channel ch1: starting piece 1 at 15-JUL-13
channel ch1: finished piece 1 at 15-JUL-13
--第二个备份片(数据文件)
piece handle=/ora/oradata_2/backup/FCZL/backupset/2013_07_15/o1_mf_nnndf_TAG20130715T114025_8y85zbbc_.bkp tag=TAG20130715T114025 comment=NONE
channel ch1: starting piece 2 at 15-JUL-13
channel ch1: finished piece 2 at 15-JUL-13
--第三个备份片(数据文件),因指定了maxpiecesize=100m,则备份片超100M会新建一个备份片存储
piece handle=/ora/oradata_2/backup/FCZL/backupset/2013_07_15/o1_mf_nnndf_TAG20130715T114025_8y861z1m_.bkp tag=TAG20130715T114025 comment=NONE
channel ch1: backup set complete, elapsed time: 00:01:40
Finished backup at 15-JUL-13

Starting backup at 15-JUL-13

--再次自动进行归档,因备份归档和数据期间,数据库处于运行状态,所以需要再次归档并备份。否则在运行期间的日志还会存
在于重做日志中,不能体现备份本次归档日志的完整性
current log archived
channel ch1: starting compressed archive log backupset
channel ch1: specifying archive log(s) in backup set
input archive log thread=1 sequence=23 recid=22 stamp=820842126
channel ch1: starting piece 1 at 15-JUL-13
channel ch1: finished piece 1 at 15-JUL-13
--第四个备份片(再次归档后的归档日志,可能有也可能没有)
piece handle=/ora/oradata_2/backup/fczldb_FCZL_19oeq3ke_1_1 tag=TAG20130715T114206 comment=NONE
channel ch1: backup set complete, elapsed time: 00:00:02
Finished backup at 15-JUL-13

Starting Control File and SPFILE Autobackup at 15-JUL-13

--第五个备份片(控制文件与服务器参数文件)
piece handle=/ora/oradata_2/backup/FCZL/autobackup/2013_07_15/o1_mf_s_820842129_8y862kqg_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 15-JUL-13

released channel: ch1

本次备份总结:

--归档日志备份片
/ora/oradata_2/backup/fczldb_FCZL_17oeq3g4_1_1 tag=TAG20130715T113948
--数据文件备份片
/ora/oradata_2/backup/FCZL/backupset/2013_07_15/o1_mf_nnndf_TAG20130715T114025_8y85zbbc_.bkp
/ora/oradata_2/backup/FCZL/backupset/2013_07_15/o1_mf_nnndf_TAG20130715T114025_8y861z1m_.bkp
--再次归档后的归档日志备份片
/ora/oradata_2/backup/fczldb_FCZL_19oeq3ke_1_1 tag=TAG20130715T114206
--控制、参数文件备份片
/ora/oradata_2/backup/FCZL/autobackup/2013_07_15/o1_mf_s_820842129_8y862kqg_.bkp

备份集只是逻辑概念,不存在于磁盘上。一个备份集可包含多个备份片

备份片才是实际上存储备份的文件,在磁盘上可见

二、将备份片文件复制到B机

--因为复制内容有文件夹注意scp要加 -r,否则会提示not a regular file

[root@localhost oracle]# scp -r root@192.168.1.102:/ora/oradata_2/backup/* /home/oracle/backup
root@192.168.1.102's password:
o1_mf_nnndf_TAG20130715T114025_8y85zbbc_.bkp
o1_mf_nnndf_TAG20130715T114025_8y85zbbc_.bkp 100% 98MB 785.1KB/s 02:08
o1_mf_nnndf_TAG20130715T114025_8y861z1m_.bkp 100% 15MB 1.1MB/s 00:13
o1_mf_s_820842129_8y862kqg_.bkp 100% 6976KB 872.0KB/s 00:08
fczldb_FCZL_17oeq3g4_1_1 100% 54MB 1.6MB/s 00:35
fczldb_FCZL_19oeq3ke_1_1

三、还原参数文件

注意oracle用户要对备份片文件有访问权限,否则会提示无法找到有效的备份

1、还原为spfile -> 适合B机文件路径与A机一致,不用修改。还原后直接用该参数文件启动实例

RMAN> restore spfile from '/home/oracle/backup/FCZL/autobackup/2013_07_15/o1_mf_s_820842129_8y862kqg_.bkp';

2、还原为pfile -> 适合B机文件路径与A机不一致,参数文件中的一些文件路径要修改

RMAN> restore spfile to pfile '/home/oracle/dbs/initfczl.ora' from
2> '/home/oracle/backup/FCZL/autobackup/2013_07_15/o1_mf_s_820842129_8y862kqg_.bkp';

Starting restore at 16-JUL-13

using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=37 devtype=DISK

channel ORA_DISK_1: autobackup found: /home/oracle/backup/FCZL/autobackup/2013_07_15/o1_mf_s_820842129_8y862kqg_.bkp

channel ORA_DISK_1: SPFILE restore from autobackup complete
Finished restore at 16-JUL-13

3、看到在dbs目录下已经恢复了参数文件

[oracle@localhost dbs]$ find /home/oracle/dbs/ -name 'spfilefczl.ora'
/home/oracle/dbs/spfilefczl.ora

4、编辑上面生成的pfile参数文件,将其中的文件路径的都修改为B机的路径

注意此处控制文件路径要是可访问的路径,因为在稍后还原的控制文件会还原到此目录

*.audit_file_dest='/ora/oradata_2/fczldb/admin/adump'
*.background_dump_dest='/ora/oradata_2/fczldb/admin/bdump'
*.control_files='/ora/oradata_2/fczldb/controlfile/control01.ctl','/ora/oradata_2/fczldb/controlfile/control02.ctl','/ora/oradata_2/fczldb/controlfile/control03.ctl'
*.core_dump_dest='/ora/oradata_2/fczldb/admin/cdump'
*.db_recovery_file_dest='/ora/oradata_2/fczldb/backup'
*.log_archive_dest_1='location=/ora/oradata_2/fczldb/archivelog'
*.user_dump_dest='/ora/oradata_2/fczldb/admin/udump'

5、用上面还原的参数文件启动实例

关闭实例

SQL> shutdown;
ORA-01507: database not mounted
ORACLE instance shut down.

启动实例到nomount状态

这里不用指定上面生成的pfile文件,系统会在dbs目录下: spfile.ora -> pfile.ora的顺序查找
因为上面已经将initfczl.ora恢复到了dbs目录,这里启动时会自动找到
SQL> startup nomount;
ORACLE instance started.

Total System Global Area 285212672 bytes

Fixed Size 1218992 bytes
Variable Size 96470608 bytes
Database Buffers 184549376 bytes
Redo Buffers 2973696 bytes
SQL> alter database mounted;

切换到挂载状态时提示异常,因为按参数文件中的路径找不到控制文件

SQL> alter database mount;
alter database mount
*
ERROR at line 1:
ORA-00205: error in identifying control file, check alert log for more info

6、还原控制文件,会被还原到上面参数文件中指定的控制文件位置

RMAN> restore controlfile from '/home/oracle/backup/FCZL/autobackup/2013_07_15/o1_mf_s_820842129_8y862kqg_.bkp';

Starting restore at 16-JUL-13

using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK

channel ORA_DISK_1: restoring control file

channel ORA_DISK_1: restore complete, elapsed time: 00:00:04
output filename=/ora/oradata_2/fczldb/controlfile/control01.ctl
output filename=/ora/oradata_2/fczldb/controlfile/control02.ctl
output filename=/ora/oradata_2/fczldb/controlfile/control03.ctl
Finished restore at 16-JUL-13

还原控制文件后,可以正常切换到挂载状态,还原数据文件需要到mount状态

SQL> alter database mount;

Database altered.

到此参数、控制文件已经还原完成,接下来就是还原数据文件与恢复了

7、还原数据文件

因为不是用catalog目录,rman信息是直接存在控制文件中的, 上面还原了控制文件,但里面记录的rman备份片

路径是A机上的,在B机上备份片位置已经变了,需要:
1、清除控制文件RMAN信息
2、将备份集的新路径注册到控制文件中

清除当前控制文件RMAN信息

RMAN> delete backup;

List of Backup Pieces

BP Key BS Key Pc# Cp# Status Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
36 36 1 1 EXPIRED DISK /ora/oradata_2/backup/fczldb_FCZL_17oeq3g4_1_1
37 37 1 1 EXPIRED DISK /ora/oradata_2/backup/FCZL/backupset/2013_07_15/o1_mf_nnndf_TAG20130715T114025_8y85zbbc_.bkp
38 37 2 1 EXPIRED DISK /ora/oradata_2/backup/FCZL/backupset/2013_07_15/o1_mf_nnndf_TAG20130715T114025_8y861z1m_.bkp
39 38 1 1 EXPIRED DISK /ora/oradata_2/backup/fczldb_FCZL_19oeq3ke_1_1

Do you really want to delete the above objects (enter YES or NO)? YES

deleted backup piece
backup piece handle=/ora/oradata_2/backup/fczldb_FCZL_17oeq3g4_1_1 recid=36 stamp=820841990
deleted backup piece
backup piece handle=/ora/oradata_2/backup/FCZL/backupset/2013_07_15/o1_mf_nnndf_TAG20130715T114025_8y85zbbc_.bkp recid=37 stamp=820842026
deleted backup piece
backup piece handle=/ora/oradata_2/backup/FCZL/backupset/2013_07_15/o1_mf_nnndf_TAG20130715T114025_8y861z1m_.bkp recid=38 stamp=820842110
deleted backup piece
backup piece handle=/ora/oradata_2/backup/fczldb_FCZL_19oeq3ke_1_1 recid=39 stamp=820842127
Deleted 4 objects

再次查看已经没有了

RMAN> list backup;

RMAN>

再把当前备份片信息注册到控制文件中

RMAN> catalog backuppiece '/home/oracle/backup/fczldb_FCZL_17oeq3g4_1_1';

cataloged backuppiece

backup piece handle=/home/oracle/backup/fczldb_FCZL_17oeq3g4_1_1 recid=40 stamp=820927947

RMAN> catalog backuppiece '/home/oracle/backup/fczldb_FCZL_19oeq3ke_1_1';

cataloged backuppiece

backup piece handle=/home/oracle/backup/fczldb_FCZL_19oeq3ke_1_1 recid=41 stamp=820927977

RMAN> catalog backuppiece '/home/oracle/backup/FCZL/autobackup/2013_07_15/o1_mf_s_820842129_8y862kqg_.bkp';

cataloged backuppiece

backup piece handle=/home/oracle/backup/FCZL/autobackup/2013_07_15/o1_mf_s_820842129_8y862kqg_.bkp recid=42 stamp=820928037

RMAN> catalog backuppiece '/home/oracle/backup/FCZL/backupset/2013_07_15/o1_mf_nnndf_TAG20130715T114025_8y85zbbc_.bkp';

cataloged backuppiece

backup piece handle=/home/oracle/backup/FCZL/backupset/2013_07_15/o1_mf_nnndf_TAG20130715T114025_8y85zbbc_.bkp recid=43 stamp=820928172

RMAN> catalog backuppiece '/home/oracle/backup/FCZL/backupset/2013_07_15/o1_mf_nnndf_TAG20130715T114025_8y861z1m_.bkp';

cataloged backuppiece

backup piece handle=/home/oracle/backup/FCZL/backupset/2013_07_15/o1_mf_nnndf_TAG20130715T114025_8y861z1m_.bkp recid=44 stamp=820928209

此时再用list backup 查看就能看到备份集路径已经为B机上的正确路径

此时B机控制文件的RMAN信息与备份片的路径都能对上了,可以进行restore database了

8、编写还原数据库脚本

数据文件路径与A机不一致时用set newname for datafile # to B机数据文件新位置

run
{
set newname for datafile 1 to '/ora/oradata_2/fczldb/datafile/system01.dbf';
set newname for datafile 2 to '/ora/oradata_2/fczldb/datafile/uodotbs01.dbf';
set newname for datafile 3 to '/ora/oradata_2/fczldb/datafile/sysaux01.dbf';
set newname for datafile 4 to '/ora/oradata_2/fczldb/datafile/user01.dbf';
set newname for datafile 5 to '/ora/oradata_2/fczldb/datafile/example01.dbf';

 

restore database;

--这里直接用restore database即可,因为控制文件中的rman信息已经能B机到备份片了

--如有多个备份集,可用from tag='TAG20130704T101905'方式还原指定备份集的数据文件

--restore database只是还原数据文件,也可单独只还原某个数据文件

switch datafile all;

}

 

9、restore database

RMAN> @/ora/oradata_2/fczldb/rman/rmanfczl.rman

RMAN> run

2> {
3> set newname for datafile 1 to '/ora/oradata_2/fczldb/datafile/system01.dbf';
4> set newname for datafile 2 to '/ora/oradata_2/fczldb/datafile/uodotbs01.dbf';
5> set newname for datafile 3 to '/ora/oradata_2/fczldb/datafile/sysaux01.dbf';
6> set newname for datafile 4 to '/ora/oradata_2/fczldb/datafile/user01.dbf';
7> set newname for datafile 5 to '/ora/oradata_2/fczldb/datafile/example01.dbf';
8>
9> restore database;
10> switch datafile all;
11> }
executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 16-JUL-13

using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backupset restore

channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /ora/oradata_2/fczldb/datafile/system01.dbf
restoring datafile 00002 to /ora/oradata_2/fczldb/datafile/uodotbs01.dbf
restoring datafile 00003 to /ora/oradata_2/fczldb/datafile/sysaux01.dbf
restoring datafile 00004 to /ora/oradata_2/fczldb/datafile/user01.dbf
restoring datafile 00005 to /ora/oradata_2/fczldb/datafile/example01.dbf
channel ORA_DISK_1: reading from backup piece /home/oracle/backup/FCZL/backupset/2013_07_15/o1_mf_nnndf_TAG20130715T114025_8y85zbbc_.bkp
channel ORA_DISK_1: restored backup piece 1
piece handle=/home/oracle/backup/FCZL/backupset/2013_07_15/o1_mf_nnndf_TAG20130715T114025_8y85zbbc_.bkp tag=TAG20130715T114025
channel ORA_DISK_1: reading from backup piece /home/oracle/backup/FCZL/backupset/2013_07_15/o1_mf_nnndf_TAG20130715T114025_8y861z1m_.bkp
channel ORA_DISK_1: restored backup piece 2
piece handle=/home/oracle/backup/FCZL/backupset/2013_07_15/o1_mf_nnndf_TAG20130715T114025_8y861z1m_.bkp tag=TAG20130715T114025
channel ORA_DISK_1: restore complete, elapsed time: 00:01:52
Finished restore at 16-JUL-13

datafile 1 switched to datafile copy

input datafile copy recid=7 stamp=820928576 filename=/ora/oradata_2/fczldb/datafile/system01.dbf
datafile 2 switched to datafile copy
input datafile copy recid=8 stamp=820928576 filename=/ora/oradata_2/fczldb/datafile/uodotbs01.dbf
datafile 3 switched to datafile copy
input datafile copy recid=9 stamp=820928576 filename=/ora/oradata_2/fczldb/datafile/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy recid=10 stamp=820928576 filename=/ora/oradata_2/fczldb/datafile/user01.dbf
datafile 5 switched to datafile copy
input datafile copy recid=11 stamp=820928576 filename=/ora/oradata_2/fczldb/datafile/example01.dbf

RMAN> **end-of-file**

 

还原数据文件完成,在/ora/oradata_2/fczldb/datafile中可以看到文件已经有了

[root@localhost datafile]# pwd
/ora/oradata_2/fczldb/datafile
[root@localhost datafile]# ll
total 896940
-rw-r-----. 1 oracle oinstall 104865792 Jul 16 11:41 example01.dbf
-rw-r-----. 1 oracle oinstall 251666432 Jul 16 11:42 sysaux01.dbf
-rw-r-----. 1 oracle oinstall 513810432 Jul 16 11:42 system01.dbf
-rw-r-----. 1 oracle oinstall 41951232 Jul 16 11:41 uodotbs01.dbf
-rw-r-----. 1 oracle oinstall 5251072 Jul 16 11:41 user01.dbf

 

10、recover database 其实就是将归档日志再次执行的过程

 

RMAN> recover database;

 

Starting recover at 16-JUL-13

using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK

 

starting media recovery

 

channel ORA_DISK_1: starting archive log restore to default destination

channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=23
channel ORA_DISK_1: reading from backup piece /home/oracle/backup/fczldb_FCZL_19oeq3ke_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/home/oracle/backup/fczldb_FCZL_19oeq3ke_1_1 tag=TAG20130715T114206
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
archive log filename=/ora/oradata_2/fczldb/archivedlog/1_23_819808530.dbf thread=1 sequence=23
unable to find archive log
archive log thread=1 sequence=24
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 07/16/2013 11:52:28
RMAN-06054: media recovery requesting unknown log: thread 1 seq 24 lowscn 609833

会提示scn不一致的错误,因为备份时数据库还在进行,可能备份完成后控制文件、归档日志、数据文件的SCN不一致,就会出现这个提示

11、在重置日志模式打开数据库

SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-00344: unable to re-create online log
'/ora/oradata_2/fczldb/fczl/redo01.log'
ORA-27040: file create error, unable to create file
Linux Error: 2: No such file or directory

重做日志路径存在控制文件中,两种方式修改

1、重建
SQL> alter database backup controlfile to trace;
在admin/udump目录下会生成.trc的文件,如叫FCZL_0011.trc,其中就有重建控制文件的SQL语句,
提取出来后可修改重做日志文件路径,并存储成文件rebuild.sql

SQL> @rebuild.sql

这样就可重建控制文件

2、语句重命名或修改到新位置(要到mount状态,open状态不能改):

SQL> alter database rename file '/ora/oradata_2/fczldb/fczl/redo03.log' to '/ora/oradata_2/fczldb/redofile/redo03.log';

Database altered.

SQL> alter database rename file '/ora/oradata_2/fczldb/fczl/redo01.log' to '/ora/oradata_2/fczldb/redofile/redo01.log';

Database altered.

SQL> alter database rename file '/ora/oradata_2/fczldb/fczl/redo02.log' to '/ora/oradata_2/fczldb/redofile/redo02.log';

Database altered.

查看修改后的日志路径

SQL> select group#,member from v$logfile;

GROUP#

----------
MEMBER
--------------------------------------------------------------------------------
3
/ora/oradata_2/fczldb/redofile/redo03.log

2

/ora/oradata_2/fczldb/redofile/redo02.log

1

/ora/oradata_2/fczldb/redofile/redo01.log

查看日志状态
SQL> select group#,status from v$log;

GROUP# STATUS

---------- ----------------
1 ACTIVE --未归档,等待归档进程进行归档,日志切换会切换会触发归档进程,可手工切换
实例恢复时要用到
3 INACTIVE --已归档
2 CURRENT --当前写

再次打开数据库

SQL> alter database open resetlogs;

Database altered.

正常关闭会将控制文件、重做日志、数据文件的SCN保持一致,能正常关闭也就表示数据库处于一致性状态,也就可以正常打开了

SQL> shutdown;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 285212672 bytes

Fixed Size 1218992 bytes
Variable Size 96470608 bytes
Database Buffers 184549376 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.
SQL>

 

 

 

 

 

 

 

 

 

转载于:https://www.cnblogs.com/doclaim/p/3194764.html

你可能感兴趣的文章
页面中公用的全选按钮,单选按钮组件的编写
查看>>
java笔记--用ThreadLocal管理线程,Callable<V>接口实现有返回值的线程
查看>>
BZOJ 1047 HAOI2007 理想的正方形 单调队列
查看>>
各种语言推断是否是手机设备
查看>>
这个看起来有点简单!--------实验吧
查看>>
PHP count down
查看>>
JVM参数调优:Eclipse启动实践
查看>>
(旧笔记搬家)struts.xml中单独页面跳转的配置
查看>>
不定期周末福利:数据结构与算法学习书单
查看>>
strlen函数
查看>>
python的列表与shell的数组
查看>>
关于TFS2010使用常见问题
查看>>
软件工程团队作业3
查看>>
python标准库——queue模块 的queue类(单向队列)
查看>>
火狐、谷歌、IE关于document.body.scrollTop和document.documentElement.scrollTop 以及值为0的问题...
查看>>
深入理解JVM读书笔记--字节码执行引擎
查看>>
vue-搜索功能-实时监听搜索框的输入,N毫秒请求一次数据
查看>>
批处理 windows 服务的安装与卸载
查看>>
React文档翻译 (快速入门)
查看>>
nodejs fs路径
查看>>