首页 > 代码库 > 关于数据库归档

关于数据库归档

  关于数据库归档
  --查看数据库是否归档模式
 SQL> select name,log_mode from v$database;

NAME      LOG_MODE
--------- ------------
ENMO      NOARCHIVELOG

SQL>  archive log list;
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            /u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch
Oldest online log sequence     6
Current log sequence           8
--要关闭数据库  在mount下启动数据库
SQL> shutdown immediate  
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount                 
ORACLE instance started.

Total System Global Area  835104768 bytes
Fixed Size                  2257840 bytes
Variable Size             541068368 bytes
Database Buffers          289406976 bytes
Redo Buffers                2371584 bytes
Database mounted.
SQL>
SQL>
--更改数据库为归档模式
SQL> alter database archivelog;

Database altered.
---  打开数据库

SQL> alter database open;

Database altered.
--启动自动归档
SQL> alter system archive log start;

System altered.

SQL>

关于数据库归档