iis服务器助手广告广告
返回顶部
首页 > 资讯 > 数据库 >standby上增加tempfile报错ORA-00604,ORA-16000怎么办
  • 689
分享到

standby上增加tempfile报错ORA-00604,ORA-16000怎么办

2024-04-02 19:04:59 689人浏览 安东尼
摘要

这篇文章主要介绍standby上增加tempfile报错ORA-00604,ORA-16000怎么办,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!在DG中对primary增加temp

这篇文章主要介绍standby上增加tempfile报错ORA-00604,ORA-16000怎么办,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!

在DG中对primary增加tempfile不会同步到standby上,所以增加tempfile需要在standby上操作,但这次在standby上增加tempfile却报错ORA-00604 ORA-16000 (mount状态,MRP cancel 报错依旧)。

standby上增加tempfile报错ORA-00604,ORA-16000怎么办

分析:

这里ORA-00604通常是trigger在影响,因为时间紧迫没有做10046 trace,直接查询官方得到权威解释。

原来是因为DB安装了OGG其中trigger GGS_DDL_TRIGGER_BEFORE(trigger主要作用是记录DDL操作)影响到增加tempfile操作。

解决:

在primary中disable trigger GGS_DDL_TRIGGER_BEFORE 后,再standby增加tempfile成功,之后再对primary中trigger enable

官方文章:

11g Standby Unable To Add Temp File (文档 ID 2168646.1)

APPLIES TO:

oracle Database - Enterprise Edition - Version 12.1.0.2 to 12.1.0.2 [Release 12.1]
Oracle Database - Enterprise Edition - Version 11.2.0.3 to 11.2.0.4 [Release 11.2]
InfORMation in this document applies to any platform.

SYMPTOMS

This occurs in the PHYSICAL standby environment.

Alter tablespace saptmp add tempfile '+DATA'
*
ERROR at line 1:
ORA-00604: error occurred at recursive sql level 1
ORA-16000: database open for read-only access
ORA-06512: at line 1147
ORA-16000: database open for read-only access

SQL> select name, database_role, open_mode from v$database;

NAME DATABASE_ROLE OPEN_MODE
--------- ---------------- --------------------
TPS    PHYSICAL STANDBY READ ONLY

CHANGES

Database DDL trigger added in the Primary.

CAUSE

 This is due to the recent addition of the database DDL trigger added in the Primary. The changes are ransported to the Standby environment.
  When trying to add temporary tablespace(Which is a DDL) in the Standby in READ ONLY mode,it will encounter misleading error message ORA-604 and ORA-16000

SOLUTION

First step get the output from the following SQL in the customer environment, make sure to compare the tempfiles on both PRIMARY and STANDBY environment.

(Note : In rare cases, there had been error messages reported but still the tempfile was added at the database level).


Data Collection

spool standby.out


set lines 200

select name, database_role, open_mode from v$database;
select FILE_NAME,STATUS, round(BYTES/1048576) from dba_temp_files;
REM <Substitute SAPTMP with appropriate Tablespace name
select dbms_metadata.get_ddl('TABLESPACE', 'SAPTMP') from dual;

select * from dba_triggers;

spool off

spool primary.out
set lines 200
select name, database_role, open_mode from v$database;
select FILE_NAME,STATUS, round(BYTES/1048576) from dba_temp_files;
REM <Substitute SAPTMP with appropriate Tablespace name
select dbms_metadata.get_ddl('TABLESPACE', 'SAPTMP') from dual;
select * from dba_triggers;
spool off

Sample output

select name, database_role, open_mode from v$database;

NAME DATABASE_ROLE OPEN_MODE
--------- ---------------- --------------------
TP100 PRIMARY READ WRITE

SQL> select FILE_NAME,STATUS, round(BYTES/1048576) from dba_temp_files;
FILE_NAME STATUS ROUND(BYTES/1048576)
----------------------------------- --------------- --------------------
+DATA/tp100/tempfile/psaptemp.338.797514523 ONLINE 30720
+DATA/tp100/tempfile/psaptemp.12326.846224883 ONLINE 30720
+DATA/tp100/tempfile/psaptemp.15382.871981083 ONLINE 30720

select dbms_metadata.get_ddl('TABLESPACE', 'SAPTMP') from dual;

DBMS_METADATA.GET_DDL('TABLESPACE','SAPTMP')
------------------------------------------------------------------------
CREATE TEMPORARY TABLESPACE "SAPTMP" TEMPFILE SIZE 32212254720 AUTOEXT

DBA_TRIGGERS view will list the details of the trigger, for example
Trigger Type : DDL
Owner : sys
name : GGS_DDL_TRIGGER_BEFORE
status : Enabled
Before ddl on database trigger

Solution


