Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Locally Managed Tablespace and Dictionary managed tablespace (LMT-DMT) Oracle
  • nfs mount command Linux/Unix
  • Follwoing korn shell is used to move files from source folder to destination folder and gzip it in destination folder. mv_iotto.ksh Linux/Unix
  • Important Script Method for tuning Oracle
  • Roles and Stored Object behaviour Oracle
  • Oracle Statspack survival Guide Oracle
  • How to know Number of CPUs on Sun Box Linux/Unix
  • PLSQL Table Syntax 1 Oracle
  • pvmehta.com SQL scripts
    Find which sessions is accessing object that prevent your session to have exclusive locks in Oracle Oracle
  • lck.sql Oracle
  • findx.sql /* Find Indexes on specified USER.TABLE_NAME */ Oracle
  • oradebug ipcrm ipcs Oracle
  • The most important Tuning Notes Oracle
  • chk_space_SID.ksh Linux/Unix
  • OEM-troubleshooting on 20-MAY-08 Oracle

Example of How To Resize the Online Redo Logfiles Note:1035935.6

Posted on 09-Nov-2005 By Admin No Comments on Example of How To Resize the Online Redo Logfiles Note:1035935.6

EXAMPLE OF HOW TO RESIZE THE ONLINE REDO LOGS:

==============================================

Often times the online redo logs are sized too small causing database

performance problems.

The following is an example of how to resize the online log groups:

1. First see the size of the current logs:

SVRMGR> connect internal (with 9i/10g use SQL> connect / as sysdba)

SVRMGR> select group#, bytes, status from v$log;

GROUP# BYTES STATUS

———- ———- —————-

1 1048576 INACTIVE

2 1048576 CURRENT

3 1048576 INACTIVE

Logs are 1MB from above, let’s size them to 10MB.

2. Retrieve all the log member names for the groups:

SVRMGR> select group#, member from v$logfile;

GROUP# MEMBER

————— —————————————-

1 /usr/oracle/dbs/log1PROD.dbf

2 /usr/oracle/dbs/log2PROD.dbf

3 /usr/oracle/dbs/log3PROD.dbf

3. Now shutdown the database and startup in restricted mode. We startup in

restricted mode so that only DBAs can login and because we do not want redo

generation during this time:

SVRMGR> shutdown immediate;

SVRMGR> startup open restrict;

4. Let’s create 3 new log groups and name them groups 4, 5, and 6, each 10MB in

size:

SVRMGR> alter database add logfile group 4

‘/usr/oracle/dbs/log4PROD.dbf’ size 10M;

SVRMGR> alter database add logfile group 5

‘/usr/oracle/dbs/log5PROD.dbf’ size 10M;

SVRMGR> alter database add logfile group 6

‘/usr/oracle/dbs/log6PROD.dbf’ size 10M;

5. Now run a query to view the v$log status:

SVRMGR> select group#, status from v$log;

GROUP# STATUS

——— —————-

1 INACTIVE

2 CURRENT

3 INACTIVE

4 UNUSED

5 UNUSED

6 UNUSED

From the above we can see log group 2 is current, and this is one of the

smaller groups we must drop. Therefore let’s switch out of this group into

one of the newly created log groups.

6. Switch until we are into log group 4, so we can drop log groups 1, 2, and 3:

SVRMGR> alter system switch logfile;

SVRMGR> alter system switch logfile;

7. Run the query again to verify the current log group is group 4:

SVRMGR> select group#, status from v$log;

GROUP# STATUS

——— —————-

1 INACTIVE

2 INACTIVE

3 INACTIVE

4 CURRENT

5 UNUSED

6 UNUSED

8. Now drop redo log groups 1, 2, and 3:

SVRMGR> alter database drop logfile group 1;

SVRMGR> alter database drop logfile group 2;

SVRMGR> alter database drop logfile group 3;

Verify the groups were dropped, and the new groups’ sizes are correct.

SVRMGR> select group#, bytes, status from v$log;

GROUP# BYTES STATUS

——— ——— —————-

4 10485760 CURRENT

5 10485760 UNUSED

6 10485760 UNUSED

9. Now shutdown and startup the database in normal mode, so all users can login:

SVRMGR> shutdown immediate;

SVRMGR> startup;

Or you can issue the following command to enable logins without having to

shutdown the database.

SVRMGR> alter system disable restricted session;

At this point, you also might want to consider taking a backup of the

database.

10. You can now go out to the operating system and delete the files associated

with redo log groups 1, 2, and 3 in step 2 above as they are no longer

needed:

% rm /usr/oracle/dbs/log1PROD.dbf

% rm /usr/oracle/dbs/log2PROD.dbf

% rm /usr/oracle/dbs/log3PROD.dbf

Monitor the alert.log for the times of redo log switches. Due to increased

redo log size, the groups should not switch as frequently under the same

load conditions.

Oracle, rman-dataguard

Post navigation

Previous Post: Standby Database Behavior when a Datafile is Resized on the Primary Database Note:123883.1
Next Post: Adding or Dropping Online Redo Log Files When Physical Standby in place

Related Posts

  • Temporary Tablespsace Temp tablespace behaviour Oracle
  • Is It Recommended To Apply Patch Bundles When PSU Is Available? -ID 743554.1 Oracle
  • Goldengate Tutorial Oracle
  • mutex in Oracle 10.2.0.2 or Oracle 10g Oracle
  • Parallel DML Oracle
  • Good RAC & Standby Notes Oracle

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Linux/Unix (149)
  • MYSQL (5)
  • Oracle (392)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (0)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (341)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • SQL Server Vs Oracle Architecture difference25-Jul-2025
  • SQL Server: How to see historical transactions25-Jul-2025
  • SQL Server: How to see current transactions or requests25-Jul-2025
  • T-SQL Vs PL/SQL Syntax25-Jul-2025
  • Check SQL Server edition25-Jul-2025
  • Checking SQL Server Version25-Jul-2025
  • Oracle vs MYSQL Architecture differences (For DBAs)24-Jul-2025
  • V$INSTANCE of Oracle in MYSQL24-Jul-2025
  • Day to day MYSQL DBA operations (Compared with Oracle DBA)24-Jul-2025
  • MYSQL and Oracle Comparison for Oracle DBA24-Jul-2025

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Find all users who have DML privileges Oracle
  • avail.sh ( find filesystem spae usage) Linux/Unix
  • send attachment from unix-shell script Linux/Unix
  • To see how much time or progress of long transaction Oracle
  • Generate SSH without password authentication. Linux/Unix
  • Standby Database Behavior when a Datafile is Resized on the Primary Database Note:123883.1 Oracle
  • standard Monitoring – 1 Oracle
  • Paste command syntax Linux/Unix

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme