[20130123]归档参数log_archive_dest_1问题.txt

简介: [20130123]归档参数log_archive_dest_1问题.txtSQL> select * from v$version where rownumBANNER----------------------------------------------...
[20130123]归档参数log_archive_dest_1问题.txt

SQL> select * from v$version where rownum
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production


SQL> show parameter log_archive_dest_1

NAME                                 TYPE        VALUE
------------------------------------ ----------- ---------------------------------------
log_archive_dest_1                   string      LOCATION=/u01/app/oracle11g/archivelog

--如果归档目录不存在会有什么问题呢?

$ mv /u01/app/oracle11g/archivelog /u01/app/oracle11g/archivelog1
$ ll  -d /u01/app/oracle11g/archi*
drwxr-xr-x  2 oracle11g oinstall 4096 Jan 23 08:38 /u01/app/oracle11g/archivelog1

--可以发现我已经修改了目录。关闭数据库重新启动。

SQL> startup
ORACLE instance started.

Total System Global Area 1603411968 bytes
Fixed Size                  2213776 bytes
Variable Size            1258293360 bytes
Database Buffers          335544320 bytes
Redo Buffers                7360512 bytes
Database mounted.
Database opened.
SQL> archive log list ;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u01/app/oracle11g/archivelog
Oldest online log sequence     121
Next log sequence to archive   123
Current log sequence           123

SQL> show parameter log_archive_dest_1

NAME                                 TYPE        VALUE
------------------------------------ ----------- --------------------------------------
log_archive_dest_1                   string      LOCATION=/u01/app/oracle11g/archivelog

SQL> alter system archive log current ;
System altered.

SQL> alter system archive log current ;
System altered.

SQL> alter system archive log current ;
System altered.

SQL> alter system archive log current ;
System altered.

$ ll  -d /u01/app/oracle11g/archi*
drwxr-xr-x  2 oracle11g oinstall     4096 Jan 23 08:38 /u01/app/oracle11g/archivelog1
-rw-r-----  1 oracle11g oinstall 15728128 Jan 23 15:21 /u01/app/oracle11g/archivelog1_123_798551880.dbf
-rw-r-----  1 oracle11g oinstall     1024 Jan 23 15:21 /u01/app/oracle11g/archivelog1_124_798551880.dbf
-rw-r-----  1 oracle11g oinstall     2048 Jan 23 15:21 /u01/app/oracle11g/archivelog1_125_798551880.dbf
-rw-r-----  1 oracle11g oinstall     1024 Jan 23 15:21 /u01/app/oracle11g/archivelog1_126_798551880.dbf

--可以发现归档放在了/u01/app/oracle11g目录,并且以archivelog开头。
SQL> select  name from v$archived_log where sequence#>=123;

NAME
--------------------------------------------------
/u01/app/oracle11g/archivelog1_123_798551880.dbf
/u01/app/oracle11g/archivelog1_124_798551880.dbf
/u01/app/oracle11g/archivelog1_125_798551880.dbf
/u01/app/oracle11g/archivelog1_126_798551880.dbf

--从视图显示也可以确定情况确实向上面一样。
--当然这并不影响使用,只不过不好。

2.再做一些补充:
--如果执行如下:(注意后面有一个/)
SQL> alter system set log_archive_dest_1='LOCATION=/u01/app/oracle11g/archivelog/';
alter system set log_archive_dest_1='LOCATION=/u01/app/oracle11g/archivelog/'
*
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-16032: parameter LOG_ARCHIVE_DEST_1 destination string cannot be translated
ORA-07286: sksagdi: cannot obtain device information.
Linux-x86_64 Error: 2: No such file or directory

--可以发现目录/u01/app/oracle11g/archivelog/不存在,报错。
--执行如下,OK!

SQL> alter system set log_archive_dest_1='LOCATION=/u01/app/oracle11g/archivelog1/';
System altered.

SQL> show parameter log_archive_dest_1
NAME                                 TYPE        VALUE
------------------------------------ ----------- -----------------------------------------
log_archive_dest_1                   string      LOCATION=/u01/app/oracle11g/archivelog1/

SQL> alter system archive log current ;
System altered.

