[20160119]日志频繁切换.txt

[20160119]日志频繁切换.txt

--元旦后的事情,主要问题是节前给主库增加几个数据文件,本来dg的磁盘空间就很紧张,加上节假日没人检查dg。
--导致dg磁盘空间满,出现了日志频繁切换,做1个记录:

1.环境:
SYS@xxxxdg2> @ &r/ver1

PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

SELECT   TRUNC (first_time) "Date", TO_CHAR (first_time, 'Dy') "Day", COUNT (1) "Total",
         SUM (DECODE (TO_CHAR (first_time, 'hh24'), '00', 1, 0)) h0,
         SUM (DECODE (TO_CHAR (first_time, 'hh24'), '01', 1, 0)) "h1",
         SUM (DECODE (TO_CHAR (first_time, 'hh24'), '02', 1, 0)) "h2",
         SUM (DECODE (TO_CHAR (first_time, 'hh24'), '03', 1, 0)) "h3",
         SUM (DECODE (TO_CHAR (first_time, 'hh24'), '04', 1, 0)) "h4",
         SUM (DECODE (TO_CHAR (first_time, 'hh24'), '05', 1, 0)) "h5",
         SUM (DECODE (TO_CHAR (first_time, 'hh24'), '06', 1, 0)) "h6",
         SUM (DECODE (TO_CHAR (first_time, 'hh24'), '07', 1, 0)) "h7",
         SUM (DECODE (TO_CHAR (first_time, 'hh24'), '08', 1, 0)) "h8",
         SUM (DECODE (TO_CHAR (first_time, 'hh24'), '09', 1, 0)) "h9",
         SUM (DECODE (TO_CHAR (first_time, 'hh24'), '10', 1, 0)) "h10",
         SUM (DECODE (TO_CHAR (first_time, 'hh24'), '11', 1, 0)) "h11",
         SUM (DECODE (TO_CHAR (first_time, 'hh24'), '12', 1, 0)) "h12",
         SUM (DECODE (TO_CHAR (first_time, 'hh24'), '13', 1, 0)) "h13",
         SUM (DECODE (TO_CHAR (first_time, 'hh24'), '14', 1, 0)) "h14",
         SUM (DECODE (TO_CHAR (first_time, 'hh24'), '15', 1, 0)) "h15",
         SUM (DECODE (TO_CHAR (first_time, 'hh24'), '16', 1, 0)) "h16",
         SUM (DECODE (TO_CHAR (first_time, 'hh24'), '17', 1, 0)) "h17",
         SUM (DECODE (TO_CHAR (first_time, 'hh24'), '18', 1, 0)) "h18",
         SUM (DECODE (TO_CHAR (first_time, 'hh24'), '19', 1, 0)) "h19",
         SUM (DECODE (TO_CHAR (first_time, 'hh24'), '20', 1, 0)) "h20",
         SUM (DECODE (TO_CHAR (first_time, 'hh24'), '21', 1, 0)) "h21",
         SUM (DECODE (TO_CHAR (first_time, 'hh24'), '22', 1, 0)) "h22",
         SUM (DECODE (TO_CHAR (first_time, 'hh24'), '23', 1, 0)) "h23", ROUND (COUNT (1) / 24, 2) "Avg"
    FROM gv$log_history
   WHERE first_time >= trunc(SYSDATE) - 20
   and thread# = inst_id
GROUP BY TRUNC (first_time), TO_CHAR (first_time, 'Dy')
ORDER BY 1 DESC;

Date                Day         Total   H0   h1   h2   h3   h4   h5   h6   h7   h8   h9  h10  h11  h12  h13  h14  h15  h16  h17  h18  h19  h20  h21  h22  h23     Avg
------------------- ------ ---------- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -------
...
2016-01-03 00:00:00 Sun             4    0    0    0    0    0    4    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0     .17
2016-01-02 00:00:00 Sat            98    0    0    0    0    0    9   12   12   13   12   11   12    8    2    6    1    0    0    0    0    0    0    0    0    4.08
2016-01-01 00:00:00 Fri             4    0    0    0    0    0    4    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0     .17
...

SELECT round((next_time - first_time) * 86400,2) xx, sequence#,first_time,next_time,blocks,creator,completion_time
    FROM V$ARCHIVED_LOG a
   WHERE     first_time BETWEEN '2016/01/02' AND '2016/01/03'
         AND name LIKE '+RECOC1%'
         AND thread# = 1
