Collect common Oracle commands-log management

Source: Internet
Author: User

Common Oracle commands-log management

1. view log files
Syntax: select Member from V $ logfile

1. Forcing log Switches
SQL> alter system switch logfile;

2. Forcing checkpoints
SQL> alter system checkpoint;

3. Adding online redo log groups
SQL> alter database add logfile [Group 4]
SQL> ('/disk3/log4a. rdo', '/disk4/log4b. rdo') size 1 m;

4. Adding online redo log members
SQL> alter database add logfile Member
SQL> '/disk3/log1b. rdo' to group 1,
SQL> '/disk4/log2b. rdo' to group 2;

5. Changes the name of the online redo logfile
SQL> alter database rename file 'C:/Oracle/oradata/oradb/redo01.log'
SQL> to 'C:/Oracle/oradata/redo01.log ';

6. Drop online redo log groups
SQL> alter database drop logfile group 3;

7. Drop online redo log members
SQL> alter database drop logfile member 'C:/Oracle/oradata/redo01.log ';

8. Clearing online redo log files
SQL> alter database clear [Unarchived] logfile 'C:/Oracle/log2a. rdo ';

9. Using logminer analyzing redo logfiles
A. In the init. ora specify utl_file_dir =''
B. SQL> execute dbms_logmnr_d.build ('oradb. ora ', 'c: \ oracle \ oradb \ log ');
C. SQL> execute dbms_logmnr_add_logfile ('C: \ oracle \ oradata \ oradb \ redo01.log ',
SQL> dbms_logmnr.new );
D. SQL> execute dbms_logmnr.add_logfile ('C: \ oracle \ oradata \ oradb \ redo02.log ',
SQL> dbms_logmnr.addfile );
E. SQL> execute dbms_logmnr.start_logmnr (dictfilename => 'C: \ oracle \ oradb \ log \ oradb. ora ');
F. SQL> select * from V $ logmnr_contents (V $ logmnr_dictionary, V $ logmnr_parameters
SQL> V $ logmnr_logs );
G. SQL> execute dbms_logmnr.end_logmnr;

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.