1 Starting Redo Apply To start apply services on a physical standby database, ensure thephysical standby database is started and mounted and then start Redo Applyusing the SQL ALTER DATABASE RECOVER MANAGED STANDBY DATABASE statement. You
1 Starting Redo Apply
To start apply services on a physical standby database, ensure thephysical standby database is started and mounted and then start Redo Applyusing the SQL ALTER DATABASE RECOVER MANAGED STANDBY DATABASE statement.
You can specify that Redo Apply runs as a foreground session or as abackground process, and enable it with real-time apply.
-
To start Redo Apply in the foreground, issue the following SQL statement:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE;
- If you start a foreground session, control is not returned to the command prompt until recovery is canceled by another session.
-
To start Redo Apply in the background, include the DISCONNECT keyword on the SQL statement. For example:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT;
alterdatabase recover managed standby database disconnect from session;
- This statement starts a detached server process and immediately returns control to the user. While the managed recovery process is performing recovery in the background, the foreground process that issued the RECOVER statement can continue performing other tasks. This does not disconnect the current SQL session.
-
To start real-time apply, include the USING CURRENT LOGFILE clause on the SQL statement. For example:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE;
alterdatabase recover managed standby database using current logfile disconnect fromsession;
2 Stopping Redo Apply
To stop Redo Apply, issue the following SQL statement:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
3 Advanced Configuration
3.1 Using Real-Time Apply to ApplyRedo Data Immediately
If the real-time apply feature is enabled, apply services can applyredo data as it is received, without waiting for the current standby redo logfile to be archived. This results in faster switchover and failover timesbecause the standby redo log files have been applied already to the standbydatabase by the time the failover or switchover begins.
Use the ALTER DATABASE statement to enable the real-time applyfeature, as follows:
- For physical standby databases, issue the ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE statement.
- For logical standby databases, issue the ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE statement.
Real-time apply requires a standbydatabase that is configured with a standby redo log and that is in ARCHIVELOGmode.
The figure belowshowsa Data Guard configuration with a local destination and a standby destination.As the remote file server (RFS) process writes the redo data to standby redolog files on the standby database, apply services can recover redo from standbyredo log files as they are being filled.
3.2 Specifying a Time Delay for theApplication of Archived Redo Log Files
In some cases, you may want to create a time lag between the timewhen redo data is received from the primary site and when it is applied to thestandby database. You can specify a time interval (in minutes) to protectagainst the application of corrupted or erroneous data to the standby database.When you set a DELAY interval, it does not delay the transport of the redo datato the standby database. Instead, the time lag you specify begins when the redodata is completely archived at the standby destination.
Note:
If you define a delay for a destination that has real-time applyenabled, the delay is ignored.
Specifying a Time Delay
You can set a time delay on primary and standby databases using theDELAY=minutes attribute of theLOG_ARCHIVE_DEST_n initializationparameter to delay applying archived redo log files to the standby database. Bydefault, there is no time delay. If you specify the DELAY attribute withoutspecifying a value, then the default delay interval is 30 minutes.
Canceling a Time Delay
You can cancel a specified delay interval as follows:
-
For physical standby databases, use the NODELAY keyword of the RECOVER MANAGED STANDBY DATABASE clause:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE NODELAY; -
For logical standby databases, specify the following SQL statement:
SQL> ALTER DATABASE START LOGICAL STANDBY APPLY NODELAY;
These commands result in apply services immediately beginning toapply archived redo log files to the standby database, before the time intervalexpires.
Using Flashback Database as anAlternative to Setting a Time Delay
As an alternative to setting an apply delay, you can use FlashbackDatabase to recover from the application of corrupted or erroneous data to thestandby database. Flashback Database can quickly and easily flash back astandby database to an arbitrary point in time.
作者:xiangsir
QQ:444367417
MSN:xiangsir@hotmail.com

ACID属性包括原子性、一致性、隔离性和持久性,是数据库设计的基石。1.原子性确保事务要么完全成功,要么完全失败。2.一致性保证数据库在事务前后保持一致状态。3.隔离性确保事务之间互不干扰。4.持久性确保事务提交后数据永久保存。

MySQL既是数据库管理系统(DBMS),也与编程语言紧密相关。1)作为DBMS,MySQL用于存储、组织和检索数据,优化索引可提高查询性能。2)通过SQL与编程语言结合,嵌入在如Python中,使用ORM工具如SQLAlchemy可简化操作。3)性能优化包括索引、查询、缓存、分库分表和事务管理。

MySQL使用SQL命令管理数据。1.基本命令包括SELECT、INSERT、UPDATE和DELETE。2.高级用法涉及JOIN、子查询和聚合函数。3.常见错误有语法、逻辑和性能问题。4.优化技巧包括使用索引、避免SELECT*和使用LIMIT。

MySQL是一种高效的关系型数据库管理系统,适用于存储和管理数据。其优势包括高性能查询、灵活的事务处理和丰富的数据类型。实际应用中,MySQL常用于电商平台、社交网络和内容管理系统,但需注意性能优化、数据安全和扩展性。

SQL和MySQL的关系是标准语言与具体实现的关系。1.SQL是用于管理和操作关系数据库的标准语言,允许进行数据的增、删、改、查。2.MySQL是一个具体的数据库管理系统,使用SQL作为其操作语言,并提供高效的数据存储和管理。

InnoDB使用redologs和undologs确保数据一致性和可靠性。1.redologs记录数据页修改,确保崩溃恢复和事务持久性。2.undologs记录数据原始值,支持事务回滚和MVCC。

EXPLAIN命令的关键指标包括type、key、rows和Extra。1)type反映查询的访问类型,值越高效率越高,如const优于ALL。2)key显示使用的索引,NULL表示无索引。3)rows预估扫描行数,影响查询性能。4)Extra提供额外信息,如Usingfilesort提示需要优化。

Usingtemporary在MySQL查询中表示需要创建临时表,常见于使用DISTINCT、GROUPBY或非索引列的ORDERBY。可以通过优化索引和重写查询避免其出现,提升查询性能。具体来说,Usingtemporary出现在EXPLAIN输出中时,意味着MySQL需要创建临时表来处理查询。这通常发生在以下情况:1)使用DISTINCT或GROUPBY时进行去重或分组;2)ORDERBY包含非索引列时进行排序;3)使用复杂的子查询或联接操作。优化方法包括:1)为ORDERBY和GROUPB


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

mPDF
mPDF是一个PHP库,可以从UTF-8编码的HTML生成PDF文件。原作者Ian Back编写mPDF以从他的网站上“即时”输出PDF文件,并处理不同的语言。与原始脚本如HTML2FPDF相比,它的速度较慢,并且在使用Unicode字体时生成的文件较大,但支持CSS样式等,并进行了大量增强。支持几乎所有语言,包括RTL(阿拉伯语和希伯来语)和CJK(中日韩)。支持嵌套的块级元素(如P、DIV),

适用于 Eclipse 的 SAP NetWeaver 服务器适配器
将Eclipse与SAP NetWeaver应用服务器集成。

WebStorm Mac版
好用的JavaScript开发工具

MinGW - 适用于 Windows 的极简 GNU
这个项目正在迁移到osdn.net/projects/mingw的过程中,你可以继续在那里关注我们。MinGW:GNU编译器集合(GCC)的本地Windows移植版本,可自由分发的导入库和用于构建本地Windows应用程序的头文件;包括对MSVC运行时的扩展,以支持C99功能。MinGW的所有软件都可以在64位Windows平台上运行。

VSCode Windows 64位 下载
微软推出的免费、功能强大的一款IDE编辑器