Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Global temporary table and system priviliges

Status
Not open for further replies.

blom0344

Technical User
Mar 20, 2002
3,441
NL
I'm trying to build a rather complex script to perform a scan on datadictionary tables.
The purpose of the scan is to check whether certain tables are present and which ones contain no data.
To achieve I store a reference set in a GTT.

GTT's are stored in the temp tablespace. I wonder if I need to have create table priviliges to run the scan. Are GTT's the exeption to the rule?
Normal access is done by consultants that have rather limited priviliges..

Ties Blom

 
Ties,

Is the user with which you are trying to achieve this objective a member of the "CONNECT" role? If so, the "CONNECT" role possesses the "CREATE TABLE" privilege, which is sufficient to successfully "CREATE GLOBAL TEMPORARY TABLE..."

Let us know if you have additional questions.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 
Santa,

Thanks, I was kind of hoping that even without explicit 'create table' priviliges it would be possible to run a script that uses a GTT. (bit naive I guess..)

Ties Blom

 
I may be missing the point here, but why would you need "create table" privilege unless you're actually creating the temporary table in each run ? Can't you just create it once and then grant privileges to the different users so that they can insert data into it ?
 
The GTT is only used to have a complete set of some 320 tables as s reference-set. This set is compared with data from the catalogue views to scan if tables are missing or empty. The average consultant can execute an SQL , but is not capable (or enabled) to create and drop objects in the database. By using a GTT he does not even need to know what is going on in the scan.
(And after the session no traces are left)

Ties Blom

 
I can see that, but I'm still puzzled why you think the consultants would need "create table" privilege just to insert data into the temporary table.
 
The GTT is created in the scan-script as executed by the consultant. To rephrase my original question: Does one need create table privilige to execute the script that contains creation at runtime of the GTT?

Ties Blom

 
Why do need to keep re-creating the temporary table ? Surely the whole point of a GTT is that lots of users can write to it and they only see their own temporary data, so you only need to create the table once and get all users to point to that single copy.
 
The GTT is only needed during the session where the scan is performed. For each customer-site this is a one-time occasion. The GTT only contains a hardcoded set of data as a reference set for the scan..

Ties Blom

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top