SQL中的感叹号(Oracle) [英] Exclamation mark in SQL (Oracle)

查看:1107
本文介绍了SQL中的感叹号(Oracle)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的数据库中查看V $ SQL时,我刚刚发现了一个奇怪的查询,看起来像是:

Looking at V$SQL in my database, I have just found a strange query that looks like :

UPDATE "MYTABLE" "A1" SET "SOMECOLUMN" = (
    SELECT "A2"."ANOTHERCOLUMN" 
    FROM "ANOTHERTABLE"@! "A2" 
    WHERE "A2".ROWID=:B1
)

有人知道语法@!的含义吗?

Does anyone know the meaning of the syntax @!

我以前从未在Oracle中见过类似的东西

I have never seen something like it before in Oracle

谢谢

推荐答案

这是源自远程数据库的查询.使用@DB_NAME语法在远程数据库的查询中引用了您在V $ SQL中看到此查询的数据库

It's a query that has originated on a remote database. The database where you've seen this query in V$SQL has been referenced in the query on the remote database using the @DB_NAME syntax

远程数据库已将查询推送到您的数据库中以便执行,但是要回答该查询,您的数据库需要从远程数据库中拉回一些信息.这是@!进来,基本上它是对查询源自

The remote database has pushed the query to your database for execution, but to answer the query, your database needs to pull some information back from the remote database. This is where the @! comes in, basically it's a reference back to the database where the query originated from

例如,创建一个测试数据库链接(甚至指向同一数据库),然后运行以下命令:

For example, create a test database link, even to the same database, and run this:

alter system flush shared_pool;
select sysdate from dual@myself;
select sql_text from gv$sql where sql_fulltext like '%@!%';

SQL_TEXT
--------
SELECT SYSDATE@! FROM "DUAL" "A1"

这篇关于SQL中的感叹号(Oracle)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