ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Oracle学习系列—归档模式的切换

Oracle学习系列—归档模式的切换

原创 Linux操作系统 作者:bq_wang 时间:2007-03-14 00:00:00 0 删除 编辑

说来很惭愧,Oracle也算学习了很久,可是我连归档日志都没用起来过,所以说都不好意思说自己的Oracle水平如何如何。。。

参阅了网上许多资料,亲自动手做了一下测试,可以说既不简单也不复杂。。。

一句话动手最重要。。。

来吧。。。



SQL*Plus: Release 9.2.0.1.0 - Production on Wed Mar 14 00:31:13 2007

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

REM以系统管理员用户登陆Oracle,并启动到mount状态
SQL> connect as sysdba;
Enter user-name: sys
Enter password:
Connected to an idle instance.
SQL> startup mount;
ORACLE instance started.

Total System Global Area 152115804 bytes
Fixed Size 453212 bytes
Variable Size 117440512 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
Database mounted.

REM操作设置数据库为归档模式
SQL> alter database archivelog;

Database altered.

REM查看归档状态
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Disabled
Archive destination C:/UserDefine
/oracle/ora92/RDBMS
Oldest online log sequence 7
Next log sequence to archive 9
Current log sequence 9

REM打开数据库
SQL> alter database open;

Database altered.

REM修改log_archive_dest归档路径参数
SQL> alter system set log_archive_dest='C:
/UserDefine/oracle/ora92/database/arch
ive';

System altered.

REM修改log_archive_start归档启动参数
SQL> alter system set log_archive_start=true scope=spfile;

System altered.

REM修改后关闭重启,查看相应的状态
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 152115804 bytes
Fixed Size 453212 bytes
Variable Size 117440512 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.

REM显示归档各个参数的值
SQL> show parameter archive;

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
archive_lag_target integer 0
log_archive_dest string C:
/UserDefine/oracle/ora92/dat
abase
/archive
log_archive_dest_1 string
log_archive_dest_10 string
log_archive_dest_2 string
log_archive_dest_3 string
log_archive_dest_4 string
log_archive_dest_5 string
log_archive_dest_6 string
log_archive_dest_7 string

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_8 string
log_archive_dest_9 string
log_archive_dest_state_1 string enable
log_archive_dest_state_10 string enable
log_archive_dest_state_2 string enable
log_archive_dest_state_3 string enable
log_archive_dest_state_4 string enable
log_archive_dest_state_5 string enable
log_archive_dest_state_6 string enable
log_archive_dest_state_7 string enable
log_archive_dest_state_8 string enable

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_state_9 string enable
log_archive_duplex_dest string
log_archive_format string ARC%S.%T
log_archive_max_processes integer 2
log_archive_min_succeed_dest integer 1
log_archive_start boolean TRUE
log_archive_trace integer 0
remote_archive_enable string true
standby_archive_dest string %ORACLE_HOME%RDBMS

REM从实例数据字典表查看归档状态
SQL>select archiver from v$instance

ARCHIVE
-------
STARTED

REM从数据库数据字典表查看归档状态
SQL>select log_mode from v$database

LOG_MODE
-----------
ARCHIVELOG

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/6517/viewspace-145505/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2007-12-07

  • 博文量
    412
  • 访问量
    1103004