How to resize redo log file?

I wrote a script named 'checkRedoLog.sh' to resize log file, which had been added to install and update script of SVA3.0.

Assuming checkRedoLog.sh is in /home/oracle.

Log on as root

[root@localhost ~]# cd /home/oracle

[root@localhost oracle]# chmod 755 checkRedoLog.sh



If you need redo information, run it with ‘state’ parameter.

[root@localhost oracle]# ./checkRedoLog.sh state



    GROUP#      BYTES STATUS

---------- ---------- ----------------

         1  536870912 INACTIVE

         2  536870912 CURRENT

         3  5242880 INACTIVE



There are two different ways to resize.

1.    Run the script directly without any parameters.
The script will check and resize redo logs automatically. But it will restart oracle at least once and at most twice if redo size is less than 512M.
The script will also add a new redo log group if there are less than three groups.


[root@localhost oracle]# ./checkRedoLog.sh

After having done this, check redo state once again to make sure whether it’s resized correctly.

[root@localhost oracle]# ./checkRedoLog.sh state



    GROUP#      BYTES STATUS

---------- ---------- ----------------

         1  536870912 INACTIVE

         2  536870912 CURRENT

         3  536870912 INACTIVE



I recommend this method if you don’t mind restarting oracle.


2. The second way, you don’t need to restart oracle, but it’s a little bit complicated.

Since there is no such command in oracle as ‘resize redo log’, you must drop the log first, and then add a new redo log with the right size.

Only Logs with status of INACTIVE or UNUSED can be dropped.

If the status of the log you want to drop (resize) is not INACTIVE, please keep doing the following steps until the status turns INACVTIVE.


First step: switch log.

[root@localhost oracle]# ./checkRedoLog.sh switch


System altered.


Then check it’s status.

[root@localhost oracle]# ./checkRedoLog.sh state



    GROUP#      BYTES STATUS

---------- ---------- ----------------

         1  536870912 CURRENT

         2  536870912 INACTIVE

         3  5242880 INACTIVE

If the status of the group you want to drop is still not INACTIVE, go back to the First step.



Now, you can drop the redo log. Let’s take group 3 for example.

[root@localhost oracle]# ./checkRedoLog.sh drop 3

Drop group 3 successfully

[root@localhost oracle]# ./checkRedoLog.sh state



    GROUP#      BYTES STATUS

---------- ---------- ----------------

         1  536870912 CURRENT

         2  536870912 INACTIVE



[root@localhost oracle]# ./checkRedoLog.sh add 3

Add group 3 512M successfully

[root@localhost oracle]# ./checkRedoLog.sh state



    GROUP#      BYTES STATUS

---------- ---------- ----------------

         1  536870912 CURRENT

         2  536870912 INACTIVE

         3  536870912 UNUSED



Some usages of the script

-state

Show status of the redo log groups

-switch

Switch log

-add groupnum

Add group with groupnum; the default size is 512M

-drop groupnum

      Drop group with groupnum

-restart

Restart oracle

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值