ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 10g中db_recovery_file_dest和log_archive_dest参数的关系

10g中db_recovery_file_dest和log_archive_dest参数的关系

原创 Linux操作系统 作者:lsq_008 时间:2008-12-18 13:39:40 0 删除 编辑

在10g中,如果指定了db_recovery_file_dest 参数,那么归档日志将存放到这个参数指向的目录下,如果同时指定了log_archive_desc,则将同时往这两个参数指定的目录中归档。

1.只设置db_recovery_file_desc参数,log_archive_desc设置为空

SQL> show parameter db_recovery
 
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      /ora10g/flash_recovery_area
db_recovery_file_dest_size           big integer 1G
SQL> show parameter log_archive_dest
 
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest                     string
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
log_archive_dest_8                   string
log_archive_dest_9                   string
 
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
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
log_archive_dest_state_9             string      enable
SQL> select name,completion_time from v$archived_log;
 
no rows selected
 
SQL> alter system switch logfile;
 
System altered.
 
SQL> select name,completion_time from v$archived_log;
 
NAME
--------------------------------------------------------------------------------
COMPLETION_TIME
-----------------
/ora10g/flash_recovery_area/EBANK/archivelog/2008_12_18/o1_mf_1_1_4no7w6tg_.arc
20081218 14:07:50
 
 
SQL> col name for a100
SQL> set lines 132
SQL> /
 
NAME                                                                                                 COMPLETION_TIME
---------------------------------------------------------------------------------------------------- -----------------
/ora10g/flash_recovery_area/EBANK/archivelog/2008_12_18/o1_mf_1_1_4no7w6tg_.arc                      20081218 14:07:50

2.设置log_archive_desc参数,同时db_recovery_file_desc参数被设置为空。

SQL>  alter system set db_recovery_file_dest='' scope=spfile;
 
System altered.
 
SQL>  alter system set log_archive_dest='/ora10g/arch' scope=spfile;
 
System altered.
 
SQL> startup force;
ORACLE instance started.
 
Total System Global Area  209715200 bytes
Fixed Size                  1218580 bytes
Variable Size             104859628 bytes
Database Buffers          100663296 bytes
Redo Buffers                2973696 bytes
Database mounted.
Database opened.
SQL> alter session set nls_date_format='yyyymmdd hh24:mi:ss';
 
Session altered.
 
SQL> col name for a100
SQL> set lines 132
SQL> alter system switch logfile;
 
System altered.
 
SQL>  select name,completion_time from v$archived_log;
 
NAME                                                                                                 COMPLETION_TIME
---------------------------------------------------------------------------------------------------- -----------------
/ora10g/flash_recovery_area/EBANK/archivelog/2008_12_18/o1_mf_1_1_4no7w6tg_.arc                      20081218 14:07:50
/ora10g/arch/1_2_673797803.dbf                                                                       20081218 14:21:01
/ora10g/flash_recovery_area/EBANK/archivelog/2008_12_18/o1_mf_1_2_4no8nwq9_.arc                      20081218 14:21:01
/ora10g/arch/1_3_673797803.dbf                                                                       20081218 14:22:15
/ora10g/arch/1_4_673797803.dbf                                                                       20081218 14:23:03
 
SQL> alter system switch logfile;
 
System altered.
 
SQL> select name,completion_time from v$archived_log;
 
NAME                                                                                                 COMPLETION_TIME
---------------------------------------------------------------------------------------------------- -----------------
/ora10g/flash_recovery_area/EBANK/archivelog/2008_12_18/o1_mf_1_1_4no7w6tg_.arc                      20081218 14:07:50
/ora10g/arch/1_2_673797803.dbf                                                                       20081218 14:21:01
/ora10g/flash_recovery_area/EBANK/archivelog/2008_12_18/o1_mf_1_2_4no8nwq9_.arc                      20081218 14:21:01
/ora10g/arch/1_3_673797803.dbf                                                                       20081218 14:22:15
/ora10g/arch/1_4_673797803.dbf                                                                       20081218 14:23:03
/ora10g/arch/1_5_673797803.dbf                                                                       20081218 14:23:36
 
6 rows selected.

3.log_archive_desc和db_recovery_file_desc参数被同时设置 

SQL> alter system switch logfile;
 
System altered.
 
SQL> /
 
System altered.
 
SQL> /
 
System altered.
 
SQL> alter system switch logfile;
 
System altered.
 
SQL>  select name,completion_time from v$archived_log;
 
NAME                                                                                                 COMPLETIO
---------------------------------------------------------------------------------------------------- ---------
/ora10g/flash_recovery_area/EBANK/archivelog/2008_12_18/o1_mf_1_1_4no7w6tg_.arc                      18-DEC-08
/ora10g/arch/1_2_673797803.dbf                                                                       18-DEC-08
/ora10g/flash_recovery_area/EBANK/archivelog/2008_12_18/o1_mf_1_2_4no8nwq9_.arc                      18-DEC-08
/ora10g/arch/1_3_673797803.dbf                                                                       18-DEC-08
/ora10g/arch/1_4_673797803.dbf                                                                       18-DEC-08
/ora10g/arch/1_5_673797803.dbf                                                                       18-DEC-08
/ora10g/arch/1_6_673797803.dbf                                                                       18-DEC-08
/ora10g/flash_recovery_area/EBANK/archivelog/2008_12_18/o1_mf_1_6_4no8xl3j_.arc                      18-DEC-08
/ora10g/arch/1_7_673797803.dbf                                                                       18-DEC-08
/ora10g/flash_recovery_area/EBANK/archivelog/2008_12_18/o1_mf_1_7_4no8y3qy_.arc                      18-DEC-08
/ora10g/arch/1_8_673797803.dbf                                                                       18-DEC-08
 
NAME                                                                                                 COMPLETIO
---------------------------------------------------------------------------------------------------- ---------
/ora10g/flash_recovery_area/EBANK/archivelog/2008_12_18/o1_mf_1_8_4no8ys0k_.arc                      18-DEC-08
/ora10g/arch/1_9_673797803.dbf                                                                       18-DEC-08
/ora10g/flash_recovery_area/EBANK/archivelog/2008_12_18/o1_mf_1_9_4no8zdk2_.arc                      18-DEC-08
/ora10g/arch/1_10_673797803.dbf                                                                      18-DEC-08
/ora10g/flash_recovery_area/EBANK/archivelog/2008_12_18/o1_mf_1_10_4no8zfjg_.arc                     18-DEC-08
/ora10g/arch/1_11_673797803.dbf                                                                      18-DEC-08
/ora10g/flash_recovery_area/EBANK/archivelog/2008_12_18/o1_mf_1_11_4no8zg7s_.arc                     18-DEC-08
/ora10g/arch/1_12_673797803.dbf                                                                      18-DEC-08
/ora10g/flash_recovery_area/EBANK/archivelog/2008_12_18/o1_mf_1_12_4no8zl4s_.arc                     18-DEC-08
 
20 rows selected.

 

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

请登录后发表评论 登录
全部评论
十余年大型金融及电信系统数据库管理经验,曾服务于中国建设银行、中国移动。对oracle,mysql数据库有深入了解。 擅长python开发,独立开发了开源数据库自动化监控运维平台Power Monitor。

注册时间:2008-02-29

  • 博文量
    325
  • 访问量
    1258379