Skip to main content

How To Resize the Online Redo Logfiles in Oracle Database

How To Resize the Online Redo Logfiles in Oracle Database

Steps:


1. Check size of the current logs:

sqlplus /nolog

SQL> connect / as sysdba

SQL> 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. Find all the log member names for the groups:

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

GROUP# MEMBER
————— —————————————-
1 /u01/oracle/db/log1PROD.dbf
2 /u01/oracle/db/log2PROD.dbf
3 /u01/oracle/db/log3PROD.dbf

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

SQL> alter database add logfile group 4  '/u01/oracle/db/log4PROD.dbf' size 10M; 
SQL> alter database add logfile group 5  '/u01/oracle/db/log5PROD.dbf' size 10M;
SQL> alter database add logfile group 6  '/u01/oracle/db/log6PROD.dbf' size 10M;

4. Run query to view the v$log status: 

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

GROUP# STATUS
--------- ----------------
1 INACTIVE
2 CURRENT
 
3 INACTIVE 
 
4 UNUSED
 
5 UNUSED
 
6 UNUSED  
 

We can see log group 2 is current, and this is one of the smaller groups which we need to drop. Let’s switch log group into one of the newly created log groups.

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

SQL> alter system switch logfile;

** repeat as necessary until group 4 is CURRENT **

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

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

GROUP# STATUS
——— —————-
1 INACTIVE
2 INACTIVE
3 INACTIVE
4 CURRENT
5 UNUSED
6 UNUSED

Note: redo log Group 1 or 2 or 3 can be active after “alter system switch log file” which means could not be dropped, in this case,
you need to do “alter system checkpoint” to make redo log groups 1,2 and 3 inactive.

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

SQL> alter database drop logfile group 1;
SQL> alter database drop logfile group 2;
SQL> alter database drop logfile group 3;

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

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

GROUP# BYTES STATUS
——— ——— —————-
4 10485760 CURRENT
5 10485760 UNUSED
6 10485760 UNUSED

8. Take backup of the database if required.


9. At the operating system level delete the files associated
with redo log groups 1, 2, and 3 

 rm /u01/oracle/db/log1PROD.dbf
 rm /u01/oracle/db/log2PROD.dbf
 rm /u01/oracle/db/log3PROD.dbf




If you like please follow and comment

Comments

Popular posts from this blog

WebLogic migration to OCI using WDT tool

WebLogic migration to OCI using WDT tool Oracle WebLogic Deploy Tool (WDT) is an open-source project designed to simplify and streamline the management of Oracle WebLogic Server domains. With WDT, you can export configuration and application files from one WebLogic Server domain and import them into another, making it a highly effective tool for tasks like migrating on-premises WebLogic configurations to Oracle Cloud. This blog outlines a detailed step-by-step process for using WDT to migrate WebLogic resources and configurations. Supported WLS versions Why Use WDT for Migration? When moving Oracle WebLogic resources from an on-premises environment to Oracle Cloud (or another WebLogic Server), WDT provides an efficient and reliable approach to: Discover and export domain configurations and application binaries. Create reusable models and archives for deployment in a target domain. Key Pre-Requisites Source System: An Oracle WebLogic Server with pre-configured resources such as: Applica...

How to Validate TDE Wallet Password in Oracle Database

How to Validate TDE Wallet Password in Oracle Database Validating the Transparent Data Encryption (TDE) wallet password is crucial, especially when ensuring that the password is correct without using the OPEN or CLOSE commands in the database. This blog post explains a straightforward method to validate the TDE password using the mkstore utility. Steps to Validate TDE Wallet Password Follow these steps to validate the TDE wallet password: Step 1: Copy the Keystore/Wallet File Navigate to your existing TDE wallet directory. Copy only the ewallet.p12 file to a new directory. If a cwallet.sso file exists, do not copy it . The absence of cwallet.sso ensures that the wallet does not use auto-login, forcing the utility to prompt for the password. Step 2: Validate Using mkstore Use the mkstore utility to check the contents of the wallet file. The mkstore utility will prompt you for the TDE wallet password, allowing you to validate its correctness. Command Syntax To display the conten...

Rename a PDB in Oracle Database Multitenant Architecture in TDE and Non TDE Environment

Rename a PDB in Oracle Database Multitenant Architecture I am sharing a step-by-step guide to help you rename a PDB. This approach uses SQL commands. Without TDE or encryption Wallet Initial Check Check the Current Database Name and Open Mode: SQL > SELECT NAME, OPEN_MODE FROM V$DATABASE; NAME OPEN_MODE --------- -------------------- BEECDB READ WRITE List Current PDBs: SQL > SHOW PDBS; CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 FUAT READ WRITE NO We need to RENAME FUAT to BEE  Steps to Rename the PDB Step 1: Export ORACLE_SID Set the Oracle SID to the Container Database (CDB): export ORACLE_SID=BEECDB Step 2: Verify Target PDB Name Availability If the target PDB name is different from the current PDB name, ensure no service exists with the target PDB name. Run SQL to Check Exi...