修改Oracle归档日志的方法
Oracle默认安装的归档日志只有50M,在做大量操作的时候会经常切换日志文件,造成性能问题,下面是具体操作方法
1、 下面是查看现有归档日志大小:
SQL> select group#, bytes, status from v$log;
2、 下面是查看归档日志组和路径信息:
SQL> select group#, member from v$logfile;
3、 添加新的归档日志组,本例为添加4、5、6三个组:
SQL> alter database add logfile group 4 '/uc/app/oradata/UCDATA/redo04a.log' size 500M;
SQL> alter database add logfile group 5 '/uc/app/oradata/UCDATA/redo05a.log' size 500M;
SQL> alter database add logfile group 6 '/uc/app/oradata/UCDATA/redo06a.log' size 500M;
4、 再为4、5、6三个组中分别添加1个组员:
SQL> alter database add logfile member '/uc/app/oradata/UCDATA/redo04b.log' to group 4;
SQL> alter database add logfile member '/uc/app/oradata/UCDATA/redo05b.log' to group 5;
SQL> alter database add logfile member '/uc/app/oradata/UCDATA/redo06b.log' to group 6;
SQL>
5、 查看添加后的组状态:
SQL> select group#, bytes, status from v$log;
SQL> select group#, member from v$logfile;
6、 切换归档日志活动组:
SQL> alter system switch logfile;
System altered.
SQL> select group#, status from v$log;
SQL> alter system switch logfile;
SQL> select group#, status from v$log;
.
SQL>
7、 待上面三个组都变为 INACTIVE时,即可删除前面3个归档日志组,那3个组为50M,过小:
SQL> alter database drop logfile group 1;
SQL> alter database drop logfile group 2;
SQL> alter database drop logfile group 3;
SQL> select group#, bytes, status from v$log;
8、 最后删除日志文件