ORA-01031: insufficient privileges when you try to run a proc

I have a procedure called KILL_MY_SESSION that is defined with a value of DEFINE AUTHID

The schema JOHN belonged procedure. The procedure makes several calls to PL/SQL DBMS_SQL package.
The last thing that not with DBMS_SQL proceedings concern an ALTER SYSTEM KILL SESSION statement.
Schema JOHN has privileges to kill a session in the database.
If I log in the scheme of JOHN, I can issue the statement ALTER SYSTEM KILL SESSION successfully.
Also, when you are logged in the scheme of JOHN, I can run the KILL_MY_SESSION procedure.

Now I have the ISTO schema. I got ISTO privileged EXECUTE on the JOHN. Procedure KILL_MY_SESSION.
Since JOHN. KILL_MY_SESSION is a privilege of rights DEFINERs, if RIGHTS shouldn't be able to execute the procedure correctly and kill a session?

This is an output of the session of the ISTO when you try to run JOHN. KILL_MY_SESSION:

SQL > conn oifs@dbname
Enter password: *.
Connected.
SQL > 500 fixed lines
SQL > select username, osuser, sid, serial #.
2 session $ v
3 where username = "OIFS."

USERNAME OSUSER SID SERIAL #.
------------------------------ ------------------------------ ---------- ----------
OIFS administrator 142 325
OIFS administrator 139 613

