Insufficient Privileges when create materialized view as user system
If I login as system (connect sys/****@DevDB) and try to create a materialized view for another schema (e.g. XDCONTROLDB), I get the insufficient privileges error. If I login as sys as sysdba then I can create successfully.
I have searched some ariticles in Google and grant create any snapshot, create any table, create any view, global query rewrite, select any table system privileges to system but still get the same error.
Any other privileges I need to grant to system?
Cheers
below is a sample script to create the view which get the error:
CREATE MATERIALIZED VIEW XDControlDB."XDTest1" PCTFREE 10
PCTUSED 0 MAXTRANS 255
STORAGE ( INITIAL 64K NEXT 0K MINEXTENTS 1 MAXEXTENTS
2147483645 PCTINCREASE 0)
TABLESPACE "USERS"
BUILD IMMEDIATE
REFRESH COMPLETE START WITH sysdate NEXT sysdate + 1/24
ENABLE QUERY REWRITE AS
SELECT * From XDControlDB.RiskInstance;
Message was edited by:
user500168
Message was edited by:
user500168
Thanks for your reply. After I grant privileges to system, I login as system and try to create the view as below which I get the insufficient privileges error:
CREATE MATERIALIZED VIEW XDControlDB."XDTest1" PCTFREE 10
PCTUSED 0 MAXTRANS 255
STORAGE ( INITIAL 64K NEXT 0K MINEXTENTS 1 MAXEXTENTS
2147483645 PCTINCREASE 0)
TABLESPACE "USERS"
BUILD IMMEDIATE
REFRESH COMPLETE START WITH sysdate NEXT sysdate + 1/24
ENABLE QUERY REWRITE AS
SELECT 1 From XDControlDB.RiskInstance;
As you can see, I try to create the view under a schema called 'XDCONTROLDB'. If I login as sys as sysdba, then it create successfully.
After I create UserA, and grant the privileges I mentioned in the ealier post, I login as UserA, and run the statement above I get the same privileges error. But if I change the stament to below which will create the view under UserA's schema, then it create successfully:
CREATE MATERIALIZED VIEW UserA."XDTest1" PCTFREE 10
PCTUSED 0 MAXTRANS 255
STORAGE ( INITIAL 64K NEXT 0K MINEXTENTS 1 MAXEXTENTS
2147483645 PCTINCREASE 0)
TABLESPACE "USERS"
BUILD IMMEDIATE
REFRESH COMPLETE START WITH sysdate NEXT sysdate + 1/24
ENABLE QUERY REWRITE AS
SELECT 1 From XDControlDB.RiskInstance;
Looking for your suggestions,
Cheers
Similar Messages
-
Insufficient privileges when creating MV with alter session set current_sch
I am getting Insufficient privileges when creating MV with alter session set current_schema=Application schema name. User running the alter session is DBA user. If run as SYSDBA, MV is created successfully. DB Version is 10.2.0.3
I observed similiar issue with regular View also in 9.2.0.6 also.
Any advice is greatly appreciated.
Thanks,
SivaSounds like your management needs a stern lecture on the concept of change management. <g>
I am not debating what you do. I am questioning the logic, or lack thereof, of doing it that way. My recommendation would be to change your procedure to one that:
A. Is more in line with good change management practices.
B. Works. -
Error when Create Materialized View
Hi
When I tried to create MV show me error :
SQL> @CRIA_MV_ARC_BW.SQL
AND INDUSTRIAL.CD_FABRICA = SUBSTR(ARC.DS_ARC, 1, 3)
ERROR at line 88:
ORA-01031: insufficient privilegesI am using Oracle 9.02 and there are Grant for all Tablles , my query of creation is:
CREATE MATERIALIZED VIEW CLIBGF.MV_ARC_BW
NOCACHE
LOGGING
NOPARALLEL
BUILD IMMEDIATE
REFRESH FORCE
START WITH TO_DATE('26-nov-2009 02:00:00','dd-mon-yyyy hh24:mi:ss')
NEXT trunc(sysdate) + 1/12
ENABLE QUERY REWRITE
AS
SELECT MAX(NVL((SELECT DECODE(A.T$CDNG$O,'F',DECODE(TRIM(B.T$CALC$O),'S','C',A.T$CDNG$O),A.T$CDNG$O)
FROM TRITON.TTDFAT995501 A, TRITON.TTDFAT996501 B
WHERE A.T$OCOM$O + 0 = ARC.CD_UNIDADE_EXPEDIDORA
AND A.T$NDOC$O = NOTAS.CD_NOTA
AND (A.T$OCOM$O = B.T$OCOM$O AND A.T$NREF$O = B.T$NREF$O)
AND ROWNUM =1),
0)) NEGOCIO,
ARC.CD_CLIENTE CD_CLIENTE,
CLIENTE.T$NAMA DS_CLIENTE,
ARC.CD_ARC,
ARC.CD_STATUS,
ARC.CD_STATUS || ' - ' || STATUS.DS_STATUS STATUS,
TO_CHAR(ARC.DT_EMISSAO, 'DD/MM/YYYY') DT_EMISSAO,
TO_CHAR(ACAO_INV.DT_REALIZADO, 'DD/MM/YYYY') DT_REALIZADO_INVESTIGACAO,
ARC.CD_MARCA || ' - ' || MARCA.T$DSMA$O MARCA,
ARC.CD_PRODUTO CD_PRODUTO,
EMBALAGEM.T$CDAC$O || ' - ' || EMBALAGEM.T$DESC$O DS_EMBALAGEM,
SUBSTR(ARC.DS_ARC, 1, 3) CD_COMPANHIA_PRODUTORA,
ARC.CD_MOTIVO_RECLAMACAO CD_MOTIVO_RECLAMACAO,
MOTIVO.DS_ITEM DS_MOTIVO_RECLAMACAO,
DECODE(ARC.FL_PROCEDENCIA, 0, 'PROCEDENTE', 1, 'IMPROCEDENTE', ' ') PROCEDENCIA,
SUM(NVL((SELECT SUM(NVL(T$IQUA$O, 0))
FROM TRITON.TTDFAT995501 A, TRITON.TTDFAT996501 B
WHERE A.T$OCOM$O + 0 = ARC.CD_UNIDADE_EXPEDIDORA
AND A.T$NDOC$O = NOTAS.CD_NOTA
AND (A.T$OCOM$O = B.T$OCOM$O AND A.T$NREF$O = B.T$NREF$O)),
0)) NR_QUANTIDADE_VENDIDA,
ARC.NR_QUANTIDADE_AFETADA NR_QUANTIDADE_AFETADA,
ARC.NR_QUANTIDADE_AFETADA_REAL NR_QUANTIDADE_AFETADA_REAL,
DS_JUSTIFICATIVA DSJUST
FROM ARCTB_ARC ARC,
ARCTB_NOTAS NOTAS,
ARCTB_TABELA_MOTIVO MOTIVO,
ARCTB_ACAO_IMEDIATA ACAO_INV,
ARCTB_ACAO_IMEDIATA ACAO_IME,
ARCTB_STATUS STATUS,
TRITON.TTCCOM010501 CLIENTE,
TRITON.TTCCOM936501 CIDADE,
TRITON.TTIITM001810 D,
TRITON.TTIITM983501 PRODUTO,
TRITON.TTFGLD010806 CC,
TRITON.TTCCOM983501 MARCA,
TRITON.TTCCOM000501 CIA,
TRITON.TTIITM982501 NAT,
SEI.SIBTB_MULTIMARCA MULTIMARCA,
SEI.SIBTB_DIRETORIA_DEPTO DIRETORIA,
TRITON.TTCCOM994501 USUARIO,
ARCTB_GERENCIA_INDUSTRIAL INDUSTRIAL,
TRITON.TTIITM984501 EMBALAGEM
WHERE ARC.CD_ARC = NOTAS.CD_ARC(+)
AND ARC.CD_ARC = ACAO_INV.CD_ARC(+)
AND ACAO_INV.CD_TIPO_ACAO(+) = 0
AND ACAO_INV.CD_ACAO_IMEDIATA(+) = 999
AND ARC.CD_ARC = ACAO_IME.CD_ARC(+)
AND ACAO_IME.CD_TIPO_ACAO(+) = 1
AND ACAO_IME.CD_ACAO_IMEDIATA(+) = 999
AND ARC.CD_CLIENTE = CLIENTE.T$CUNO(+)
AND CLIENTE.T$ESTA$L = CIDADE.T$ESTA$L(+)
AND CLIENTE.T$CDMU$L = CIDADE.T$MUNI$L(+)
AND TRIM(REPLACE(ARC.CD_PRODUTO, '-', '')) =
TRIM(REPLACE(D.T$ITEM(+), '-', ''))
AND TRIM(REPLACE(ARC.CD_PRODUTO, '-', '')) =
TRIM(REPLACE(PRODUTO.T$ITEM$O(+), '-', ''))
AND PRODUTO.T$PROC$O = NAT.T$PROC$O(+)
AND EMBALAGEM.T$CDAC$O(+) = PRODUTO.T$CDAC$O
AND ARC.CD_MOTIVO_RECLAMACAO = MOTIVO.CD_ITEM(+)
AND ARC.CD_MARCA = MARCA.T$CDMA$O(+)
AND SUBSTR(ARC.DS_ARC, 1, 3) = CIA.T$NCMP(+)
AND ARC.CD_STATUS = STATUS.CD_STATUS(+)
AND TRIM(ARC.CD_CENTRO_CUSTO) = TRIM(CC.T$DIMX(+))
AND CC.T$DTYP(+) = 2
AND CC.T$SUBL(+) = 0
AND ARC.CD_DEPTO_MULTIMARCA = MULTIMARCA.CD_MULTIMARCA(+)
AND ARC.CD_DEPTO = DIRETORIA.CD_DEPTO(+)
AND ARC.CD_USUARIO = TRIM(USUARIO.T$CDUS$O(+))
AND ARC.CD_STATUS IS NOT NULL
AND ARC.CD_MOTIVO_RECLAMACAO = MOTIVO.CD_ITEM(+)
AND INDUSTRIAL.CD_FABRICA = SUBSTR(ARC.DS_ARC, 1, 3)
GROUP BY TO_CHAR(ARC.DT_EMISSAO, 'YYYY'),
TO_CHAR(ARC.DT_EMISSAO, 'MM'),
ARC.CD_ARC,
ARC.DS_ARC,
ARC.DS_SUPERVISOR,
ARC.CD_STATUS,
STATUS.DS_STATUS,
TO_CHAR(ARC.DT_EMISSAO, 'DD/MM/YYYY'),
TO_CHAR(ACAO_INV.DT_ORIGINAL, 'DD/MM/YYYY'),
TO_CHAR(ACAO_INV.DT_REALIZADO, 'DD/MM/YYYY'),
TO_CHAR(ACAO_IME.DT_ORIGINAL, 'DD/MM/YYYY'),
TO_CHAR(ACAO_IME.DT_REALIZADO, 'DD/MM/YYYY'),
TO_CHAR(ARC.DT_PROCEDENCIA, 'DD/MM/YYYY'),
TO_CHAR(ARC.DT_RECEBIMENTO, 'DD/MM/YYYY'),
TO_CHAR(NVL(ARC.DT_APROVACAO_INDUSTRIAL,
ARC.DT_APROVACAO_COMERCIAL),
'DD/MM/YYYY'),
ARC.CD_CLIENTE,
CLIENTE.T$NAMA,
CIDADE.T$DSCA$L,
ARC.CD_MARCA,
MARCA.T$DSMA$O,
ARC.CD_PRODUTO,
D.T$SEAK,
EMBALAGEM.T$CDAC$O || ' - ' || EMBALAGEM.T$DESC$O,
NAT.T$DESC$O,
ARC.NR_LOTE,
ARC.DT_FABRICACAO,
SUBSTR(ARC.DS_ARC, 1, 3),
CIA.T$CITY,
ARC.CD_MOTIVO_RECLAMACAO,
MOTIVO.DS_ITEM,
DECODE(ARC.FL_PROCEDENCIA,
0,
'PROCEDENTE',
1,
'IMPROCEDENTE',
ARC.DS_DISPOSICAO,
ARC.CD_CENTRO_CUSTO,
CC.T$DESC,
ARC.NR_QUANTIDADE_AFETADA,
DS_JUSTIFICATIVA,
DS_DISPOSICAO,
CD_RESPONSAVEL_CAUSA,
ARC.NR_QUANTIDADE_AFETADA_REAL,
ARC.DT_ATENDIMENTO,
MOTIVO.CLASSIFICACAO,
ARC.DS_COORDENADOR,
ARC.FL_ATENDIMENTO,
TO_CHAR(ARC.DT_ATENDIMENTO, 'DD/MM/YYYY'),
ARC.DS_COORDENADOR_INVESTIGACAO,
INDUSTRIAL.REGIAO
ORDER BY ARC.CD_ARC DESC;
Edited by: muttleychess on Nov 25, 2009 10:25 AMPlease see my privilege
GRANTEE PRIVILEGE ADM
CLIBGF CREATE TABLE NO
CLIBGF CREATE ANY VIEW NO
CLIBGF CREATE SNAPSHOT NO
CLIBGF SELECT ANY TABLE NO
CLIBGF CREATE ANY TRIGGER NO
CLIBGF CREATE ANY SNAPSHOT NO -
"Invalid Metadata Objects" when creating materialized views
Hi experts,
I have run into some trouble. I had an analytic workspace that grew too fast (see 11.2.0.2 AW size grows steadily with every cube build so I deleted it and created a new one.
It seemed to build fine using the tip that David Greenfield gave us in the mentioned forum post, but when I try to enable materialized views (which I had enabled in the previous workspace) I'm gettig the following error:
Your metadata changes have been saved, with the following errors
Invalid Metadata Objects:
Invalid Object "TABLESPACE.LECTURAS": "CREATE MATERIALIZED VIEW "TABLESPACE"."CB$LECTURAS"
ORGANIZATION CUBE ON TABLESPACE.TABLESPACE_AW(
FACT "LECTURAS_STORED"("LECTURAS_MEASURE_DIM" 'LECTURA') IS "LECTURA",
DIMENSION "TIEMPO" IS "TIEMPO" USING "TIEMPO_TIEMPO_HOUR_ID_UNIQUE_KEY" ,
DIMENSION "GEOGRAFIA" IS "GEOGRAFIA" USING "GEOGRAFIA_GEOGRAFIA_CONTADOR_ID_UNIQUE_KEY" )
BUILD DEFERRED
REFRESH ON DEMAND
FORCE
USING TRUSTED CONSTRAINTS
AS
SELECT
TO_CHAR(T1."FEC_LECTURA", 'dd/mm/yyyy hh24:mi:ss') "TIEMPO",
T1."COD_METERID" "GEOGRAFIA",
SUM(T1."VAL_AI_HOR") "LECTURA"
FROM
TABLESPACE."LECTURA_HORARIA_FINAL" T1
GROUP BY
(TO_CHAR(T1."FEC_LECTURA", 'dd/mm/yyyy hh24:mi:ss') , T1."COD_METERID")
ORA-00942: table or view does not exist
Running this same script in SQLDeveloper yields the same error at line 17, which is the FROM clause. BUT I can run the SELECT statement by itself and returns the expected result. So the table exists in the correct tablespace.
I must be missing something big...
Thanks in advance.
Joan
P.S.: In the code above I'm using "TABLESPACE" in substitution for the real username and tablespace name (which is the same) for privacy reasons.When you ran the select statement, were you connected as the same user that you used to try to enable the MVs?
Can you create a standard (non cube) MV with the same select statement? (Connected as the same user you used in AWM.)
"CREATE MATERIALIZED VIEW "TABLESPACE"."MV_TEST"
BUILD DEFERRED
REFRESH ON DEMAND
FORCE
USING TRUSTED CONSTRAINTS
AS
SELECT
TO_CHAR(T1."FEC_LECTURA", 'dd/mm/yyyy hh24:mi:ss') "TIEMPO",
T1."COD_METERID" "GEOGRAFIA",
SUM(T1."VAL_AI_HOR") "LECTURA"
FROM
TABLESPACE."LECTURA_HORARIA_FINAL" T1
GROUP BY
(TO_CHAR(T1."FEC_LECTURA", 'dd/mm/yyyy hh24:mi:ss') , T1."COD_METERID")
{code} -
ORA-12052 when create materialized view
I following the sample in Oracle document to create materialized viewCREATE MATERIALIZED VIEW LOG ON sales
WITH ROWID, SEQUENCE(amount_sold, time_id, prod_id) INCLUDING NEW VALUES;
CREATE MATERIALIZED VIEW LOG ON times
WITH ROWID, SEQUENCE (time_id, calendar_year) INCLUDING NEW VALUES;
CREATE MATERIALIZED VIEW LOG ON products
WITH ROWID, SEQUENCE (prod_id,prod_name) INCLUDING NEW VALUES;
CREATE MATERIALIZED VIEW sales_mv
BUILD IMMEDIATE REFRESH FAST ON COMMIT
AS SELECT t.calendar_year, p.prod_id, p.prod_name,
SUM(s.amount_sold) AS sum_sales
FROM times t, products p, sales s
WHERE t.time_id = s.time_id AND p.prod_id = s.prod_id
GROUP BY t.calendar_year, p.prod_id, p.prod_name; This works. BUt I actually does not want do aggregation. Thus I changed the MV creation statement toCREATE MATERIALIZED VIEW sales_mv
BUILD IMMEDIATE REFRESH FAST ON COMMIT
AS SELECT t.calendar_year, p.prod_id, p.prod_name,s.amount_sold
FROM times t, products p, sales s
WHERE t.time_id = s.time_id AND p.prod_id = s.prod_id;I got errorSQL Error: ORA-12052: cannot fast refresh materialized view GLU.SALES_MV
*Cause: Either ROWIDs of certain tables were missing in the definition or
the inner table of an outer join did not have UNIQUE constraints on
join columns.
*Action: Specify the FORCE or COMPLETE option. If this error is got
during creation, the materialized view definition may have be
changed. Refer to the documentation on materialized views.Please help or point me to the relevant document.
Thanksdamorgan, Thank you for you reply.
the inner table of an outer join did not have UNIQUE constraints on join columns.
I am not sure how much clearer and explanation can be written.If you look at the query, you will find that there is no outer join in the query.
sales table does not have unique constraints on prod_id and time_id. If this is the cause of the problem, I cannot change the data but is there a work around. That is way I ask for specific doc. In 11g documents, I only find some info on CREATE MV. That is mainly on syntax but not on requirement. -
Insufficient privileges when creating user logged in as SYS
Hi,
I'm working on 11.1.0.6.0 Enterprise Edition, Advanced Security options, Label Security a and Database Vault installed. (for testing purposes)
I'm creating a new user being logged as SYS using this sentence:
CREATE USER "HR_DIRECTOR" PROFILE "DEFAULT" IDENTIFIED BY "*******" DEFAULT TABLESPACE "USERS" TEMPORARY TABLESPACE "TEMP" ACCOUNT UNLOCK;
However, the command fails with the message "Failed to commit: ORA-01031: insufficient privileges . You do not have enough privileges to perform this operation. You must have the appropriate system and object privileges to create, edit, or drop database objects or objects outside of your schema."
Please note that I'm working on a fresh DB install and I have also installed Database Vault in this instance for testing purposes, but still haven't configured any realm or command rules on it.
Is it possible Vault is the reason why I am not able to create a new user?
Thanks and Regards,
LeandroHi, It seems I've found it.
After you install Database Vault and associate it with your SID, SYS user is revoked the CREATE USER system privilege.
Only a user with the DV_ACCTMGR role may create, alter or drop a user. This is done in order to separate responsabilities in your database. A SYS user cannot grant himself this role or the DV_OWNER role.
(If interested, check page 10-4 from http://www.oracle.com/pls/db111/to_toc?pathname=server.111/b31222/toc.htm)
Regards,
Leandro -
4.0 EA2 - Insufficient Privileges When Creating Object With Proxy
When I have connected by proxying to another user, I receive the following message when trying to create a new object:
The database user has insufficient privileges for the given operation.
Steps to reproduce:
Connect by proxying to another user
Right Click on Views
Select New View
I noticed this under EA1, though, not sure if reported. This worked under 3.2.2Sounds like your management needs a stern lecture on the concept of change management. <g>
I am not debating what you do. I am questioning the logic, or lack thereof, of doing it that way. My recommendation would be to change your procedure to one that:
A. Is more in line with good change management practices.
B. Works. -
ORA-01031: insufficient privileges when creating a table in other schema
Dear all,
I appreciate your help please in this issue :
when i try to issue the below statement to create a table in an another schema than the user i am connected in
CREATE TABLE SCHEMA_NAME_B.HST_ARCH nologging AS
SELECT *
FROM HST
WHERE 1 = 0;
I always get ORA-01031: insufficient privileges error, even if i have granted the create table privilege to the user i am connected in.
What other privileges should i grant also,
Please if you have any idea.user562674 wrote:
Dear all,
I appreciate your help please in this issue :
when i try to issue the below statement to create a table in an another schema than the user i am connected in
CREATE TABLE SCHEMA_NAME_B.HST_ARCH nologging AS
SELECT *
FROM HST
WHERE 1 = 0;
I always get ORA-01031: insufficient privileges error, even if i have granted the create table privilege to the user i am connected in.
What other privileges should i grant also,
Can you show us a cut/paste from the sql*plus of session of yours which should show that you have given the privilege directly to this user and after that the command fails?
Aman.... -
Create materialized view throws insufficient privileges in single schema
I'm trying to create a complex materialized view in my own schema, using only tables from my own schema:
CREATE MATERIALIZED VIEW MYSCHEMA.MYMVIEW AS
SELECT
A.ONE_THING,
B.ANOTHER_THING,
C.A_THIRD_THING
FROM MYSCHEMA.TABLEA A
JOIN MYSCHEMA.TABLEB B
ON A.COL1 = B.COL1
JOIN MYSCHEMA.TABLEC C
ON A.COL2 = C.COL2The line JOIN MYSCHEMA.TABLEB B throws an ORA-01031: insufficient privileges error, highlighting TABLEB.
I understand that grants need to be explicit on tables when creating objects across schemas, but this code is operating within my own schema only; i created and own all the tables in this schema.
What's going on?
Thanks!Perhaps it is the tool that i am using that highlights the wrong item, because as it turns out, i don't have the CREATE MATERIALIZED VIEW permission after all (the permission was mistakenly granted to a different user instead of to me).
SELECT * FROM SESSION_PRIVS;returns CREATE VIEW, but does not return CREATE MATERIALIZED VIEW.
Sorry to have wasted your time. -
Insufficient privilege when Activating an attribute view (person responsible for package = SYSTEM)
SAP HANA Studio
Version: 1.0.33
Build id: 201206301604 (363996)
Playing with the efashion tutorial with HANA Studio.
I am SYSTEM user by default when starting the studio.
-Schema created
-DDL created
-Data loaded
-Attribute views created
Below an extract of the error log:
<info>Create Attribute View failed: SQL: transaction rolled back by an internal error: insufficient privilege: Not authorizedHello Anooj and Sri,
Thank you for your answers, I really appreciate your inputs.
So I executed this:
"GRANT SELECT ON SCHEMA SYSTEM TO _SYS_REPO WITH GRANT OPTION;"
Under the Studio SQL GUI and I still have the same error when activating my very simple attribute view.
I have installed a recent HANA + Studio + Client release on my laptop:
SAP HANA Studio
Version: 1.0.33
Build id: 201207050531 (364183)
And yes, this is a demo and yes I am logged as the SYSTEM user (default user when stating the studio). For now, I dont know how to connect to another user with the studio and I will search the doumentation.
Below a copy/past of the error msg.
Internal deployment of object failed;Repository: Encountered an error in repository runtime extension;Internal Error:Deploy Attribute View: SQL: transaction rolled back by an internal error: insufficient privilege: Not authorized (ptime/query/plan_executor/ddl/qx_cube.cc:1514) n
Create view DDL statement: CREATE COLUMN VIEW "_SYS_BIC"."efashion/ATV_OUTLET_LOOKUP" TYPE JOIN WITH PARAMETERS ( joinIndex = "EFASHION_TUTORIAL"."OUTLET_LOOKUP", joinIndexType = 0, viewAttribute = ('SHOP_ID', "EFASHION_TUTORIAL"."OUTLET_LOOKUP", "SHOP_ID", '', 'default', 'attribute', '', 'efashion/ATV_OUTLET_LOOKUP$SHOP_ID'), viewAttribute = ('SHOP_NAME', "EFASHION_TUTORIAL"."OUTLET_LOOKUP", "SHOP_NAME", '', 'default', 'attribute', '', 'efashion/ATV_OUTLET_LOOKUP$SHOP_NAME'), viewAttribute = ('MANAGER', "EFASHION_TUTORIAL"."OUTLET_LOOKUP", "MANAGER", '', 'default', 'attribute', '', 'efashion/ATV_OUTLET_LOOKUP$MANAGER'), viewAttribute = ('ZIP_CODE', "EFASHION_TUTORIAL"."OUTLET_LOOKUP", "ZIP_CODE", '', 'default', 'attribute', '', 'efashion/ATV_OUTLET_LOOKUP$ZIP_CODE'), viewAttribute = ('CITY', "EFASHION_TUTORIAL"."OUTLET_LOOKUP", "CITY", '', 'default', 'attribute', '', 'efashion/ATV_OUTLET_LOOKUP$CITY'), view = ('V_OUTLET_LOOKUP', "EFASHION_TUTORIAL"."OUTLET_LOOKUP"), defaultView = 'V_OUTLET_LOOKUP', 'REGISTERVIEWFORAPCHECK' = '1' )nVersion: 48n
Thank you.
Patrick -
Create materialized view is failing when refresh fast is used
version 10.2.0.4 on solaris
This statement is working fine
CREATE MATERIALIZED VIEW MVIEW1
TABLESPACE MIS_CURD01
BUILD IMMEDIATE
as
SELECT ACTIVITY_ID "ACTIVITY_ID",
ASSOC_ID "ASSOC_ID",
PIT_ROLE_CODE "PIT_ROLE_CODE",
PIT_BANK_CODE "PIT_BANK_CODE",
PIT_COST_CENTER "PIT_COST_CENTER",
RESP_ASSOC_IND "RESP_ASSOC_IND"
FROM TABLE1@DBLINK;
The statement with fast refresh is failing with this error message
ERROR at line 18:
ORA-12018: following error encountered during code generation for
"TABLE1"
ORA-00942: table or view does not exist
Here is the statement
CREATE MATERIALIZED VIEW MVIEW1
TABLESPACE MIS_CURD01
NOCACHE
LOGGING
NOCOMPRESS
NOPARALLEL
BUILD IMMEDIATE
USING INDEX TABLESPACE MIS_CURI01
REFRESH FAST ON DEMAND
WITH PRIMARY KEY
AS
SELECT ACTIVITY_ID "ACTIVITY_ID",
ASSOC_ID "ASSOC_ID",
PIT_ROLE_CODE "PIT_ROLE_CODE",
PIT_BANK_CODE "PIT_BANK_CODE",
PIT_COST_CENTER "PIT_COST_CENTER",
RESP_ASSOC_IND "RESP_ASSOC_IND"
FROM TABLE1@DBLINK;
Any idea what's going wrong here. Thanks for your help in advance.
Edited by: user11319873 on Jun 30, 2010 4:17 PMRefresh FAST requires that
a. An MV Log (Snapshot Log) be created on the source table
b. The user doing the refresh (i.e. the account that the DBLink uses) has SELECT privilege on the MV Log.
Hemant K Chitale -
Illegal use of LONG datatype error message when i create materialized view
Hello to all
I want create read only materialized view replication environment two of our tables have LONG datatype when i create materialized view against on them
I recieve this error message
CREATE MATERIALIZED VIEW MDB.TOAD_PLAN_TABLE TABLESPACE aramis REFRESH FORCE WITH ROWID AS SELECT * FROM MDB.TOAD_PLAN_TABLE@arahisto
Error report:
SQL Error: ORA-00997: illegal use of LONG datatype
00997. 00000 - "illegal use of LONG datatype"
Do you know any resort solution for it?
thanksYou can not use longs in materialized views over a database link, you can however take a part of a long over to a materialized view.
I have gotten this to work in the past l had to create a PL/SQL function that you can use to extract the character data from the long column and use that to
as part of the function you will need to pass in the columns of the table that will identify the unique records so you can pick out the long column
example function
-- you will need to make sure this funtion is in the remote location as you can not select longs accross a DB LINK.
CREATE OR REPLACE FUNCTION MDB.TOAD_PLAN_LONG_CONV
(pass in the primary key columns for the table)
RETURN VARCHAR2
IS
v_long VARCHAR2(32767) ;
BEGIN
BEGIN
-- need to select the long column into the PL/SQL variable
SELECT long_column
INTO v_long
FROM MDB.TOAD_PLAN_TABLE
WHERE key_columns = passed columns ;
EXCEPTION
WHEN OTHERS THEN
IF SQLCODE = '-01406' THEN
NULL ;
ELSE
RAISE ;
END IF ;
END ;
RETURN SUBSTR(v_long,1,4000) ;
END ;
Then when you create the materialized view utilize that function on the long column.
create or replace materialized view MDB.TOAD_PLAN_TABLE TABLESPACE aramis REFRESH FORCE WITH ROWID
AS
SELECT column1, .... columnx,
MDB.TOAD_PLAN_LONG_CONV@arahisto (primary key column list) as long_column_name
FROM MDB.TOAD_PLAN_TABLE@arahisto ;
See if this will work for you? Keep in mind however this solution will not get the entire long column only as much as a PL/SQL variable will hold of it.
Mike -
ORA-25175 when trying to create materialized view, organization index SOLV
Hi,
I'm trying to create a materialized view to compensate for non-normalized table.
I have table anormal, and mv is to be on distinct agency, company in that table.
Here goes:
SQL> select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for IBM/AIX RISC System/6000: Version 10.2.0.3.0 - Productio
NLSRTL Version 10.2.0.3.0 - Production
SQL> create table anormal (company varchar2(8) not null
2 ,dept varchar2(8) not null
3 ,agency varchar2(8) not null
4 ,constraint anormal_pk primary key (company,dept));
Table created.
SQL> insert into anormal values('c1', 1, 'Ajax');
1 row created.
SQL> insert into anormal values('c1', 2, 'Ajax');
1 row created.
SQL> insert into anormal values('c1', 3, 'Acme');
1 row created.
SQL> insert into anormal values('c2', 1, 'Acme');
1 row created.
SQL> insert into anormal values('c2', 2, 'Acme');
1 row created.
SQL> commit;
Commit complete.
SQL> select * from anormal;
COMPANY DEPT AGENCY
c1 1 Ajax
c1 2 Ajax
c1 3 Acme
c2 1 Acme
c2 2 Acme
SQL> create materialized view agency_comp_mv
2 organization index --primary key (agency, company)
3 build deferred
4 refresh on demand
5 as
6 select distinct agency, company from anormal
7 /
select distinct agency, company from anormal
ERROR at line 6:
ORA-25175: no PRIMARY KEY constraint found
SQL>The error tells me that there is no primary key, but is there any way to add such?
- or is my problem rather that I cannot use DISTINCT with organization index?
Regards
Peter
bump
Message was edited by:
Peter Gjelstrup
<SOLVED>
Message was edited by:
Peter GjelstrupThanks William,
I tried with ON PREBUILT TABLE, just to see what happens.
Building on my OP:
SQL> create table iot(agency varchar2(8) not null, company varchar2(8) not null
2 ,constraint iot_pk primary key (agency,company))
3 organization index;
Table created.
SQL> insert into iot select distinct agency, company from anormal;
4 rows created.
SQL> commit;
Commit complete.
SQL> create materialized view iot on prebuilt table
2 as
3 select distinct agency, company from anormal;
Materialized view created.
SQL> select * from iot;
AGENCY COMPANY
Acme c1
Acme c2
Ajax c1
SQL> insert into anormal values('c3', 2, 'Foo');
insert into anormal values('c3', 2, 'Foo')
1 row created
SQL> select * from anormal;
COMPANY DEPT AGENCY
c1 1 Ajax
c1 2 Ajax
c1 3 Acme
c2 1 Acme
c2 2 Acme
c3 2 Foo
6 rows selected.
SQL> select * from iot;
AGENCY COMPANY
Acme c1
Acme c2
Ajax c1
3 rows selectedNow, try to refresh and MV
SQL> alter materialized view iot refresh complete;
Materialized view altered.
SQL> select object_type, to_char(last_ddl_time, 'hh:mi:ss'), status
2 from user_objects where object_name = 'IOT';
OBJECT_TYPE DDL_TIME STATUS
TABLE 10:40:42 VALID
MATERIALIZED VIEW 10:41:13 VALID
SQL> select * from iot;
AGENCY COMPANY
Acme c1
Acme c2
Ajax c1Agency "Foo" is not in MV,
Looks like that IOT select'ed from is indeed the MV:
SQL> drop table iot;
drop table iot
ERROR at line 1:
ORA-12083: must use DROP MATERIALIZED VIEW to drop "STIK"."IOT"
SQL>So, seems that Maxim is right, it just can't be done. And it seems my options are:
Create HEAP organized MV or
Create and maintain IOT
Regards
Peter -
Cannot create Materialized View using PL/SQL procedure
Hello,
I have a question related to Materialized View creation.
I have a stored procedure that creates materialized view. When trying to run this procedure I get insufficient privileges error: ORA-01031.
When I run content of this procedure as anonymous PL/SQL block them materialized view is created without any complications.
Can you please advice me on that topic?
Is it even possible to create materialized view in stored procedure as I haven't found an info on it.
Thanks
PetrHi chudapet,
Whenever you do operation in procedure you need to have direct grants and not via a role.
Most probably the grant to create materialized view is available via a role to your user.
Assign direct grant to the user:
grant create materialized view to scott;
{code} -
Privilege for creating a View from a Stored Procedure
Hi,
I need to create a view from a procedure. I could do it from an anonymous block whereas I am unable to do that from a Stored Procedure. Should I need a specific privilege for performing this operation? If so what would be the reason behind it? Will that privilege be given in production databases?
Code to replicate:
CREATE TABLE t11 AS SELECT * FROM DUAL;
CREATE OR REPLACE PROCEDURE p_etl_test_view
AS
BEGIN
EXECUTE IMMEDIATE 'CREATE OR REPLACE VIEW v_t11 AS SELECT * FROM t11';
END;
PROCEDURE P_ETL_TEST_VIEW compiled
Elapsed: 00:00:00.131
BEGIN
EXECUTE IMMEDIATE 'CREATE OR REPLACE VIEW v_t11 AS SELECT * FROM t11';
END;
anonymous block completed
Elapsed: 00:00:00.069
BEGIN
p_etl_test_view;
END;
Error starting at line 13 in command:
BEGIN
p_etl_test_view;
END;
Error report:
ORA-01031: insufficient privileges
ORA-06512: at "OCCSS_ENTMT_HK_DEV_01.P_ETL_TEST_VIEW", line 4
ORA-06512: at line 2
01031. 00000 - "insufficient privileges"
*Cause: An attempt was made to change the current username or password
without the appropriate privilege. This error also occurs if
attempting to install a database without the necessary operating
system privileges.
When Trusted Oracle is configure in DBMS MAC, this error may occur
if the user was granted the necessary privilege at a higher label
than the current login.
*Action: Ask the database administrator to perform the operation or grant
the required privileges.
For Trusted Oracle users getting this error although granted the
the appropriate privilege at a higher label, ask the database
administrator to regrant the privilege at the appropriate label.
Elapsed: 00:00:00.100
The privileges I am having:
SELECT *
FROM dba_sys_privs
WHERE grantee = 'OCCSS_ENTMT_HK_DEV_01'
OR grantee IN (SELECT granted_role
FROM dba_role_privs
where grantee = 'OCCSS_ENTMT_HK_DEV_01')
ORDER BY 1;
GRANTEE
PRIVILEGE
ADMIN_OPTION
EXP_FULL_DATABASE
ADMINISTER RESOURCE MANAGER
NO
EXP_FULL_DATABASE
ADMINISTER SQL MANAGEMENT OBJECT
NO
EXP_FULL_DATABASE
BACKUP ANY TABLE
NO
EXP_FULL_DATABASE
CREATE SESSION
NO
EXP_FULL_DATABASE
CREATE TABLE
NO
EXP_FULL_DATABASE
EXECUTE ANY PROCEDURE
NO
EXP_FULL_DATABASE
EXECUTE ANY TYPE
NO
EXP_FULL_DATABASE
READ ANY FILE GROUP
NO
EXP_FULL_DATABASE
RESUMABLE
NO
EXP_FULL_DATABASE
SELECT ANY SEQUENCE
NO
EXP_FULL_DATABASE
SELECT ANY TABLE
NO
OCCSS_ENTMT_HK_DEV_01
CREATE DATABASE LINK
NO
OCCSS_ENTMT_HK_DEV_01
CREATE TABLE
NO
OCCSS_ENTMT_HK_DEV_01
DEBUG CONNECT SESSION
NO
OCCSS_ENTMT_HK_DEV_01
SELECT ANY DICTIONARY
NO
SCB_SCHEMA_ROLE
ALTER SESSION
NO
SCB_SCHEMA_ROLE
CREATE CLUSTER
NO
SCB_SCHEMA_ROLE
CREATE DIMENSION
NO
SCB_SCHEMA_ROLE
CREATE INDEXTYPE
NO
SCB_SCHEMA_ROLE
CREATE JOB
NO
SCB_SCHEMA_ROLE
CREATE MATERIALIZED VIEW
NO
SCB_SCHEMA_ROLE
CREATE OPERATOR
NO
SCB_SCHEMA_ROLE
CREATE PROCEDURE
NO
SCB_SCHEMA_ROLE
CREATE SEQUENCE
NO
SCB_SCHEMA_ROLE
CREATE SESSION
NO
SCB_SCHEMA_ROLE
CREATE SYNONYM
NO
SCB_SCHEMA_ROLE
CREATE TABLE
NO
SCB_SCHEMA_ROLE
CREATE TRIGGER
NO
SCB_SCHEMA_ROLE
CREATE TYPE
NO
SCB_SCHEMA_ROLE
CREATE VIEW
NOBoopathyVasagam wrote:
Thank you for your answer. So should I issue the below statement? (Since I dont have dba privs i couldn't test this)
GRANT CREATE VIEW to P_ETL_TEST_VIEW;
I doubt that above will prevent the error from being thrown.
prior to running anonymous block again; just do as below
SET ROLE NONE;
doing so should result in same error being thrown when invoking
BEGIN
p_etl_test_view;
END;
Maybe you are looking for
-
F7 & F8 key is not working in forms 10g
Dear all, I am working with oracle application version 10.1.2.3.0, installed on windows server 2003 and database 10gR2 on windows server 2008. When i open any form and tries F8 / F7 to executed & enter query, its not working. But its owrking with wit
-
Hi everybody, in MIGO we should record data not only in field <storage location> but also for the <storage bin>. This field is not beeing displayed in MIGO. Any suggestions for development? Afterwards the recorded data for storage bin should be visib
-
Create Item disable at PageLayout level
Hi, I am trying to add an image item under pageLayout (/oracle/apps/ap/oie/entry/summary/webui/ConfirmationPG). However, the "Create Item" icon is disabled. I tried to change "Admin Personalization" at all the level, but still its disabled. I had a s
-
X axis to represent Yearin weeks and months ?
I want to create an X axis to represent a year in weeks and months. Anyone know how please ? The current limits of 10 max for major and minor will not allow a sensible scale or grid.
-
I terminated synchronization of iphone4 with itune on my hp laptom before it got completed. After this, i got unique trouble in some of my phone book entries. It shows character like E 11 in phone book numbrers.