ORACLE搭建Stream过程中报错【error收集】

时间:2021-08-06 22:47:54
ORACLE搭建Stream过程中报错【error收集】

错误一:在配置完源库和目标数据库后,创建复制管理员。连接上复制管理员后,在源库执行MAINTAIN_TABLE过程:

declare
v_tables DBMS_UTILITY.UNCL_ARRAY;
begin
v_tables() := 'hr.test01';
v_tables() := 'hr.test02';
v_tables() := '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 :
ORA-: Failure in executing block for script
06F6BBB2E70137C5E05054B4F621416C
ORA-: at "SYS.DBMS_RECOVERABLE_SCRIPT", line
ORA-: at "SYS.DBMS_RECOVERABLE_SCRIPT", line
ORA-: at "SYS.DBMS_STREAMS_MT", line
ORA-: at "SYS.DBMS_STREAMS_ADM", line
ORA-: at line

解决方案:

解决方案:

通过捕获源库的执行脚本,根据错误id找到是第几步执行出错

select invoking_package_owner as owner,
invoking_package as package,
invoking_procedure as procedure,
status,
total_blocks,
done_block_num
from dba_recoverable_script
where script_id = '06F6BBB2E70137C5E05054B4F621416C'
; OWNER PACKAGE
------------------------------ ------------------------------
PROCEDURE STATUS TOTAL_BLOCKS DONE_BLOCK_NUM
------------------------------ ------------ ------------ --------------
SYS DBMS_STREAMS_ADM
MAINTAIN_TABLES ERROR

再查一下究竟是什么原因:

select error_number, error_message
from dba_recoverable_script_errors
where script_id = '06F6BBB2E70137C5E05054B4F621416C' and block_num=; ERROR_NUMBER
------------
ERROR_MESSAGE
--------------------------------------------------------------------------------
-
ORA-: Temporary Tablespace is Empty

原来是临时表空间报错报空。那么就查一下源库的临时文件情况,结果显示存在。那就纳闷了。

SQL> select tablespace_name,file_name from dba_temp_files
; 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,发现没有报错!