log_archive_format定义了归档文件名称的格式。
SQL> select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
default value
SQL> show parameter log_archive_format;
NAME TYPE VALUE
log_archive_format string %t_%s_%r.dbf
detail
l %s:日志序列号
l %S:日志序列号(带有前导)
l %t:重做线程编号
l %T:重做线程编号(带有前导)
l %a:活动ID号
l %d:数据库ID号
l %r:resetlogs的ID值
modify
SQL> alter system set log_archive_format=’ARCH_%t_%s_%r.ARC’ scope=both;
alter system set log_archive_format=’ARCH_%t_%s_%r.ARC’ scope=both
*
ERROR at line 1:
ORA-02095: specified initialization parameter cannot be modified
SQL> alter system set log_archive_format=’ARCH_%t_%s_%r.ARC’ scope=spfile;
System altered.
restart
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.
Total System Global Area 1603411968 bytes
Fixed Size 2228784 bytes
Variable Size 973082064 bytes
Database Buffers 620756992 bytes
Redo Buffers 7344128 bytes
Database mounted.
Database opened.
check
SQL> show parameter log_archive_format;
NAME TYPE VALUE
log_archive_format string ARCH_%t_%s_%r.ARC
SQL> alter system switch logfile;
System altered.
[oracle@orcl01rmp]$ ls -l
total 43992
-rw-r—–. 1oracle oinstall 16677376 Jan 5 10:521_23_899396931.dbf
-rw-r—–. 1oracle oinstall 24066560 Jan 5 10:521_24_899396931.dbf
-rw-r—–. 1oracle oinstall 2202624 Jan 5 10:52 1_25_899396931.dbf
-rw-r—–. 1oracle oinstall 2093568 Jan 5 14:04 ARCH_1_27_899396931.ARC