$ ll   -R /u01/app/oracle11g/archiv*
-rw-r-----  1 oracle11g oinstall 15728128 Jan 23 15:21 /u01/app/oracle11g/archivelog1_123_798551880.dbf
-rw-r-----  1 oracle11g oinstall     1024 Jan 23 15:21 /u01/app/oracle11g/archivelog1_124_798551880.dbf
-rw-r-----  1 oracle11g oinstall     2048 Jan 23 15:21 /u01/app/oracle11g/archivelog1_125_798551880.dbf
-rw-r-----  1 oracle11g oinstall     1024 Jan 23 15:21 /u01/app/oracle11g/archivelog1_126_798551880.dbf

/u01/app/oracle11g/archivelog1:
total 40
-rw-r-----  1 oracle11g oinstall 40960 Jan 23 15:29 1_127_798551880.dbf

--确实这样。
$ mv archivelog1 archivelog

SQL> alter system archive log current ;
alter system archive log current
*
ERROR at line 1:
ORA-16038: log 2 sequence# 128 cannot be archived
ORA-00312: online log 2 thread 1: '/u01/app/oracle11g/oradata/test/redo02.log'
ORA-07286: sksagdi: cannot obtain device information.
Linux-x86_64 Error: 2: No such file or directory

--这时log_archive_dest_1='LOCATION=/u01/app/oracle11g/archivelog1/',转换无法实现。
--这也是我今天帮别人解决的问题。
SQL> alter system set log_archive_dest_1='LOCATION=/u01/app/oracle11g/archivelog';
System altered.

SQL> alter system archive log current ;
System altered.

--正常!

3.如果想把归档移动到/u01/app/oracle11g/archivelog目录,仅仅需要rman下catalog就可以了。
$ mv archivelog1* archivelog

RMAN> crosscheck copy ;

using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=71 device type=DISK
specification does not match any datafile copy in the repository
specification does not match any control file copy in the repository
validation failed for archived log
archived log file name=/u01/app/oracle11g/archivelog1_123_798551880.dbf RECID=61 STAMP=805476069
validation failed for archived log
archived log file name=/u01/app/oracle11g/archivelog1_124_798551880.dbf RECID=62 STAMP=805476070
validation failed for archived log
archived log file name=/u01/app/oracle11g/archivelog1_125_798551880.dbf RECID=63 STAMP=805476072
validation failed for archived log
archived log file name=/u01/app/oracle11g/archivelog1_126_798551880.dbf RECID=64 STAMP=805476073
validation failed for archived log
archived log file name=/u01/app/oracle11g/archivelog1/1_127_798551880.dbf RECID=65 STAMP=805476599
validation succeeded for archived log
archived log file name=/u01/app/oracle11g/archivelog/1_128_798551880.dbf RECID=66 STAMP=805476917
validation succeeded for archived log
archived log file name=/u01/app/oracle11g/archivelog/1_129_798551880.dbf RECID=67 STAMP=805476917
Crosschecked 7 objects


RMAN> delete expired  archivelog all ;

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=71 device type=DISK
List of Archived Log Copies for database with db_unique_name TEST
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - -------------------
61      1    123     X 2013-01-23 08:36:17
        Name: /u01/app/oracle11g/archivelog1_123_798551880.dbf

62      1    124     X 2013-01-23 15:21:08
        Name: /u01/app/oracle11g/archivelog1_124_798551880.dbf

63      1    125     X 2013-01-23 15:21:09
        Name: /u01/app/oracle11g/archivelog1_125_798551880.dbf

64      1    126     X 2013-01-23 15:21:12
        Name: /u01/app/oracle11g/archivelog1_126_798551880.dbf

65      1    127     X 2013-01-23 15:21:13
        Name: /u01/app/oracle11g/archivelog1/1_127_798551880.dbf


Do you really want to delete the above objects (enter YES or NO)? yes
deleted archived log
archived log file name=/u01/app/oracle11g/archivelog1_123_798551880.dbf RECID=61 STAMP=805476069
deleted archived log
archived log file name=/u01/app/oracle11g/archivelog1_124_798551880.dbf RECID=62 STAMP=805476070
deleted archived log
archived log file name=/u01/app/oracle11g/archivelog1_125_798551880.dbf RECID=63 STAMP=805476072
deleted archived log
archived log file name=/u01/app/oracle11g/archivelog1_126_798551880.dbf RECID=64 STAMP=805476073
deleted archived log
archived log file name=/u01/app/oracle11g/archivelog1/1_127_798551880.dbf RECID=65 STAMP=805476599
Deleted 5 EXPIRED objects

RMAN> catalog start with '/u01/app/oracle11g/archivelog/';
searching for all files that match the pattern /u01/app/oracle11g/archivelog/

