您现在的位置: 首页 > 网站导航收录 > 百科知识百科知识
ORA20001(Oracle 报错 Ora-20001)
触发器,代码,抛出ORA20001(Oracle 报错 Ora-20001)
发布时间:2019-02-08加入收藏来源:互联网点击:
最近很多小伙伴想了解ORA20001的一些资讯,今天小编整理了与ORA20001相关的信息分享给大家,一起来看看吧。
本文目录一览:
1、如何使用触发器实现ip限制用户登录 2、Oracle 报错 Ora-20001 3、oracle 触发器中抛出异常删除最新插入的行 4、PL/SQL DEBUG出现错误ORA-06512如何使用触发器实现ip限制用户登录
在Oracle里,不像MySQL那样方便,可以直接在用户上进行IP限制,Oracle要实现用户级别的IP限制,可以使用触发器来迂回实现,以下就是示例,需要的朋友可以参考下
下面是一个触发器的例子:
早誉消复制代码
代码如下:
create
or
replace
trigger
logon_ip_control
after
logon
on
database
陆知declare
ip
STRING(30);
user
STRING(30);
begin
SELECT
SYS_CONTEXT('USERENV','SESSION_USER')
into
user
from
dual;
SELECT
SYS_CONTEXT('USERENV','IP_ADDRESS')
into
ip
from
dual;
if
user='EPAY_USER'
THEN
IF
ip
not
in
('192.168.219.20','192.168.219.22')
THEN
raise_application_error(-20001,'User
'||user||'
is
not
allowed
to
connect
from
'||ip);
END
IF;
END
IF;
end;
/
该触发器对用户EPAY_USER进行了IP限制(只允许'192.168.219.20','192.168.219.22',如果需要设置IP段,用%或?代替即可,如'192.168.219.%‘)。
下面看几虚早个例子测试一下:
1)从非允许IP地址登陆
(192.168.219.21),连接失败
复制代码
代码如下:
[oracle@lxdb2
~]$
sqlplus
epay_user@pri
SQL*Plus:
Release
11.2.0.3.0
Production
on
Wed
Jul
3
19:23:48
2013
Copyrigt
(c)
1982,
2011,
Oracle.
All
rigts
reserved.
Enter
password:
ERROR:
ORA-00604:
error
occurred
at
recursive
SQL
level
1
ORA-20001:
User
EPAY_USER
is
not
allowed
to
connect
from
192.168.219.21
ORA-06512:
at
line
10
2)从允许IP地址登陆(192.168.219.22),连接成功
复制代码
代码如下:
[oracle@lxdb1
~]$
sqlplus
epay_user
SQL*Plus:
Release
11.2.0.3.0
Production
on
Wed
Jul
3
11:24:25
2013
Copyrigt
(c)
1982,
2011,
Oracle.
All
rigts
reserved.
Enter
password:
Connected
to:
Oracle
Database
11g
Enterprise
Edition
Release
11.2.0.3.0
-
64t
Production
Wit
te
Partitioning,
OLAP,
Data
Mining
and
Real
Application
Testing
options
3)从本地登陆(192.168.219.23)不受IP限制影响,连接成功
复制代码
代码如下:
[oracle@lxdb1
~]$
sqlplus
epay_user
SQL*Plus:
Release
11.2.0.3.0
Production
on
Wed
Jul
3
11:24:25
2013
Copyrigt
(c)
1982,
2011,
Oracle.
All
rigts
reserved.
Enter
password:
Connected
to:
Oracle
Database
11g
Enterprise
Edition
Release
11.2.0.3.0
-
64t
Production
Wit
te
Partitioning,
OLAP,
Data
Mining
and
Real
Application
Testing
options
Oracle 报错 Ora-20001
这应该是个bug,metalink上的说明如下
ORA-20001,ORA-2074:Consolidation Cross Instance Data Transfer [ID 469104.1] Modified 12-AUG-2010 Type PROBLEM Status MODERATED In tis Document
Symptoms
Canges
Cause
Solution
References
Platforms: 1-914CU; Tis document is being delivered to you via Oracle Support's Rapid Visility (RaV) process and terefore as not been subject to an independent tecnical review.Applies to: Oracle General Ledger - Version: 11.5.10.2 to 11.5.10.2 - Release: 11.5.10 to 11.5.10
Information in tis document applies to any platform.
SymptomsOn te Consolidation Transfer Screen, an error is received after selecting Run Options Validate Remote Sign on:
Cross Instance Data Transfer Failed due to oter Reasons. (RESULT=ORA-20001:
Oracle Error -20001:
ORA-20001: Oracle error -2074: ORA-02074: cannot SET NLS in a distributed
transaction as been detected in
fnd_global.set_nls.set_paramenters ('NLS_LANGUAGE;'AMERICAN').)
### Steps to Reproduce ###
Using GL Responsility
Navigate to CONSOLIDATION -- TRANSFER
Query for Specific mapping and execute te query.
Enter period on subsidiary
Enter period on parent
Press run options
Verify database link and responsility
Press te Validate button
Message box appears saying tat tis may take a few minutes - acknowledge message
Error box appears
CangesFND patc 11I.ATG_PF.H.RUP 5 as been applied. CauseTis is caused by Bug 6447350.
APPS Initialization uses dbms_session API to set NLS parameters tat is not supported across database links.
Fixed files:
patc/115/sql/glucirmb.pls-115.23.115103.3
patc/115/sql/glucirms.pls-115.15.115103.3
patc/115/sql/glucitrb.pls-115.36.115103.3
SolutionTo implement te solution, please execute te following steps:
1. Download and review te readme and pre-requisites for Patc 9774858.
2. Ensure tat you ave taken a backup of your system before applying
te recommended patc.
3. Apply te patc in a test environment.
4. Retest te issue.
5. Migrate te solution as appropriate to oter environments.
References
Related
Products Oracle E-Business Suite Financial Management Financial Control and Reporting Oracle General Ledger Keywords DISTRIBUTED TRANSACTIONS; DISTRIBUTED; CONSOLIDATION; CONSOLIDATION TRANSFER; 20001Errors ORA-20001; ORA-2074; PLS-115
oracle 触发器中抛出异常删除最新插入的行
第一种写法应该是不行的,必须要抛出一个错误才能阻止插入数据的动源型作,第一种写法只是将信息显示雹蔽猜出来,没有并键什么作用。
PL/SQL DEBUG出现错误ORA-06512
1. 你这个TEST,i=1, 所以肯定会trow "exception"。
2. 你的这个exception中用了 raise_application_error, 这个的作用就是定义一个用户自定义的错误轮埋梁。
3. 运行结果为:
第一行:ORA-20001: game over
第二行:ORA-6512:at line ...(第N行)
这个程序必然会抛错, 错误信息就是你自己定义的ORA-20001, 所以6512同液辩时会抛出解释啊。。
你如果把i换成其他值就不会出现信息。
6512本身并不指向错误本身, 他一般说明的是腊运某行会造成此错误信息。
以上就是ORA20001的相关信息介绍,希望能对大家有所帮助。
本文到此结束,希望对大家有所帮助呢。
上一篇:鲫组词语(鲫怎么组词?)
下一篇:返回列表
相关链接 |
||
网友回复(共有 0 条回复) |