Oracle Backup(三):数据库归档设置

oracle结束一个联机重做日志的写入并开始写入另一个联机重做日志时,会发生日志切换。如果数据库处于ARCHIVELOG模式下,日志切换的结果是生成联机重做日志的副本,这个副本叫做归档日志,数据库在介质恢复的期间,会采用归档日志来执行恢复。

第一章 归档模式切换

1.1. 查看日志是否归档

#方法一:
SQL> archive log list;
Database log mode          Archive Mode
Automatic archival         Enabled
Archive destination        /backup/redo/archive/
Oldest online log sequence     9
Next log sequence to archive   11
Current log sequence           11
#方法二:
SQL> select LOG_MODE from v$database;

LOG_MODE
------------
ARCHIVELOG

说明数据库处于归档模式。

1.2. 归档模式切换

#将归档模式切换了非归档模式
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area  784998400 bytes
Fixed Size          2257352 bytes
Variable Size         515903032 bytes
Database Buffers      264241152 bytes
Redo Buffers            2596864 bytes
Database mounted.
SQL> alter database noarchivelog;

Database altered.

SQL> alter database open;

Database altered.

SQL> archive log list;
Database log mode          No Archive Mode
Automatic archival         Disabled
Archive destination        /backup/redo/archive/
Oldest online log sequence     9
Current log sequence           11

#将非归档模式转换为归档模式
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area  784998400 bytes
Fixed Size          2257352 bytes
Variable Size         515903032 bytes
Database Buffers      264241152 bytes
Redo Buffers            2596864 bytes
Database mounted.

SQL> alter database archivelog;

Database altered.

SQL> alter database open;

Database altered.

SQL> archive log list;
Database log mode          Archive Mode
Automatic archival         Enabled
Archive destination        /backup/redo/archive/
Oldest online log sequence     9
Next log sequence to archive   11
Current 

你可能感兴趣的:(Oracle,Backup,数据库,oracle)