Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5698343
  • 博文数量: 745
  • 博客积分: 10075
  • 博客等级: 上将
  • 技术积分: 7716
  • 用 户 组: 普通用户
  • 注册时间: 2005-04-29 12:09
文章分类

全部博文(745)

文章存档

2019年(1)

2016年(1)

2010年(31)

2009年(88)

2008年(129)

2007年(155)

2006年(197)

2005年(143)

分类: Oracle

2009-08-03 10:21:40

接上篇
5,进行日志切换,让原有日志组文件下岗,让新增日志组文件得到使用:
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
 
SQL> select group#, bytes/1024/1024, status from v$log;
    GROUP# BYTES/1024/1024 STATUS
---------- --------------- ----------------
         1       48.828125 ACTIVE
         2       48.828125 INACTIVE
         3       48.828125 INACTIVE
         4             500 ACTIVE
         5             500 CURRENT
 
6,删除非激活状态下日志组2、日志组3:
SQL> alter database drop logfile group 2;
Database altered.
SQL> alter database drop logfile group 3;
Database altered.
 
7,删除激活状态下日志组1:
SQL> alter database clear logfile group 1;
Database altered.
SQL> alter database drop logfile group 1;
Database altered.
 
8,增加日志组1、日志组2、日志组3,对应日志文件仍然使用之前的裸设备redo_1、redo_2、redo_3:
SQL> alter database add logfile group 1 ('/dev/vgdata/rredo_1') size 500m;
Database altered.
SQL> alter database add logfile group 2 ('/dev/vgdata/rredo_2') size 500m;
Database altered.
SQL> alter database add logfile group 3 ('/dev/vgdata/rredo_3') size 500m;
Database altered.
 
9,查看日志组状态:
SQL> select group#, bytes/1024/1024, status from v$log;
    GROUP# BYTES/1024/1024 STATUS
---------- --------------- ----------------
         1             500 UNUSED
         2             500 UNUSED
         3             500 UNUSED
         4             500 ACTIVE
         5             500 CURRENT
注意观察日志组1、2、3下的日志文件此时都是500MB大小。
 
10,进行日志切换,让新增日志组1、2、3得到使用:
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> select group#, bytes/1024/1024, status from v$log;
    GROUP# BYTES/1024/1024 STATUS
---------- --------------- ----------------
         1             500 ACTIVE
         2             500 ACTIVE
         3             500 CURRENT
         4             500 INACTIVE
         5             500 ACTIVE
 
11,删除激活状态下日志组5以及未激活状态下日志组4:
SQL> alter database clear logfile group 5;
Database altered.
SQL> alter database drop logfile group 5;
Database altered.
SQL> alter database drop logfile group 4;
Database altered.
 
12,进行检验:
SQL> select group#, bytes/1024/1024, status from v$log;
    GROUP# BYTES/1024/1024 STATUS
---------- --------------- ----------------
         1             500 ACTIVE
         2             500 ACTIVE
         3             500 CURRENT
此即为本次操作所需要达到的最终目的。
 
13,数据库启停测试:
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 1895825408 bytes
Fixed Size                  1994600 bytes
Variable Size             419430552 bytes
Database Buffers         1459617792 bytes
Redo Buffers               14782464 bytes
Database mounted.
Database opened.
 
14,删除多余无用的裸设备文件,释放空间:
# lvremove /dev/vgdata/redo1_4
The logical volume "/dev/vgdata/redo1_4" is not empty;
do you really want to delete the logical volume (y/n) : y
Logical volume "/dev/vgdata/redo1_4" has been successfully removed.
Volume Group configuration for /dev/vgdata has been saved in /etc/lvmconf/vgdata.conf
# lvremove /dev/vgdata/redo1_5
The logical volume "/dev/vgdata/redo1_5" is not empty;
do you really want to delete the logical volume (y/n) : y
Logical volume "/dev/vgdata/redo1_5" has been successfully removed.
Volume Group configuration for /dev/vgdata has been saved in /etc/lvmconf/vgdata.conf
 
15,等待一个小时检查alert文件看是否还有之前类似报错,正常。查看数据库状态,正常。
本次故障诊断与测试过程结束。
 
 
阅读(2043) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~