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表空间已经被删除。