Chinaunix首页 | 论坛 | 博客
  • 博客访问: 245285
  • 博文数量: 50
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 533
  • 用 户 组: 普通用户
  • 注册时间: 2015-07-28 21:56
个人简介

活着,寻找生存。

文章分类

全部博文(50)

文章存档

2017年(1)

2016年(20)

2015年(29)

我的朋友

分类: Oracle

2015-11-20 18:31:39

   很多时候由于磁盘空间不足等原因,使我们不得不关闭掉归档。那么我们如何关闭和启动归档呢!

首先查看数据库归档状态:

oracle@oracle /home/oracle$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Fri Nov 20 18:17:06 2015
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /opt/oracle/oradata/ora/archive
Oldest online log sequence     7
Next log sequence to archive   13
Current log sequence           13

归档状态是Enabled,因为安装得时候笔者一般会开启归档,所以所看到的是已开启的状态。

关闭归档:

关闭数据库:
 
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

将数据库启动到mount状态:
  
SQL> startup mount;
ORACLE instance started.
Total System Global Area 2137886720 bytes
Fixed Size                  2230072 bytes
Variable Size            1593837768 bytes
Database Buffers          536870912 bytes
Redo Buffers                4947968 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            /opt/oracle/oradata/ora/archive
Oldest online log sequence     7
Current log sequence           13

可以看到归档状态已经Disabled 了,说明已经关闭归档了。

开启归档:

关闭数据库:
 
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

将数据库启动到mount状态:
 
SQL> startup mount;
ORACLE instance started.
Total System Global Area 2137886720 bytes
Fixed Size                  2230072 bytes
Variable Size            1593837768 bytes
Database Buffers          536870912 bytes
Redo Buffers                4947968 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            /opt/oracle/oradata/ora/archive
Oldest online log sequence     7
Next log sequence to archive   13
Current log sequence           13


归档状态已经Enabled 了,说明已经开启归档了。


阅读(1166) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~