GotoWorkspace in after Logon trigger
Our users want to switch automatically to the last workspace they use when they connect. Because they can use one of several applications, I decided to put this feature in a logon after tripping on the database.
The trigger, the tables and procedures are owned by the user WM_UTILS:
----------------------------
create table wm_utils.recent_user_workspaces
(username varchar2 (30 bytes) primary key
nom_espace_de_travail varchar2 (30 byte));
create or replace procedure wm_utils.goto_last_workspace authid current_user as
pragma autonomous_transaction;
last_workspace varchar2 (30);
Start
last_workspace: = get_last_workspace();
If (last_workspace is not null) then
dbms_wm. GotoWorkspace (last_workspace);
end if;
commit;
end;
create or replace procedure wm_utils. set_last_workspace (workspace in varchar2) as
Start
merge into recent_user_workspaces
using double on (username = user)
When not matched then insert (username, nom_espace_de_travail) values (user, workspace)
when matched, then update set nom_espace_de_travail = workspace;
end;
create or replace function wm_utils. get_last_workspace return varchar2 as
workspace varchar2 (30);
Start
Select nom_espace_de_travail
in the workspace
of recent_user_workspaces
where username = user;
Returns the workspace;
exception
When NO_DATA_FOUND then
Returns a null value.
end;
create or replace procedure wm_utils.goto_workspace (workspace in varchar2) authid CURRENT_USER as
PRAGMA AUTONOMOUS_TRANSACTION;
Start
dbms_wm. GotoWorkspace (workspace);
set_last_workspace (Workspace);
commit;
end;
create or replace trigger wm_utils.on_login
After logon on database
Start
goto_last_workspace();
exception
while others then
null;
end;
------------------------------------------------------
Call wm_utils.goto_workspace instead of dbms_wm. GotoWorkspace if they want to remember their choice for their next login.
The problem is that this operation fails with the error "ORA-20073: sufficient privileges to ACCESS the workspace: 'TEST_WORKSPACE'." It is a work space owned by the user attempting to log on, but there no privileges granted explicitly. The user can call wm_utils.goto_last_workspace () to be identified and it works. Y at - it something on the way in which work orders that would prevent from working in a trigger AFTER logon?
Hello
Triggers have the same privileges as a DEFINER procedure/function. So, once the wm_utils.on_login trigger is executed when a user connects to the database, all the procedures performed as a result of the trigger are executed with the privileges of the wm_utils schema. This includes even those defined as authid current_user, since at this moment in time wm_util is essentially the user that executes the procedure. So, you can create a DEFINER rights procedure in the scheme of each user to manage dbms_wm of execution. GotoWorkspace which will remove the privileges of the user running, or give the privilege of system ACCESS_ANY_WORKSPACE wm_utils schema using dbms_wm. GrantSystemPriv.
Kind regards
Ben
Tags: Database
Similar Questions
-
Hello
I use the 11.2.0.3.0 Oracle version.
I created a trigger to restrict specific users (logging of specific program and having specific OSUSER) from loging in the database.
I created under triggers in the SYS schema.CREATE OR REPLACE TRIGGER t1
AFTER
OPENING OF SESSION
WE DATABASE
DECLARE
trg_program varchar2 (4000);
trg_user varchar2 (4000);
trg_osuser varchar2 (4000);
v_killsession VARCHAR2 (4000);
v_sid VARCHAR2 (4000);
v_serial VARCHAR2 (4000);
BEGIN
SELECT TOP (program), SUPERIOR (USERNAME), SUPERIOR (OSUSER), SID, serial #.
IN trg_program, trg_user, trg_osuser, v_sid, v_serial
SESSION $ v
WHERE audsid = SYS_CONTEXT ('USERENV', 'SESSIONID') AND ROWNUM = 1;
IF trg_program IN ('SQLPLUS.) EXE ',' SQLPLUSW. EXE ',' TOAD. EXE')
AND trg_user in ("USER1", "User2")-, "SYS", "SYSTEM")
- AND trg_osuser not in ('O12345')
THEN
raise_application_error (-20001, "You are not authorized to connect directly to this pattern!'");
END IF;
END;
/
When I log in User1 by sqlplus/Toad, it works very well, I get the required message that is referred to as "raise the application error".but when I'm compiling the relaxation by uncommenting additional condition for OSUSER IE trg_osuser not in ('O12345') in the code of the trigger, so that this will not affect the summer strongly user (i.e. OSUSER O12345). During the connection to the USER1 user I get below error
ERROR:
ORA-04045: errors during recompilation/revalidation of
XIGNCMN. RESTRICT_UNAUTH_ACCESS
ORA-01031: insufficient privilegesIt would alow me to access because I'm OSUSER 'O12345', then why his does not work?
933257 wrote:
I created under triggers in the SYS schema.
Bad idea. Never create objects in the SYS schema.
933257 wrote:
ORA-01031: insufficient privileges
You must have the privilege to ADMINISTRATION the TRIGGERS of DATABASE to compile / recompile database trigger.
SY.
-
Hi all
I need to trigger for each logon after, change the profile to test.
CREATE OR REPLACE TRIGGER TESTE_LOGON
AFTER LOGON ON DATABASE
BEGIN
EDIT the PROFILE USER X test;
END;
What I'll put in variabile x to effect each user who will connect?
tnhaks
PauloYes each connection the altar of user x will be held,
You should take the user to the help:CREATE OR REPLACE TRIGGER TESTE_LOGON AFTER LOGON ON DATABASE DECLARE current_usr varchar2(100); BEGIN current_usr := sys_context('USERENV', 'SESSION_USER'); execute immediate 'ALTER USER'|| current_usr ||'PROFILE test'; END;
Oded
[www.dbsnaps.com]
[www.orbiumsoftware.com]Published by: Oded Raz July 2, 2009 21:18
-
When clause is missing from the logon trigger
I have a questions that looks very similar to 14840619 of Bug - FORUM - RELAXATION-CLAUSE WHEN NOT WATCH if ONLY a BASIC USER PRIVILEGES
Assuming that SCOTT is a DBA and it issues the following command to create a logon trigger.
CREATE OR REPLACE TRIGGER "SYSTEM". "SCOTT_LOGON_TRG" AFTER LOGON ON DATABASE.
WHEN BEGIN (USER in ("SCOTT"))
RUN IMMEDIATELY 'ALTER SESSION SET EVENTS "TRACE NAME CONTEXT FOREVER, LEVEL 12 10046" ';
END;
/
ALTER TRIGGER 'SYSTEM '. "" SCOTT_LOGON_TRG "DISABLE;
The trigger is created successfully.
When you view the trigger of the developer sql code I don't see the WHEN clause.
IM using sql developer version 4.0.1.14 (Build hand 14.48) 64-bit on Windows 7
Is this a known bug?
Thank you
I created a service request with the support of the Oracle, and they were able to reproduce the issues.
Here is the related bug number
Bug 18603106 : WHEN CLAUSE is MISSING THE LOGON TRIGGER
-
Hello
I have create a trigger to kill the unwanted remote sessions to help AFTER logon ON DATABASE.
But the session is killed after about 30 seconds. Until the time ' select distinct username, status from v$ session; "reflecting the situation as inactive instead of 'KILLED '.
Once the State takes the session killed get immediately terminated.
I can understand if the status is killed and waiting for a period of time as it will only mark he shot and async... killés the session in a few seconds.
but I'm not able to follow why it shows almost 30 second INACTIVE status.
Thank you
Ajay
Hello
You should not need to kill just raise an exception in the logon trigger that will kick to it-see this example on asktom
http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:3236035522926
See you soon,.
Rich
-
Logon trigger does not not on DB-Link?
Hi all
I have a serious question on the table access via a database link.
I have three schemas:
DATA@SOURCE
INTERFACE@SOURCE
WORK@TARGET
DATA schema has a table called T1
The scheme of the INTERFACE has select privileges on all the DATA tables. In addition, INTERFACE schema has a logon trigger change the "current schema" data:
CREATE OR REPLACE TRIGGER TRG_A_LOGIN_SET_SCHEMA AFTER LOGON ON INTERFACE.SCHEMA BEGIN execute immediate 'ALTER SESSION SET CURRENT_SCHEMA = DATA'; END;
The scheme of WORK has a link database to the schema of the INTERFACE called INT_DB_LINK.
I am now logged in the scheme of WORK on the TARGET database and I will execute following statement:
select a from T1@INT_DB_LINK
-> it works
Then I run
declare cursor c is select a from T1@INT_DB_LINK where rownum<2; begin for r in c loop null; end loop; end;
It does not work. Error message is ORA-000942: table or view does not exist.
But why?
Can someone help me?
Thanks in advance
Py
Hi all
After a long, very long search I found what caused this strange behavior.
The error ORA - was not triggered by the SQL execution engine, but by the SQL-parser/SQL-Validation.
The second statement is that an anonymous block of SQL Oracle parser checks all the dependencies of objects before execution.
This means that a connection is established to the TARGET to SOURCE checking if table T1 is available. The strange thing is
that, in this respect the "ALTER SESSION" trigger is not fired. If the Analyzer does not find the object T1 in schema INTERFACE.
If I create an empty table T1 in INTERFACE the anonymous block gets analysis/validated and the statement is executed. But this
time the block made a normal life 'connect session' and the trigger is triggered. This means that statements access table T1
DATA schema. (But T1 in the INTERFACE should be existing this analysis/validation works)
I don't know if it's a bug or a feature.
To work around this I created private synonyms in the diagram pointing to DATA objects INTERFACE.
Thanks for your help!
Py
------
regarding the other question:
Yes, the permissions are granted on a role.
-
In NLS_SESSION_PARAMETERS logon trigger does not
Hello
I have a problem with a logon trigger setting session parameters:
After I connect, the new row is added to the table, but the session parameters are completely intact.create or replace TRIGGER standard.after_logon_trg AFTER LOGON ON STANDARD.SCHEMA BEGIN DBMS_APPLICATION_INFO.set_module(USER, 'Initialized'); EXECUTE IMMEDIATE ('ALTER SESSION SET current_schema=standard'); EXECUTE IMMEDIATE ('ALTER SESSION SET NLS_DATE_LANGUAGE=''AMERICAN'''); EXECUTE IMMEDIATE ('ALTER SESSION SET NLS_TERRITORY=''AMERICA'''); EXECUTE IMMEDIATE ('ALTER SESSION SET NLS_TIMESTAMP_FORMAT=''HH24:mi:ss'''); EXECUTE IMMEDIATE ('ALTER SESSION SET NLS_DATE_FORMAT=''YYYY-MM-DD'''); EXECUTE IMMEDIATE ('ALTER SESSION SET NLS_COMP=LINGUISTIC'); EXECUTE IMMEDIATE ('ALTER SESSION SET NLS_SORT=BINARY_CI'); insert into standard.testcc (bezeichnung, datum) values ('logontrigger', SYSDATE); END;
Select * from NLS_SESSION_PARAMETERS says:
If I run the ALTER SESSION statements in the sql (standard user) console, they work perfectly, so this seems to be without end of permission.NLS_LANGUAGE GERMAN NLS_TERRITORY GERMANY NLS_CURRENCY € NLS_ISO_CURRENCY GERMANY NLS_NUMERIC_CHARACTERS ,. NLS_CALENDAR GREGORIAN NLS_DATE_FORMAT DD.MM.RR NLS_DATE_LANGUAGE GERMAN NLS_SORT GERMAN NLS_TIME_FORMAT HH24:MI:SSXFF NLS_TIMESTAMP_FORMAT DD.MM.RR HH24:MI:SSXFF NLS_TIME_TZ_FORMAT HH24:MI:SSXFF TZR NLS_TIMESTAMP_TZ_FORMAT DD.MM.RR HH24:MI:SSXFF TZR NLS_DUAL_CURRENCY € NLS_COMP BINARY NLS_LENGTH_SEMANTICS BYTE NLS_NCHAR_CONV_EXCP FALSE
Which is wrong with the trigger?
Thanks and greetings
Christian
Published by: 853536 on 20.04.2011 00:31
OK, I traced the entire database and discovered that my settings are overwritten. So after that my trigger has been executed, the NLS Session parameters are changed, for example:
This explains why they are crushed, but I still don't know why the session parameters are changed after my trigger at all. Any idea?===================== PARSING IN CURSOR #4 len=386 dep=0 uid=40 oct=3 lid=40 tim=4721509708 hv=302297662 ad='ab275c28' select parameter,value from nls_session_parameters union all SELECT 'DB_TIMEZONE' name, DBTIMEZONE value FROM DUAL union all SELECT 'SESSION_TIMEZONE' name, SESSIONTIMEZONE value FROM DUAL union all SELECT 'SESSION_TIMEZONE_OFFSET' name, TZ_OFFSET(SESSIONTIMEZONE) value from DUAL union all SELECT parameter, value FROM nls_database_parameters WHERE parameter='NLS_CHARACTERSET' END OF STMT PARSE #4:c=0,e=3962,p=0,cr=4,cu=0,mis=1,r=0,dep=0,og=1,tim=4721509705 EXEC #4:c=0,e=21,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,tim=4721509816 FETCH #4:c=0,e=111,p=0,cr=0,cu=0,mis=0,r=10,dep=0,og=1,tim=4721509976 FETCH #4:c=0,e=132,p=0,cr=0,cu=0,mis=0,r=10,dep=0,og=1,tim=4721510598 FETCH #4:c=0,e=204,p=0,cr=3,cu=0,mis=0,r=1,dep=0,og=1,tim=4721511118 STAT #4 id=1 cnt=21 pid=0 pos=1 obj=0 op='UNION-ALL (cr=3 pr=0 pw=0 time=264 us)' STAT #4 id=2 cnt=17 pid=1 pos=1 obj=0 op='FIXED TABLE FULL X$NLS_PARAMETERS (cr=0 pr=0 pw=0 time=128 us)' STAT #4 id=3 cnt=1 pid=1 pos=2 obj=0 op='FAST DUAL (cr=0 pr=0 pw=0 time=1 us)' STAT #4 id=4 cnt=1 pid=1 pos=3 obj=0 op='FAST DUAL (cr=0 pr=0 pw=0 time=0 us)' STAT #4 id=5 cnt=1 pid=1 pos=4 obj=0 op='FAST DUAL (cr=0 pr=0 pw=0 time=1 us)' STAT #4 id=6 cnt=1 pid=1 pos=5 obj=96 op='TABLE ACCESS FULL PROPS$ (cr=3 pr=0 pw=0 time=194 us)' ===================== PARSING IN CURSOR #3 len=41 dep=0 uid=40 oct=42 lid=40 tim=4721512239 hv=2321140216 ad='ab275184' alter session set NLS_TERRITORY='GERMANY' END OF STMT PARSE #3:c=0,e=329,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=1,tim=4721512236 EXEC #3:c=0,e=48,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,tim=4721512424 ===================== PARSING IN CURSOR #2 len=35 dep=0 uid=40 oct=42 lid=40 tim=4721513208 hv=2785092162 ad='ab274e88' alter session set NLS_SORT='GERMAN' END OF STMT PARSE #2:c=0,e=283,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=1,tim=4721513205 EXEC #2:c=0,e=20,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,tim=4721513370 ===================== ...
Published by: 853536 on 20.04.2011 01:24
Problem solved: I was using Oracle SQL Developer to change my trigger and try it - and Developer SQL seems ovewrite the NLS_Session settings. Duh.
Published by: 853536 on 20.04.2011 02:04Yes, SQL Developer usually replace the settings. It should not do this if you go to tools-> Preferences-> database-> NLS and mark 'Skip NLS Settings'.
But any program using JDBC OCI will also replace most of the settings. Therefore, don't rely on the database to set the NLS parameters. It's applications to properly prepare the environment of the NLS (if the standard initialization based on the settings of operating system and/or NLS_LANG is not satisfactory).
-Sergiusz
-
Limit user connections using a Logon trigger
Hi all
I'm now restrict selected terminals user connections, using the following logon trigger.
It allows users with user with DBA privileges.
How to restrict privileged users DBA?
Note:-by my application needs privileged DBA.
CREATE OR REPLACE TRIGGER on_logon
AFTER LOGON
WE DATABASE
DECLARE
VPROGRAM VARCHAR2 (30);
VUserName VARCHAR2 (30);
VTERMINAL VARCHAR2 (30);
CURSOR user_prog IS
SELECT UPPER (program), UPPER (username), NVL (TERMINAL, 'X') OF v$ session
WHERE the audsid = sys_context ('USERENV', 'SESSIONID');
BEGIN
OPEN user_prog.
EXTRACT the user_prog IN Vprogram, Vusername VTERMINAL;
IF VTERMINAL NOT IN ("APP1", "APP2", "APP3")+.
and Vusername = "ABUL"+.
THEN
RAISE_APPLICATION_ERROR (-20001, 'you are not allowed to log');
END IF;
CLOSE User_prog;
END;
Thanks I advance
-
ABKYour application needs the role DBA? This is a terrible design - it violates all the principles of secure coding.
Connection triggers trigger for users with the role of s/n, then you will not be able to use a connection here. You can leave the logon trigger and configure nodes invited and excluded in the listener sqlnet.ora file, i.e.
tcp.validnode_checking = yes tcp.excluded_nodes = (hostname1,hostname2,hostname3)
You need to restart the receiver after making this change.
Justin
-
Activation level-12 record in the SYSTEM. LOGON trigger
I try to activate the trace level-12 for a user as soon as it to connect to the database.
CREATE OR REPLACE TRIGGER SYSTEM. LOGON_ASPIRE
AFTER LOGON
WE DATABASE
BEGIN
If (Upper (User) = "U_DATAHUB") then
RUN IMMEDIATELY 'ALTER SESSION SET EVENTS "TRACE NAME CONTEXT FOREVER, LEVEL 12 10046" ';
run immediately "alter session set current_schema = DATAHUB';"
end if;
I Grant DBA user U_DATAHUB and I'm able to generatr trace for all sessions... but all trace files will appear this error
PARSING IN CURSOR #4 len = dep 68 = 2 uid = 5 oct 42 lid = 5 = tim = hv 14297715680259 = ad 753686485 = ' 0'
ALTER SESSION SET EVENTS 10046 TRACE NAME CONTEXT FOREVER, LEVEL 12'
END OF STMT
ANALYSIS # 4: c = 0, e = 18, p = 0, cr = 0, set cu = 0, = 0, r = 0, dep = 2, og = 0, tim = 14297715680254
#2 ERROR: err = 1031 tim = 2228813739
Ignored the error 604 while SYSTEM is running. LOGON_ASPIRE
2008-10-24 16:09:40.272
ksedmp: internal or fatal error
ORA-00604: an error has occurred at the SQL level 1 recursive
ORA-01031: insufficient privileges
ORA-06512: at line 192Have you abandoned the previous trigger, under System? If not, maybe that's the problem, it is also running, the drop!
-
Original title: startup problem
during the priming of the laptop without LAN connection after logon credentils applied it takes a long time to load the items on the desktop, but by connecting the laptop with LAN a boot of the computer LAPTOP, all right, please provide a solution for this problem of starting.
Hello
I removed IE 8, now it works fine
-
Problems with sidebar after logon
Hello
We use the Windows with Windows Server 2008 Std R2 DC field. We currently have several offices of Vista that belong to the domain. DNS is configured as suggested by Ms. recommended and there is no other group policy in use than the default domain policy.
After logon successful sidebar does'nt load completely (sidebar is displayed, but the clock is not displayed). Also, if you try to start Office MS Word it stuck in the loading screen. If you don't expect anything happens. Strange thing is that all other programs will be load normally (even other Office programs), but Word and Sidebar are stuck.
All this happens completely random. You can open a successful session of 3 times, but then it happens again.
This problem came just after computers, where joined to the domain. The proglem didn't happen while that computers in the workgroup.
No idea what could be wrong?
Please repost your question to the Discussion Windows Server group to: http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.windows.server.general&cat=en_US_9741c575-ec92-42f8-85ba-00dfe1483cf5&lang=en&cr=US where the Windows Server experts will be happy to help you. The fact that the Vista machines worked are in a working group suggests that the probllem is from the domain which means from the server.
I hope this helps.
Good luck!
Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.
-
Hi all
I need help to create the logon trigger. Help, please... Here are the details.
I have a name like "TEST" userid and 50 users are using the same username name to connect. I would like to limit some users read only the single task and some users to read the writing task using the same user name 'TEST '. I have all the machine name of 50 users. The logon trigger to control the permission(readonly/readwrite) according to the name of the computer at the time of the connection. Please help write the trigger. Thanks in advance.
Kind regards
ManonSince you know the host names for 50 users, you can create the logon trigger to learn namespace and the setting via SYS_CONTEXT.
For example, SELECT SYS_CONTEXT ('USERENV', 'HOST') of double;
You will need to test for the hosts that you want to allow to read and write over the hosts that you want to only allow reading. To set read-only compared to the privileges of reading / writing, I suggest to create two roles respectively and based on the condition, set the role for the session.
CREATE THE TRIGGER
...
l_host VARCHAR2 (128);
BEGIN
SELECT SYS_CONTEXT ('USERENV', 'HOST') IN the double l_host;
IF l_host IN (list of hosts for read-only)
-series playback only
READ_ONLY_ROLE ROLE PLAY;
ON THE OTHER
READ_WRITE_ROLE ROLE PLAY;
END IF;
END;
/ -
Hello
I used the custom basic auth on the employee table.
I'd like to force change pwd user after logon
Please help me on this case
Thank you.Hi Hailt,
Even now, you assign points to my answer.
You can find the correct or relatively useful option in my reply post where I answered it at the top right, you can find it.
Brgds,
Mini -
: NEWS cannot be used after Delete Trigger?
Hello
Is it possible to get the: NW.value in the After delete trigger for each line. My requirement is the audit trail for the end user with username DML operations (HERE the USER IS NOT the USER ORACLE, in REASON OF THE LARGE NUMBER of USERS END WE ARE NOW ONE TABLE to CREATE USER NAME and PASSWORD WHEN the USER LOGIN to ORACLE FORM SCREEN, ASSIGN THE NAME OF GLOBAL VARIABLE USER) & Action Date.
Here is my code for trigger - it works very well with INSERTION and UPDATE, but for the REMOVAL of the user is NULL
CREATE OR REPLACE TRIGGER Tgr_stud_det
AFTER INSERT or UPDATE or DELETE ON student_details
FOR EACH LINE
DECLARE
BEGIN
IF the insertion
-INSERT VALUE-
INSERT INTO Log_student_details
(Seq,
App_User,
Action,
Action_Date,
stud_name,
stud_age,
stud_sex)
VALUES
(stud_sequence. NEXTVAL,
: NEW. App_User,
"INSERT."
SYSDATE,
: NEW.stud_name,.
: NEW.stud_age,.
(: NEW.stud_sex);
-REMOVE VALUE-
ELSIF deletion THEN
INSERT INTO Log_student_details
(Seq,
App_User,
Action,
Action_Date,
Comment_Up,
stud_name,
stud_age,
stud_sex)
VALUES
(stud_sequence. NEXTVAL,
: OLD. App_User,
'DELETE ',.
SYSDATE,
NULL,
: OLD.stud_name,.
: OLD.stud_age,.
(: OLD.stud_sex);
ELSIF update THEN
-VALUE OF - UPDATE
INSERT INTO Log_student_details
(Seq,
App_User,
Action,
Action_Date,
Comment_Up,
stud_name,
stud_age,
stud_sex)
VALUES
(stud_sequence. NEXTVAL,
: NEW. App_User,
"UPDATE."
SYSDATE,
"NEW VALUE."
: NEW.stud_name,.
: NEW.stud_age,.
(: NEW.stud_sex);
INSERT INTO Log_student_details
(Seq,
App_User,
Action,
Action_Date,
Comment_Up,
stud_name,
stud_age,
stud_sex)
VALUES
(stud_sequence. CURRVAL,
: NEW. App_User,
"UPDATE."
SYSDATE,
"OLD VALUE";
: OLD.stud_name,.
: OLD.stud_age,.
(: OLD.stud_sex);
END IF;
EXCEPTION
WHILE OTHERS THEN
NULL;
END Tgr_stud_det;
Thanks in advance.Hello
I don't know much about Oracle Forms. As you said "I assigned the user of the Application name in the global variable of form", can you put the value of the global variable Form to a package global variable in the trigger of preform shape of the Oracle. Then, in the delete after trigger instead of put: new.user_name you can assign to package.pck_global_user_name. The global variable to the package will get the username value when the form is loaded, i.e. when a user connects successfully IE in the triggering of preform of Oracle Forms. It will remain throughout the session.
It will be useful,
Twinkle -
index and a nls settings logon trigger
Hello world
We had a problem with the index. A few months ago the client asked us to modify the application so that all searches are case insensitive and independent of diacritics (i.e. treat all non-ASCII as their equivalent ASCII - for example 'a' characters should be considered equal to 'a' etc.). We decided to create a simple LOGON trigger, which sets some parameters, NLS session for a given user (namely NLS_COMP = LINGUISTIC and NLS_SORT = CZECH_AI).
This solution works, either it does what the customer has asked for, but I noticed there are problems with the index. Suddenly some of them are not used, so there is many unnecessary sequential scans of large tables (millions of rows), which influences the performance badly and that takes a lot more time. I believe that this is caused by the index created with the original, different from those current NLS parameters.
Am I wrong? And how to fix it? I was able to recreate all the indexes, but is it possible to find what indexes are affected by this problem, or not?
concerning
TomasI don't think your alter session modification statement will affect the content of the index, but they will have an impact of the plan. For example see the following example, where the full table Scan scan index range plan changes.
SQL> select name from emp where name = 'a'; no rows selected Execution Plan ---------------------------------------------------------- Plan hash value: 2061206800 ----------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ----------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 1 | 12 | 1 (0)| 00:00:01 | |* 1 | INDEX RANGE SCAN| EMP_NAME | 1 | 12 | 1 (0)| 00:00:01 | ----------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 1 - access("NAME"=U'a') Note ----- - dynamic sampling used for this statement (level=2) SQL> alter session set NLS_COMP=LINGUISTIC; Session altered. SQL> alter session set NLS_SORT=CZECH_AI; Session altered. SQL> select name from emp where name = 'a'; no rows selected Execution Plan ---------------------------------------------------------- Plan hash value: 3956160932 -------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | -------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 1 | 12 | 3 (0)| 00:00:01 | |* 1 | TABLE ACCESS FULL| EMP | 1 | 12 | 3 (0)| 00:00:01 | -------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 1 - filter(NLSSORT("NAME",'nls_sort=''CZECH_AI''')=HEXTORAW('14000100 ') ) Note ----- - dynamic sampling used for this statement (level=2) SQL>
Maybe you are looking for
-
Help, please
-
IMac using Firefox 8 and Yahoo as a homepage. When I click on a link of news it brings up the error message next - "your browser has requested that this server could not understand. A request header field exceeds server limit. When I use Safari it is
-
Hello, I wanted to know if there are drivers for the external dvd HP 1170 player? Thanks and take care, Bryan
-
Hello I have a T540p which is around the age of 6 months. I use it with an external monitor. I noticed that the screen backlight is always on. However, if I set the camera on standby and then bring back (always connected to external websites) the scr
-
Acer Aspire V15 V3 - 575 - 50TD Ram upgrade
Hello, I just bought a laptop named in the subject. The stock of RAM according to CPU - Z is ACR16D3LS1KNG/4 G. I tried with RAM Module Kingston KVR16S11/8 (1.5V) and did NOT work. I want to know what type of ram can I use upgrade. I also want to kno