Oracle Data Guard_ 主库添加数据文件或创建表空间
8.3Managing Primary Database Events That Affect the Standby Database
8.3 管理主库能影响备库的事件
To prevent possible problems, you must be aware of events on the primary database that affect a standby database and learn how to respond to them. This section describes these events and the recommended responses to these events.
In some cases, the events or changes that occur on a primary database are automatically propagated through redo data to the standby database and thus require no extra action on the standby database. In other cases, you might need to perform maintenance tasks on the standby database.
indicates whether or not a change made on the primary database requires additional intervention by the database administrator (DBA) to be propagated to the standby database. It also briefly describes how to respond to these events. Detailed descriptions of the responses are described in the section references provided.
The following events are automatically administered by redo transport services and Redo Apply, and therefore require no intervention by the database administrator:
A SQLALTER DATABASEstatement is issued with theENABLE THREADorDISABLE THREADclause.
The status of a tablespace changes (changes to read/write or read-only, placed online or taken offline).
A datafile is added or tablespace is created when theSTANDBY_FILE_MANAGEMENTinitialization parameter is set toAUTO.
Table 8-1 Actions Required on a Standby Database After Changes to a Primary Database
ReferenceChange Made on Primary DatabaseAction Required on Standby Database
Add a datafile or create a tablespace
添加文件或创建表空间
If you did not set theSTANDBY_FILE_MANAGEMENTinitialization parameter toAUTO, you must copy the new datafile to the standby database.
如果STANDBY_FILE_MANAGEMENT初始化参数没有设置为AUTO,那么你必须将新的数据文件拷贝到备库
Drop or delete a tablespace or datafile
删除表空间或数据文件
Delete datafiles from primary and standby databases after the archived redo log file containing theDROPorDELETEcommand was applied.
从主库删除数据文件,备库机会应用包含DROP或者DELETE命令的归档重做日志来应用
Use transportable tablespaces
使用传输表空间
Move tablespaces between the primary and standby databases.
在主备库之间移动表空间
Rename a datafile
重命名一个数据文件
Rename the datafile on the standby database.
在备库重命令数据文件
Add or drop redo log files
添加或删除重做日志文件爱你
Synchronize changes on the standby database.
在备库上同步改变
Perform a DML or DDL operation using theNOLOGGINGorUNRECOVERABLEclause
使用NOLOGGING 或者UNRECOVERABLE执行DML或者DDL操作,
Send the datafile containing the unlogged changes to the standby database.
向备库发送包含没有日志记录的文件
Change initialization parameters
改变初始化参数
Dynamically change the standby parameters or shut down the standby database and update the initialization parameter file.
动态的改变备用的参数或者关闭备库,,再更新初始化参数文件
8.3.1Adding a Datafile or Creating a Tablespace
8.3.1添加一个数据文件或者创建一个表空间
The initialization parameter,STANDBY_FILE_MANAGEMENT, enables you to control whether or not adding a datafile to the primary database is automatically propagated to the standby database, as follows:
STANDBY_FILE_MANAGEMENT初始化参数文件,能使用控制是否在添加数据文件到主库自动传播到备库,如下:
If you set theSTANDBY_FILE_MANAGEMENTinitialization parameter in the standby database server parameter file (SPFILE) toAUTO, any new datafiles created on the primary database are automatically created on the standby database as well.
如果STANDBY_FILE_MANAGEMENT这个初始化参数文件在备库中的spfile是AUTO,那么任何在主库上新创建的数据文件会自动的在备库创建。
If you do not specify theSTANDBY_FILE_MANAGEMENTinitialization parameter or if you set it toMANUAL, then you must manually copy the new datafile to the standby database when you add a datafile to the primary database.
如果STANDBY_FILE_MANAGEMENT没有设置或者设置为MANUAL,那么当你在主库添加数据文件时,你必须手动拷贝新的数据文件到备库
Note that if you copy an existing datafile from another database to the primary database, then you must also copy the new datafile to the standby database and re-create the standby control file, regardless of the setting ofSTANDBY_FILE_MANAGEMENTinitialization parameter.
注意,如果你从另一个数据库已存在的数据文件拷贝到到主库,那么你必须也要拷贝到倒库,然后重新创建备用控制文件,除非你设置了STANDBY_FILE_MANAGEMENT 初始化参数。
The following sections provide examples of adding a datafile to the primary and standby databases when theSTANDBY_FILE_MANAGEMENTinitialization parameter is set toAUTOandMANUAL,respectively.
按以下提供的例子来添加一个数据文件到主库,备库的STANDBY_FILE_MANAGEMENT分别设置为AUTO和MANUAL。
8.3.1.1When STANDBY_FILE_MANAGEMENT Is Set to AUTO