List of Files Unknown to the Database
=====================================
File Name: /u01/app/oracle11g/archivelog/1_127_798551880.dbf
File Name: /u01/app/oracle11g/archivelog/archivelog1_126_798551880.dbf
File Name: /u01/app/oracle11g/archivelog/archivelog1_124_798551880.dbf
File Name: /u01/app/oracle11g/archivelog/archivelog1_125_798551880.dbf
File Name: /u01/app/oracle11g/archivelog/archivelog1_123_798551880.dbf

Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /u01/app/oracle11g/archivelog/1_127_798551880.dbf
File Name: /u01/app/oracle11g/archivelog/archivelog1_126_798551880.dbf
File Name: /u01/app/oracle11g/archivelog/archivelog1_124_798551880.dbf
File Name: /u01/app/oracle11g/archivelog/archivelog1_125_798551880.dbf
File Name: /u01/app/oracle11g/archivelog/archivelog1_123_798551880.dbf

相关实践学习
日志服务之使用Nginx模式采集日志
本文介绍如何通过日志服务控制台创建Nginx模式的Logtail配置快速采集Nginx日志并进行多维度分析。
目录
相关文章
|
4月前
|
缓存 关系型数据库 MySQL
MySQL Binlog--事务日志和BINLOG落盘参数对磁盘IO的影响
MySQL Binlog--事务日志和BINLOG落盘参数对磁盘IO的影响
47 0
|
5月前
|
JSON Java 测试技术
为了理直气壮怼回去,写了一个日志切面输出接口出入参数
我们在日常排查问题过程中知道,入参传错是导致接口调用失败的常见原因之一。特别是提供给第三方调用的**回调接口和openAPI接口**,由于无法保证第三方开发人员的水平,经常问题不断,反反复复找你问为啥掉不通,甚至吐槽写的“啥玩意接口”,这时候你肯定一脸懵逼,怒火中烧,想展开撕逼甩锅大战,但是对方有可能是甲方金主爸爸并且你没有第一时间掌握证据证明证是对方调用的问题,你只能忍着问他是如何调接口的,卑微请求他把传参发过来看看。。。为了扭转局势,挺直腰杆怼回去:能不能靠谱点?今天我们就来讲讲系统服务中如何优雅地实现统一打印接口API参数日志,方便服务端开发快速甩锅还能拿出证据!!!
70 0
为了理直气壮怼回去,写了一个日志切面输出接口出入参数
|
3月前
重写 AppiumService 类,添加默认启动参数,并实时显示启动日志
重写 AppiumService 类,添加默认启动参数,并实时显示启动日志
24 0
|
6月前
|
XML Java 数据库连接
mybatis参数配置和日志详解~
mybatis参数配置和日志详解~
|
8月前
|
缓存 安全 Java
JVM中垃圾回收相关参数介绍:大页和NUMA参数+GC日志相关参数
大页和NUMA参数 本节介绍JVM为使用OS而提供的大页和NUMA特性相关的参数。 该参数控制JVM向OS请求内存时使用大页的粒度。使用该参数时需要对OS进行配置,只有OS允许时才能真正启动。参数的默认值与平台相关,一般为false。 在允许使用大页方式向OS请求内存时,如果堆空间小于该阈值,则强制禁止大页使用。该参数的默认值为128MB。 在允许使用大页方式向OS请求内存时,优先在本地节点进行分配。该参数仅适用于Windows系统。 在允许使用大页方式向OS请求内存时,如果OS提供了多种大页的设置,可通过该参数选择其中的大页设置。参数的默认值为0,表示使用OS默认的大页设置。
104 0
|
8月前
|
监控 Java 编译器
【jvm系列-13】jvm性能调优篇---参数设置以及日志分析
【jvm系列-13】jvm性能调优篇---参数设置以及日志分析
155 0
|
10月前
|
关系型数据库 MySQL
二进制日志的保存时间参数binlog_expire_logs_seconds和expire_logs_days的设置
在MySQL 8.0中,默认的二进制日志的保存时间参数binlog_expire_logs_seconds和expire_logs_days的设置如下
146 0
|
11月前
修改log_archive_dest_1参数出错:ORA-16179
修改log_archive_dest_1参数时出错
|
11月前
|
关系型数据库 数据库 PostgreSQL
pg_log默认是关闭的需要设置参数logging_collector = on启用日志
PostgreSQL有3种日志,分别是pg_log(数据库运行日志)、pg_xlog(WAL 日志,即重做日志)、pg_clog(事务提交日志,记录的是事务的元数据)