错误一:在配置完源库和目标数据库后,创建复制管理员。连接上复制管理员后,在源库执行MAINTAIN_TABLE过程:
declarev_tables DBMS_UTILITY.UNCL_ARRAY; beginv_tables(1) := 'hr.test01';v_tables(2) := 'hr.test02';v_tables(3) := 'hr.test03';dbms_streams_adm.maintain_tables(table_names => v_tables,source_directory_object => null,destination_directory_object => null,source_database => 'orcl.net',destination_database => 'weber.net',perform_actions => true,bi_directional => true,include_ddl => true,instantiation => dbms_streams_adm.instantiation_table_network); end; /
就发现是这个错误:
就发现是这个错误:
ERROR at line 1: ORA-23616: Failure in executing block 22 for script 06F6BBB2E70137C5E05054B4F621416C ORA-06512: at "SYS.DBMS_RECOVERABLE_SCRIPT", line 593 ORA-06512: at "SYS.DBMS_RECOVERABLE_SCRIPT", line 616 ORA-06512: at "SYS.DBMS_STREAMS_MT", line 7747 ORA-06512: at "SYS.DBMS_STREAMS_ADM", line 2458 ORA-06512: at line 7
解决方案:
解决方案:
通过捕获源库的执行脚本,根据错误id找到是第几步执行出错
select invoking_package_owner as owner,invoking_package as package,invoking_procedure as procedure,status,total_blocks,done_block_numfrom dba_recoverable_script8 where script_id = '06F6BBB2E70137C5E05054B4F621416C'9 ;OWNER PACKAGE ------------------------------ ------------------------------ PROCEDURE STATUS TOTAL_BLOCKS DONE_BLOCK_NUM ------------------------------ ------------ ------------ -------------- SYS DBMS_STREAMS_ADM MAINTAIN_TABLES ERROR 48 21
再查一下究竟是什么原因:
select error_number, error_messagefrom dba_recoverable_script_errors3 where script_id = '06F6BBB2E70137C5E05054B4F621416C' and block_num=22;ERROR_NUMBER ------------ ERROR_MESSAGE ---------------------------------------------------------------------------------25153 ORA-25153: Temporary Tablespace is Empty
原来是临时表空间报错报空。那么就查一下源库的临时文件情况,结果显示存在。那就纳闷了。
SQL> select tablespace_name,file_name from dba_temp_files2 ;TABLESPACE_NAME ------------------------------ FILE_NAME -------------------------------------------------------------------------------- TEMP /u01/app/oracle/oradata/orcl/temp01.dbf
再查一下目标数据库的临时文件:
SQL> select name from v$tempfile;no rows selected
擦,居然没有,这个时候就基本可以发现了是这个问题。把目标数据库的临时文件加上去就好了。
alter tablespace temp add tempfile '/u01/app/oracle/oradata/weber/temp01.dbf';Tablespace altered.
再次执行在源库执行MAINTAIN_TABLE过程。OK,发现没有报错!