ORA-46340: Command cannot have both BY and IN SESSION clauses together ORACLE 报错 故障修复 远程处理

文档解释

ORA-46340: Command cannot have both BY and IN SESSION clauses together

Cause: BY clause was supplied with IN SESSION clause in the command.

Action: Use either BY or IN SESSION clause.

ORA-46340:该命令无法同时具有BY 和IN SESSION 子句。

官方解释

常见案例

SQL> ALTER SESSION SET CURRENT_SCHEMA = APP_SCHEMA BY username IN SESSION ((SCHEMA_NAME => ‘APP_SCHEMA’, SESSION_NUMBER => ‘123’));

报告了ORA-46340错误。

一般处理方法及步骤

1.仔细检查语句,删除BY子句或IN子句中出现的一个,以确保只有一个子句出现在命令中。

2.如果需要使用两个子句,则需要分成两个单独的命令。


数据运维技术 » ORA-46340: Command cannot have both BY and IN SESSION clauses together ORACLE 报错 故障修复 远程处理