MySQL和SQLite的主要区别在于设计理念和使用场景:1.MySQL适用于大型应用和企业级解决方案,支持高性能和高并发;2.SQLite适合移动应用和桌面软件,轻量级且易于嵌入。

MySQL中的索引是数据库表中一列或多列的有序结构,用于加速数据检索。1)索引通过减少扫描数据量提升查询速度。2)B-Tree索引利用平衡树结构,适合范围查询和排序。3)创建索引使用CREATEINDEX语句,如CREATEINDEXidx_customer_idONorders(customer_id)。4)复合索引可优化多列查询,如CREATEINDEXidx_customer_orderONorders(customer_id,order_date)。5)使用EXPLAIN分析查询计划,避

在MySQL中使用事务可以确保数据一致性。1)通过STARTTRANSACTION开始事务,执行SQL操作后用COMMIT提交或ROLLBACK回滚。2)使用SAVEPOINT可以设置保存点,允许部分回滚。3)性能优化建议包括缩短事务时间、避免大规模查询和合理使用隔离级别。

选择PostgreSQL而非MySQL的场景包括:1)需要复杂查询和高级SQL功能,2)要求严格的数据完整性和ACID遵从性,3)需要高级空间功能,4)处理大数据集时需要高性能。PostgreSQL在这些方面表现出色,适合需要复杂数据处理和高数据完整性的项目。

MySQL数据库的安全可以通过以下措施实现:1.用户权限管理:通过CREATEUSER和GRANT命令严格控制访问权限。2.加密传输:配置SSL/TLS确保数据传输安全。3.数据库备份和恢复:使用mysqldump或mysqlpump定期备份数据。4.高级安全策略:使用防火墙限制访问,并启用审计日志记录操作。5.性能优化与最佳实践:通过索引和查询优化以及定期维护兼顾安全和性能。

如何有效监控MySQL性能?使用mysqladmin、SHOWGLOBALSTATUS、PerconaMonitoringandManagement(PMM)和MySQLEnterpriseMonitor等工具。1.使用mysqladmin查看连接数。2.用SHOWGLOBALSTATUS查看查询数。3.PMM提供详细性能数据和图形化界面。4.MySQLEnterpriseMonitor提供丰富的监控功能和报警机制。

MySQL和SQLServer的区别在于:1)MySQL是开源的,适用于Web和嵌入式系统,2)SQLServer是微软的商业产品,适用于企业级应用。两者在存储引擎、性能优化和应用场景上有显着差异,选择时需考虑项目规模和未来扩展性。

在需要高可用性、高级安全性和良好集成性的企业级应用场景下,应选择SQLServer而不是MySQL。1)SQLServer提供企业级功能,如高可用性和高级安全性。2)它与微软生态系统如VisualStudio和PowerBI紧密集成。3)SQLServer在性能优化方面表现出色,支持内存优化表和列存储索引。


热AI工具

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

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

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

Video Face Swap
使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

热工具

EditPlus 中文破解版
体积小,语法高亮,不支持代码提示功能

记事本++7.3.1
好用且免费的代码编辑器

SublimeText3汉化版
中文版,非常好用

Dreamweaver Mac版
视觉化网页开发工具

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