Solved

compute statistics using index Tablespace

Posted on 2004-08-18
6
1,343 Views
Last Modified: 2008-01-09
Creating this index using oracle 9i

create unique index FLOG_PREFIX_DATE_inx on FAX_LOG
 (SUBSTR(FLAG_CONFIRM,5,10))
   compute statistics using index Tablespace tsdix;

And getting the following error:

ERROR at line 3:
ORA-02158: invalid CREATE INDEX option
0
Comment
Question by:bolicat
6 Comments
 
LVL 18

Expert Comment

by:JR2003
ID: 11829868
create unique index FLOG_PREFIX_DATE_inx on FAX_LOG
 (SUBSTR(FLAG_CONFIRM,5,10))
Tablespace tsdix;

I've never seen compute statistic put there before!
0
 
LVL 23

Expert Comment

by:seazodiac
ID: 11829902
using index syntax does not belong here either.
It's used to create index when you create constraints like Primary key or Unique key.

JR's suggestion should work.
0
 
LVL 1

Accepted Solution

by:
JanMah earned 250 total points
ID: 11830207
JR2003:
You can use Compute Statistics while Creating Index

Use the following:
create unique index FLOG_PREFIX_DATE_inx on FAX_LOG
 (SUBSTR(FLAG_CONFIRM,5,10))
   compute statistics;

If you want to create the index on tablespace tsdix then

create unique index FLOG_PREFIX_DATE_inx on FAX_LOG
 (SUBSTR(FLAG_CONFIRM,5,10)) tablespace QSA_INDEX
   compute statistics;


JanMah
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 1

Expert Comment

by:JanMah
ID: 11830213
The QSA_INDEX to be changed to tsdix, sorry

JanMah
0
 
LVL 47

Expert Comment

by:schwertner
ID: 11830518
To create the tablespace use JRs sugestion.
 

To create statistics on index analyze the table as follow:
   
 ANALYZE TABLE fax_log COMPUTE STATISTICS;

or

exec DBMS_STATS.GATHER_TABLE_STATS(OWNNAME => NULL, TABNAME => ' fax_log', CASCADE => TRUE);
0
 
LVL 34

Expert Comment

by:johnsone
ID: 11831073
I agree with schwerner's suggestion.

Analyze the table after the index has been created.  This is because the optimizer will not understand the correct cost until the table has been re-analyzed.  Not sure if an enhancement has come through to address this, but that has definitely been the case.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now