Oracle优化之redo日志优化

记录一次Oracle数据库优化记录-redo日志优化,默认安装完数据库的参数比较小,通过DBA了解到可以通过增加redo日志的大小以及数量优化数据库速度

SQL> select group#,bytes/1024/1024 MB ,status from v$log
    GROUP#         MB STATUS
---------- ---------- ----------------
         1         10 ACTIVE
         2         10 CURRENT
         3         10 INACTIVE


SQL> select * from v$logfile;
    GROUP# STATUS  TYPE    MEMBER                                                                           IS_RECOVERY_DEST_FILE
---------- ------- ------- -------------------------------------------------------------------------------- ---------------------
         1         ONLINE  /bases/oracle/oradata/CTMMS/redo01.log                                           NO
         2         ONLINE  /bases/oracle/oradata/CTMMS/redo02.log                                           NO
         3         ONLINE  /bases/oracle/oradata/CTMMS/redo03.log                                           NO

SQL> alter database add logfile group 4 ('/bases/oracle/oradata/CTMMS/redo04.log') size 512M;
Database altered
SQL> alter database add logfile group 5 ('/bases/oracle/oradata/CTMMS/redo05.log') size 512M;
Database altered
SQL> alter database add logfile group 6 ('/bases/oracle/oradata/CTMMS/redo06.log') size 512M;
Database altered
SQL> select group#,bytes/1024/1024 MB ,status from v$log
    GROUP#         MB STATUS
---------- ---------- ----------------
         1         10 INACTIVE
         2         10 ACTIVE
         3         10 INACTIVE
         4        512 CURRENT
         5        512 UNUSED
         6        512 UNUSED
         
SQL> alter database drop logfile group 1;
Database altered
SQL> select * from v$logfile;
    GROUP# STATUS  TYPE    MEMBER                                                                           IS_RECOVERY_DEST_FILE
---------- ------- ------- -------------------------------------------------------------------------------- ---------------------
         2         ONLINE  /bases/oracle/oradata/CTMMS/redo02.log                                           NO
         3         ONLINE  /bases/oracle/oradata/CTMMS/redo03.log                                           NO
         4         ONLINE  /bases/oracle/oradata/CTMMS/redo04.log                                           NO
         5         ONLINE  /bases/oracle/oradata/CTMMS/redo05.log                                           NO
         6         ONLINE  /bases/oracle/oradata/CTMMS/redo06.log                                           NO
         
SQL> select group#,bytes/1024/1024 MB ,status from v$log         
    GROUP#         MB STATUS
---------- ---------- ----------------
         2         10 ACTIVE
         3         10 INACTIVE
         4        512 CURRENT
         5        512 UNUSED
         6        512 UNUSED
SQL> alter system switch logfile;
System altered

SQL>  select group#,bytes/1024/1024 MB ,status from v$log;
    GROUP#         MB STATUS
---------- ---------- ----------------
         2         10 INACTIVE
         3         10 INACTIVE
         4        512 ACTIVE
         5        512 CURRENT
         6        512 UNUSED
         
SQL> alter database drop logfile group 2;   
Database altered
SQL> alter database drop logfile group 3;
Database altered


本文作者:枫、清风

本文链接:http://qdxxwl.cn/post/5.html

版权声明:本篇文章于2020-04-30,由枫、清风发表,转载请注明出处:知点星。如有疑问,请联系我们

Oracle创建表空间/用户/用户授权/删除表空间/删除用户

发表评论

取消
扫码支持