Oracle Data Guard_ 主库删除表空间
8.3.2 Dropping Tablespaces and Deleting Datafiles
When you delete one or more datafiles
or drop one or more tablespaces in the primary database, you also need to delete the corresponding datafiles to the standby database. The following sections provide examples of dropping
tablespaces and deleting datafiles when the STANDBY_FILE_MANAGEMENT
initialization parameter is set to AUTO
or MANUAL
.
当你在主库删除一个或多个数据文件或者删除一个或多个表空间时,你也需要在备库删除相关的数据文件,以下部分提供的例子,当STANDBY_FILE_MANAGEMENT参数设置为AUTO或者MANUAL时关于删除表空间和删除数据文件。
8.3.2.1 When STANDBY_FILE_MANAGEMENT Is Set to AUTO or MANUAL
The following procedure works whether the STANDBY_FILE_MANAGEMENT
initialization parameter is set to either MANUAL
or AUTO
, as follows:
以下的步骤不管STANDBY_FILE_MANAGEMENT参数设置为MANUAL还是AUTO,都能工作,如下:
-
Drop the tablespace from the primary database:
1.从主库删除一个表空间
SQL> DROP TABLESPACE tbs_4;SQL> ALTER SYSTEM SWITCH LOGFILE;
-
Make sure that Redo Apply is running (so that the change is applied to the standby database). If the following query returns the MRP or MRP0 process, Redo Apply is running.
确保重做应用在运行,这样备库就会应用这些变化。如果以下的查询返回的MRP或者MRP0进程,则说明重做应用在运行
SQL> SELECT PROCESS, STATUS FROM V$MANAGED_STANDBY;
To verify that deleted datafiles are no longer part of the database, query the
V$DATAFILE
view.验证已经删除的数据文件不再存在数据库中,可查询V$DATAFILE视图。
-
Delete the corresponding datafile on the standby system after the archived redo log file was applied to the standby database. For example:
在归档重做日志被应用再备库之后,在备库删除相应的数据文件,例如:
% rm /disk1/oracle/oradata/payroll/s2tbs_4.dbf
-
On the primary database, after ensuring the standby database applied the redo information for the dropped tablespace, you can remove the datafile for the tablespace. For example:
在主库中,确保备库应用删除表空间的重做信息之后,你可以从表空间移除数据文件,例如:
% rm /disk1/oracle/oradata/payroll/tbs_4.dbf
8.3.2.2 Using DROP TABLESPACE INCLUDING CONTENTS AND DATAFILES
You can issue the SQL DROP TABLESPACE INCLUDING CONTENTS AND DATAFILES
statement on the primary database to delete the datafiles on both the primary and standby databases. To use this statement, the STANDBY_FILE_MANAGEMENT
initialization
parameter must be set to AUTO
. For example, to drop the tablespace at the primary site:
你可以在主库上使用DROP TABLESPACE INCLUDING CONTENTS AND DATAFILES来删除主库和备库的数据文件,前提是STANDBY_FILE_MANAGEMENT必须设置为AUTO,例如,在主库上删除一个表空间:
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。