Home » SQL & PL/SQL » SQL & PL/SQL » Create global temporary table
Create global temporary table [message #10263] Mon, 12 January 2004 01:18 Go to next message
Ric Jones
Messages: 1
Registered: January 2004
Junior Member
Hi all,

 I’m trying to create a global temporary table (using 8.1.7.4 on AIX) but I keep getting ORA-01031 “insufficient privileges” error whenever I run it.  the user has its own tablespace and "create session" & "unlimited tablespace" privileges only but as far as I was aware, anyone could create a temp table regardless of their system privileges/roles – or am I completely wrong ??

 If I am wrong, will the user need the “create table” privilege, even for a temporary table ??

 TIA,

 Ric Jones
Re: Create global temporary table [message #10267 is a reply to message #10263] Mon, 12 January 2004 05:29 Go to previous messageGo to next message
sverch
Messages: 582
Registered: December 2000
Senior Member
You have the create table privelege via a role, you need to have it granted
directly to you.

http://asktom.oracle.com/pls/ask/f?p=4950:8:383290::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:1086033238621,
Re: Create global temporary table [message #10278 is a reply to message #10263] Mon, 12 January 2004 21:55 Go to previous messageGo to next message
Barbara Boehmer
Messages: 9088
Registered: November 2002
Location: California, USA
Senior Member
Granting just create session and unlimited tablespace is insufficient, however also granting resource works, as demonstrated below.

scott@ORA92> CREATE USER TEST IDENTIFIED BY TEST;

User created.

scott@ORA92> GRANT CREATE SESSION TO TEST;

Grant succeeded.

scott@ORA92> GRANT UNLIMITED TABLESPACE TO TEST;

Grant succeeded.

scott@ORA92> @ CONNECT TEST/TEST
test@ORA92> CREATE GLOBAL TEMPORARY TABLE TEST (TEST NUMBER);
CREATE GLOBAL TEMPORARY TABLE TEST (TEST NUMBER)
*
ERROR at line 1:
ORA-01031: insufficient privileges

test@ORA92> @ CONNECT SCOTT
Enter password: *****
scott@ORA92> GRANT RESOURCE TO TEST;

Grant succeeded.

scott@ORA92> @ CONNECT TEST/TEST
test@ORA92> CREATE GLOBAL TEMPORARY TABLE TEST (TEST NUMBER);

Table created.

test@ORA92> 
Re: Create global temporary table [message #10494 is a reply to message #10278] Mon, 26 January 2004 13:12 Go to previous messageGo to next message
Warren Crossing
Messages: 1
Registered: January 2004
Junior Member
SQL> CREATE GLOBAL TEMPORARY TABLE T_REPORT13A AS SELECT * FROM dual;

Table created.

However I still get the insufficient privileges error
using the JDBC drivers from oracle classes12.jar oracle 8.1.5

java.sql.SQLException: ORA-01031: insufficient privileges
ORA-06512: at "HSDST.FN_REPORT13B", line 97
Re: Create global temporary table [message #10503 is a reply to message #10494] Tue, 27 January 2004 03:22 Go to previous message
Barbara Boehmer
Messages: 9088
Registered: November 2002
Location: California, USA
Senior Member
What privileges were granted and were they granted through roles or directly? It may be that you need to grant the required privilegs directly rather than through roles. Can you also provide a cut and paste of the exact code and error messages received?
Previous Topic: comparing values
Next Topic: correlated Queries
Goto Forum:
  


Current Time: Fri Apr 19 07:28:08 CDT 2024