Create a log file in oracle and an oracle Log File

Source: Internet
Author: User

Create a log file in oracle and an oracle Log File

The syntax for creating a log file is as follows:

Alter database database_name add logfile [group group_number]

(File_name [, file_name [,...]) [SIZE number] [reuse];
The syntax is described as follows;
Group group_number is the ID of the specified group in the log file.
File_name creates a log file Member for this group
Size number indicates the size of log file members.
Reuse if the created Log File member already exists, you can use the reuse keyword to overwrite the existing file. However, if the file cannot belong to another log file group, it cannot be replaced.
Create a log file
Creating a log file generally refers to adding a log member to a log file. You must use the alter database... add logfile member statement.
For example, add a new log file to log file group 4;
Alter database add logfile member
'F: \ orealcfile \ logfile \ record. log' to group 4;
First, query the log file groups in the database:
SQL> select group #, member from v $ logfile;
GROUP # MEMBER
-------------------------------------------------------------------------------
3 D: \ ORACLE \ ORADATA \ ORACLE12C \ REDO03.LOG
2 D: \ ORACLE \ ORADATA \ ORACLE12C \ REDO02.LOG
1 D: \ ORACLE \ ORADATA \ ORACLE12C \ REDO01.LOG
Then, add a log file to the log file group.
SQL> alter database add logfile group 4
(
'F: \ oracledata \ logfile \ redo1.log ',
'F: \ oracledata \ logfile \ redo2.log'
) Size 10 m;
The database has been changed.
Again, we can see that there are 4 more database file groups in the system's Database Log File Group.
SQL> select group #, member from v $ logfile;
GROUP # MEMBER
-------------------------------------------------------------------------------
3 D: \ ORACLE \ ORADATA \ ORACLE12C \ REDO03.LOG
2 D: \ ORACLE \ ORADATA \ ORACLE12C \ REDO02.LOG
1 D: \ ORACLE \ ORADATA \ ORACLE12C \ REDO01.LOG
4 F: \ ORACLEDATA \ LOGFILE \ REDO1.LOG
4 F: \ ORACLEDATA \ LOGFILE \ REDO2.LOG


Create a log file and add it to log group 4.


SQL> alter database add logfile member // add a member to the corresponding log
2 'f: \ oracledata \ logfile \ redo3.log'
3 to group 4;
The database has been changed.
SQL> select group #, member from v $ logfile; // System Database Log File group
GROUP # MEMBER
-------------------------------------------------------------------------------
3 D: \ ORACLE \ ORADATA \ ORACLE12C \ REDO03.LOG
2 D: \ ORACLE \ ORADATA \ ORACLE12C \ REDO02.LOG
2 D: \ ORACLE \ ORADATA \ ORACLE12C \ REDO01.LOG
4 F: \ ORACLEDATA \ LOGFILE \ REDO1.LOG
4 F: \ ORACLEDATA \ LOGFILE \ REDO2.LOG
3 F: \ ORACLEDATA \ LOGFILE \ REDO3.LOG

















Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.