- Este tópico contém 8 respostas, 5 vozes e foi atualizado pela última vez 14 anos, 9 meses atrás por
burga.
-
AutorPosts
-
26 de janeiro de 2011 às 4:03 am #97966
souza
ParticipantePEssoal,
Existe alguma permissão especial para se criar indexes baseado em função ? Estou tentando criar e dá erro de insuficientes privilégios …
Desde já obrigado
Eduardo26 de janeiro de 2011 às 5:45 am #97968hudsona
ParticipanteConsegue criar o indice normalmente ?
28 de janeiro de 2011 às 12:06 am #97997gauss
ParticipantePoste o comando e o erro para podermos ajudar.
29 de janeiro de 2011 às 1:24 am #98025souza
ParticipanteO indice normal consigo criar, porém esse abaixo baseado em função não!
CREATE INDEX owmer.idx_mmp_dt_mov
ON owner.MVTO_MAT_PERIODO(TRUNC(DT_MOVIMENTO))
Erro na Linha de Comando:2.219 Coluna:36
Relatório de Erro:
Erro de SQL: ORA-01031: privilégios insuficientes
01031. 00000 – “insufficient privileges”Desde já obrigado
Eduardo29 de janeiro de 2011 às 3:18 am #98026Ishii
ParticipanteOla,
O problema esta na funcao, veja a linha 2219 coluna 36 e veja a que ele se refere pois ai esta faltando os grants necessarios.
[]s Ishii
17 de fevereiro de 2011 às 1:49 am #98275souza
ParticipanteOi pessoal , a questão é a seguinte: o indice é baseado em função por causa do trunc …
CREATE INDEX owner .idx_mmp_dt_mov
ON owner.MVTO_MAT_PERIODO(TRUNC(DT_MOVIMENTO))continua a procurar por algo …mas ainda não achei nada …..
se alguém tiver uma luz agradeço …..
17 de fevereiro de 2011 às 3:52 am #98276burga
ParticipanteOi Souza,
Recorrendo novamente ao site do Tom, segue o que é necessário para criar índices baseados em funções:
How to use this
Above we now have most of the steps you need to use function based indexes. In addition to the above steps, there are some init.ora or session settings you must use and a privelege you must have. The following is a list of what needs to be done to use function based indexes:
* You must have the system privelege query rewrite to create function based indexes on tables in your own schema.
* You must have the system privelege global query rewrite to create function based indexes on tables in other schemas
* For the optimizer to use function based indexes, the following session or system variables must be set:·
· QUERY_REWRITE_ENABLED=TRUE
· QUERY_REWRITE_INTEGRITY=TRUSTED
You may enable these at either the session level with ALTER SESSION or at the system level via ALTER SYSTEM or by setting them in the init.ora parameter file. The meaning of query_rewrite_enabled is to allow the optimizer to rewrite the query allowing it to use the function based index. The meaning of query_rewrite_integrity=trusted is to tell the optimizer to ‘trust’ that the code marked deterministic by the programmer is in fact deterministic. If the code is in fact not deterministic (that is, it returns different output given the same inputs), the resulting rows from the index may be incorrect.
* Use the Cost Based Optimizer. Function based indexes are only visible to the Cost Based Optimizer and will not be used by the Rule Based Optimizer ever.
* Use substr() to constrain return values from user written functions that return VARCHAR2 or RAW types. Optionally hide the substr in a view (recommended).Once the above list has been satisfied, it is as easy as “CREATE INDEX” from there on in. The optimizer will find and use your indexes at runtime for you.
Fonte: http://asktom.oracle.com/pls/apex/ASKTOM.download_file?p_file=8597570332252006617
Espero que ajude…
Abraços!!26 de fevereiro de 2011 às 1:49 am #98412souza
Participanteobrigado pela ajuda Ricardo.
Porém no site indicado explica pelo que vi a criar funções baseadas em indices …e o que preciso é indices baseados em funções…
Mas de qualquer forma mto obrigado !!!
Se alguém tiver alguma sugestão aceito ..
Dando um grant all funciona….porém não sei o impacto do grant all…
grant all on tabela to user;
Eduardo
26 de fevereiro de 2011 às 5:09 pm #98416burga
ParticipanteOi Souza,
Acho que você confundiu um pouco o inglês… 🙄function based indexes = índices baseados em funções
Seguem algumas URLs pra esclarecer melhor 😉 :
http://www.akadia.com/services/ora_function_based_index_2.html
http://www.dba-oracle.com/oracle_tips_index_scan_fbi_sql.htm
-
AutorPosts
- Você deve fazer login para responder a este tópico.