SQL > exec ('142 ', 325') john.kill_my_session
BEGIN john.kill_my_session ('142 ', 325'); END;

*
ERROR on line 1:
ORA-01031: insufficient privileges
ORA-06512: at "SYS." DBMS_SYS_SQL", line 1204
ORA-06512: at "SYS." DBMS_SQL", line 323
ORA-06512: at "EIADBA. KILL_MY_SESSION', line 20
ORA-06512: at line 1


Someone at - he a clue as to what I'm doing wrong?
View DBA_PROCEDURES, here's the record for KILL_MY_SESSION


OWNER
------------------------------
OBJECT_NAME
--------------------------------------------------------------------------------
OBJECT_TYPE AUTHID
------------------- ------------
JOHN
KILL_MY_SESSION
DEFINE PROCEDURE

I mean the privilege of system alter directly, not through roles.

GRANT ALTER SYSTEM TO JOHN;

Please read the articles below, you should restrict the sessions that can be killed, according to what will be your implementation.

It could be useful.
http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:226613885088
http://DBA-Oracle.com/t_granting_alter_system_kill_session.htm

Tags: Database

Similar Questions

  • Download "error: ORA-01031: insufficient privileges" when try to add relief of database

    Hi all

    I get insufficient privileges error when I added a standby database to dg configuration. I read some blog and he said that dgmgrl does not support os authentication, which means that I need to connect with sys and password. But I found that if I keep standby and primary SIDs are the same, the error will not occur even if I don't provide a password. Anyone know the reason? And no workaround?

    The process as follows:

    main SID: orcl ensures sid: prxx

    connect to "dgmgrl / '.

    Run ' add the database ' prxx_stby "as an identifier of connection is"prxx_stby"

    Download:

    Error: ORA-01031: insufficient privileges

    Failed.

    But if sid main: orcl ensures sid: orcl

    connect to "dgmgrl / '.

    Run ' add the database ' orcl_stby "as an identifier of connection is"orcl_stby"

    Download:

    Database "orcl_stby" added

    Liz

    I think still you can connect as "dgmgrl /", but its recommended to use "dgmgrl sys / * '.

    As rchem has said, there can be question of password. It doesn't matter whether the SID is the same or not primary and standby so different locations. So the best practice is to connect to the database from the primary server before using Oracle net service and test whether you connect or not.

    Ex: Prim_host > sqlplus sys/***@stby as sysdba

    There are a lot of possible issues

    -Missing or invalid password file

    -Service name is not registered with earphone

    -service incorrect, mentioned in the tns names

    and so many things, overlaps with these things.

  • Error ORA-01031 insufficient privilege when selecting a view

    OK, I think it's maybe a stupid question, but I can't understand it:

    The user John won the right to SELECT (directly, not by a database role) to the FRED.table1 schema.
    John user can issue select * from FRED.table1; and it works very well.

    User John then got the right to SELECT (directly, without going through a database role) to the schema
    MARK.view1;

    MARK.view1 selects only FRED.table1. No other table is in the View1.
    Schema MARK questionable views successfully. SELECT * FROM View1 returns results.
    I also checked the MARK scheme to ensure that she got the select on FRED.table1 directly that he has.

    Now, when you're logged in schema John, I try SELECT * to SCORE. VIEW1; and I get error ORA-01031 insufficient privileges.

    I don't know how to solve this. If John is granted SELECT a TABLE, it works of course but I don't want John to have this powerful private.

    As a reminder, SELECT these two brands a John. View1 and the table View1 selects from (FRED. (TABLE 1).
    John can select FRED. Table1: no problem but does not receive a privilege error even if John has SELECT on the BRAND. VIEW1.

    Any thoughts?

    Oh, Oracle 10.2.0.4 EA

    JSebastian wrote:
    OK, I think it's maybe a stupid question, but I can't understand it:

    The user John won the right to SELECT (directly, not by a database role) to the FRED.table1 schema.
    John user can issue select * from FRED.table1; and it works very well.

    User John then got the right to SELECT (directly, without going through a database role) to the schema
    MARK.view1;

    MARK.view1 selects only FRED.table1. No other table is in the View1.
    Schema MARK questionable views successfully. SELECT * FROM View1 returns results.
    I also checked the MARK scheme to ensure that she got the select on FRED.table1 directly that he has.

    Now, when you're logged in schema John, I try SELECT * to SCORE. VIEW1; and I get error ORA-01031 insufficient privileges.

    I don't know how to solve this. If John is granted SELECT a TABLE, it works of course but I don't want John to have this powerful private.

    As a reminder, SELECT these two brands a John. View1 and the table View1 selects from (FRED. (TABLE 1).
    John can select FRED. Table1: no problem but does not receive a privilege error even if John has SELECT on the BRAND. VIEW1.

    Any thoughts?

    Oh, Oracle 10.2.0.4 EA

    Are you sure that John was granted select on Mark.view1? In order for that to work, Mark would have had to select on the WITH GRANT OPTION Fred.table1... otherwise the grant to fail and then John would not be able to select the view because the grant was never issued successfully.

    Here is a basic test case (which I think is consistent with what you said) to make it work.

    drop user u1 cascade;
    drop user u2 cascade;
    drop user u3 cascade;
    
    create user u1 identified by u1;
    grant connect, resource to u1; 
    
    create user u2 identified by u2;
    grant connect, resource, create view to u2;
    
    create user u3 identified by u3;
    grant connect, resource to u3;
    
    connect u1/u1@orcl
    create table test1 (col1 number);
    grant select on test1 to u2 with grant option; --> this is the important part
    grant select on test1 to u3;
    
    connect u2/u2@orcl
    create view test2 as select * from u1.test1;
    grant select on test2 to u3;
    
    connect u3/u3@orcl
    select * from u2.test2;
    
  • ORA-01031: insufficient privileges when granted access privileges to a new user

    Hello.

    When you are connected to a SYSTEM, I'm trying to create a new user and give him all the system privileges, but do so always the following error message appears:

    Cannot process the SQL command

    -

    Error at startup to the line: 123 to orders.

    SYSDBA GRANT TestUser

    Error report-

    SQL error: ORA-01031: insufficient privileges

    01031 00000 - "insufficient privileges".

    * Cause: An attempt was made to execute a database operation without

    the necessary privileges.

    * Action: Ask your database or the designated security administrator

    administrator to grant you the required privileges

    After clicking OK, the user is still being created, but it lacks many privileges to access.

    How can I solve this problem?

    I use Oracle SQL Developer version 4.1.2.20 and Oracle database 11g of the express edition.

    Connect as SYS, not SYSTEM to grant this priv

    Give him with extreme prejudice - it is powerful

    Note in the 12 c database we have stopped a lot of the administrative bits of the SYSDBA role in less powerful. This gives you more flexibility on who can do what in your database

    https://docs.Oracle.com/database/121/DBSEG/authorization.htm#DBSEG578

  • ORA-01031: insufficient privileges when connecting as SYSDBA

    I am trying to connect to the database and receiving "ORA-01031: insufficient privileges". Database version is 11.2.0.3 (standalone) on Linux.

    [oracle@dbserv admin] $ echo $ORACLE_HOME

    /U01/app/Oracle/product/11.2.0.3/db1

    [oracle@dbserv admin] $

    [oracle@dbserv admin] $ which sqlplus

    /U01/app/Oracle/product/11.2.0.3/db1/bin/sqlplus

    [oracle@dbserv dbs] $ sqlplus sys/oracle@newdb as sysdba

    SQL * more: Production release 11.2.0.3.0 Wed Aug 26 20:38:13 2015

    Copyright (c) 1982, 2011, Oracle.  All rights reserved.

    ERROR:

    ORA-01031: insufficient privileges

    Enter the user name:

    Password file has been created and is in $ORACLE_HOME/dbs location.

    [oracle@dbserv dbs] $ pwd

    /U01/app/Oracle/product/11.2.0.3/db1/DBS

    [oracle@dbserv dbs] $ ls - lrt * orapw *.

    -rw - r - 1 oracle oinstall 1536 26 August to 20:38 orapwnewdb

    To be clear, there is a version of GI 11.2.0.2 already installed with 11.2.0.2 RDBMS version on the same server (standalone).

    In addition, 11.2.0.3 has been installed on the same machine and a new listening port has been created on 11.2.0.3 home for databases residing on this House.

    Here are the details:

    [oracle@dbserv dbs] $ ps - ef | grep tns

    Oracle 4226 1 0 20:20?        00:00:00 /u01/app/oracle/product/11.2.0.2/grid/bin/tnslsnr EARPHONE-inherit

    Oracle 4239 1 0 20:20?        00:00:00 /u01/app/oracle/product/11.2.0.3/db1/bin/tnslsnr LISTENER_NEWDB-inherit

    Oracle 4599 3734 0 20:44 pts/2 00:00:00 grep tns

    [oracle@dbserv dbs] $ lsnrctl status LISTENER_NEWDB

    LSNRCTL for Linux: Version 11.2.0.3.0 - Production on August 26, 2015 20:44:32

    Copyright (c) 1991, 2011, Oracle.  All rights reserved.

    Connection to (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST=dbserv.mydomain) (PORT = 1526)))

    STATUS of the LISTENER

    ------------------------

    Alias LISTENER_NEWDB

    Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production

    Start date August 26, 2015 11:20:20

    Uptime 0 days 0 h 24 min 21 sec

    Draw level off

    Security ON: OS Local Authentication

    SNMP OFF

    Parameter Listener of the /u01/app/oracle/product/11.2.0.3/db1/network/admin/listener.ora file

    The listener log file /U01/app/Oracle/diag/tnslsnr/dbserv/listener_newdb/alert/log.XML

    Summary of endpoints listening...

    (DESCRIPTION = (ADDRESS = (PROTOCOL = tcp)(HOST=dbserv.mydomain) (PORT = 1526)))

    (DESCRIPTION = (ADDRESS = (PROTOCOL = ipc) (KEY = EXTPROC1526)))

    Summary of services...

    Service 'SLAVE_PORT_NUM' has 1 instance (s).

    Instance of 'SLAVE_PORT_NUM', status UNKNOWN, has 1 operation for this service...

    The command completed successfully

    My bad. OP has already validated the status of the listener. I just forgot.

    I suspected to be an incompatibility with SID in regard to upper and lower case letters and now seem to be confident.

    The listener status indicates the name of the instance as SLAVE_PORT_NUM but OP said as slave_port_num lowercase. Let's take a look in the file of the listener.

    TNS ADMIN could also be a cause, but in this case, it could lift error related to the listener (TNS).

    OP, please send the contents of listener.ora crossing 11.2.0.3 House.

    -Jonathan Rolland

  • ORA-01031 insufficient privilege when updating a table join

    Update (select a.f1, b.f2 FROM tableA a join tableB b using (fk))
    Set f1 = f2

    the user connection enough readonly privilege for tableB, but sql never update the tableB, why Oracle triggers the error?

    How can I implement the logic to update?

    UPDATE tablea a
    SET (f1, col) = (SELECT b.f2, b.col
    FROM tableb b
    WHERE = a.key b.key)

    If one given by Danish works, then you can simplify this in writing as it... even that request that eliminating two claims her...

    Ravi Kumar

    Published by: user10164479 on July 24, 2009 11:16

  • ORA-01031: insufficient privileges while selectin view belongs to another schema in oracle database 11g

    Hello

    DB version 11.2.0.3.0

    We have a few views resides in the application schema, we cerated user and granted select on the view through the roles.

    but the user becomes ORA-01031: insufficient privileges when accessing the content view

    appreciated inputs

    BR

    Praaksh GR

    > I issued a grant select on Z.table - X with the option grant.

    This isn't what you need - you should

    Grant select on Z.table y with the option grant.

    Grant select on Y.view to X;

  • ORA-01031: error of insufficient privileges when I try to use ALERT_QUE

    Hello
    I'm working on SYS. ATTENTION. THAT for system alerts. I use ODP in c# to connect to the Oracle database with username = SYSTEM, but when I try to survey or deque any message from SYS. ATTENTION. Que., its gives an error ORA-01031: insufficient privileges. I am not able to understand how to assign SYSDBA privileges to the SYSTEM and access ALERT_QUE to get alerts of system. I write my code below, please take a look and let me know what is wrong with the code. I am able to connect to the database using the SYSTEM, do I have to use username = SYS for access to the content database ALERT_QUE? Please let me know what is the solution.


    Con OracleConnection = new OracleConnection (constr.);

    Create the queue
    Queue OracleAQQueue = new OracleAQQueue ("sys.alert_que", con);

    Open connection
    con. Open();

    BEGIN txn for enqueue
    OracleTransaction txn = con. BeginTransaction();

    Set the type of message to the queue
    queue. MessageType = OracleAQMessageType.Raw;

    Prepare the message and payload BRUTE
    OracleAQMessage enqMsg = new OracleAQMessage();
    Byte [] bytePayload = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
    enqMsg.Payload = bytePayload;
    Agent [] OracleAQAgent = new OracleAQAgent [1];

    Agent [0] = new OracleAQAgent ("SUBSCRIBER1");
    enqMsg.Recipients = agent;
    enqMsg.SenderId = new OracleAQAgent ("SENDER1");

    Prepare for the queue
    queue. EnqueueOptions.Visibility = OracleAQVisibilityMode.OnCommit;

    Message from the queue
    queue. Enqueue (enqMsg);


    The code throws the exception to the line "queue. Enqueue (enqMsg); "saying: ORA-01031: insufficient privileges

    Published by: 916462 on February 27, 2012 03:31

    You are looking for a connection preferred, which means that you must connect as SYSDBA
    Check this doc on how to do it.
    http://docs.Oracle.com/CD/B19306_01/win.102/b14307/featConnecting.htm

  • ORA-01031: insufficient privileges with user SYS when I try to log

    Hello

    When I try to connect to our database with the user SYS via TOAD he gives below error.
    ORA-01031: insufficient privileges

    If I use SQLPLUS "/ as sysdba" it's conningting but if I try to use another tool like TOAD I can't connect.

    You could someone help me what is the problem andhow can I connect the user SYS with TOAD.
    version of database is 9.2.0.8.

    Thank you and best regards,

    You set remote_login_passwordfile exclusive.

  • EXPDP: ORA-01031: insufficient privileges

    Hello

    When I add the QUERY clause in the settings file, get the following errors.

    ERROR:
    ORA-31693: Data Table object 'TESTDB '. "' ACCOUNT ' could not load/unload and being ignored because of the error:
    ORA-01031: insufficient privileges

    Version: Export: Release 10.2.0.4.0 - Production 64-bit

    Parameter:

    DIRECTORY = USER_DATA_PUMP_DIR
    CONTENT = ALL
    PARALLEL = 4
    ESTIMATE = STATISTICS
    INCLUDE = TABLE: 'IN (SELECT EXP_TABLE_NAME FROM EXPDP. '. EXP_TABLES).
    QUERY = TESTDB. ACCOUNT: ' IF ADDED_OPRID NOT IN (SELECT OPRID FROM EXCLUDE_OPRID).
    FLASHBACK_TIME = "to_timestamp (to_char (sysdate, 'YYYY-MM-DD HH24:MI:SS'),"YYYY-MM-DD HH24:MI:SS").

    The following grants have been created on the user of datapump EXPDP export.

    GRANT PERMISSION TO EXPDP
    GRANT 'CONNECT' TO THE EXPDP
    GRANT CREATE SESSION EXPDP
    GRANT CREATE TABLE TO EXPDP
    GRANT SELECT ANY TABLE TO EXPDP

    Can you help me solve this problem?

    Thank you

    Hello
    you do an export with the return of flame parameter.
    Try to give your user FLASHBACK ANY TABLE export.

    I have several problems in the past, the permission is not enough for the return of flame.

    concerning
    Peter

  • Error: ORA-01031: insufficient privileges, the connect via SQLPlus

    Hello
    I installed Oracle database 11.2.0.1.0 on Windows 2008.
    When I try to connect using sqlplus, it gives me the following error:

    C:\users\administrator > sqlplus "/ as sysdba".

    SQL * more: Production of release 11.2.0.1.0 Fri Sep 2 10:43:57 2011

    Copyright (c) 1982, 2010, Oracle. All rights reserved.

    ERROR:
    ORA-01031: insufficient privileges


    Enter the user name:

    The administrator of the user part of the ora_dba group.
    Please help me how I can solve this problem.

    Thank you

    You are right. I didn't know that it was Windows. My bad! Thanks for pointing it out.

    It should be NTS (for the native security)

  • ORA-01031: insufficient privileges from a function

    Deploy_ctl.fun_stg_raw (NO_DAYS in NUMBER, of the FUNCTION to CREATE or REPLACE
    col_date DATE)

    RETURN NUMBER
    AS

    RTN_SUCCESS CONSTANT NUMBER (1): = 0;
    RTN_FAILURE CONSTANT NUMBER (1): = 1;
    RTN_NON_FATAL NUMBER (1) CONSTANT: = 2;


    CURSOR stg_raw_cur IS
    SELECT RAW_STG_ID,
    DEVICE_CD,
    MODEL_VERSION,
    PLATFORM_CD,
    PROFILE_COOKIE,
    LOCATION_CD,
    SAMPLE_RATE,
    EVENT_TYPE_CD,
    EVENT_DATE_TIME,
    EVENT_SPECIFIC,
    BATCH_ID,
    DWH_ARVL_DT,
    DWH_ARVL_DT_ID,
    Dwh_stg.stg_raw DWH_CREATE_DT
    When trunc (to_date (EVENT_DATE_TIME, "YYYYMMDD"T"hh24:mi:ss"Z"')) = to_date (' 04/28/2014 ',' mm/dd/yyyy')
    order of batch_id CSA;


    TYPE stgrawarr IS TABLE OF stg_raw_cur % ROWTYPE;

    stg_raw_rec stgrawarr;

    l_batch_id NUMBER: = 0;
    v_ctr NUMBER: = 1;
    l_temp_batch_id number: = 0;
    l_date VARCHAR2 (2000);

    BEGIN

    run immediately 'truncate table t_stg_raw;

    OPEN stg_raw_cur.
    LOOP
    Get the stg_raw_cur COLLECT LOOSE stg_raw_rec LIMIT 100;
    OUTPUT
    WHEN stg_raw_cur % NOTFOUND;
    END LOOP;

    CLOSE Stg_raw_cur;

    I'm in stg_raw_rec.first... stg_raw_rec. Last
    loop

    -dbms_output.put_line (' batch code is ' | .batch_id stg_raw_rec (i));
    IF l_temp_batch_id! = stg_raw_rec (i) .batch_id
    then

    l_batch_id: = stg_raw_rec (i) .batch_id - v_ctr;
    l_temp_batch_id: = stg_raw_rec (i) .batch_id;
    * dbms_output.put_line ('Différent' |) "v_ctr" |
    v_ctr | ' ' || l_batch_id |
    ' ' || stg_raw_rec (i) .batch_id | ' ' ||
    stg_raw_rec (i). EVENT_DATE_TIME) ;*/
    v_ctr: = v_ctr + 2;

    end if;

    1.no_days j
    loop
    l_date: = to_char (to_date (to_date (substr (stg_raw_rec (i). (EVENT_DATE_TIME, 1, 8), 'YYYYMMDD')-j |
    'T' ||
    substr (stg_raw_rec (i). EVENT_DATE_TIME, 10, 8).
    ('Z', "DD-MON-RR"T"HH24:MI:SS 'Z'"), "YYYYMMDDYY"T"HH24:MI:SS 'Z'");
    dbms_output.put_line (' l_batch_id ' | l_batch_id |)
    "stg_raw_rec (i) .batch_id | stg_raw_rec (i) .batch_id |

    "l_date" | l_date);
    end loop;

    l_temp_batch_id: = stg_raw_rec (i) .batch_id;
    commit;
    end loop;

    RETURN RTN_SUCCESS;

    EXCEPTION
    WHILE OTHERS THEN
    -Insert in the (current) error log table
    DBMS_OUTPUT. PUT_LINE ('SQLCODE' |) SQLCODE. ' '|| SQLERRM);

    RETURN RTN_FAILURE;

    END fun_stg_raw;
    /
    DISPLAY ERRORS;
    /


    I can execute SQL statements on its own as a user DEPLOY_CTL but when compiling the function, he throws ORA-01031: insufficient privileges error.

    Thank you

    This may be infamous granting by the issue of the role. You need the explicit subsidies. For more information see Re: compile errors
    You can use the VALUE NO ROLE and then try to run the SQL to check.

  • Failure to logon with the user SYS: ORA-01031: insufficient privileges

    Hello

    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE 11.2.0.1.0 Production
    AMT for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production

    OS: CentOS 5.5

    I can't log in with the user SYS via PL/SQL Developer. I get the message: ORA-01031: insufficient privileges. PL/SQL Developer is installed on Windows 7 Professional. Version of the Oracle Client is 11.2.0.1.0. However, I connect successfully with SYSMAN and SYSTEM.
    For those who may wonder if I try to connect 'as sysdba' when I use the SYS user, the answer is YES, I do.
    In addition, I think that the name of the tool (PL/SQL Developer) does not matter because I think I'm going to face the same error with any other tool (but I mentioned just in case).

    Server side, I have no problem with the SYS user. I can connect via SQLPlus with connect / as sysdba or connect "virtue sysdba" without fault.

    The sec_case_sensitive_logon initialization parameter is set to FALSE
    SQL > show parameter sensi

    VALUE OF TYPE NAME
    ------------------------------------ ----------- ------------------------------
    SEC_CASE_SENSITIVE_LOGON boolean FALSE

    I use the local name to connect and client side, I have a tnanames.ora file. The sqlnet.ora file looks like this:
    SQLNET.AUTHENTICATION_SERVICES= (NTS)
    
    NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
    I read in this forum (another thread) on the use of a password file. I created a password file using orapwd this way:
    orapwd file=orapwDB11G2 entries=100 ignorecase=y password=a_password
    where I replaced "a_password" with the SYS password.

    In fact, I'm not sure that the customer is influenced by the file password anyway because I said to use a local naming.

    Clues?

    Thank you very much!

    So your ORACLE_SID is planet but not DB11G2 , second password file must be located in $ORACLE_HOME/dbs location if you want to connect the planet of database/sid and therefore

    orapwd file= $ORACLE_HOME/dbs/orapwplanet password=syspass
    

    Then try again.

  • Oracle ORA-01031 insufficient privileges

    Hi all,

    I installed oracle 10g and created the new database. When I try to create the simple view wristwatch the following error.

    Oracle ORA-01031 insufficient privileges

    Note: if I connected through the admin user, I was able to create the view (System Manager). Although I have provide him grant leave, I could not able to create the view, his request for privileges.

    say create or replace view view-name as select * from employees;

    Error: oracle ora-01031 insufficient privileges

    Thanks in advance

    Hello

    You need the privilege system CREATE VIEW to create a view. This is in addition to the SELECT on the tables directly granted privileges at home (and not a role you have).

  • Create table ORA-01031: insufficient privileges

    SQL > indicate user USER is 'TEST_RPT.

    SQL > CREATE TABLE mytest (id NUMBER); - it does not work

    CREATE TABLE mytest (id NUMBER)

    * ERROR at line 1: ORA-01031: insufficient privileges

    SQL > CREATE TABLE TEST_RPT.mytest (id NUMBER).

    Table created. SQL >


    SQL > select * from session_privs;

    PRIVILEGE

    ----------------------------------------

    ANY PROCEDURE DEBUG

    DEBUGGING SESSION CONNECT

    CREATE INDEXTYPE

    OPERATOR TO CREATE

    CREATE THE TYPE

    CREATE THE TRIGGER

    CREATE PROCEDURE

    CREATE SEQUENCES

    CREATE VIEW

    CREATE SYNONYM

    CREATE THE CLUSTER

    CREATE TABLE

    UNLIMITED TABLESPACE

    ALTER SESSION STATEMENT

    CREATE SESSION

    Try this:

    SELECT USER, SYS_CONTEXT('USERENV','CURRENT_SCHEMA') FROM DUAL;

    The two identical values? CURRENT_SCHEMA is what will determine the owner of the table you create, if you do not specify an owner.

    This can be changed by

    ALTER SESSION SET CURRENT_SCHEMA = whatever_you_want_it_to_be;

Maybe you are looking for