Creating Redo Log Groups
ALTER DATABASE ADD LOGFILE ('/oracle/dbs/log1c.rdo','/oracle/dbs/log2c.rdo') SIZE 500K;
ALTER DATABASE ADD LOGFILE GROUP 10 ('/oracle/dbs/log1c.rdo','/oracle/dbs/log2c.rdo') SIZE 500K;
Creating Redo Log Members
ALTER DATABASE ADD LOGFILE MEMBER '/oracle/dbs/log2b.rdo' TO GROUP 2;
ALTER DATABASE ADD LOGFILE MEMBER '/oracle/dbs/log2c.rdo' TO ('/oracle/dbs/log2a.rdo', '/oracle/dbs/log2b.rdo');
Note:
Fully specify the filenames of new log members to indicate where the operating system files should be created. Otherwise, the files will be created in either the default or current directory of the database server, depending upon your operating system. You may also note that the status of the new log member is shown as INVALID. This is normal and it will change to active (blank) when it is first used.
Relocating and Renaming Redo Log Members
Shut down the database.
SHUTDOWN Immediate
Copy the redo log files to the new location.
Note:
You can execute an operating system command to copy a file (or perform other operating system commands) without exiting SQL*Plus by using the HOST command. Some operating systems allow you to use a character in place of the word HOST. For example, you can use an exclamation point (!) in UNIX.
The following example uses operating system commands (UNIX) to move the redo log members to a new location:
mv /diska/logs/log1a.rdo /diskc/logs/log1c.rdo
mv /diska/logs/log2a.rdo /diskc/logs/log2c.rdo
Startup the database, mount, but do not open it.
CONNECT / as SYSDBA
STARTUP MOUNT
Rename the redo log members.
ALTER DATABASE RENAME FILE '/diska/logs/log1a.rdo', '/diska/logs/log2a.rdo TO '/diskc/logs/log1c.rdo', '/diskc/logs/log2c.rdo';
Open the database
ALTER DATABASE OPEN;
Dropping Log Groups
Make sure a redo log group is archived (if archiving is enabled) before dropping it. To see whether this has happened, use the V$LOG view.
SELECT GROUP#, ARCHIVED, STATUS FROM V$LOG;
Drop a redo log group
ALTER DATABASE DROP LOGFILE GROUP 3;
Dropping Redo Log Members
ALTER DATABASE DROP LOGFILE MEMBER '/oracle/dbs/log3c.rdo';
Forcing Log Switches
ALTER SYSTEM SWITCH LOGFILE;
Clearing a Redo Log File
ALTER DATABASE CLEAR LOGFILE GROUP 3;
Viewing Redo Log Information
The following views provide information on redo logs.
View
|
Description
|
V$LOG
|
Displays the redo log file information from the control file
|
V$LOGFILE
|
Identifies redo log groups and members and member status
|
V$LOG_HISTORY
|
Contains log history information
|
No comments:
Post a Comment