【oracle】开启或关闭归档模式

Posted on 2012-07-17 15:45  雅飞士  阅读(605)  评论(1编辑  收藏  举报

必须以sys 用户登录sqlplus

C:\Users\yafeishi>sqlplus system/*****

SQL*Plus: Release 10.2.0.3.0 - Production on 星期二 7月 17 15:32:53 2012
Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> archive log list;
ORA-01031: 权限不足

换sys用户:

SQL> connect / as sysdba
已连接。
SQL> archive log list;
数据库日志模式             非存档模式
自动存档             禁用
存档终点            USE_DB_RECOVERY_FILE_DEST
最早的联机日志序列     352
当前日志序列           354

当前是非归档模式,开启归档:

SQL> shutdown immediate;
数据库已经关闭。
已经卸载数据库。
ORACLE 例程已经关闭。
SQL> startup mount;        --数据库启动到mount状态。
ORACLE 例程已经启动。
Total System Global Area 1258291200 bytes
Fixed Size                  1292156 bytes
Variable Size             327157892 bytes
Database Buffers          922746880 bytes
Redo Buffers                7094272 bytes
数据库装载完毕。
SQL> alter database archivelog;
数据库已更改。
SQL> alter database open;
数据库已更改。
SQL> archive log list;
数据库日志模式            存档模式
自动存档             启用
存档终点            USE_DB_RECOVERY_FILE_DEST
最早的联机日志序列     352
下一个存档日志序列   354
当前日志序列           354

下面关闭归档:

SQL> shutdown immediate;
数据库已经关闭。
已经卸载数据库。
ORACLE 例程已经关闭。
SQL> startup mount;
ORACLE 例程已经启动。
Total System Global Area 1258291200 bytes
Fixed Size                  1292156 bytes
Variable Size             327157892 bytes
Database Buffers          922746880 bytes
Redo Buffers                7094272 bytes
数据库装载完毕。
SQL> alter database noarchivelog;
数据库已更改。
SQL> alter database open;
数据库已更改。
SQL> archive log list;
数据库日志模式             非存档模式
自动存档             禁用
存档终点            USE_DB_RECOVERY_FILE_DEST
最早的联机日志序列     352
当前日志序列           354

--EOF

原文地址:http://www.yafeishi.net/blog/2012/07/archivelog-on-off.html

Copyright © 2024 雅飞士
Powered by .NET 8.0 on Kubernetes