重做日志按照有序循环的方式被使用,即当一组日志文件被填满后,循环覆盖下一组日志文件,不断循环。此时称为日志切换。检查点操
一个重做日志组可以包括一个或多个日志成员,这多个成员应该放再不同的磁盘上,作为磁盘日志镜像,同一组的成员的内容是一样的,如果没有多个磁盘,没有必要为重做日志组建立多个日志成员。当一组都写满时开始归档,使用下一日志组,当日志组都写满又轮回到第一日志组时,如果第一日志组归档完毕就覆盖它,若没有就只能使用日志缓冲区等待归档完毕之后才能使用它。
一、重做日志的运行流程:
重做日志按照有序循环的方式被使用,,即当一组日志文件被填满后,循环覆盖下一组日志文件,不断循环。此时称为日志切换。检查点操作也在此时发生,检查点操作是用来实现同步的,它会写数据文件的头信息、控制文件。在归档模式下,当一组日志文件被填满后,ARCH(归档写进程)将这组复制到归档日志文件中。(在ARCH正在写的重做日志文件LGWR是不可以写的)
1、重做日志文件的定稿是依靠LGWR后台进程
2、.LGWR正在写的重做日志组称为:当前重做日志组。
3、重做日志文件------联机日志文件;归档日志文件------脱机日志文件
二、查询重做日志组:
1、日志组:
select group#, sequence#, members, bytes, status, archived from v$log;
Status列中各值的意义:
Current:当前组。
Inactive:实例恢复已不需要这组日志了
Activie:这组日志是活动的,但非当前组。例如正在归档。
Unused:此组从未被写过。是日志刚被添加到DB中的状态。
2、日志文件:
Select * from v$logfile;
Status列中各值的含义:
空白:此文件正在使用。
Stale:该文件内容是不完全的。
Invalid:该文件不可以被访问。例如刚建立
Deleted:该文件已不再有用。
三、创建与删除重做日志文件组:
1、创建2个新的日志组
SQL> alter database add logfile group 4('/Oracle/oradata/orcl/redo04.rdo') size 10m;
SQL> alter database add logfile group 5('/oracle/oradata/orcl/redo05.rdo') size 10m;
2、切换当前日志到新的日志组
alter system switch logfile;
alter system switch logfile;
3、删除旧的日志组
alter database drop logfile group 1;
alter database drop logfile group 2;
alter database drop logfile group 3;
4、操作系统下删除原日志组1、2、3中的文件
rm /oracle/oradata/orcl/redo01.rdo
rm /oracle/oradata/orcl/redo01.rdo
rm /oracle/oradata/orcl/redo01.rdo
5、重建日志组1、2、3
alter database add logfile group 1('/oracle/oradata/orcl/redo01.rdo') size 10m;
alter database add logfile group 2('/oracle/oradata/orcl/redo02.rdo') size 10m;
alter database add logfile group 3('/oracle/oradata/orcl/redo03.rdo') size 10m;
6、切换日志组
alter system switch logfile;
alter system switch logfile;
alter system switch logfile;

The steps to create and manage user accounts in MySQL are as follows: 1. Create a user: Use CREATEUSER'newuser'@'localhost'IDENTIFIEDBY'password'; 2. Assign permissions: Use GRANTSELECT, INSERT, UPDATEONmydatabase.TO'newuser'@'localhost'; 3. Fix permission error: Use REVOKEALLPRIVILEGESONmydatabase.FROM'newuser'@'localhost'; then reassign permissions; 4. Optimization permissions: Use SHOWGRA

MySQL is suitable for rapid development and small and medium-sized applications, while Oracle is suitable for large enterprises and high availability needs. 1) MySQL is open source and easy to use, suitable for web applications and small and medium-sized enterprises. 2) Oracle is powerful and suitable for large enterprises and government agencies. 3) MySQL supports a variety of storage engines, and Oracle provides rich enterprise-level functions.

The disadvantages of MySQL compared to other relational databases include: 1. Performance issues: You may encounter bottlenecks when processing large-scale data, and PostgreSQL performs better in complex queries and big data processing. 2. Scalability: The horizontal scaling ability is not as good as Google Spanner and Amazon Aurora. 3. Functional limitations: Not as good as PostgreSQL and Oracle in advanced functions, some functions require more custom code and maintenance.

MySQL supports four JOIN types: INNERJOIN, LEFTJOIN, RIGHTJOIN and FULLOUTERJOIN. 1.INNERJOIN is used to match rows in two tables and return results that meet the criteria. 2.LEFTJOIN returns all rows in the left table, even if the right table does not match. 3. RIGHTJOIN is opposite to LEFTJOIN and returns all rows in the right table. 4.FULLOUTERJOIN returns all rows in the two tables that meet or do not meet the conditions.

MySQL's performance under high load has its advantages and disadvantages compared with other RDBMSs. 1) MySQL performs well under high loads through the InnoDB engine and optimization strategies such as indexing, query cache and partition tables. 2) PostgreSQL provides efficient concurrent read and write through the MVCC mechanism, while Oracle and Microsoft SQLServer improve performance through their respective optimization strategies. With reasonable configuration and optimization, MySQL can perform well in high load environments.

InnoDBBufferPool reduces disk I/O by caching data and indexing pages, improving database performance. Its working principle includes: 1. Data reading: Read data from BufferPool; 2. Data writing: After modifying the data, write to BufferPool and refresh it to disk regularly; 3. Cache management: Use the LRU algorithm to manage cache pages; 4. Reading mechanism: Load adjacent data pages in advance. By sizing the BufferPool and using multiple instances, database performance can be optimized.

Compared with other programming languages, MySQL is mainly used to store and manage data, while other languages such as Python, Java, and C are used for logical processing and application development. MySQL is known for its high performance, scalability and cross-platform support, suitable for data management needs, while other languages have advantages in their respective fields such as data analytics, enterprise applications, and system programming.

MySQL is worth learning because it is a powerful open source database management system suitable for data storage, management and analysis. 1) MySQL is a relational database that uses SQL to operate data and is suitable for structured data management. 2) The SQL language is the key to interacting with MySQL and supports CRUD operations. 3) The working principle of MySQL includes client/server architecture, storage engine and query optimizer. 4) Basic usage includes creating databases and tables, and advanced usage involves joining tables using JOIN. 5) Common errors include syntax errors and permission issues, and debugging skills include checking syntax and using EXPLAIN commands. 6) Performance optimization involves the use of indexes, optimization of SQL statements and regular maintenance of databases.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

SublimeText3 English version
Recommended: Win version, supports code prompts!

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.