如何启动或关闭数据库的归档模式

如何启动或关闭数据库的归档模式,第1张

您好,这样呀:

1shutdown normal或shutdown immediate关闭数据库

[oracle@jumper oracle]$ sqlplus "/ as sysdba"

SQLPlus: Release 92040 - Production on Sat Oct 15 15:48:36 2005

Copyright (c) 1982, 2002, Oracle Corporation All rights reserved

Connected to:

Oracle9i Enterprise Edition Release 92040 - Production

With the Partitioning option

JServer Release 92040 - Production

SQL> shutdown immediate;

Database closed

Database dismounted

ORACLE instance shut down

2启动数据库到mount状态

SQL> startup mount;

ORACLE instance started

Total System Global Area 101782828 bytes

Fixed Size 451884 bytes

Variable Size 37748736 bytes

Database Buffers 62914560 bytes

Redo Buffers 667648 bytes

Database mounted

3启用或停止归档模式

如果要启用归档模式,此处使用

alter database archivelog 命令。

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/conner/archive

Oldest online log sequence 148

Next log sequence to archive 151

Current log sequence 151

如果需要停止归档模式,此处使用:

alter database noarchivelog 命令。

SQL> shutdown immediate;

Database closed

Database dismounted

ORACLE instance shut down

SQL> startup mount;

ORACLE instance started

Total System Global Area 101782828 bytes

Fixed Size 451884 bytes

Variable Size 37748736 bytes

Database Buffers 62914560 bytes

Redo Buffers 667648 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 Enabled

Archive destination /opt/oracle/oradata/conner/archive

Oldest online log sequence 149

Current log sequence 152

4修改相应的初始化参数

Oracle10g之前,你还需要修改初始化参数使数据库处于自动归档模式。

在pfile/spfile中设置如下参数:

log_archive_start = true

重启数据库此参数生效,此时数据库处于自动归档模式。

也可以在数据库启动过程中,手工执行:

archive log start

使数据库启用自动归档,但是重启后数据库仍然处于手工归档模式。

在对象资源管理器中,展开“管理”,展开“SQL Server 日志”,再双击“当前 <日期/时间>”,此时将显示 SQL Server、“SQL 代理”和 Windows NT 日志。

查看与作业相关的日志

在对象资源管理器中,展开“SQL Server 代理”,右键单击“作业”,再单击“查看历史记录”,此时将显示“作业历史记录”和“SQL 代理”日志。

查看与维护计划相关的日志

在对象资源管理器中,展开“管理”,右键单击“维护计划”,再单击“查看历史记录”,此时将显示“维护计划”、“作业历史记录”和“SQL 代理”日志。

以上就是关于如何启动或关闭数据库的归档模式全部的内容,包括:如何启动或关闭数据库的归档模式、SQL 数据库如何查看归档日志、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/sjk/9749142.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-01
下一篇2023-05-01

发表评论

登录后才能评论

评论列表(0条)

    保存