技术头条 - 一个快速在微博传播文章的方式     搜索本站
您现在的位置首页 --> Oracle --> ASM的优点总结–关于日志文件调整

ASM的优点总结–关于日志文件调整

浏览:1499次  出处信息

    日志文件是我们经常关注的,比如出现checkpoint not complete,或者是我们发现alert.log里日志切换特频繁,这个时候就要调整日志,比如事务总是等待LGWR写日志文件,日志文件切换在等归档,可能这个时候就要添加日志组了,利用ASM,可以很容易的规范日志成员的名字和日志组的编号.

SQL> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- ---------------------------------------------------
3 ONLINE +DISK_GROUP1/devdb/logfile/redo03.log NO
2 STALE ONLINE +DISK_GROUP1/devdb/logfile/redo02.log NO
1 ONLINE +DISK_GROUP1/devdb/logfile/redo01.log NO
4 STALE ONLINE +DISK_GROUP1/devdb/onlinelog/group_4.273.640618259 NO
4 STALE ONLINE +DISK_GROUP1/devdb/onlinelog/group_4.274.640618265 YES
3 ONLINE +DISK_GROUP1/devdb/logfile/group_3.redo03.log NO
1 ONLINE +DISK_GROUP2/devdb/onlinelog/group_1.277.642080697 NO
已选择7行。
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME
---------- ---------- ---------- ---------- ---------- --- ---------------- ---
1 1 9 52428800 2 YES INACTIVE 254431852 20-1月 -08
2 1 10 52428800 1 YES INACTIVE 254467357 23-1月 -08
3 1 11 52428800 2 NO CURRENT 254506062 23-1月 -08
4 1 8 104857600 2 YES INACTIVE 254407862 19-1月 -08 
SQL> alter database add logfile (\'+DISK_GROUP1/devdb/onlinelog/group_5_01.log\', 2 \'+DISK_GROUP1/devdb/onlinelog/group_5_02.log\') size 50m;
数据库已更改。 

    -利用手工方式,添加日志文件组和成员

SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME
---------- ---------- ---------- ---------- ---------- --- ---------------- ---
1 1 9 52428800 2 YES INACTIVE 254431852 20-1月 -08
2 1 10 52428800 1 YES INACTIVE 254467357 23-1月 -08
3 1 11 52428800 2 NO CURRENT 254506062 23-1月 -08
4 1 8 104857600 2 YES INACTIVE 254407862 19-1月 -08
5 1 0 52428800 2 YES UNUSED 0 

SQL> select * from v$logfile order by group#;
GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- ----------------------------------------------------
1 ONLINE +DISK_GROUP1/devdb/logfile/redo01.log NO
1 ONLINE +DISK_GROUP2/devdb/onlinelog/group_1.277.642080697 NO
2 STALE ONLINE +DISK_GROUP1/devdb/logfile/redo02.log NO
3 ONLINE +DISK_GROUP1/devdb/logfile/group_3.redo03.log NO
3 ONLINE +DISK_GROUP1/devdb/logfile/redo03.log NO
4 STALE ONLINE +DISK_GROUP1/devdb/onlinelog/group_4.273.640618259 NO
4 STALE ONLINE +DISK_GROUP1/devdb/onlinelog/group_4.274.640618265 YES
5 ONLINE +DISK_GROUP1/devdb/onlinelog/group_5_01.log NO
5 ONLINE +DISK_GROUP1/devdb/onlinelog/group_5_02.log NO 

已选择9行。 
SQL> alter database add logfile group 6 \'+DISK_GROUP1\' size 50m; 

数据库已更改。 

    -利用ASM的方式添加日志组和成员

SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME
 ---------- ---------- ---------- ---------- ---------- --- ---------------- --
1 1 9 52428800 2 YES INACTIVE 254431852 20-1月 -08
2 1 10 52428800 1 YES INACTIVE 254467357 23-1月 -08
3 1 11 52428800 2 NO CURRENT 254506062 23-1月 -08
4 1 8 104857600 2 YES INACTIVE 254407862 19-1月 -08
5 1 0 52428800 2 YES UNUSED 0
6 1 0 52428800 1 YES UNUSED 0 

已选择6行。 

SQL> select * from v$logfile order by group#; 

GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- -----------------------------------------------------
1 ONLINE +DISK_GROUP1/devdb/logfile/redo01.log NO
1 ONLINE +DISK_GROUP2/devdb/onlinelog/group_1.277.642080697 NO
2 STALE ONLINE +DISK_GROUP1/devdb/logfile/redo02.log NO
3 ONLINE +DISK_GROUP1/devdb/logfile/group_3.redo03.log NO
3 ONLINE +DISK_GROUP1/devdb/logfile/redo03.log NO
4 STALE ONLINE +DISK_GROUP1/devdb/onlinelog/group_4.273.640618259 NO
4 STALE ONLINE +DISK_GROUP1/devdb/onlinelog/group_4.274.640618265 YES
5 ONLINE +DISK_GROUP1/devdb/onlinelog/group_5_01.log NO
5 ONLINE +DISK_GROUP1/devdb/onlinelog/group_5_02.log NO
6 ONLINE +DISK_GROUP1/devdb/onlinelog/group_6.261.644775363 NO 

已选择10行。

    我们发现日志组成员添加是一个成员,ASM是否可以添加两个呢?

SQL> alter database add logfile group 7 (\'+DISK_GROUP1\',\'+DISK_GROUP1\') size 50m; 

数据库已更改。 

SQL> select * from v$logfile order by group#; 

GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- -----------------------------------------------------
1 ONLINE +DISK_GROUP2/devdb/onlinelog/group_1.277.642080697 NO
1 ONLINE +DISK_GROUP1/devdb/logfile/redo01.log NO
2 STALE ONLINE +DISK_GROUP1/devdb/logfile/redo02.log NO
3 ONLINE +DISK_GROUP1/devdb/logfile/redo03.log NO
3 ONLINE +DISK_GROUP1/devdb/logfile/group_3.redo03.log NO
4 STALE ONLINE +DISK_GROUP1/devdb/onlinelog/group_4.273.640618259 NO
4 STALE ONLINE +DISK_GROUP1/devdb/onlinelog/group_4.274.640618265 YES
5 ONLINE +DISK_GROUP1/devdb/onlinelog/group_5_01.log NO
5 ONLINE +DISK_GROUP1/devdb/onlinelog/group_5_02.log NO
6 ONLINE +DISK_GROUP1/devdb/onlinelog/group_6.261.644775363 NO
7 ONLINE +DISK_GROUP1/devdb/onlinelog/group_7.259.644775421 NO
7 ONLINE +DISK_GROUP1/devdb/onlinelog/group_7.268.644775419 NO
已选择12行。

    可以看到ASM可以自动添加两个组成员

建议继续学习:

  1. ASM使用AIX raw disk的问题    (阅读:3691)
  2. Oracle ASM存储方式浅析    (阅读:3178)
  3. ASM装载磁盘组时ORA-15063错误处理    (阅读:2510)
  4. ASM中如何配置多个控制文件    (阅读:2430)
  5. ASM的争论    (阅读:2253)
  6. ASM的争论    (阅读:2218)
  7. 用ASM和iSCSI实现的另类HA方案    (阅读:1950)
  8. ASM HEADER 备份与恢复    (阅读:1444)
QQ技术交流群:445447336,欢迎加入!
扫一扫订阅我的微信号:IT技术博客大学习
© 2009 - 2024 by blogread.cn 微博:@IT技术博客大学习

京ICP备15002552号-1