当前位置:  数据库>oracle

Oracle Data Guard_ 主库删除表空间

    来源: 互联网  发布时间:2017-06-02

    本文导语: 8.3.2Dropping Tablespaces and Deleting Datafiles 8.3.2 删除表空间和删除数据文件   When you delete one or moredatafiles 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 exa...

8.3.2Dropping Tablespaces and Deleting Datafiles
8.3.2 删除表空间和删除数据文件
 

When you delete one or moredatafiles 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 theSTANDBY_FILE_MANAGEMENTinitialization parameter is set toAUTOorMANUAL.

当你在主库删除一个或多个数据文件或者删除一个或多个表空间时,你也需要在备库删除相关的数据文件,以下部分提供的例子,当STANDBY_FILE_MANAGEMENT参数设置为AUTO或者MANUAL时关于删除表空间和删除数据文件。 

8.3.2.1When STANDBY_FILE_MANAGEMENT Is Set to AUTO or MANUAL
8.3.2.1 当STANDBY_FILE_MANAGEMENT设置为AUTO或者MANUAL时
 

The following procedure works whether theSTANDBY_FILE_MANAGEMENTinitialization parameter is set to eitherMANUALorAUTO, 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 theV$DATAFILEview.

    验证已经删除的数据文件不再存在数据库中,可查询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.2Using DROP TABLESPACE INCLUDING CONTENTS AND DATAFILES
    8.3.2.2 使用DROP TABLESPACE INCLUDING CONTENTS AND DATAFILES
     

    You can issue the SQLDROP TABLESPACE INCLUDING CONTENTS AND DATAFILESstatement on the primary database to delete the datafiles on both the primary and standby databases. To use this statement, theSTANDBY_FILE_MANAGEMENTinitialization parameter must be set toAUTO. For example, to drop the tablespace at the primary site:

    你可以在主库上使用DROP TABLESPACE INCLUDING CONTENTS AND DATAFILES来删除主库和备库的数据文件,前提是STANDBY_FILE_MANAGEMENT必须设置为AUTO,例如,在主库上删除一个表空间:

     

    SQL> DROP TABLESPACE INCLUDING CONTENTS AND DATAFILES tbs_4;
    SQL> ALTER SYSTEM SWITCH LOGFILE;
     
    ###########################################################################################################
     
    1.首先查看STANDBY_FILE_MANAGEMENT参数是否设置为AUTO
    SYS@PRODSTD>show parameter STANDBY_FILE_MANAGEMENT
     
    NAME TYPE VALUE
    ------------------------------------ ----------- ------------------------------
    standby_file_management string AUTO
     
    2.查看两边的表空间以及数据文件
    主库:
    SYS@PROD>select file_name,tablespace_name from dba_data_files;
     
    FILE_NAME TABLESPACE_NAME
    -------------------------------------------------- ------------------------------
    /u01/app/oracle/oradata/PROD/Disk1/system01.dbf SYSTEM
    /u01/app/oracle/oradata/PROD/Disk1/undotbs01.dbf UNDOTBS1
    /u01/app/oracle/oradata/PROD/Disk1/sysaux01.dbf SYSAUX
    /u01/app/oracle/oradata/PROD/Disk1/example01.dbf EXAMPLE
    /u01/app/oracle/oradata/PROD/Disk1/users01.dbf USERS
    /u01/app/oracle/oradata/PROD/Disk1/swtich_tbs01.db SWTICH_TBS
    f
     
     
    6 rows selected.
     
    备库:
    SYS@PRODSTD>select name from v$datafile;
     
    NAME
    --------------------------------------------------------------------------------
    /u01/app/oracle/oradata/PRODSTD/Disk1/system01.dbf
    /u01/app/oracle/oradata/PRODSTD/Disk1/undotbs01.dbf
    /u01/app/oracle/oradata/PRODSTD/Disk1/sysaux01.dbf
    /u01/app/oracle/oradata/PRODSTD/Disk1/example01.dbf
    /u01/app/oracle/oradata/PRODSTD/Disk1/PRODSTD/datafile/o1_mf_swtich_t_9m21f1f0_.
    dbf
     
    /u01/app/oracle/oradata/PRODSTD/Disk1/users01.dbf
     
    6 rows selected.
     
    3.在主库执行删除表空间及数据文件
    SYS@PROD>drop tablespace SWTICH_TBS including contents and datafiles;
     
    Tablespace dropped.
     
    ------------------------------------------------------------------------------------------
    主库告警日志:
    Sun Mar 30 10:47:37 2014
    drop tablespace SWTICH_TBS including contents and datafiles
    Sun Mar 30 10:47:42 2014
    Deleted file /u01/app/oracle/oradata/PROD/Disk1/swtich_tbs01.dbf
    Completed: drop tablespace SWTICH_TBS including contents and datafiles
    ------------------------------------------------------------------------------------------
    4.再次查看两边的表空间以及数据文件
    主库:
    SYS@PROD>select file_name,tablespace_name from dba_data_files;
     
    FILE_NAME TABLESPACE_NAME
    -------------------------------------------------- ------------------------------
    /u01/app/oracle/oradata/PROD/Disk1/system01.dbf SYSTEM
    /u01/app/oracle/oradata/PROD/Disk1/undotbs01.dbf UNDOTBS1
    /u01/app/oracle/oradata/PROD/Disk1/sysaux01.dbf SYSAUX
    /u01/app/oracle/oradata/PROD/Disk1/example01.dbf EXAMPLE
    /u01/app/oracle/oradata/PROD/Disk1/users01.dbf USERS
     
    备库:
    SYS@PRODSTD>select name from v$datafile;
     
    NAME
    --------------------------------------------------------------------------------
    /u01/app/oracle/oradata/PRODSTD/Disk1/system01.dbf
    /u01/app/oracle/oradata/PRODSTD/Disk1/undotbs01.dbf
    /u01/app/oracle/oradata/PRODSTD/Disk1/sysaux01.dbf
    /u01/app/oracle/oradata/PRODSTD/Disk1/example01.dbf
    /u01/app/oracle/oradata/PRODSTD/Disk1/PRODSTD/datafile/o1_mf_swtich_t_9m21f1f0_.dbf
    /u01/app/oracle/oradata/PRODSTD/Disk1/users01.dbf
     
    6 rows selected.
    此时主库的归档重做日志还没有传到备库。
    5.手动切换日志,同步主备库,让备库应用重做日志。
    SYS@PROD>alter system switch logfile;
     
    System altered.
    -------------------------------------------------------------------------------------------
    主库告警日志:
    LNS1 started with pid=57, OS id=3000
    Sun Mar 30 10:58:08 2014
    Thread 1 advanced to log sequence 34
    Current log# 2 seq# 34 mem# 0: /u01/app/oracle/oradata/PROD/Disk1/redo02.log
    Current log# 2 seq# 34 mem# 1: /u01/app/oracle/oradata/PROD/Disk2/redo02_1.log
    Sun Mar 30 10:58:10 2014
    LNS: Standby redo logfile selected for thread 1 sequence 34 for destination LOG_ARCHIVE_DEST_2
    Sun Mar 30 10:58:11 2014
    ARC5: Standby redo logfile selected for thread 1 sequence 33 for destination LOG_ARCHIVE_DEST_2
     
    备库告警日志:
     
    Sun Mar 30 10:58:11 2014
    Redo Shipping Client Connected as PUBLIC
    -- Connected User is Valid
    RFS[3]: Assigned to RFS process 2939
    RFS[3]: Identified database type as 'physical standby'
    Sun Mar 30 10:58:11 2014
    Redo Shipping Client Connected as PUBLIC
    -- Connected User is Valid
    RFS[4]: Assigned to RFS process 2941
    RFS[4]: Identified database type as 'physical standby'
    Primary database is in MAXIMUM PERFORMANCE mode
    Primary database is in MAXIMUM PERFORMANCE mode
    RFS[4]: Successfully opened standby log 6: '/u01/app/oracle/oradata/PRODSTD/Disk1/standby06.log'
    Sun Mar 30 10:58:12 2014
    RFS[3]: Successfully opened standby log 7: '/u01/app/oracle/oradata/PRODSTD/Disk1/standby07.log'
    Sun Mar 30 10:58:17 2014
    Media Recovery Log /u01/app/oracle/oradata/PRODSTD/Disk2/arch/1_33_842523531.arc
    Recovery deleting file #5:'/u01/app/oracle/oradata/PRODSTD/Disk1/PRODSTD/datafile/o1_mf_swtich_t_9mh1rzf6_.dbf' from controlfile.
    Deleted Oracle managed file /u01/app/oracle/oradata/PRODSTD/Disk1/PRODSTD/datafile/o1_mf_swtich_t_9mh1rzf6_.dbf
    Recovery dropped tablespace 'SWTICH_TBS'
    Media Recovery Waiting for thread 1 sequence 34 (in transit)
    -----------------------------------------------------------------------------------------------------------
    6.查看备库数据文件
    SYS@PRODSTD>select file#,name from v$datafile;
     
    FILE# NAME
    ---------- -------------------------------------------------------
    1 /u01/app/oracle/oradata/PRODSTD/Disk1/system01.dbf
    2 /u01/app/oracle/oradata/PRODSTD/Disk1/undotbs01.dbf
    3 /u01/app/oracle/oradata/PRODSTD/Disk1/sysaux01.dbf
    4 /u01/app/oracle/oradata/PRODSTD/Disk1/example01.dbf
    7 /u01/app/oracle/oradata/PRODSTD/Disk1/users01.dbf
     
    此时备库的SWITCH_TBS表空间已经被删除。

     

    相关参考:

    Oracle Data Guard 重要配置参数

    基于同一主机配置 Oracle 11g Data Guard

    探索Oracle之11g DataGuard

    Oracle Data Guard (RAC+DG) 归档删除策略及脚本

    Oracle Data Guard 的角色转换

    Oracle Data Guard的日志FAL gap问题

    Oracle 11g Data Guard Error 16143 Heartbeat failed to connect to standby 处理方法


        
     
     

    您可能感兴趣的文章:

  • 请教:为什么删除不掉?我用超级用户删除某一文件夹rm -R oracle失败。
  • 在linux 中如何删除oracle db 与卸载oracle.
  • Oracle删除表前判断表名是否存在若存在则删除
  • oracle创建删除用户示例分享(oracle删除用户命令及授权)
  • oracle 彻底删除方法
  • Oracle删除后不能重新安装的解决方法
  • ubuntu如何彻底删除oracle
  • 彻底删除Oracle数据库的方法
  • Oracle删除当前用户下所有表的方法适用于有或没有删除权限
  • shell脚本操作oracle删除表空间、创建表空间、删除用户
  • 技巧分享 删除Oracle10G中的垃圾表
  • Oracle删除带有空格的表
  • 请问怎么用jsp语句删除oracle中的一条记录?
  • Linux环境下完全删除Oracle
  • oracle怎么删除用户提供解决方案
  • linux下如何卸载oracle?直接删除就可以么??
  • oracle单库彻底删除干净的执行步骤
  • 删除Oracle中奇怪的表名称BIN$…的方法
  • linux oracle数据库删除操作指南
  • oracle数据库添加或删除一列的sql语句
  • [Oracle] Data Guard 之 Redo传输详解
  • [Oracle] Data Guard 之 三种保护模式介绍
  • [Oracle] Data Guard 之 浅析Switchover与Failover
  • [Oracle] Data Guard CPU/PSU补丁安装详细教程
  •  
    本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
    本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。












  • 相关文章推荐
  • Oracle 12c发布简单介绍及官方下载地址
  • 在linux下安装oracle,如何设置让oracle自动启动!也就是让oracle那个服务自动启动,不是手动的
  • oracle 11g最新版官方下载地址
  • 请问su oracle 和su - oracle有什么不同?
  • Oracle 数据库(oracle Database)Select 多表关联查询方式
  • 虚拟机装Oracle R12与Oracle10g
  • Oracle数据库(Oracle Database)体系结构及基本组成介绍
  • Oracle 数据库开发工具 Oracle SQL Developer
  • 如何设置让Oracle SQL Developer显示的时间包含时分秒
  • Oracle EBS R12 支持 Oracle Database 11g
  • Oracle 10g和Oracle 11g网格技术介绍
  • SCO unix下安装oracle,但没有光盘,请大家推荐一个oracle下载站点(unix版本的)。谢谢!!!!
  • oracle中如何把表中具有相同值列的多行数据合并成一行
  • 请问大家用oracle数据库, 用import oracle.*;下的东西么? 还是用标准库?
  • Oracle 数据库(oracle Database)性能调优技术详解
  • Linux /$ORACLE_HOME $ORACLE_HOME
  • ORACLE日期相关操作
  • Linux系统下Oracle的启动与Oracle监听的启动
  • ORACLE数据库常用字段数据类型介绍
  • 请问在solaris下安装ORACLE,用root用户和用oracle用户安装有什么区别么?
  • Oracle 12c的九大最新技术特性介绍
  • 网间Oracle的连接,远程连接Oracle服务器??


  • 站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,