二维码

如何启动或关闭oracle的归档(ARCHIVELOG)模式

1698 人阅读 | 时间:2019年03月07日 09:37

1.管理员身份连接数据库


C:\Users\Administrator>sqlplus sys/sys@prjdb as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Tue Jun 17 23:50:55 2014Copyright (c) 1982, 2010, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options

2.查看当前归档模式,是归档还是非归档


SQL> archive log list;Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     228Current log sequence           230

3.关闭数据库

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

4.启动数据库到mount状态


SQL> startup mount;
ORACLE instance started.

Total System Global Area 3423965184 bytes
Fixed Size                  2180544 bytes
Variable Size            2013268544 bytesDatabase Buffers         1392508928 bytes
Redo Buffers               16007168 bytesDatabase mounted.

5.启动归档模式


SQL> alter database archivelog;Database altered.

SQL> archive log list;Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     228Next log sequence to archive   230Current log sequence           230

6.启动数据库

SQL> alter database open;Database altered.

7.关闭归档模式


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

Total System Global Area 3423965184 bytes
Fixed Size                  2180544 bytes
Variable Size            2013268544 bytesDatabase Buffers         1392508928 bytes
Redo Buffers               16007168 bytesDatabase mounted.
SQL> alter database noarchivelog;Database altered.

SQL> archive log list;Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     228Current log sequence           230SQL>

 

 

©著作权归作者所有:来自ZhiKuGroup博客作者没文化的原创作品,如需转载,请注明出处,否则将追究法律责任 来源:ZhiKuGroup博客,欢迎分享。

评论专区
  • 昵 称必填
  • 邮 箱选填
  • 网 址选填
◎已有 0 人评论
搜索
作者介绍
30天热门
×
×
本站会员尊享VIP特权,现在就加入我们吧!登录注册×
»
会员登录
新用户注册
×
会员注册
已有账号登录
×