Chinaunix首页 | 论坛 | 博客
  • 博客访问: 970293
  • 博文数量: 358
  • 博客积分: 8185
  • 博客等级: 中将
  • 技术积分: 3751
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-15 16:27
个人简介

The views and opinions expressed all for my own,only for study and test, not reflect the views of Any Company and its affiliates.

文章分类

全部博文(358)

文章存档

2012年(8)

2011年(18)

2010年(50)

2009年(218)

2008年(64)

我的朋友

分类: Oracle

2009-06-10 16:59:26


SQL>  conn  /  as sysdba;
SQL> alter system set log_archive_format='arc_%t_%s.dbf' scope=spfile;
System altered.
SQL> alter system set log_archive_dest_1 = 'location=/u01/gaudi/oracle/9204/dbs/arclog' scope=spfile;
System altered.
SQL> shutdown immediate
Database closed.
Database dismounted.
SQL> startup restrict
ORACLE instance started.
Total System Global Area 1309742180 bytes
Fixed Size                   451684 bytes
Variable Size             234881024 bytes
Database Buffers         1073741824 bytes
Redo Buffers                 667648 bytes
Database mounted.
Database opened.
SQL> shutdown
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 1309742180 bytes
Fixed Size                   451684 bytes
Variable Size             234881024 bytes
Database Buffers         1073741824 bytes
Redo Buffers                 667648 bytes
Database mounted.
SQL> alter database archivelog;
    ????SQL>  startup force mount;
SQL>  alter database archivelog;  ##起用归档模式
SQL>  alter database open; ##打开数据库
SQL> archive log list -- 观看日志文件点
Database log mode              Archive Mode
Automatic archival             Disabled
Archive destination            /u01/gaudi/oracle/9204/dbs/arch
Oldest online log sequence     4810
Next log sequence to archive   4812
Current log sequence           4812
SQL>  alter system switch logfile; --强制系统进行日志切换,可马上观察到归档日志的产生语句已处理。
SQL>  archive log list  -- 观看日志文件点
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u01/gaudi/oracle/9204/dbs/arch
Oldest online log sequence     4811
Next log sequence to archive   4813
Current log sequence           4813
・Confirm that the database is in archivelog mode and that the archiver is
running with these two queries.
SQL> select log_mode from v$database;
SQL> select archiver from v$instance;
SQL> select name from v$archived_log;
■切换归档模式命令
alter database noarchivelog;
alter database archivelog;
■切换自动归档模式命令
alter system archive log stop;
alter system archive log start;
select * from V$ARCHIVED_LOG
select * from V$ARCHIVE_DEST
select * from V$LOG_HISTORY
select * from V$DATABASE
select * from V$ARCHIVE_PROCESSES
**************
  tip:
 修改相应的初始化参数
  Oracle10g之前,你还需要修改初始化参数使数据库处于自动归档模式。
  在pfile/spfile中设置如下参数:
  log_archive_start = true
  重启数据库此参数生效,此时数据库处于自动归档模式。
  也可以在数据库启动过程中,手工执行:
  archive log start
  使数据库启用自动归档,但是重启后数据库仍然处于手工归档模式。
  从Oracle10g开始,log_archive_start参数已经废除
阅读(490) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~