Unable to create database trigger

i am working with Oracle 8 on PC running on Windows 98. For learning purpose i login as scott/tiger.
I was trying to create following trigger (to keep track of each logon in my databse)

create or replace trigger track_logon
after logon on database
begin
    insert into log_trail values (user,sysdate,'LOGON');
   commit;
end ;

It gives the following error (the table log_trail has been created) :

SQL> start trigger1.sql
  7  /
after logon on database
      *
ERROR at line 2:
ORA-04072: invalid trigger type

What went wrong and where. Please help. Thanks.
--TheTechGuy.
Sandeep SoodProgrammerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sandeep SoodProgrammerAuthor Commented:
further..
 i have tried it by logging in as system/manager also. but same problem occured there also.

thanks.
0
Thandava VallepalliCommented:
do use commit in trigger.....

commit will not work in triggers

itsvtk
0
Thandava VallepalliCommented:
remove commit; statement and try....  if u get same problem  let me know

itsvtk
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

boriskalavskyCommented:
trigger actions need to be able to rollback for uncommited transactions therefore you can not use commit in the trigger
0
Sandeep SoodProgrammerAuthor Commented:
thanks all for your answers.
ok, i will try it. but the error it is displaying is at line  :

after logon on database
      *
ERROR at line 2:
ORA-04072: invalid trigger type

so is the trigger type valid. i means is it the correct way to create a database trigger. and does the user scott require any special privilege for it.
waiting..
Thanks.
0
boriskalavskyCommented:
COMPATIBLE parameter needs to be set to at least 8.1.6
It is nopt supported if you do not have =>8.1.6
0
boriskalavskyCommented:
not supported at least 8.1.6
0
Sandeep SoodProgrammerAuthor Commented:
Hi. boriskalavsky  feedback
sorry, i was unable to understand your answer.
PLEASE. can you explain a little more.
what do you mean by 8.1.6 ?
Waiting..
Thanks.
0
boriskalavskyCommented:
COMPATIBLE parameter needs to be set to at least 8.1.6 in init.ora
"after logon on database" triggers are not supported if you do not have => 8.1.6
0
Sandeep SoodProgrammerAuthor Commented:
Hi boriskalavsky !!
thanks for your help. but..

i could not set Compatible = 8.1.6.
first, i dont have a file named init.ora instead i have initorcl.ora and initseed.ora files in c:\orawin95\database directory.

second, i tried to write compatible = 8.1.6 at the end of the file initorcl.ora  but then could not start oracle. it resultd in error "ora-401" saying "Can Not Satrt Oracle 8 Instance"

3rd
I am using SQL*Plus: Release 8.0.4.0.0
I tried to update it using alter system command also. but got the following error.



SQL> alter system set compatible='8.1.6' ;
alter system set compatible='8.1.6'
                 *
ERROR at line 1:
ORA-02095: specified initialization parameter cannot be modified


Please look into the matter and reply.
thanks again.
waiting..
0
Sandeep SoodProgrammerAuthor Commented:
hello.
Please any experts can solve this problem.
waiting..
0
boriskalavskyCommented:
"after logon on database" triggers are not supported if you do not have => 8.1.6 and seem to be running version 8.0.4 of Oracle. Try to run "select * from v$version;" in SQLPlus. Result lower then 8.1.6 would mean that you can not run "after logon on database". Oracle did not have this functionality in versions before 8.1.6.
0
Sandeep SoodProgrammerAuthor Commented:
Thanks boriskalavsky  !!
Ok Sir.
i promise to accept your answer.
but just as a closing comment  pleae tell me is there any other way to achieve this in Oracle 8.0
thanks.
0
boriskalavskyCommented:
All new sessions are going to be instarted in v$session (catalog view).
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
boriskalavskyCommented:
All new sessions are going to be inserted in v$session (catalog view).
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.