ORDER BY first_time ;

        XX  SEQUENCE# FIRST_TIME          NEXT_TIME               BLOCKS CREATOR COMPLETION_TIME
---------- ---------- ------------------- ------------------- ---------- ------- -------------------
        24       1812 2016-01-02 05:27:03 2016-01-02 05:27:27         45 ARCH    2016-01-02 05:27:27
       390       1813 2016-01-02 05:27:27 2016-01-02 05:33:57       1696 ARCH    2016-01-02 05:33:57
       660       1814 2016-01-02 05:33:57 2016-01-02 05:44:57       5086 ARCH    2016-01-02 05:44:57
       360       1815 2016-01-02 05:44:57 2016-01-02 05:50:57       3199 ARCH    2016-01-02 05:50:58
       961       1816 2016-01-02 05:50:57 2016-01-02 06:06:58      12949 ARCH    2016-01-02 06:06:58
       600       1817 2016-01-02 06:06:58 2016-01-02 06:16:58       6508 ARCH    2016-01-02 06:16:58
       660       1818 2016-01-02 06:16:58 2016-01-02 06:27:58       5870 ARCH    2016-01-02 06:27:58
       361       1819 2016-01-02 06:27:58 2016-01-02 06:33:59       3229 ARCH    2016-01-02 06:33:59
       660       1820 2016-01-02 06:33:59 2016-01-02 06:44:59       3228 ARCH    2016-01-02 06:44:59
       600       1821 2016-01-02 06:44:59 2016-01-02 06:54:59       9595 ARCH    2016-01-02 06:54:59
       600       1822 2016-01-02 06:54:59 2016-01-02 07:04:59      17983 ARCH    2016-01-02 07:05:00
       361       1823 2016-01-02 07:04:59 2016-01-02 07:11:00       7856 ARCH    2016-01-02 07:11:00
       360       1824 2016-01-02 07:11:00 2016-01-02 07:17:00      11690 ARCH    2016-01-02 07:17:00
       603       1825 2016-01-02 07:17:00 2016-01-02 07:27:03      19300 ARCH    2016-01-02 07:27:03
       657       1826 2016-01-02 07:27:03 2016-01-02 07:38:00      21525 ARCH    2016-01-02 07:38:01
       601       1827 2016-01-02 07:38:00 2016-01-02 07:48:01      17937 ARCH    2016-01-02 07:48:01
       363       1828 2016-01-02 07:48:01 2016-01-02 07:54:04      19807 ARCH    2016-01-02 07:54:04
       360       1829 2016-01-02 07:54:04 2016-01-02 08:00:04      19327 ARCH    2016-01-02 08:00:04
       600       1830 2016-01-02 08:00:04 2016-01-02 08:10:04      55352 ARCH    2016-01-02 08:10:05
       661       1831 2016-01-02 08:10:04 2016-01-02 08:21:05      62631 ARCH    2016-01-02 08:21:05
       600       1832 2016-01-02 08:21:05 2016-01-02 08:31:05      65873 ARCH    2016-01-02 08:31:05
       360       1833 2016-01-02 08:31:05 2016-01-02 08:37:05      44382 ARCH    2016-01-02 08:37:05
       357       1834 2016-01-02 08:37:05 2016-01-02 08:43:02      43982 ARCH    2016-01-02 08:43:03
       604       1835 2016-01-02 08:43:02 2016-01-02 08:53:06      89033 ARCH    2016-01-02 08:53:06
       660       1836 2016-01-02 08:53:06 2016-01-02 09:04:06     104306 ARCH    2016-01-02 09:04:07
       600       1837 2016-01-02 09:04:06 2016-01-02 09:14:06     101150 ARCH    2016-01-02 09:14:07
       661       1838 2016-01-02 09:14:06 2016-01-02 09:25:07     113452 ARCH    2016-01-02 09:25:07
       600       1839 2016-01-02 09:25:07 2016-01-02 09:35:07      99097 ARCH    2016-01-02 09:35:07
       600       1840 2016-01-02 09:35:07 2016-01-02 09:45:07     107339 ARCH    2016-01-02 09:45:08
       661       1841 2016-01-02 09:45:07 2016-01-02 09:56:08     118777 ARCH    2016-01-02 09:56:08
       600       1842 2016-01-02 09:56:08 2016-01-02 10:06:08     107504 ARCH    2016-01-02 10:06:08
       600       1843 2016-01-02 10:06:08 2016-01-02 10:16:08     132672 ARCH    2016-01-02 10:16:09
       601       1844 2016-01-02 10:16:08 2016-01-02 10:26:09     115642 ARCH    2016-01-02 10:26:09
       600       1845 2016-01-02 10:26:09 2016-01-02 10:36:09     107361 ARCH    2016-01-02 10:36:09
       600       1846 2016-01-02 10:36:09 2016-01-02 10:46:09     111693 ARCH    2016-01-02 10:46:09
       660       1847 2016-01-02 10:46:09 2016-01-02 10:57:09      92669 ARCH    2016-01-02 10:57:10
       601       1848 2016-01-02 10:57:09 2016-01-02 11:07:10      99623 ARCH    2016-01-02 11:07:10
       600       1849 2016-01-02 11:07:10 2016-01-02 11:17:10      98332 ARCH    2016-01-02 11:17:10
       600       1850 2016-01-02 11:17:10 2016-01-02 11:27:10      98874 ARCH    2016-01-02 11:27:11
       601       1851 2016-01-02 11:27:10 2016-01-02 11:37:11      88746 ARCH    2016-01-02 11:37:11
       600       1852 2016-01-02 11:37:11 2016-01-02 11:47:11      73500 ARCH    2016-01-02 11:47:11
       600       1853 2016-01-02 11:47:11 2016-01-02 11:57:11      76376 ARCH    2016-01-02 11:57:12
       661       1854 2016-01-02 11:57:11 2016-01-02 12:08:12      56820 ARCH    2016-01-02 12:08:12
      1800       1855 2016-01-02 12:08:12 2016-01-02 12:38:12      87001 ARCH    2016-01-02 12:38:13
       601       1856 2016-01-02 12:38:12 2016-01-02 12:48:13      25307 ARCH    2016-01-02 12:48:13
       600       1857 2016-01-02 12:48:13 2016-01-02 12:58:13      20046 ARCH    2016-01-02 12:58:13
       901       1858 2016-01-02 12:58:13 2016-01-02 13:13:14      45822 ARCH    2016-01-02 13:13:14
      3601       1859 2016-01-02 13:13:14 2016-01-02 14:13:15     151869 ARCH    2016-01-02 14:13:16
      1201       1860 2016-01-02 14:13:15 2016-01-02 14:33:16      62884 ARCH    2016-01-02 14:33:16
      1140       1861 2016-01-02 14:33:16 2016-01-02 14:52:16     168460 ARCH    2016-01-02 14:52:17
       361       1862 2016-01-02 14:52:16 2016-01-02 14:58:17      43611 ARCH    2016-01-02 14:58:17
       360       1863 2016-01-02 14:58:17 2016-01-02 15:04:17      33833 ARCH    2016-01-02 15:04:17
     51769       1864 2016-01-02 15:04:17 2016-01-03 05:27:06    2617582 ARCH    2016-01-03 05:27:19

