Insufficient privilege while using dynamic sql in procedure
Hi,
I am using following script on oracle 10g. and getting unsufficient privs error. please advice.
SQL> show user
User is "GRSADM"
SQL> create or replace procedure grsadm.test_proc as
a varchar2(2000);
begin
a:='CREATE OR REPLACE VIEW
test_view
AS SELECT
''sadf'' a
FROM dual';
execute immediate a;
end;
Procedure created.
SQL> begin
grsadm.test_proc;
end;
begin
grsadm.test_proc;
end;
Error at line 16
ORA-01031: insufficient privileges
ORA-06512: at "GRSADM.TEST_PROC", line 9
ORA-06512: at line 2
SQL> select * from session_privs
where privilege like '%VIEW%'
PRIVILEGE
CREATE ANY VIEW
DROP ANY VIEW
CREATE ANY MATERIALIZED VIEW
ALTER ANY MATERIALIZED VIEW
DROP ANY MATERIALIZED VIEW
5 rows selected.
Edited by: Ratnesh Sharma on Nov 24, 2011 12:00 PM
yes it has EXECUTE ANY PROCEDURE priv.
Following is the list of all the priv this user has.
PRIVILEGE
CREATE ANY SQL PROFILE
DROP ANY SQL PROFILE
GRANT ANY OBJECT PRIVILEGE
DEBUG CONNECT SESSION
RESUMABLE
ADMINISTER DATABASE TRIGGER
ADMINISTER RESOURCE MANAGER
DROP ANY OUTLINE
DROP ANY CONTEXT
CREATE ANY CONTEXT
MANAGE ANY QUEUE
DROP ANY DIMENSION
CREATE ANY DIMENSION
GLOBAL QUERY REWRITE
DROP ANY INDEXTYPE
CREATE ANY INDEXTYPE
DROP ANY OPERATOR
CREATE ANY OPERATOR
DROP ANY LIBRARY
CREATE ANY LIBRARY
EXECUTE ANY TYPE
DROP ANY TYPE
ALTER ANY TYPE
CREATE ANY TYPE
DROP ANY DIRECTORY
CREATE ANY DIRECTORY
DROP ANY MATERIALIZED VIEW
ALTER ANY MATERIALIZED VIEW
CREATE ANY MATERIALIZED VIEW
ANALYZE ANY
DROP PROFILE
CREATE PROFILE
DROP ANY TRIGGER
ALTER ANY TRIGGER
CREATE ANY TRIGGER
EXECUTE ANY PROCEDURE
DROP ANY PROCEDURE
ALTER ANY PROCEDURE
CREATE ANY PROCEDURE
CREATE PROCEDURE
AUDIT ANY
DROP ANY ROLE
CREATE ROLE
DROP PUBLIC DATABASE LINK
CREATE PUBLIC DATABASE LINK
CREATE DATABASE LINK
DROP ANY SEQUENCE
CREATE ANY SEQUENCE
DROP ANY VIEW
CREATE ANY VIEW
DROP PUBLIC SYNONYM
CREATE PUBLIC SYNONYM
DROP ANY SYNONYM
CREATE ANY SYNONYM
DROP ANY INDEX
ALTER ANY INDEX
CREATE ANY INDEX
DROP ANY CLUSTER
CREATE ANY CLUSTER
DELETE ANY TABLE
UPDATE ANY TABLE
INSERT ANY TABLE
SELECT ANY TABLE
COMMENT ANY TABLE
DROP ANY TABLE
ALTER ANY TABLE
CREATE ANY TABLE
DROP ROLLBACK SEGMENT
CREATE ROLLBACK SEGMENT
DROP USER
BECOME USER
CREATE USER
UNLIMITED TABLESPACE
DROP TABLESPACE
ALTER TABLESPACE
CREATE TABLESPACE
CREATE SESSION
ALTER SYSTEM
Similar Messages
-
Getting error while using DYNAMIC SQL
Hi Team,
I am Oracle DBA. I have limited knowledge on PL/SQL. I used below PL/SQL code to drop 50 partitons from one of the table.
I used Dynamic SQL EXECUTE IMMEDIATE to drop partions. But error occured. If I commented EXECUTE IMMEDIATE, procedure executed successfully.
Please suggest me, where i did the mistake. Also please suggest for better code than my code. please find below code and error details.
SQL> ed
Wrote file afiedt.buf
1 DECLARE
2 CURSOR DROP_PARTITON IS select partition_name from user_tab_subpartitions where PARTITION_NAME<='ABCD_2011_04';
3 BEGIN
4 for curr IN DROP_PARTITON LOOP
5 DBMS_output.put_line(curr.partition_name);
6 execute immediate(Alter table Table_Name drop partition curr.partition_name);
7 end loop;
8* END;
SQL> /
execute immediate(Alter table BILLCHRG drop partition curr.partition_name);
ERROR at line 6:
ORA-06550: line 6, column 19:
PLS-00103: Encountered the symbol "ALTER" when expecting one of the following:
( - + case mod new not null others <an identifier>
<a double-quoted delimited-identifier> <a bind variable> avg
count current exists max min prior sql stddev sum variance
execute forall merge time timestamp interval date
<a string literal with character set specification>
<a number> <a single-quoted SQL string> pipe
<an alternatively-quoted string literal with character set specification>
<an alternative
SQL> ed
Wrote file afiedt.buf
1 DECLARE
2 CURSOR DROP_PARTITON IS select partition_name from user_tab_subpartitions where PARTITION_NAME<='ABCD_2011_04';
3 BEGIN
4 for curr IN DROP_PARTITON LOOP
5 DBMS_output.put_line(curr.partition_name);
6 --execute immediate(Alter table TABLE_NAME drop partition curr.partition_name);
7 end loop;
8* END;
SQL> /
ABCD_2009_06
ABCD_2009_06
ABCD_2009_06
BILLCHRG_2011_04
PL/SQL procedure successfully completed.PL/SQL code runs on the server, inside an Oracle process - thus PL/SQL code cannot dynamically write and display messages to the client. That server process is not connected to any keyboard, mouse or display.
DBMS_OUTPUT can be used. This is a PL/SQL buffer area in that server process that code can write lines of text too. When the server process informs the client that it has completed, the client can now request the contents of the DBMS_OUTPUT buffer and the client can display it on the client device.
This is what set serveroutput on in SQL*Plus does - tell the sqlplus client to request the DBMS_OUTPUT buffer after each Oracle server call made and to display the contents locally.
So to display the SQL command can be done using DBMS_OUTPUT. E.g.
declare
dropPart varchar2(32767);
begin
for c in (select...) loop
dropPart := 'alter table my_tab drop partition '||c.partition_name';
--// write the SQL command to DBMS_OUTPUT
DBMS_OUTPUT.put_line( dropPart );
--// execute the SQL using a begin..end block in order to catch error
begin
execute immediate dropPart;
DBMS_OUTPUT.put_line( 'command completed successfully' );
exception when OTHERS then
DBMS_OUTPUT.put_line( 'command failed with: '||SQLERRM(SQLCODE) );
end;
end loop;
end;So after this code block has been executed and partitions dropped, sqlplus will display the DBMS_OUTPUT generated by this code block. -
ERROR: insufficient privileges while using EXPLAIN PLAN command
Hi,
I have a table named TEST and i ran following command on this table.
SQL> EXPLAIN PLAN FOR
2 SELECT NAME FROM TEST;
SELECT NAME FROM TEST
ERROR at line 2:
ORA-01031: insufficient privileges
So which privilege do i need to give for using EXPLAIN PLAN command.
Thank.http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14211/ex_plan.htm#i19260
SQL> @C:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\utlxplan.sql
Table created.
SQL> select table_name from user_tables where table_name='PLAN_TABLE';
TABLE_NAME
PLAN_TABLE
You might consider checking dba_tables to check the owner in your case and may be you don't privilege on that table. -
Should I use dynamic SQL for simple updates?
Please tell me, out of the two options given below, which option should i use to update columns in a table and why?
what will be the performance difference between the two approaches?
Please note: The options given below is just for an example
procedure proc1(var1 varchar2)
is
begin
update tab1 set col1 = var1;
commit;
end;
procedure proc1(var1 varchar2)
is
sqlstr varchar2(1000);
begin
sqlstr := 'update tab1 set col1 = :v1';
execute immediate sqlstr using var1;
commit;
end;
Thanks
ArunArun G Nath wrote:.
Should I use dynamic SQL for simple updates? No way, not a chance.
Performance is not the issue (as long as you are using bind variables).
But with dynamic SQL, you loose compile time checking; you do not know until runtime if the SQL is valid.
You also loose the dependency between proc1 and tab1, which can be found only if you search user_source.
(And in either case, you probably want to remove the commit)
Regards
Peter -
Can we use Dynamic SQL in Oracle Reports ?
Hi ,
Can we use Dynamic SQL in Oracle Reports ?
If yes please give some examples .
Thanx
sriniI believe the built-in package SRW.Do_Sql is what you are looking for
Example from the document:
/* Suppose you want to create a "table of contents" by getting the
** first character of a columns value, and page number on which its
** field fires to print. Assume that you want to put the "table of
contents"
** into a table named SHIP. You could write the following construct:
DECLARE
PAGE_NO NUMBER;
PAGE_FOR INDEX NUMBER;
SORT_CHAR CHAR(1);
CMD_LINE CHAR(200);
BEGIN
SORT_CHAR := :SORT_NAME ;
IF :CALLED = Y THEN
SRW.GET_PAGE_NUM(PAGE_FOR_INDEX);
SRW.USER_EXIT(RWECOP PAGE_FOR_INDEX
P_START_PAGENO);
SRW.MESSAGE(2,TO_CHAR(:P_START_PAGENO));
END IF;
SRW.GET_PAGE_NUM(PAGE_NO);
CMD_LINE := INSERT INTO SHIP VALUES
(||SORT_CHAR||,||TO_CHAR(PAGE_NO)||);
SRW.MESSAGE(2,CMD_LINE);
SRW.DO_SQL(CMD_LINE);
COMMIT;
EXCEPTION
WHEN DUP_VAL_ON_INDEX THEN
NULL;
WHEN SRW.DO_SQL_FAILURE THEN
SRW.MESSAGE(1,FAILED TO INSERT ROW INTO SHIP TABLE);
WHEN OTHERS THEN
COMMIT;
END; -
Can anybody please send me a small program on How to Use Dynamic SQL.
How to execute and run give details.
Thanks
nullYou can certainly use the INTO (and USING) clauses of EXECUTE IMMEDIATE to pass in and return data, i.e.
EXECUTE IMMEDIATE sqlStmt
USING variable1, variable2
INTO output1, output2The more complex the statement, however, the more appropriate DBMS_SQL is. DBMS_SQL also has the potential to allow you to use bind variables rather than reparsing the statement many times.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC -
Delcare Cursor using Dynamic SQL using PL/SQL in Oracle 7.3.4
In Oracle 7.3.4, can I declare a cursor at run time using Dynamic SQL. From the sample code in this website, it seems that Oracle 8 support this function. Please help. Thanks a lot.
If I can do this on Oracle 7.3.4, could you give me some sample codes? Thanks.
Regards,
RaymondHi,
Try using the the following code where you can dynamically build the Valid Select stmt. and call that where ever you want.
declare
Type Cur_ref Is Ref Cursor;
C_ref Cur_ref;
V_Str Varchar2(100);
V_Name Varchar2(100);
Begin
V_Str := 'Select Ename from Scott.emp Where empno = 7369';
Open C_Ref for V_Str;
Fetch C_ref Into V_Name;
close C_Ref;
dbms_output.put_line(V_Name);
End;
regards
gaurav
null -
Does anyone know anything about Dynamic SQL not being available in Forms v. 6.0.8.11.3? I trying to use Dynamic SQL for the first time and am having some difficulty. When I try to put my SQL in a function and run it straight into the database through SQLPlus, it works fine, but when trying to compile the code in Forms Builder (in a library), I get compiler errors. Any help would be appreciated...
Thanks!
VanessaWhen I tried to compile the following code in Forms, the compiler error I got was Encountered the symbol "STMT_STR" when expecting one of the following: select. However, when I run it in SQLPlus, it creates the function without any errors.
FUNCTION my_func
return number
is
TYPE DiaryCurTyp IS REF CURSOR;
cur DiaryCurTyp;
stmt_str VARCHAR2(200);
dmonth NUMBER;
dday NUMBER;
BEGIN
stmt_str := 'SELECT dmonth, dday FROM p2_diary
WHERE dmonth = :1';
OPEN cur FOR stmt_str USING '12';
LOOP
FETCH cur INTO dmonth, dday;
EXIT WHEN cur%NOTFOUND;
-- <process data>
END LOOP;
CLOSE cur;
END; -
Using dynamic sql in triggers with :OLD values
i need to record all deleted rows from an entire schema in a single table. for that matter i created a function that receives a table name and generate an insert command according to it's primary key columns. i call this function in the table triggers. in order to insert the old values before the delete i use :OLD with "execute immediate" as followed :
create or replace trigger trg_some_tbl_bd
before delete on some_tbl
for each row is
declare
v_sql varchar2(4000);
begin
v_sql := generate_insert_command('some_table');
execute immediate v_sql;
end;
the return value from "generate_insert_command" function is the string:
insert into deleted_table (table_name , date , pk1 , pk2) values
('some_table' , sysdate , :OLD.pk1 , :OLD.pk2)
the execute immediate command notice the :OLD and looks for bind variables.
i need to know i can i bypass that. i tried looking for escape characters but couldent find any...
i would appriciate any help , it's kynda urgent
Thanks !I don't believe this is going to work. Even if you could get around the fact that :old looks like a bind variable, the :old values are not visible to the dynamic SQL statement, they're like local variables in that respect.
If you wanted to pass old values in, those values would have to be passed in as bind variables, i.e.
EXECUTE IMMEDIATE v_sql USING :old.pk1, :old.pk2which defeats the purpose of using dynamic SQL.
Since you have to create a trigger for each table, I don't see why you would bother with dynamic SQL inside the trigger-- your table structure is fixed when the trigger is created. You could write dynamic SQL that generated the triggers in the first place, but the code inside the trigger should be dynamic.
As an aside, you realize that logging every audit record into a single table creates rather massive contention issues, right? And have you considered how painful it is to query this sort of table? Have you considered other options for maintaining history like Workspace Manager? Or at least separate history tables for each table?
Justin -
Hello,
I'm trying to create a function utilizing Dynamic SQL. The function compiles fine, but when I go to call it using the select staement below, I get :
ORA-01006: bind variable does not exist
ORA-06512: at "ICIM.PROD_SALES_DATA", line 24
select prod_sales_data('09','I',2009,'Awning')
from dual;
CREATE OR REPLACE FUNCTION prod_sales_data
(p_ahl1 IN VARCHAR2, p_phl1 IN VARCHAR2, p_fisyr IN NUMBER,
p_prod_str IN VARCHAR2)
RETURN NUMBER IS
v_return NUMBER;
query_str VARCHAR2(10000);
BEGIN
query_str :='select sum(a.qsh*a.unitcnt)'||chr(13)
||'from sh_units a, sh_product_desc b, sh_ad_glass c'||chr(13)
||'where a.unittype = b.unittype'||chr(13)
||'and a.sh_id = c.sh_id(+)'||chr(13)
||'AND a.ahl1 = '||chr(39)||p_ahl1||chr(39)||chr(13)
||'AND a.phl1 = '||chr(39)||p_phl1||chr(39)||chr(13)
||'AND a.fisyr ='|| p_fisyr||chr(13)
||'AND UPPER(b.descrip) = UPPER('||chr(39)||p_prod_str||chr(39)||')'||chr(13)
||'AND a.invdt between b.eff_beg and b.eff_end'||chr(13)
||'and a.parts_flag <>'||chr(39)||'Y'||chr(39)||chr(13)
||'and a.unittype <>'||chr(39)||'OTHE'||chr(39)||chr(13)
||'and icim.sh_rept_chk_ortp(a.ortp) = 1'||chr(13)
||'and A.REPT_RELEASE_DT is not null';
DBMS_OUTPUT.PUT_LINE(query_str) ;
EXECUTE IMMEDIATE query_str
INTO v_return
USING p_ahl1,p_phl1,p_fisyr,p_prod_str;
RETURN v_return;
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
END prod_sales_data ;
Any help as to what is going wrong would be greatly appreciated.
Thanks,
TylerHello,
>
I'm trying to create a function utilizing Dynamic SQL. But why?
Whenever you turn towards dynamic SQL, ask yourself why?
I bet for a couple of years you aren't able rto come up with an answer. Meaning you shouldn't.
Even if you do come up with an answer, think again. The answer may very well be wrong.
Wouldn't it be nice if your function was as simple as:
CREATE OR REPLACE FUNCTION prod_sales_data
( p_ahl1 IN VARCHAR2
, p_phl1 IN VARCHAR2
, p_fisyr IN NUMBER,
p_prod_str IN VARCHAR2)
RETURN NUMBER
IS
v_return NUMBER;
BEGIN
select sum(a.qsh*a.unitcnt)
into v_return
from sh_units a
, sh_product_desc b
, sh_ad_glass c
where a.unittype = b.unittype
and a.sh_id = c.sh_id(+)
and a.ahl1 = p_ahl1
and a.phl1 = p_phl1
and a.fisyr = p_fisyr
and upper(b.descrip) = upper(p_prod_str)
and a.invdt between b.eff_beg and b.eff_end
and a.parts_flag != 'Y'
and a.unittype != 'OTHE'
and icim.sh_rept_chk_ortp(a.ortp) = 1
and a.rept_release_dt is not null;
RETURN v_return;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURN NULL;
END prod_sales_data ;
/Now using proper bind variables, plain static pre-compiled SQL. And even works properly WITH NO DATA FOUND.
I know it's dangerous to use words as always and never, but i dare say
Always (Whenever you can) use static SQL. Never (Unless you must) use dynamic SQL (When you can use static).
Regards
Peter -
Convert a trigger format into a stored procedure using Dynamic Sql
Hi everyone,
ihave table
Table_NAME_ABCD contains
i have a trigger Table_NAME_ID,ROW_CREATED_DATE,ROW_CREATED_BY,ROW_CHANGED_DATE,ROW_CHANGED_BY,UNQ columns
i am populating Table_NAME_ID(primary_key) using sequencer in the below mentioned trigger.
and for this table i have created IU trigger for inserting or updating trigger will fire
create or replace
TRIGGER "Table_NAME_IU_TRG" BEFORE INSERT OR UPDATE ON Table_NAME_ABCD FOR EACH ROW
BEGIN
If inserting then
If :new.Table_NAME_ID is NULL THEN
SELECT Table_NAME_ID_ABCD_SEQ.NEXTVAL INTO :NEW.Table_NAME_ID FROM DUAL;
end if;
if :new.ROW_CREATED_DATE is NULL then
:new.ROW_CREATED_DATE := SYSDATE;
end if;
if :new.ROW_CREATED_BY is NULL then
:new.ROW_CREATED_BY := USER;
end if;
if :new.ROW_CHANGED_DATE is NULL then
:new.ROW_CHANGED_DATE := SYSDATE;
end if;
if :new.ROW_CHANGED_BY is NULL then
:new.ROW_CHANGED_BY := USER;
end if;
if :new.UNQ is NULL then
:new.UNQ := SYS_GUID():
end if;
end if;
If updating then
:new.ROW_CHANGED_DATE := SYSDATE;
:new.ROW_CHANGED_BY := USER;
end if;
END;
above mentioned table along with trigger is same format for ~100 different tables i have been created.
i want a stored procedure in side it above mentioned trigger (i.e., for inserting or updating )code should be written with Dynamic Sql so that when ever i am passing Tablename as a parameter it should work.
please suggest me.What is new since this thread?
Stored procedure instead of Trigger -
Using dynamic value in procedure on column
I want a PL/sql procedure to select the data from the column dynamically into a variable .
My friend suggested its not possible in PL/sql ,its only possible in sql .
What i want is when i execute the PL/sql procedure the a_1 must get the value of the data in the table,i do not want to use execute immediate in pl/sql.
I create a table A
create table A (a1 number,a2 number,a3 number);
insert into a values (1,2,3);
then i create a procedure
create or replace
procedure test_a (var IN number)
as
a_1 number;
i number;
z varchar2(5);
begin
if var=1
then
i:=1;
elsif var = 2
then
i:=2;
z:='A2';
end if;
SELECT 'a'||i into a_1 from a;
end;
Edited by: user536416 on May 13, 2010 4:03 AMI prefer reference cursors over execute immediate if I must do dynamic SQL (and have learned not to do it unless necessary - among other things dynamic SQL is hard to debug and maintain).
The advantages to ref cursors are
* execute immedate will only retrieve one row, ref cursors as many as you want
* easier for me to build the query first, then execute it (though you can do this with execute immediate too) for debugging
You can buiid the query dynamcially but have to be careful to make sure the select list matches the INTO clause on the fetch statements. Although the queries in the example below are hard coded I could have done something like
v_command_c := 'select '||var1||', '||var2||' from '''||table_name||'''';
open refcur for v_command_c;To randomize your column selection use something like the above with IF logic and a randomizer, possibly the DBMS_RANDOM package or a time extraction.
Something like
SET SCAN OFF
SET SERVEROUTPUT ON
DECLARE
--define composite data types
--reference cursor type - structure
TYPE RefCursorType IS REF CURSOR;
--collection (index-by table) type - structure
TYPE TablesTableType IS TABLE OF user_tables.table_name%TYPE
INDEX BY BINARY_INTEGER;
--define ref cursors to be used in BEGIN section
UserTablesCursor RefCursorType;
UserViewCursor RefCursorType;
--define actual index-by tables to be used in BEGIN section
NamesTable TablesTableType;
ViewsTable TablesTableType;
--define internal procedures to be used in this script
PROCEDURE ListItems(RefCursor IN RefCursorType,
DataTable IN OUT TablesTableType
) IS
Counter INTEGER := 1;
TableName user_tables.table_name%TYPE;
BEGIN
FETCH RefCursor INTO DataTable(Counter);
Counter := Counter + 1;
WHILE RefCursor%FOUND LOOP
FETCH RefCursor INTO DataTable(Counter);
Counter := Counter + 1;
END LOOP;
END; --ListItems;
PROCEDURE WriteItems(DataTable IN TablesTableType) IS
BEGIN
FOR i IN 1..DataTable.count LOOP
dbms_output.put_line(DataTable(i));
END LOOP;
END; --WriteItems;
BEGIN
OPEN UserTablesCursor FOR
SELECT table_name
FROM user_tables;
ListItems(UserTablesCursor,NamesTable);
CLOSE UserTablesCursor;
dbms_output.put_line('user_tables');
dbms_output.put_line('--------------');
WriteItems(NamesTable);
--second defintion & set of calls
dbms_output.put_Line(CHR(13));
OPEN UserTablesCursor FOR
SELECT view_name
FROM user_views;
ListItems(UserTablesCursor,ViewsTable);
CLOSE UserTablesCursor;
dbms_output.put_line('user_views');
dbms_output.put_line('--------------');
WriteItems(ViewsTable);
END;
/Edited by: riedelme on May 13, 2010 5:44 AM -
ORA-01031: insufficient privileges when connecting by SQL PLUS 8.0 with sys
From client, I use SQL PLUS 8.0 to connect to server: sys/password@MYDB1 as sysdba
The error always raises “ORA-01031: insufficient privileges”
I have done:
- Set: remote_login_passwordfile=exclusive in tnsname.ora file
- Uncomment: SQLNET.AUTHENTICATION_SERVICES in “sqlnet.ora” file
Also on this client:
to use SQL PLUS 8.0 to connect to server: manager/password@MYDB1. To connect normally
to use PLSQL Deverloper (it is the same oracle_home with SQL PLUS 8.0) to connect to database normally with user sys.
To use Enterprise manager console (it is other oracle_home with SQL PLUS 8.0) to connect to database normally with user sys
Please, help me to solve this troubleTHIS IS CONTENT OF SQLNET.ora CLIENT
# copyright (c) 1996 by the Oracle Corporation
# NAME
# sqlnet.ora
# FUNCTION
# Oracle Network Client startup parameter file example
# NOTES
# This file contains examples and instructions for defining all
# Oracle Network Client parameters. It should be possible to read
# this file and setup a Client by uncommenting parameter definitions
# and substituting values. The comments should provide enough
# explanation to enable a reasonable user to manage his TNS connections
# without having to resort to 'real' documentation.
# SECTIONS
# ONames Client
# Namesctl
# Native Naming Adpaters
# MODIFIED
# skanjila 06/06/97 - Correct default for Automatic_IPC
# eminer 05/15/97 - Add the relevant onrsd parameters.
# asriniva 04/23/97 - Merge with version from doc
# ggilchri 03/31/97 - mods
# bvasudev 02/07/97 - Change sqlnet.authentication_services documentation
# bvasudev 11/25/96 - Merge sqlnet.ora transport related parameters
# asriniva 11/12/96 - Revise with new OSS parameters.
# asriniva 11/05/96 - Add ANO parameters.
# - ONames Client ----------------------------------------------------
#names.default_domain = world
#Syntax: domain-name
#Default: NULL
# Indicates the domain from which the client most often requests names. When
# this parameter is set the default domain name (for example, US.ACME), the
# domain name will be automatically appended to any unqualified name in an
# ONAmes request (query, register, deregister, etc). Any name which contains
# an unescaped dot ('.') will not have the default domain appended. Simple
# names may be qualified with a trailing dot (for example 'rootserver.').
#names.initial_retry_timeout = 30
#Syntax: 1-600 seconds
#Default: 15 (OSD)
# Determines how long a client will wait for a response from a Names Server
# before reiterating the request to the next server in the preferred_servers
# list.
#names.max_open_connections = 3
#Syntax: 3-64
#Default: ADDRS in preferred_servers
# Determines how many connections an ONames client may have open at one time.
# Clients will ordinarily keep connections to servers open once they are
# established until the operation (or session in namesctl) is complete. A
# connection will be opened whenever needed, and if the maximum would be
# exceeded the least recently used connection will be closed.
#names.message_pool_start_size = 10
#Syntax: 3-256
#Default: 10
# Determines the initial number of messages allocated in the client's message
# pool. This pool provides the client with pre-allocated messages to be used
# for requests to ONames servers. Messages which are in the pool and unused
# may be reused. If a message is needed and no free messages are available in
# the pool more will be allocated.
#names.preferred_servers = (address_list =
# (address=(protocol=ipc)(key=n23))
# (address=(protocol=tcp)(host=nineva)(port=1383))
# (address=(protocol=tcp)(host=cicada)(port=1575))
#Syntax: ADDR_LIST
#Default: Well-Known (OSD)
# Specifies a list of ONames servers in the client's region; requests will be
# sent to each ADDRESS in the list until a response is recieved, or the list
# (and number of retries) is exhausted.
# Addresses of the following form specify that messages to the ONames server
# should use Oracle Remote Operations (RPC):
# (description =
# (address=(protocol=tcp)(host=nineva)(port=1383))
# (connect_data=(rpc=on))
#names.request_retries = 2
#Syntax: 1-5
#Default: 1
# Specifies the number of times the client should try each server in the list
# of preferred_servers before allowing the operation to fail.
#names.directory_path
#Syntax: <adapter-name>
#Default: TNSNAMES,ONAMES,HOSTNAME
# Sets the (ordered) list of naming adaptors to use in resolving a name.
# The default is as shown for 3.0.2 of sqlnet onwards. The default was
# (TNSNAMES, ONAMES) before that. The value can be presented without
# parentheses if only a single entry is being specified. The parameter is
# recognized from version 2.3.2 of sqlnet onward. Acceptable values include:
# TNSNAMES -- tnsnames.ora lookup
# ONAMES -- Oracle Names
# HOSTNAME -- use the hostname (or an alias of the hostname)
# NIS -- NIS (also known as "yp")
# CDS -- OSF DCE's Cell Directory Service
# NDS -- Novell's Netware Directory Service
# - Client Cache (ONRSD) ---------------------------------------------
names.addresses = (ADDRESS=(PROTOCOL=IPC)(KEY=ONAMES))
Syntax: ADDR
Default: (ADDRESS=(PROTOCOL=IPC)(KEY=ONAMES))
Address on which the client cache listens (is available to clients).
Any valid TNS address is allowed. The default should be used if at
all possible; clients have this entry hardwired as the first line
of their server-list file (sdns.ora). If the address is set to a
non-default value the client's preferred_servers parameter should
be set to include the client-cache address first.
names.authority_required = False
Syntax: T/F
Default: False
Determines whether system querys (for the root etc) require Authoritative
answers.
names.auto_refresh_expire = 259200
Syntax: Number of seconds, 60-1209600
Default: 259200
This is the amount of time (in seconds) the server will cache the addresses
of servers listed in server-list file (sdns.ora). When this time expires the
server will issue another query to the servers in those regions to refresh
the data.
names.auto_refresh_retry = 180
Syntax: Number of seconds, 60-3600
Default: sec. 180
This set how often the server will retry when the auto_refresh query fails.
names.cache_checkpoint_file = cache.ckp
Syntax: filename
Default: $ORACLE_HOME/network/names/ckpcch.ora
Specifies the name of the operating system file to which the Names Server
writes its foreign data cache.
names.cache_checkpoint_interval = 7200
Syntax: Number of seconds, 10-259200
Default: 0 (off)
Indicates the interval at which a Names Server writes a checkpoint of its
data cache to the checkpoint file.
names.default_forwarders=
(FORWARDER_LIST=
(FORWARDER=
(NAME= rootserv1.world)
(ADDRESS=(PROTOCOL=tcp)(PORT=42100)(HOST=roothost))))
Syntax: Name-Value/address_list
Default: NULL
A list (in NV form) of the addresses of other servers which should be used to
forward querys while in default_forwarder (slave) mode. NAME is the global
names for the server to which forwards whould be directed, and ADDRESS is its
address.
names.default_forwarders_only = True
Syntax: T/F
Default: False
When set to true this server will use the servers listed in default_forwarders
to forward all operations which involve data in foreign regions. Otherwise it
will use the servers defined in the server-list file (sdns.ora) in addition
to any defined in the default_forwarders parameter.
names.log_directory = /oracle/network/log
Syntax: directory
Default: $ORACLE_HOME/network/log
Indicates the name of the directory where the log file for Names Server
operational events are written.
names.log_file = names.log
Syntax: filename
Default: names.log
The name of the output file to which Names Server operational events are
written.
names.log_stats_interval = 3600
Syntax: Number of seconds, 10-ub4max
Default: sec. 0 (off)
Specifies the number of seconds between statistical entries in log file.
names.log_unique = False
Syntax: T/F
Default: False
If set to true the server will guarantee that the log file will have a unique
name which will not overwrite any existing files (note that log files are
appended to, so log information will not be lost if log_unique is not true).
names.max_open_connections = 10
Syntax: 3-64
Default: 10
Specifies the number of connections that the Names Server can have open at any
given time. The value is generated as the value 10 or the sum of one
connection for listening, five for clients, plus one for each foreign domain
defined in the local administrative region, whichever is greater. Any
operation which requires the server to open a network connection will use
an already open connection if it is available, or will open a connection
if not. Higher settings will save time and cost network resources; lower
settings save network resources, cost time.
names.max_reforwards = 2
Syntax: 1-15
Default: 2
The maximum number of times the server will attempt to forward a certain
operation.
names.message_pool_start_size = 24
Syntax: 3-256
Default: 10
Determines the initial number of messages allocated in the server's message
pool. This pool provides the server with pre-allocated messages to be used
for incoming or outgoing messages (forwards). Messages which are in the pool
and unused may be reused. If a message is needed and no free messages are
available in the pool more will be allocated.
names.no_modify_requests = False
Syntax: T/F
Default: False
If set to true, the server will refuse any operations which modify the
data in its region (it will still save foreign info in the cache which is
returned from foreign querys).
names.password = 625926683431AA55
Syntax: encrypted string
Default: NULL
If set the server will require that the user provide a password in his
namesctl session (either with sqlnet.ora:namesctl.server_password or 'set
password') in order to do 'sensitive' operations, like stop, restart, reload.
This parameter is generally set in encrypted form, so it can not be set
manually.
names.reset_stats_interval = 3600
Syntax: 10-ub4max
Default: 0 (off)
Specifies the number of seconds during which the statistics collected by the
Names Servers should accumulate. At the frequency specified, they are reset
to zero. The default value of 0 means never reset statistics.
names.trace_directory = /oracle/network/trace
Syntax: directory
Default: $ORACLE_HOME/network/trace
Indicates the name of the directory to which trace files from a Names Server
trace session are written.
names.trace_file = names.trc
Syntax: filename
Default: names.trc
Indicates the name of the output file from a Names Server trace session.
names.trace_func # NA
Syntax: T/F
Default: False
Internal mechanism to control tracing by function name.
names.trace_level = ADMIN
Syntax: T/F
Default: False
Syntax: {OFF,USER,ADMIN,0-16}
Default: OFF (0)
Indicates the level at which the Names Server is to be traced.
Available Values:
0 or OFF - No trace output
4 or USER - User trace information
10 or ADMIN - Administration trace information
16 or SUPPORT - WorldWide Customer Support trace information
names.trace_mask = (200,201,202,203,205,206,207)
Syntax: list of numbers
Default: NULL
Internal mechanism to control trace behavior.
names.trace_unique = True
Syntax: T/F
Default: False
Indicates whether each trace file has a unique name, allowing multiple trace
files to coexist. If the value is set to ON, a process identifier is appended
to the name of each trace file generated.
# - Namesctl ---------------------------------------------------------
#namesctl.trace_directory = /oracle/network/trace
#Syntax: directory
#Default: $ON/trace
# Indicates the name of the directory to which trace files from a namesctl
# trace session are written.
#namesctl.trace_file = namesctl.trc
#Syntax: filename
#Default: namesctl.trc
# Indicates the name of the output file from a namesctl trace session.
#namesctl.trace_func # NA
#Syntax: word list
#Default: NULL
# Internal mechanism to control tracing by function name.
#namesctl.trace_level = ADMIN
#Syntax: {OFF,USER,ADMIN,0-16}
#Default: OFF (0)
# Indicates the level at which the namesctl is to be traced.
# Available Values:
# 0 or OFF - No trace output
# 4 or USER - User trace information
# 10 or ADMIN - Administration trace information
# 16 or SUPPORT - WorldWide Customer Support trace information
#namesctl.trace_mask # NA
#Syntax: number list
#Default: NULL
# Internal mechanism to control trace behavior.
#namesctl.trace_unique = True
#Syntax: T/F
#Default: False
# Indicates whether each trace file has a unique name, allowing multiple trace
# files to coexist. If the value is set to ON, a process identifier is appended
# to the name of each trace file generated.
#namesctl.no_initial_server = False
#Syntax: T/F
#Default: False
# If set to TRUE namesctl will suppress any error messages when namesctl is
# unable to connect to a default names server.
#namesctl.internal_use = True
#Syntax: T/F
#Default: False
# If set to true namesctl will enable a set of internal undocumented commands.
# All internal commands are preceded by an underscore ('_') in order to
# distinguish them as internal. Without going into details, the commands
# enabled are:
# adddata createname deletename
# fullstatus ireplacedata newttlname
# pause remove_data renamename
# replacedata start walk*
# There are also a set of names server variables which may be set when
# namesctl is in internal mode:
# authorityrequired autorefresh*
# cachecheckpoint_interval cachedump
# defaultautorefresh_expire defaultautorefresh_retry
# defaultforwarders_only forwardingdesired
# maxreforwards modifyops_enabled
# nextcache_checkpoint nextcache_flush
# nextstat_log nextstat_reset
# reload request_delay
# restart shutdown
#namesctl.noconfirm = True
#Syntax: T/F
#Default: False
# When set to TRUE namesctl will suppress the confirmation prompt when
# sensitive operations (stop, restart, reload) are requested. This is
# quite helpful when using namesctl scripts.
#namesctl.server_password = mangler
#Syntax: string
#Default: NULL
# Automatically sets the password for the names server in order to perform
# sensitive operations (stop, restart, reload). The password may also be
# set manually during a namesctl session using 'set password'.
#namesctl.internal_encrypt_password = False
#Syntax: T/F
#Default: True
# When set to TRUE namesctl will not encrypt the password when it is sent to
# the names server. This would enable an unencrypted password to be set in
# names.ora:names.server_password
# - Native Naming Adpaters -------------------------------------------
#names.dce.prefix = /.:/subsys/oracle/names
#Syntax: DCE cell name
#Default: /.:/subsys/oracle/names
#Specifies the DCE cell (prefix) to use for name lookup.
#names.nds.name_context = personnel.acme
#Syntax: NDS name
#Default: (OSD?)
# Specifies the default NDS name context in which to look for the name to
# be resolved.
#names.nis.meta_map # NA
# Syntax: filename
# Default: sqlnet.maps
# Specifies the file to be used to map NIS attributes to an NIS mapname.
# Currently unused.
# - Advanced Networking Option Authentication Adapters ----------------
#sqlnet.authentication_services
# Syntax: A single value or a list from {beq, none, all, kerberos5,
# cybersafe, securid, identitx}
# Default: NONE
# Enables one or more authentication services. To enable
# authentication via the Oracle Security Server, use (beq, oss). If
# the Advanced Networking Option has been installed with Kerberos5
# support, using (beq, kerberos5) would enable authentication via
# Kerberos.
sqlnet.authentication_services=(beq, oss)
## Parmeters used with Kerberos adapter.
#sqlnet.kerberos5_cc_name
# Syntax: Any valid pathname.
# Default: /tmp/krb5cc_<uid>
# The Kerberos credential cache pathname.
#sqlnet.kerberos5_cc_name=/tmp/mycc
#sqlnet.kerberos5_clockskew
# Syntax: Any positive integer.
# Default: 300
# The acceptable difference in the number of seconds between when a
# credential was sent and when it was received.
#sqlnet.kerberos5_clockskew=600
#sqlnet.kerberos5_conf
# Syntax: Any valid pathname.
# Default: /krb5/krb.conf
# The Kerberos configuration pathname.
#sqlnet.kerberos5_conf=/tmp/mykrb.conf
#sqlnet.kerberos5_realms
# Syntax: Any valid pathname
# Default: /krb5/krb.realms
# The Kerberos host name to realm translation file.
#sqlnet.kerberos5_realms=/tmp/mykrb.realms
#sqlnet.kerberos5_keytab
# Syntax: Any valid pathname.
# Default: /etc/v5srvtab
# The Kerberos secret key file.
#sqlnet.kerberos5_keytab=/tmp/myv5srvtab
#sqlnet.authentication_kerberos5_service
# Syntax: Any string.
# Default: A default is not provided.
# The Kerberos service name.
#sqlnet.authentication_kerberos5_service=acme
## Parmeters used with CyberSAFE adapter.
#sqlnet.authentication_gssapi_service
# Syntax: A correctly formatted service principal string.
# Default: A default is not provided.
# The CyberSAFE service principal
#sqlnet.authentication_gssapi_service=acme/[email protected]
## Parmeters used with Identix adapter.
#sqlnet.identix_fingerprint_method
# Syntax: Must be oracle.
# Default: A default is not provided.
# The Identix authentication server method
#sqlnet.identix_fingerprint_method=oracle
#sqlnet.identix_fingerprint_database
# Syntax: Any string.
# Default: A default is not provided.
# The Identix authentication server TNS alias
#sqlnet.identix_fingerprint_database=ofm
#sqlnet.identix_fingerprint_database_user
# Syntax: Any string
# Default: A default is not provided.
# The Identix authentication service well known username.
#sqlnet.identix_fingerprint_database_user=ofm_client
#sqlnet.identix_fingerprint_database_password
# Syntax: Any string
# Default: A default is not provided.
# The Identix authentication service well known password.
#sqlnet.identix_fingerprint_database_password=ofm_client
# - Advanced Networking Option Network Security -------------------------
#sqlnet.crypto_checksum_client
#sqlnet.crypto_checksum_server
#sqlnet.encryption_client
#sqlnet.encryption_server
# These four parameters are used to specify whether a service (e.g.
# crypto-checksumming or encryption) should be active:
# Each of the above parameters defaults to ACCEPTED.
# Each of the above parameters can have one of four possible values:
# value meaning
# ACCEPTED The service will be active if the other side of the
# connection specifies "REQUESTED" or REQUIRED" and
# there is a compatible algorithm available on the other
# side; it will be inactive otherwise.
# REJECTED The service must not be active, and the connection
# will fail if the other side specifies "REQUIRED".
# REQUESTED The service will be active if the other side specifies
# "ACCEPTED", "REQUESTED", or "REQUIRED" and there is a
# compatible algorithm available on the other side; it
# will be inactive otherwise.
# REQUIRED The service must be active, and the connection will
# fail if the other side specifies "REJECTED" or if there
# is no compatible algorithm on the other side.
#sqlnet.crypto_checksum_types_client
#sqlnet.crypto_checksum_types_server
#sqlnet.encryption_types_client
#sqlnet.encryption_types_server
# These parameters control which algorithms will be made available for
# each service on each end of a connection:
# The value of each of these parameters can be either a parenthesized
# list of algorithm names separated by commas or a single algorithm
# name.
# Encryption types can be: RC4_40, RC4_56, RC4_128, DES, DES40
# Encryption defaults to all the algorithms.
# Crypto checksum types can be: MD5
# Crypto checksum defaults to MD5.
#sqlnet.crypto_seed ="4fhfguweotcadsfdsafjkdsfqp5f201p45mxskdlfdasf"
#sqlnet.crypto_checksum_server = required
#sqlnet.encryption_server = required
# - Oracle Security Server ---------------------------------------------
#oss.source.my_wallet
# Syntax: A properly formatted NLNV list.
# Default: Platform specific. Unix: $HOME/oracle/oss
# The method for retrieving and storing my identity.
#oss.source.my_wallet
# =(source
# =(method=file)
# (method_data=/dve/asriniva/oss/wallet)
#oss.source.location
# Syntax: A properly formatted NLNV list.
# Default: Oracle method, oracle_security_service/oracle_security_service@oss
# The method for retrieving encrypted private keys.
#oss.source.location
# =(source
# =(method=oracle)
# (method_data=
# (sqlnet_address=andreoss)
# - Sqlnet(v2.x) and Net3.0 Client ------------------------------------------
# In the following descriptions, the term "client program" could mean
# either sqlplus, svrmgrl or any other OCI programs written by users
#trace_level_client = ADMIN
#Possible values: {OFF,USER,ADMIN,0-16}
#Default: OFF (0)
#Purpose: Indicates the level at which the client program
# is to be traced.
# Available Values:
# 0 or OFF - No Trace output
# 4 or USER - User trace information
# 10 or ADMIN - Administration trace information
# 16 or SUPPORT - Worldwide Customer Support trace information
#Supported since: v2.0
#trace_directory_client = /oracle/network/trace
#Possible values: Any valid directory path with write permission
#Default: $ORACLE_HOME/network/trace ($ORACLE_HOME=/oracle at customer
# site)
#Purpose: Indicates the name of the directory to which trace files from
# the client execution are written.
#Supported since: v2.0
#trace_file_client = /oracle/network/trace/cli.trc
#Possible values: Any valid file name
#Default: $ORACLE_HOME/network/trace/cli.trc ($ORACLE_HOME =
# /oracle at customer site)
#Purpose: Indicates the name of the file to which the execution trace
# of the client is written to.
#Supported since: v2.0
#trace_unique_client = ON
#Possible values: {ON, OFF}
#Default: OFF
#Purpose: Used to make each client trace file have a unique name to
# prevent each trace file from being overwritten by successive
# runs of the client program
#Supported since: v2.0
#log_directory_client = /oracle/network/log
#Possible values: Any valid directory pathname
#Default: $ORACLE_HOME/network/log ($ORACLE_HOME = /oracle at customer
# site)
#Purpose: Indicates the name of the directory to which the client log file
# is written to.
#Supported since: v2.0
#log_file_client = /oracle/network/log/sqlnet.log
#Possible values: This is a default value, u cannot change this
#Default: $ORACLE_HOME/network/log/sqlnet.log ($ORACLE_HOME=/oracle in
# customer site)
#Purpose: Indicates the name of the log file from a client program
#Supported since: v2.0
#log_directory_server = /oracle/network/trace
#Possible values: Any valid diretcory path with write permission
#Default: $ORACLE_HOME/network/trace ( $ORACLE_HOME=/oracle at customer
# site)
#Purpose: Indicates the name of the directory to which log files from the
# server are written
#Supported since: v2.0
#trace_directory_server = /oracle/network/trace
#Possible values: Any valid directory path with write permission
#Default: $ORACLE_HOME/network_trace ( $ORACLE_HOME=/oracle at customer
# site)
#Purpose: Indicates the name of the directory to which trace files from
# the server are written
#Supported since: v2.0
#trace_file_server = /orace/network/trace/svr_<pid>.trc
#Possible values: Any valid filename
#Default: $ORACLE_HOME/network/trace/svr_<pid>.trc where <pid? stands for
# the process id of the server on UNIX systems
#Purpose: Indicates the name of the file to which the execution trace of
# the server program is written to.
#Supported since: v2.0
#trace_level_server = ADMIN
#Possible values: {OFF,USER,ADMIN,0-16}
#Default: OFF (0)
#Purpose: Indicates the level at which the server program
# is to be traced.
# Available Values:
# 0 or OFF - No Trace output
# 4 or USER - User trace information
# 10 or ADMIN - Administration trace information
# 16 or SUPPORT - Worldwide Customer Support trace information
#Supported since: v2.0
#use_dedicated_server = ON
#Possible values: {OFF,ON}
#Default: OFF
#Purpose: Forces the listener to spawn a dedicated server process for
# sessions from this client program.
#Supported since: v2.0
#use_cman = TRUE
#Possible values: {TRUE, FALSE}
#Default: FALSE
#Purpose:
#Supported since: v3.0
#tnsping.trace_directory = /oracle/network/trace
#Possible values: Any valid directory pathname
#Default: $ORACLE_HOME/network/trace ($ORACLE_HOME=/oracle at customer
# site)
#Purpose: Indicates the directory to which the execution trace from
# the tnsping program is to be written to.
#Supported since: v2.0
#tnsping.trace_level = ADMIN
#Possible values: {OFF,USER,ADMIN,0-16}
#Default: OFF (0)
#Purpose: Indicates the level at which the server program
# is to be traced.
# Available Values:
# 0 or OFF - No Trace output
# 4 or USER - User trace information
# 10 or ADMIN - Administration trace information
# 16 or SUPPORT - Worldwide Customer Support trace information
#Supported since: v2.0
#sqlnet.expire_time = 10
#Possible values: 0-any valid positive integer! (in minutes)
#Default: 0 minutes
#Recommended value: 10 minutes
#Purpose: Indicates the time interval to send a probe to verify the
# client session is alive (this is used to reclaim watseful
# resources on a dead client)
#Supported since: v2.1
#sqlnet.client_registration = <unique_id>
#Possible values:
#Default: OFF
#Purpose: Sets a unique identifier for the client machine. This
# identifier is then passed to the listener with any connection
# request and will be included in the Audit Trail. The identifier
# can be any alphanumeric string up to 128 characters long.
#Supported since: v2.3.2
#bequeath_detach = YES
#Possible values: {YES,NO}
#Default: NO
#Purpose: Turns off signal handling on UNIX systems. If signal handling
# were not turned off and if client programs written by users make
# use of signal handling they could interfere with Sqlnet/Net3.
#Supported since: v2.3.3
#automatic_ipc = OFF
#Possible values: {ON,OFF}
#Default: OFF
#Purpose: Force a session to use or not to use IPC addresses on the
# client's node.
#Supported since: v2.0
#disable_oob = ON
#Possible values: {ON,OFF}
#Default: OFF
#Purpose: If the underlying transport protocol (TCP, DECnet,...) does
# not support Out-of-band breaks, then disable out-of-band
# breaks
#Supported since: v2.0
# -
How to mention numbers in array while creating dynamic sql
Hi,
I am creating a dynamic sql and in that I am selecting some rows from the table and storing it into the array.
I am firing this sql statement within trigger.
But i got the error:
ORA-06502: PL/SQL: numeric or value error: character to number conversion error
I took the same sql statement (the one which was created dynamically) in the procedure and tried to run it but it gave me the same error.
=========================================================
Begin
type NewValueArray is table of varchar2(4000);
nVal_Array NewValueArray;
Begin
Select
DISCOVERYHOSTNAME,
DISCOVERYMACPRIMARYPHYSICAL,
DISCOVERYSERIALNUMBER
into
nVal_Array(1),
nVal_Array(2),
nVal_Array(3)
from ALT_42_Consolidated
where rowid = 'AAEWNEABXAAAAkxAAA';
EXCEPTION
WHEN others THEN
Raise;
End;
=========================================================
I tried using to_number but still the same error.
Can some body please inform me where I am goofing.
Thanks!I got a different error, but you need to initialise your nval_array and make sure it can hold three values. The following should work:
declare
type NewValueArray is table of varchar2(4000);
nVal_Array NewValueArray := NewValueArray();
Begin
nval_array.extend(3);
Select col1, col2, col3
into nVal_Array(1), nVal_Array(2), nVal_Array(3)
from tab1
where rowid = 'AAAGJZAAGAAAAAWAAV';
EXCEPTION
WHEN others THEN
Raise;
End;
/ -
Giving error of insufficient privileges while creating triggers
Hi all,
I am facing the problem of insuffcient privilege on base tables while creating triggers. I have three schemas say A, B, C in my database.
Base tables are in schema A. I have given all the grants on base table to schema B and C.
grant all on base_table_name to B;
grant all on base_table_name to C;
I have created synonym also on that base table.
And i m creating triggers in schema B.
When i execute the query for trigger the it giving following error :
+AFTER INSERT OR UPDATE OR DELETE ON BASE_TBALE_NAME *+
ERROR at line 3:
ORA-01031: insufficient privileges
even i have checked in dba_tab_privs for that base_table.....it is showing all the grants to USER B and C.
What should I do now?
please suggest.......
Regards,
Andy.Hi karan,
You are right. While searching docs i got the solution of my problem.
Privileges Required to Use Triggers
To create a trigger in your schema:
+•You must have the CREATE TRIGGER system privilege+
+•One of the following must be true:+
+◦You own the table specified in the triggering statement+
+◦You have the ALTER privilege for the table specified in the triggering statement+
+◦You have the ALTER ANY TABLE system privilege+
To create a trigger in another schema, or to reference a table in another schema from a trigger in your schema:
+•You must have the CREATE ANY TRIGGER system privilege.+
+•You must have the EXECUTE privilege on the referenced subprograms or packages.+
To create a trigger on the database, you must have the ADMINISTER DATABASE TRIGGER privilege. If this privilege is later revoked, you can drop the trigger but not alter it.
The object privileges to the schema objects referenced in the trigger body must be granted to the trigger owner explicitly (not through a role). The statements in the trigger body operate under the privilege domain of the trigger owner, not the privilege domain of the user issuing the triggering statement (this is similar to the privilege model for stored subprograms).
I have to grant only create any trigger to user.
Problem solved.
Thanks to all for ur help.
Regards,
Andy.
Maybe you are looking for
-
I have received the error code 87 when attempting to update Creative Cloud. I had previously received an update for Acrobat Pro (not the CC version), and the install failed. Now I cannot install any Adobe product. How do I resolve this issue? Rather
-
Inconsistent Date Implementation in Apps (Yosemite)
After upgrading to Yosemite 10.10.2 from Mavericks (10.9.latest), I've noticed several inconsistencies in how dates are shown in various apps. System Prefs Settings: Short: dd/mm/yy Medium: d/mon/yyyy Long: d month yyyy Full: Day, d month yyyy Calend
-
Four Quadrants in Web Template
Hi All, We need a web tenplate where in we can have header, footer and body with 4 equally distributed quadrants with currency conversion option enabled. For Currency Conversion: We can see three options 1) Fixed to any one currency 2) Fixed to defau
-
Premiere Pro will not open/start. I click on the icon from the start menu and nothing happens. I've cleaned out my installs and reintalled so many times only to have the apps work once and then not work the next time I reboot. Grrr!
-
HI Experts, I am facing problems while connecting to a sap thru REmote connection.I got a saplogon.ini where can i place this file. Wats the use of this file Thanks Abhishek