052-234(新增70题2018)

为防止在使用RESETLOGS选项进行恢复时覆盖旧的日志文件,文章详细介绍了如何设置LOG_ARCHIVE_FORMAT参数,通过包含特定变量如%t(线程号),%s(日志序列号)和%r(resetlogs ID)来生成唯一的归档日志文件名。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

In your database, you may be forced to perform a recovery using the RESETLOGS option during which the redo logs would be reset to sequence number 1. You want to avoid the overwriting of old log files.

Which archived log file name format ensures this?

A. %t_%s.dbf

B. arch_%t.arc

C. arch_%d.arc

D. arch_%t_%d.arc

E. arch_%d_%s_.dbf

F. arch_%t_%s_%r.arc

Answer: F

LOG_ARCHIVE_FORMAT = arch_%t_%s_%r.arc

  In this example, SQL*Plus automatically suggests the file name /arc_dest/loc2/arch_%t_%s_%r.arc (where %t is the thread, %s is the sequence and %r is the resetlogs ID).

  Optionally, set the LOG_ARCHIVE_FORMAT initialization parameter, using %t to include the thread number as part of the file name, %s to include the log sequence number, and %r to include the resetlogs ID (a timestamp value represented in ub4). Use capital letters (%T%S, and %R) to pad the file name to the left with zeroes.

Note:

If the  COMPATIBLE initialization parameter is set to 10.0.0 or higher, the database requires the specification of resetlogs ID ( %r) when you include the  LOG_ARCHIVE_FORMAT parameter. The default for this parameter is operating system dependent.

The incarnation of a database changes when you open it with the RESETLOGS option. Specifying %r causes the database to capture the resetlogs ID in the archived redo log file name. See Oracle Database Backup and Recovery User's Guide for more information about this method of recovery.

The following example shows a setting of LOG_ARCHIVE_FORMAT:

LOG_ARCHIVE_FORMAT = arch_%t_%s_%r.arc

This setting will generate archived logs as follows for thread 1; log sequence numbers 100, 101, and 102; resetlogs ID 509210197. The identical resetlogs ID indicates that the files are all from the same database incarnation:

/disk1/archive/arch_1_100_509210197.arc, 
/disk1/archive/arch_1_101_509210197.arc, 
/disk1/archive/arch_1_102_509210197.arc

/disk2/archive/arch_1_100_509210197.arc, 
/disk2/archive/arch_1_101_509210197.arc, 
/disk2/archive/arch_1_102_509210197.arc

/disk3/archive/arch_1_100_509210197.arc, 
/disk3/archive/arch_1_101_509210197.arc, 
/disk3/archive/arch_1_102_509210197.arc

 

转载于:https://www.cnblogs.com/Babylon/p/8622211.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值