Alter database

(1) Required Privileges

You must have the ALTER DATABASE system privilege.To specify the RECOVER clause, you must also have the SYSDBA system privilege.

(2) Adding Redo Log File Groups:

Examples

The following statement adds a redo log file group with two members and identifies it with a GROUP parameter value of 3:

ALTER DATABASE ADD LOGFILE GROUP 3 (‘<redo_log_file_name_with_path>’ , ‘<redo_log_file_name_with_path>’) SIZE 50K;

The following statement adds a redo log file group containing two members to thread 5 (in a Real Application Clusters environment) and assigns it a GROUP parameter value of 4:

ALTER DATABASE ADD LOGFILE thread 5 GROUP 4 (‘<redo_log_file_name_with_path>’, ‘<redo_log_file_name_with_path>’);

(3) Adding Redo Log File Group Members:

Example

The following statement adds a member to the redo log file group added in the previous example:

ALTER DATABASE ADD LOGFILE MEMBER ‘<redo_log_file_name_with_path>’ TO GROUP 3;

(4) Dropping Log File Members:

Example

The following statement drops one redo log file member added in the previous example:

ALTER DATABASE DROP LOGFILE MEMBER ‘<redo_log_file_name_with_path>’;

(5) drop redolog group

Example

The following statement drops all members of the redo log file group 3:

ALTER DATABASE DROP LOGFILE GROUP 3;

(5) Renaming a Log File Member:

Example

The following statement renames a redo log file member:

ALTER DATABASE RENAME FILE ‘<old_redo_log_file_name_with_path>’ TO ‘<new_redo_log_file_name_with_path>’;

The preceding statement only changes the member of the redo log group from one file to another. The statement does not actually change the name of the file diskc:log3.log to diskb:log3.log. Before issuing this statement, you must change the name of the file through your operating system.

(1) Required Privileges

You must have the ALTER DATABASE system privilege.To specify the RECOVER clause, you must also have the SYSDBA system privilege.

(2) Adding Redo Log File Groups:

Examples

The following statement adds a redo log file group with two members and identifies it with a GROUP parameter value of 3:

ALTER DATABASE ADD LOGFILE GROUP 3 (‘<redo_log_file_name_with_path>’ , ‘<redo_log_file_name_with_path>’) SIZE 50K;

The following statement adds a redo log file group containing two members to thread 5 (in a Real Application Clusters environment) and assigns it a GROUP parameter value of 4:

ALTER DATABASE ADD LOGFILE thread 5 GROUP 4 (‘<redo_log_file_name_with_path>’, ‘<redo_log_file_name_with_path>’);

(3) Adding Redo Log File Group Members:

Example

The following statement adds a member to the redo log file group added in the previous example:

ALTER DATABASE ADD LOGFILE MEMBER ‘<redo_log_file_name_with_path>’ TO GROUP 3;

(4) Dropping Log File Members:

Example

The following statement drops one redo log file member added in the previous example:

ALTER DATABASE DROP LOGFILE MEMBER ‘<redo_log_file_name_with_path>’;

(5) drop redolog group

Example

The following statement drops all members of the redo log file group 3:

ALTER DATABASE DROP LOGFILE GROUP 3;

(5) Renaming a Log File Member:

Example

The following statement renames a redo log file member:

ALTER DATABASE RENAME FILE ‘<old_redo_log_file_name_with_path>’ TO ‘<new_redo_log_file_name_with_path>’;

The preceding statement only changes the member of the redo log group from one file to another. The statement does not actually change the name of the file diskc:log3.log to diskb:log3.log. Before issuing this statement, you must change the name of the file through your operating system.

(6) Clearing a Log File:
Example

The following statement clears a log file:

ALTER DATABASE CLEAR LOGFILE ‘diskc:log3.log’;