Commands for adding log groups and log members in oracle

Source: Internet
Author: User

Commands for adding log groups and log members in oracle 1. Adding a log group: alter database add logfile group 4'/oradata/oracle/oradata/oracle_sid/redo04.log 'size 100 M; 2. Change the log group size (First, check the archiving status: SQL> select group #, thread #, members, archived, status from v $ log; www.2cto.com GROUP # THREAD # members arc status ------------ ---------- --- ---------------- 1 1 1 1 yes inactive 2 1 1 yes inactive 3 1 1 1 no current 4 1 1 YES UNUSED4 rows selected. second, DROP G ROUP 1 (it is better not to DROP GROUP3 at this time. As for the consequences, I did not TEST in this direction .) SQL> alter database drop logfile group 1; Database altered. Delete redo01.logSQL>! Rm/oradata/oracle/oradata/NC5X/redo01.log add redo01.log: SQL> alter database add logfile group 1'/oradata/oracle/oradata/ORACLE_SID/redo01.log 'size 100 M; SQL> select group #, thread #, members, archived, status from v $ log; GROUP # THREAD # members arc status ---------- --- ---------------- 1 1 1 yes unused 2 1 1 yes inactive 3 1 1 no current 4 1 1 YES UNUSED4 rows selected. in this case, switch the log: SQ L> alter system switch logfile; www.2cto.com System altered. Note: The difference between alter system switch logfile and alter system archive log current. Alter system switch logfile: switch logfile without waiting for archiving to complete. If archive log mode is not enabled for the database. There is no doubt about using this switch. In addition, log switching is performed for the current instance in single-instance database and RAC mode. The alter system archive log current switch logfile only after archiving is complete. Switches logs to all instances. In general, the results of the two commands are almost the same in the automatically archived library. The difference is that alter system archive log current takes longer time than alter system switch logfile.
3. add members to the log group: SQL> alter database add logfile member '/oraback/logbackup/redo01_ B .log' to group 1; Database altered. Note: The redo01_ B .log size cannot be set in the alter statement. SQL> alter database add logfile member '/oraback/logbackup/redo01_ B .log 'size 100 M to group 1; alter database add logfile member '/oraback/logbackup/redo01_ B .log' size 100 M to group 1 * ERROR at line 1: ORA-00946: missing TO keyword. After the Alter statement is run, the size of the Redo01_ B .log generated is the same as that of redo01.log. The path can be different from the default path. Finally, you must declare that several log groups can be added at the same time. You can also add several log group members. Statement format: alter database add logfile '/LOCATION_DUEST/REDO01.LOG' SIZE 10 M, ''/LOCATION_DUEST/REDO02.LOG 'size 10M ......; and so on. Adding members is similar. Not here. Www.2cto.com
4. delete a log group and a member of the log group: before deletion, follow the following principles. Each instance must have at least two log groups. When a group is in ACTIVE or CURRENT status, it cannot be deleted; deleting a log GROUP only changes the database, and the operating system files have not been deleted. When the drop logfile group n statement is applied to the deletion, all members in group n will be deleted. Alter database drop logfile group n; Principles for deleting a log Member: You cannot delete a member when it is the last member in the GROUP; when the Group's turntable is in the current status, you cannot delete the Group members. In archive mode, you must archive the group before deleting the Group members. You can only change the database when deleting the group members, the operating system file has not been deleted. alter database drop logfile member '/LOCATION_DUST/REDO0N_N.LOG'; prepared by Li Zhiqiang

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.