--sum(blocks)总量与平时的放假的业务基本相当。多数600秒,当然也有部分360秒切换1次。另外奇怪的是到了15:04:17时间后频繁切换日志的情况消失。

--我检查dg的alert*.log文件,发现存在如下信息,到了2016/01/02 15:07:35 2016 ,alert*.log出现:

Sat Jan 02 15:07:35 2016
Non critical error ORA-48181 caught while writing to trace file "/u01/app/oracle/diag/rdbms/dbcndg2/dbcndg2/trace/dbcndg2_m000_26694.trc"
Error message: Linux-x86_64 Error: 28: No space left on device
Additional information: 1
Writing to the above trace file is disabled for now on...
Sat Jan 02 15:08:35 2016

--到了15:07:35 2016,已经没有空间了。节后检查dg发现磁盘满,当时并没有注意日志的切换问题,整理出磁盘空间后一切ok。

总结自己遇到日志频繁切换的主要因素:
1.CP数量U太多,要设置每个redo大一些,最好1G以上。
2.archive_lag_target参数
3.dg磁盘空间满,也会出现这种情况。
4.网络传输速度慢,这个要进一步测试,在log_archive_dest_N包含SYNC的情况下,有时会出现频繁切换的情况,这个好像在网络从坏到
  好的情况时,会出现切换情况,我还要需要一些测试。

时间: 2024-11-08 23:34:11

[20160119]日志频繁切换.txt的相关文章

[20170303]dg环境下在线日志损坏8.txt

