

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 第 4 阶段 — 验证传输的数据
<a name="phase4"></a>

## 步骤 1：检查表空间是否损坏
<a name="phase4-step1"></a>

在此步骤中，传输的表空间在目标数据库中是只读的。您可以通过运行 RMAN 命令来验证表空间是否有效，如下所示。

```
sqlplus / as sysdba;
set feedback off
set pagesize 0
set heading off
spool tbs_val.sql;
select 'validate tablespace '||tablespace_name||' check logical;' from dba_tablespaces where tablespace_name not in ('SYSTEM','SYSAUX','TEMP','USERS','UNDOTBS1','UNDOTBS2','UNDOTBS3','UNDOTBS3','UNDOTBS4');
spool off;
exit;

--Remove the first and last line in the spool file, tbs_val.sql
rman target /
RMAN> @tbs_val.sql
```

此外，您还可以检查对象的数量，例如表、索引、同义词、视图和包对象。

## 步骤 2：将目标数据库中所有传输的表空间设置为读/写
<a name="phase4-step2"></a>

```
sqlplus / as sysdba;
set feedback off
set pagesize 0
set heading off
spool tbs_rw.sql
select 'alter tablespace '||tablespace_name||' read write;' from dba_tablespaces where status='READ ONLY';
spool off;
exit;
--Remove the first and last line in the spool file, tbs_rw.sql
sqlplus / as sysdba;
SQL> @tbs_rw.sql
```