Oracle Create log file

Source: Internet
Author: User

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 below;
Group Group_number Specifies the number of groups for the log file
file_name Create log file members for this group
Size number Specifies the number of log file members
Reuse if you create a log file member already exists, you can use the Reuse keyword to overwrite a file that already exists. However, if the file cannot already belong to another log filegroup, it cannot be replaced.
Create a log file
To create a log file, which generally refers to adding log members to a log file, you need to use the ALTER DATABASE ... add LOGFILE member statement.
For example, add a new log file to the log Filegroup Group 4;
ALTER DATABASE add LogFile Member
' F:\orealcfile\logfile\record.log ' to group 4;
We 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
1D:\ORACLE\ORADATA\ORACLE12C\REDO01. LOG
Then add the 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 10m;
The database has changed.
Again, we can see that the database log file group in the system has a number 4th database filegroup
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 to add the log file to the log Group 4


sql> ALTER DATABASE Add logfile member//add a member for the corresponding log
2 ' F:\oracledata\logfile\redo3.log '
3 to group 4;
The database has changed.
Sql> the database log file group for the Select Group#,member from v$logfile;//system
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

















Oracle Create log file

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.