[20170303]dg环境下在线日志损坏8.txt --前面的测试,链接http://blog.itpub.net/267265/viewspace-2134481/ --前面的测试必须使用recover database using backup controlfile until change 13276911099; 才能恢复到结尾. --但是由于主备库scn相差1,在open resetlog时备库的数据文件头scn号减1,采用应用日志. --前面学习了解文件头fuzzy特性以及具体位

oralce非归档模式下的恢复(二)日志发生切换且历史日志已经被覆盖

案例2:日志发生切换,历史日志已经被覆盖(只能做不完全恢复) 1)模拟环境 SQL> insert into scott.tb01 values(777); 1 row created. SQL> insert into scott.tb01 values(888); 1 row created. SQL> commit; Commit complete. SQL> col status for a10 SQL> select * from v$log; GROUP#    

oracle-Redo log频繁切换问题,生成的archivelog文件远小于Redo log设置大小

问题描述 Redo log频繁切换问题,生成的archivelog文件远小于Redo log设置大小 Dear all, 遇到个问题Oracle DB Redo log每分钟差不多切换两次,设置的大小为600MB,但实际切换生成的archivelog文件只有1MB左右. 在alert log每分钟都有alter system archive log的记录,请教各位可能是什么原因造成?

linux中进程上下文频繁切换导致load average过高

一.问题现象   现网有两台虚拟机主机95%的cpu处于idle状态,内存使用率也不是特别高,而主机的load average达到了40多.   二.问题分析   先在主机上通过top.free.ps.iostat 等常用工具分析了下主机的CPU.内存.IO使用情况,发现三者都不高.通过vmstat 1 查看的结果如下:     从vmstat的输出结果来看,io项的block in 和block out 并不频繁.而system项的每称的中断数(in).每秒的上下文切换(cs)特别频繁.这就造

[20170518]11G审计日志清除3.txt

[20170518]11G审计日志清除3.txt --//以前写的链接:http://blog.itpub.net/267265/viewspace-2133145/ --//我当时写存在许多问题,仅仅清除sys.aud$内容,参数audit_file_dest目录的文件不清除,而这里参数大量的aud文件,重新测试看看. 1.环境: SYS@book> @ &r/ver1 PORT_STRING                    VERSION        BANNER -------

[20170302]正常关闭数据库日志丢失3.txt

[20170302]正常关闭数据库日志丢失3.txt --//上午写了一篇[20170302]什么是fuzzy.txt ,链接 http://blog.itpub.net/267265/viewspace-2134551/ --//到最后恢复结束时fuzzy=NO,这时scn=13276966782.也就是将只有恢复到结束,oracle才会认为数据文件一致的. --//我本来想删除日志文件看看是否能open resetlogs的,结果报错. --//下午重新探究看看: 1.环境: SYS@boo

[20170309]dg环境下在线日志损坏13.txt

[20170309]dg环境下在线日志损坏13.txt http://blog.itpub.net/267265/viewspace-2134665/ http://blog.itpub.net/267265/viewspace-2134481/ --//按照如下链接,拷贝备用日志到主库,修改文件头偏移0x230 日志组号.以及hws,eot对应位置,欺骗oracle是正常的日志文件. http://blog.itpub.net/267265/viewspace-2134816/ --//看了一

[20170307]dg环境下在线日志损坏12.txt

[20170307]dg环境下在线日志损坏12.txt http://blog.itpub.net/267265/viewspace-2134665/ http://blog.itpub.net/267265/viewspace-2134481/ --//前面的链接我测试了如果日志实时传输与应用的情况下,主库的崩溃并且在线日志删除的情况下(包括主机的备用日志)情况下, --//利用备库接收日志来恢复主库的情况.做一点点总结: 1.将备用日志拷贝过来,必须执行如下命令,加入最后应用的scn号. r

1git命令的使用,查看git仓库状态,添加文件到git跟踪,git提交,查看git分支,查看git仓库日志信息,切换git分支,解决git分支合并后出现冲突的问题

1新建一个存储git的文件夹,命令是: toto@toto-K45VD:~$ mkdir gitfolder 2初始化一个git仓库,命令是: toto@toto-K45VD:~$cd gitfolder/ toto@toto-K45VD:~/gitfolder$ls toto@toto-K45VD:~/gitfolder$git init 初始化空的 Git版本库于 /home/toto/gitfolder/.git/ 注意:如果是第一次使用git,还要对git对进行如下配置 git conf