After identifying the suspect trigger, Go ahead and disable the trigger in the PRIMARY

Example : ALTER TRIGGER sys.GGS_DDL_TRIGGER_BEFORE DISABLE;

Wait for the changes to be propagated in the STANDBY environment. Now you would be able to add the tempfile in the STANDBY using the "alter tablespace" SQL.

Despite above approach, if the error persists then follow the Troubleshooting section for further analysis.

Troubleshooting

Connect as sysdba

alter session set tracefile_identifier='add_tempfile';
alter session set events '10046 trace name context forever,level 12'
alter session set events '604 trace name ERRORSTACK level 3';
alter session set events '16000 trace name errorstack level 3';
-- (Run the Alter tablespace command here)
-- alter tablespace psaptemp add tempfile '+DATA';
-- Make sure to exit session
exit;

Identify all the tracefiles in the trace directory.
ls -al *add_tempfile*

Identify the 10046 trace and run tkprof on that tracefile

Collect the following from customer for review.

a. Upload all the raw trace files along with tkprof output file.

b. Also upload the Alert.log with the error message.

c. Output from

spool tempfile_info.out
select name, database_role, open_mode from v$database;
select file#,ts#, name,status,round(bytes/1048576),con_id from v$tempfile;
select FILE_NAME,STATUS, round(BYTES/1048576) from dba_temp_files;
REM REM <Substitute SAPTMP with appropriate Tablespace name
select dbms_metadata.get_ddl('TABLESPACE', 'SAPTMP') from dual;
select * from v#tempfile;
select * from dba_temp_files;
spool off

以上是“standby上增加tempfile报错ORA-00604,ORA-16000怎么办”这篇文章的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注编程网数据库频道!

您可能感兴趣的文档:

--结束END--

本文标题: standby上增加tempfile报错ORA-00604,ORA-16000怎么办

本文链接: https://www.lsjlt.com/news/64505.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • oracle怎么查询当前用户所有的表
    要查询当前用户拥有的所有表,可以使用以下 sql 命令:select * from user_tables; 如何查询当前用户拥有的所有表 要查询当前用户拥有的所有表,可以使...
    99+
    2024-05-14
    oracle
  • oracle怎么备份表中数据
    oracle 表数据备份的方法包括:导出数据 (exp):将表数据导出到外部文件。导入数据 (imp):将导出文件中的数据导入表中。用户管理的备份 (umr):允许用户控制备份和恢复过程...
    99+
    2024-05-14
    oracle
  • oracle怎么做到数据实时备份
    oracle 实时备份通过持续保持数据库和事务日志的副本来实现数据保护,提供快速恢复。实现机制主要包括归档重做日志和 asm 卷管理系统。它最小化数据丢失、加快恢复时间、消除手动备份任务...
    99+
    2024-05-14
    oracle 数据丢失
  • oracle怎么查询所有的表空间
    要查询 oracle 中的所有表空间,可以使用 sql 语句 "select tablespace_name from dba_tablespaces",其中 dba_tabl...
    99+
    2024-05-14
    oracle
  • oracle怎么创建新用户并赋予权限设置
    答案:要创建 oracle 新用户,请执行以下步骤:以具有 create user 权限的用户身份登录;在 sql*plus 窗口中输入 create user identified ...
    99+
    2024-05-14
    oracle
  • oracle怎么建立新用户
    在 oracle 数据库中创建用户的方法:使用 sql*plus 连接数据库;使用 create user 语法创建新用户;根据用户需要授予权限;注销并重新登录以使更改生效。 如何在 ...
    99+
    2024-05-14
    oracle
  • oracle怎么创建新用户并赋予权限密码
    本教程详细介绍了如何使用 oracle 创建一个新用户并授予其权限:创建新用户并设置密码。授予对特定表的读写权限。授予创建序列的权限。根据需要授予其他权限。 如何使用 Oracle 创...
    99+
    2024-05-14
    oracle
  • oracle怎么查询时间段内的数据记录表
    在 oracle 数据库中查询指定时间段内的数据记录表,可以使用 between 操作符,用于比较日期或时间的范围。语法:select * from table_name wh...
    99+
    2024-05-14
    oracle
  • oracle怎么查看表的分区
    问题:如何查看 oracle 表的分区?步骤:查询数据字典视图 all_tab_partitions,指定表名。结果显示分区名称、上边界值和下边界值。 如何查看 Oracle 表的分区...
    99+
    2024-05-14
    oracle
  • oracle怎么导入dump文件
    要导入 dump 文件,请先停止 oracle 服务,然后使用 impdp 命令。步骤包括:停止 oracle 数据库服务。导航到 oracle 数据泵工具目录。使用 impdp 命令导...
    99+
    2024-05-14
    oracle
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作