Small knowledge, big challenge! This article is participating in the creation activity of “Essential Tips for Programmers”.

After the Oracle database is installed, the default number of redo logs is 3. To add or delete redo logs, perform the following operations:

Query:

set line222
col member for a60
select a.group#,b.member member,a.bytes/1024/1024 "size(M)" from v$log a,v$logfile b where a.group#=b.group#;
Copy the code

Feature:

Standalone database:

alter database add logfile group 4 '/oradata/orcl/redo04.log' size 50M;
alter database add logfile group 5 '/oradata/orcl/redo05.log' size 50M;
alter database add logfile group 16 '/oradata/orcl/redo16.log' size 1024M;
alter database add logfile group 17 '/oradata/orcl/redo17.log' size 1024M;
alter database add logfile group 18 '/oradata/orcl/redo18.log' size 1024M;
Copy the code

RAC Cluster database:

alter database add logfile thread 1 
group 4 '/oradata/orcl/redo04.log' size 50M,
group 5 '/oradata/orcl/redo05.log' size 50M,
group 6 '/oradata/orcl/redo06.log' size 50M;

alter database add logfile thread 2
group 7 '/oradata/orcl/redo07.log' size 50M,
group 8 '/oradata/orcl/redo08.log' size 50M,
group 9 '/oradata/orcl/redo09.log' size 50M;
Copy the code

Delete:

alter database drop logfile group 16; 
alter database drop logfile group 17; 
alter database drop logfile group 18; 
Copy the code

📢 Note: If the logfile to be deleted is not in INACTIVE state, an error will be reported. You need to run ALTER SYSTEM SWITCH logfile. To toggle the log and delete it until it is INACTIVE!


This is the end of sharing ~

If you think the article is helpful to you, please like it, favorites it, pay attention to it, comment on it, and support it four times with one button. Your support is the biggest motivation for my creation.

❤️ technical exchange can follow the public number: Lucifer think twice before you do ❤️