oracle 扩 redolog 文件大小
数据泵impdp导入慢,查看alert.log发现relog频繁切换,查看发现默认大小是3个50M的日志组,这里介绍如何扩展为1G
1.检查日志文件大小
1 2 3 4 5 6 7 8 9 10 |
SQL> column group# format 99999; SQL> column status format a10; SQL> column mb format 99999; SQL> select group#, status, bytes/1024/1024 mb from v$log; GROUP# STATUS MB ------ ---------- ------ 1 CURRENT 50 2 INACTIVE 50 3 INACTIVE 50 |
2.添加3个1G的日志组
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
SQL> alter database add logfile group 4 ('/u01/app/oracle/oradata/ORCL/redo04.log') size 1g, group 5 ('/u01/app/oracle/oradata/ORCL/redo05.log') size 1g, group 6 ('/u01/app/oracle/oradata/ORCL/redo06.log') size 1g; Database altered. SQL> select group#, status, bytes/1024/1024 mb from v$log; GROUP# STATUS MB ------ ---------- ------ 1 CURRENT 50 2 INACTIVE 50 3 INACTIVE 50 4 UNUSED 1024 5 UNUSED 1024 6 UNUSED 1024 |
3.切换日志文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
SQL> alter system switch logfile; System altered. SQL> / System altered. SQL> select group#, status, bytes/1024/1024 mb from v$log; GROUP# STATUS MB ------ ---------- ------ 1 ACTIVE 50 2 INACTIVE 50 3 INACTIVE 50 4 CURRENT 1024 5 UNUSED 1024 6 UNUSED 1024 6 rows selected. |
4. 设置 1,2,3日志组为INACTIVE
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
SQL> alter system checkpoint; System altered. SQL> select group#, status, bytes/1024/1024 mb from v$log; GROUP# STATUS MB ------ ---------- ------ 1 INACTIVE 50 2 INACTIVE 50 3 INACTIVE 50 4 CURRENT 1024 5 UNUSED 1024 6 UNUSED 1024 6 rows selected. |
5.删除日志组1,2,3
1 2 3 4 5 6 7 8 9 10 11 |
SQL> alter database drop logfile group 1, group 2, group 3; Database altered. SQL> select group#, status, bytes/1024/1024 mb from v$log; GROUP# STATUS MB ------ ---------- ------ 4 CURRENT 1024 5 UNUSED 1024 6 UNUSED 1024 |
6.手动删除日志文件
1 |
rm -i /u01/app/oracle/oradata/ORCL/redo0[1-3].log |
分类: oracle