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

你可能感兴趣的:(oracle,Go)