-
Error in creating procedure
I am trying to create the following procedure
1 CREATE OR REPLACE PROCEDURE ck_security AS
2 cur integer;
3 rc integer;
4 v_sid number;
5 v_serial number;
6 v_username varchar2(100);
7 v_machine varchar2(100);
8 CURSOR c_user_security IS
9 SELECT sid, serial#, username, terminal, machine, status
10 FROM v$session;
11 BEGIN
12 FOR this IN c_user_security LOOP
13 IF this.username = 'LISTEST' THEN
14 IF this.terminal = 'JK1157' THEN
15 null;
16 ELSIF this.status <> 'KILLED' THEN
17 v_sid := this.sid;
18 v_serial := this.serial#;
19 cur := DBMS_SQL.OPEN_CURSOR;
20 DBMS_SQL.PARSE(cur,
21 'ALTER SYSTEM KILL SESSION '''
22 || v_sid
23 || ','
24 || v_serial
25 || '''', DBMS_SQL.NATIVE);
26 rc := DBMS_SQL.EXECUTE(cur);
27 DBMS_SQL.CLOSE_CURSOR(cur);
28 INSERT INTO ck_security_table
29 VALUES
30 ('Security Violation: '
31 || this.username
32 || ' accessed from '
33 || this.machine
34 || '('
35 || this.terminal
36 || ') on '
37 || TO_CHAR(sysdate(),'MON-DD-YYYY HH24:MI:SS'));
38 END IF;
39 END IF;
40 END LOOP;
41* END ck_security;
42 /
Warning: Procedure created with compilation errors.
SQL> show errors
Errors for PROCEDURE CK_SECURITY:
LINE/COL ERROR
-------- -------------------------------------------------------
9/1 PL/SQL: SQL Statement ignored
10/6 PL/SQL: ORA-00942: table or view does not exist
13/1 PL/SQL: Statement ignored
Can anybody help in this regard?
thanx in advance
-
Most likely you do not have SELECT privilege on v$session.
Last edited by SANJAY_G; 12-04-2006 at 04:14 AM.
Sanjay G.
Oracle Certified Professional 8i, 9i.
"The degree of normality in a database is inversely proportional to that of its DBA"
-
 Originally Posted by SANJAY_G
Most likely you do not have SELECT privilege on v$session.
i am tring to create the procedure while i am logon as 'sys as sysdba'user
-
There are three kinds of lies: Lies, damned lies, and benchmarks...
Unix is user friendly. It's just very particular about who it's friends are.
Oracle DBA
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|