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 Gjelstrup

Thanks 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

Similar Messages

  • Error: ORA-00905:Missing keyword while creating Materialized view

    Hi Gurus,
    I am trying to create a materialized view as :
    1 CREATE MATERIALIZED VIEW AMREG.ClientData
    2 TABLESPACE AMREG_DATA
    3 COMPRESS
    4 PARALLEL
    5 NOLOGGING
    6 BUILD IMMEDIATE
    7 REFRESH COMPLETE
    8 ON DEMAND
    9 DISABLE QUERY REWRITE
    10 REFRESH START WITH TRUNC( SYSDATE + 1 ) + 3/24 NEXT TRUNC( SYSDATE + 1 ) + 3/24
    11 AS
    12 SELECT
    13 CHILD.CLIENT_SGK "Child SGK",
    14 CHILD.CLIENT_NAME "Child Name",
    15 CHILD.ARC_ACCT_CD "Child ARC Acct Code",
    16 ULTIMATE.CLIENT_SGK "Ultimate Parent SGK",
    17 ULTIMATE.CLIENT_NAME "Ultimate Parent Name",
    18 ULTIMATE.ARC_ACCT_CD "Ultimate ARC Acct Code",
    19 HIER.LVL_FROM_ANCESTOR ,
    20 FROM [email protected] CHILD,
    21 [email protected] HIER,
    22 [email protected] ULTIMATE
    23 WHERE HIER.DESCENDANT_CLIENT_SGK = CHILD.CLIENT_SGK
    24* AND ULTIMATE.CLIENT_SGK = HIER.ANCESTOR_CLIENT_SGK;
    SQL> /
    REFRESH START WITH TRUNC( SYSDATE + 1 ) + 3/24 NEXT TRUNC( SYSDATE + 1 ) + 3/24
    ERROR at line 10:
    ORA-00905: missing keyword
    DBLink name is : DNYCPH60.WORLD
    Please guide me on this and help to resolve the issue.

    I provided the answer over at the duplicate post ...
    ORA-00905: missing keyword error while creating a materialised view
    Please, please, please ... please do not duplicate posts. Pick one. If you don't get an answer in a reasonable time - close it (edit the title) and THEN open in a different forum.

  • ORA-12054 when trying to create an MV

    10gR2
    I'm trying to create an MV, but is failing with the mentioned error. I've tried to search for the reason(s), but cannot seem to find it. Can somebody help? Thanks.
    create materialized view MV_POC
    build immediate
    refresh on commit
    enable query rewrite
    as
    SELECT
    SRBU.SRV_REQ_ID as SRID,
    ORGNZ.NAME as DIVISION ,
    SRVRQ.CREATED as OPENED,
    SRVRQ.SR_SUBTYPE_CD as SOURCE,
    USR.LOGIN as OWNER
    FROM SIEBEL.S_PARTY PRTY,
    SIEBEL.S_ORG_EXT ORGNZ,
    SIEBEL.S_SRV_REQ_BU SRBU,
    SIEBEL.S_BU BU,
    SIEBEL.S_SRV_REQ SRVRQ,
    SIEBEL.S_USER USR
    WHERE SRVRQ.ROW_ID = SRBU.SRV_REQ_ID (+)
    AND
    SRVRQ.OWNER_EMP_ID = USR.PAR_ROW_ID (+)
    AND
    ( PRTY.ROW_ID = ORGNZ.PAR_ROW_ID AND PRTY.ROW_ID = BU.PAR_ROW_ID AND SRBU.BU_ID = PRTY.ROW_ID)
    AND (ORGNZ.INT_ORG_FLG = 'Y' AND BU.BU_FLG = 'Y')
    AND (ORGNZ.PAR_BU_ID = (SELECT ROW_ID FROM SIEBEL.S_ORG_EXT WHERE NAME = 'State of Washington')))

    From the documentation you failed to search
    ORA-12054 cannot set the ON COMMIT refresh attribute for the materialized view
    Cause: The materialized view did not satisfy conditions for refresh at commit time.
    Action: Specify only valid options.
    Those valid conditions are likely documented, and likely they have to do with the numerous outer joins, maybe on primary key columns, may be not.
    Most views must be 'key-preserved' to be updatable.
    Sybrand Bakker
    Senior Oracle DBA

  • ORA-01555 when performing refresh of materialized views via DBMS_JOB

    All,
    With this project needing to be finished soon and an issue occuring on the local database, I am hopefuly one of you will have the answer or resolution so that I may complete this project soon....
    Here is the setup..
    10g database (remote)
    9i database (local
    DB Link from local to remote database
    103 materialized views in local database that are refreshed by pulling data from dblink to remote database.
    A PL/SQL procedure has been created which sets the v_failures variable = 0 and then performs a check to see if the current job has a failure and if so, inserts that value into the v_failures variable. When that reaches "1", then the procedure does nothing and closes out. If the failures are equal to "0" then it performs a DBMS_MVIEW.REFRESH procedure for each materialized view.
    This worked the first time but its continually failing now with the ORA-01555 error (snapshot too old). From what I can tell, the dbms_job duration is 4 seconds and the Last_Exec is 2m 7s after it starts (8:30 PM). With that said, our DBAs working o nthe project have increased the Undo_Retention settings and assure us that shouldn't be the problem. Odd thing is, this never happened in the dev environment when we were developing/testing - only in the production environment once it got migrated.
    I am looking for possible causes and possible solutions to the ORA-01555 error. A sample of the code in my procedure is below:
    CREATE OR REPLACE PROCEDURE Ar_Mviews IS
    V_FAILURES NUMBER := 0;
    BEGIN
    BEGIN
              SELECT FAILURES INTO V_FAILURES FROM USER_JOBS WHERE SCHEMA_USER = 'CATEBS' AND WHAT LIKE '%DISCO_MVIEWS%';
              IF V_FAILURES = 1 THEN NULL;
              ELSE
    DBMS_MVIEW.REFRESH ('AR_BATCH_RECEIPTS_V', 'C');
              DBMS_OUTPUT.PUT_LINE(V_FAILURES); END IF;
    END;
    BEGIN
         SELECT FAILURES INTO V_FAILURES FROM USER_JOBS WHERE SCHEMA_USER = 'CATEBS' AND WHAT LIKE '%DISCO_MVIEWS%';
              IF V_FAILURES = 1 THEN NULL;
              ELSE
    DBMS_MVIEW.REFRESH ('AR_BATCHES_ALL_V', 'C');
              DBMS_OUTPUT.PUT_LINE(V_FAILURES); END IF;
    END;
    END Ar_Mviews;
    ---------------------------------------------------------------------------------------------------------------

    We are doing complete refreshes and doing it that way for consistency in the data presented. Because some materialized views are dependent upon data in other materialized views, we have them ordered in a procedure so that when one finishes, the next starts and they are also in a specific order as to ensure accurate data.
    The condition for v_failures is done so that the job doesn't get, lets say, 90% finished and hit an error and start over again. We do the IF statement which results in NULL (do nothing) so that the job doesn't repeat itself over and over again. If one MV fails, we have to consider the job a failure and do nothing else because the one MV that failed may have been a dependency of another MV down the line. (i.e. MV7 calls MV3 and MV3 fails, so the whole job fails because MV7 can't be accurate without the most current data from MV3).
    As well, this is being performed in off-business hours after backup to tape, etc. and prior to start of business so that no one is using the system when we run this job. That won't always be the case when we move to high availability with this system for varying time-zone end-users.
    I hope I have answered your question and look forward to continued feedback.
    Thanks!

  • ORA-01034 when trying to create a database

    I successfully installed Oracle 8.1.7 on Solaris 8, but when I tried creating a database (by executing sql<SID>.sh after I ran "dbassist"), this error appeared:
    ORA-01034: Oracle not available.
    I could not use svrmgrl to do a startup because there is NO database.
    What services have to run before I can create a database?
    Thank you.
    null

    I chose "custom installation" and not to create a database during installation. There was no error when I installed the Oracle software and I modified the /etc/system (shmmax, shmmin, etc.) according to the Oracle documentation. After that, I used "dbassist" to create a database. Then the "ORA-01034: Oracle not available" appeared.
    I also tried to install Oracle with "Typical" option that is suppose to create the initial database for me. It also failed. The same error appeared when the 'Database Configuration Tools' were trying to create the database files.

  • ORA-01450 when trying to create index on xmltype column

    Hi,
    I have a table that contains an xmltype column. It is a schema-based column and uses object-relational structured storage. When I tried to create an index like:
    create index ssual_sipuser_idx on ssua_line (extractValue(ssual_configuration, '/ssuaLineApplication/sipUser'));
    I got the following:
    ORA-01450: maximum key length (3118) exceeded
    The sipUser tag is of string type. I have also tried creating the index on the extract function.
    create index ssual_sipuser_idx on ssua_line (ssual_configuration.extract('/ssuaLineApplication/sipUser/text()').getStringVal())
    Gave me the same error message. My database block size is 4k. This is Oracle 9.2.0.4 running on Solaris.
    Any help will be appreciated.
    Thanks,
    Gloria

    Thanks for the reply, Coby.
    My field is really small, probably around 10 bytes. Actually I've been testing on two servers, a 9201 and a 9204. I know that Oracle doesn't support XML DB on 9201 anymore but our company hasn't switched over yet. Anyways, here's really what I saw:
    9201
    - creating an index with extractValue() or extract() doesn't work
    9204
    - extractValue() works
    - extract() still doesn't work
    Now I'm using the substr() workaround. I should also mention that extractValue() with a numeric field works (using getNumberVal()).
    I wonder if specifying the field length in the XML Schema would make a difference. I may try that next.

  • ORA-06502 when trying to create a web service reference

    Hi,
    I want to create a reference to mail a report from BI Publisher.
    Apparently the e-mail option is no longer available in the v2 webservices so I tried to create a web service reference to:
    .../xmlpserver/services/PublicReportService?wsdl
    I had no problems creating references to the v2 web services however I don't manage to create a reference for this WSDL.
    The last step gives me:
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    Thanks for tips or advice.
    Other workarounds to email a report are welcome as well. I tried to use the v2 webservices runReport & scheduleReport before but they don't seem to support this.
    Thanks!

    Okay, so email is available in the v2 webservices I found out. (despite stated in many blogpost it is not)
    --- ScheduleService
    If you're going to use it to send emails you need to create your webservice manually. Otherwise it will not work as the scheduleReport also can print, fax or save your report to webdav and you will need to remove these elements from you soapenveloppe to get it to work.
    This is not possible with the services created using the WSDL wizard.

  • Ora-07445 When tried to select a view using where clause it got disconnectd

    select * from v_my_view;
    plan group_name plan_id
    plan_one group_one 101
    1 row selected.
    when I tried
    select * from v_my_view where plan_id='101';
    It got disconnected and show to end of communication error
    Current verson of database I am working with is 10.2.0.1.0
    Please help, niether i have metalink access nor I have any patch to install.
    Thanks and Regards in advance,

    First don't create Multiple thread I guess you created 3 thread for the same problem.
    Coming back to your problem did you check your Alert log, is your server running in shared/Dedicated mode whats your OS.

  • Error on creating Materialized view.

    Hi,
    I don't understand why it happens...
    When I tried to creating materialized view, it shows a error "ORA-01013: User requested cancel of current operation".
    I don't understand why it happens. I just waited it successfully created. But I didn't press any button.
    Does it matter of size of joining table? I had same issue before. At that time I just removed some tables from the joining condition, this error was gone.
    But at this time, I cannot exclude any other tables the select statement
    Can anyone help me this issue, please?

    Hi,
    11g ( 11.2.0.3 ) has a problem with materialized views based on ROWID, resulting in the problem you mentioned.
    A workaround is creating the MV's based on primary keyl.
    There is also a patch available on MOS, to solve the problem ( thanks to a very long SR from me :-) )
    It is known as bug 13657605 and the patch for it has the same number.
    Remember to read the README, as this patch is only for 11.2.0.3 !!
    Cheers
    FJFranken

  • Error while creating Materialized View in AWM

    Hello,
    I am using Oracle 11g with Analytic WorkSpace Manager 11.1.0.6.0A
    I am trying to create materialized view on my Cube..
    The Cube has 5 Dimensions out of which Four are having two levels i.e.,
    TotalA-->DimensionA
    TotalB-->DimensionB...and so on
    And one time Dimension having 4 levels
    TotalTime-->YEAR-->QUARTER-->MONTH
    When i try to create the materialized view, i get an error saying that
    "Your metadata changes have been saved, with the following errors
    CREATE MATERIALIZED VIEW "ENT.CB$TIME_TIME_HIER"
    ORA-02267:column type incompatible with referenced column type"
    When i googled regarding this error, it says to change the datatype of the column..
    But which column's data type is to be changed..Please throw some light regarding this...
    Awaiting for reply..

    My query is as follows:
    SELECT
    sum(cd.SALESAMT *(case when (k.LEVEL_NAME = 'ALL_product' AND l.level_name='ALL_MODE' AND m.LONG_DESCRIPTION = 'Type1')then 1 else 0 end)) as Cumm_Type1Txn_Amount,
    sum(cd.SALESAMT *(case when (k.LEVEL_NAME = 'ALL_product' AND l.level_name='ALL_MODE' AND m.LONG_DESCRIPTION = 'Type2')then 1 else 0 end)) as Cumm_Type2Txn_Amount,
    sum(cd.SALESAMT *(case when (k.LONG_DESCRIPTION='product1'AND l.level_name='ALL_MODE'AND m.LONG_DESCRIPTION = 'Type1' )then 1 else 0 end)) as Cumm_product1_Type1Txn_Amount,
    sum(cd.SALESAMT *(case when (k.LONG_DESCRIPTION='product1'AND l.level_name='ALL_MODE'AND m.LONG_DESCRIPTION = 'Type2')then 1 else 0 end)) as Cumm_product1_Type2Txn_Amount,
    sum(cd.SALESAMT *(case when (k.LEVEL_NAME = 'ALL_product' AND l.LONG_DESCRIPTION='Mode1'AND m.LONG_DESCRIPTION = 'Type1')then 1 else 0 end)) as Cumm_Mode1_Type1Txn_Amount,
    sum(cd.SALESAMT *(case when (k.LEVEL_NAME = 'ALL_product' AND l.LONG_DESCRIPTION='Mode1'AND m.LONG_DESCRIPTION = 'Type2')then 1 else 0 end)) as Cumm_Mode1_Type2Txn_Amount,
    sum(cd.SALESAMT *(case when (k.LEVEL_NAME = 'ALL_product' AND l.LONG_DESCRIPTION='Mode2'AND m.LONG_DESCRIPTION = 'Type1')then 1 else 0 end)) as Cumm_CLRING_Type1Txn_Amount,
    sum(cd.SALESAMT *(case when (k.LEVEL_NAME = 'ALL_product' AND l.LONG_DESCRIPTION='Mode2'AND m.LONG_DESCRIPTION = 'Type2')then 1 else 0 end)) as Cumm_Mode2_Type2Txn_Amount,
    sum(cd.SALESAMT *(case when (k.LEVEL_NAME = 'ALL_product' AND l.LONG_DESCRIPTION='Mode3'AND m.LONG_DESCRIPTION = 'Type1')then 1 else 0 end)) as Cumm_TRSFER_Type1Txn_Amount,
    sum(cd.SALESAMT *(case when (k.LEVEL_NAME = 'ALL_product' AND l.LONG_DESCRIPTION='Mode3'AND m.LONG_DESCRIPTION = 'Type2')then 1 else 0 end)) as Cumm_Mode3_Type2Txn_Amount,
    sum(cd.SALESAMT *(case when (k.LEVEL_NAME = 'ALL_product' AND l.level_name='ALL_MODE' AND m.level_name = 'ALL_TYPE')then 1 else 0 end)) as Cumm_Txn_Amount,
    sum(cd.SALESAMT *(case when (k.LEVEL_NAME = 'ALL_product' AND l.long_description='Mode3' AND m.level_name = 'ALL_TYPE')then 1 else 0 end)) as Cumm_Mode3_Txn_Amount,
    sum(cd.SALESAMT *(case when (k.LEVEL_NAME = 'ALL_product' AND l.long_description='Mode2' AND m.level_name = 'ALL_TYPE')then 1 else 0 end)) as Cumm_Mode2_Txn_Amount,
    sum(cd.SALESAMT *(case when (k.long_description = 'product1' AND l.level_name='ALL_MODE' AND m.level_name = 'ALL_TYPE')then 1 else 0 end)) as Cumm_product1_Txn_Amount,
    sum(cd.SALESAMT *(case when (k.long_description = 'product1' AND l.long_description='Mode1' AND m.LONG_DESCRIPTION = 'Type1')then 1 else 0 end)) as Cumm_product1Mode1Type1_Txn_Amount,
    sum(cd.SALESAMT *(case when (k.long_description = 'product1' AND l.long_description='Mode1' AND m.LONG_DESCRIPTION = 'Type2')then 1 else 0 end)) as Cumm_product1_Mode1_Type2_Txn_Amount,
    sum(cd.SALESAMT *(case when (k.long_description = 'product1' AND l.long_description='Mode1' AND m.level_name = 'ALL_TYPE')then 1 else 0 end)) as Cumm_product1_Mode1_Total_Txn_Amount
    /* From dimension views and cube view */
    FROM CUSTOMER_ID_CUSTOMER_ID_HIE_VIEW b,
    TIME_TIME_HIER_VIEW j,
    product_product_HIER_VIEW k,
    MODE_MODE_HIER_VIEW l,
    TYPE_TYPE_HIER_VIEW m,
    CUBETEST_VIEW cd
    /* Create level filters */
    WHERE b.level_name = 'CUSTOMER_ID'
    AND b.LONG_DESCRIPTION='xyz'
    AND j.LEVEL_NAME='MONTH'
    AND j.END_DATE between to_date('2007-10-31','YYYY-MM-DD') and to_date('2007-10-31','YYYY-MM-DD')
    /* Join dimension views to cube view */
    AND b.DIM_KEY=cd.ACCOUNT_ID
    AND j.DIM_KEY=cd.TIME
    AND k.DIM_KEY=cd.product
    AND l.DIM_KEY=cd.MODE
    AND m.DIM_KEY=cd.TYPE
    ORDER BY j.end_date,
    k.level_name,
    l.level_name,
    m.level_name;

  • Problems in creating Materialized View from 10g R2  to 11g

    Hi,
    We have two databases in 10g Release 2. These databases are on two different servers and we use
    Materialized views to replicate data between these servers. We are currently using 64 bit version of
    oracle 10g release 2 for LINUX.
    Oracle Database 10g Release 10.2.0.1.0 - 64 bit Production
    PL/SQL Release 10.2.0.1.0 - Production
    CORE 10.2.0.1.0 Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    We use CENTOS 5 - 64 bit edition
    We upgraded one of the databases to 11g (We exported the data from old database and
    imported it in new database) . Then we tried to create a Materialized view with incremental refresh
    on it where the base table is in the second Oracle 10g database.
    The problem is that it is not letting us create the view with FAST Refresh. It kept on giving ORA-12028
    error. We tried different remedies suggested on forums like creating a view with ROWID, but still it
    continued giving us the same error. We also synchronized the characterset of Oracle 10g and Oracle 11g
    installations but still it did not work.
    Our base table size is pretty large (over 10 Million records) and if we do a full refresh, it takes hours to
    refresh it.
    Without incremental refresh, we will not be able to fucntion, and to upgrade both database simultaneously
    we will need a large down-time which also we can not afford.
    Please advise what should we do.
    Best Regards
    Madhup
    Edited by: Madhup on Mar 2, 2009 10:45 AM

    Hello,
    Yesterday I met the same problem and very sad about this, however, my story is much more complicated (I think so).
    I have 6 databases:
    2 - 11g
    2 - 10g
    2 - 9i
    Every database of each release has different characterset(UTF8 and AL16UTF16).
    I am trying to create Materialized view with FAST REFRESH on Oracle 11g, when master tables are located on 10g database and 9i database.
    Materialized view, which points to 9i database, was successfully created.
    Materialized view, which points to 10g database, gets ORA-12028
    Like you, I tried many notes from METALINK and thought at the begining that the problem is my characterset. But, when the materialized views were successfully built on Oracle 9i database, I understood that the problem is something else.
    Did you find the actual reason why this issue does not work??
    Thanks,
    Alex

  • Create materialized view in SE referring table in EE

    Hi DBAs,
    I am trying to create a Materialized view on Oracle 10g Standard Edition which is installed on Linux Debian Lenny.
    The master table is on Oracle 10g Enterprise Edition installed on Red Hat Linux 4.1.2.
    When I run,
    create materialized view t1 build immediate refresh fast as (select * from aksharaemsmigrated.t1@db102)
    i get,
    ORA-12028: materialized view type is not supported by master site
    When I run,
    create materialized view t1 build immediate refresh fast on commit as (select * from aksharaemsmigrated.t1@db102);
    I get,
    ORA-01031: insufficient privileges
    When I run,
    select * from aksharaemsmigrated.t1@db102
    I get,
    the rows from aksharaemsmigrated.t1@db102
    NOTE: 'db102' is remote DB on 10g EE for which I created db link.
    I am able to create Mview for local table.
    Is this not supported? I mean creating Mview on Oracle SE referring base table from Oracle EE.
    I have to give solution soon. Can you please throw some light.
    Regards,
    Vijay

    Don't put select statement inside parantheses.
    Test these
    create table x1 as select * from aksharaemsmigrated.t1@db102;
    create materialized view t1 build immediate refresh fast as select * from aksharaemsmigrated.t1@db102 ;Note that you cannot create an MV that is REFRESH ON COMMIT when across Databases.
    See my explanation at http://hemantoracledba.blogspot.com/2008/06/mvs-with-refresh-on-commit-cannot-be.html
    Hemant K Chitale

  • Issue with creating materialized view

    Hi,
    We have a select query (containing joins, aggregates and UNION ALL’s) using which we are creating materialized views. We were able to create these mat views in development environment, however when tried to run the same scripts in a higher environment the creation never completes. The higher environment has three times more data than in Dev currently.
    The below operations complete well in time , but when we add “CREATE MATERIALIZED VIEW MAT_VIEW_NAME” to the select query it takes forever (we have cancelled the operation after waiting for more 1 hour)
    Select count(1) from the complete Mat. View query -     takes 3.2 min to complete - the query resullts in      3,010,068 rows
    Create Normal VIEW using complete Mat. View select query -     takes      3.06 sec     to complete
    Create table using complete Mat. View select query     takes 5.75 min to complete - the query resullts in           3,010,068
    Does anyone have an idea why this could be happening ? if you have ever faced this kind of issue, can you please provide pointers on how you were able to solve the problem. We are using Oracle 11g.
    Let me know if I have to provide any other information for you to understand the issue better.
    Thanks

    SELECT vis.uid, findet.yr, findet.ect, vis.ind,
    tm_view.col1_id, tm_view.col1_name,
    tm_view.col2_id, tm_view.col2_name,
    tm_view.col3_id, tm_view.col3_name,
    clnt.cl_id, clnt.cl_nm,
    prodparent_view.parent_cd,
    prodparent_view.parent_desc,
    prod_view.parent_cd,
    prod_view.parent_desc,
    prod_view.child_cd,
    prod_view.child_desc,
    SUM (value1), SUM (value2),
    SUM (value3), SUM (value4),
    SUM (value5), SUM (value6),
    SUM (value7), SUM (value8),
    SUM (value9), SUM (value10),
    SUM (value11), SUM (value12)
    FROM vis,
    (SELECT *
    FROM analytic_e,
    (SELECT table_val
    FROM TAB_CHECK s
    WHERE s.tgt_table_nm = 'ANALYTIC'
    AND s.table_val = 'ANALYTIC_E')
    WHERE table_val = 'ANALYTIC_E'
    UNION ALL
    SELECT *
    FROM analytic_o,
    (SELECT switch_val
    FROM tab_check s
    WHERE s.tgt_table_nm = 'ANALYTIC'
    AND s.switch_val = 'ANALYTIC_O')
    WHERE switch_val = 'ANALYTIC_O') findet,
    prod_view,
    prodparent_view,
    tm_view,
    clnt,
    (select to_number(to_char(ref_dt,'yyyy'))-1 year_agg from DATE_TABLE) tbabt
    WHERE tbabt.yr = findet.yr
    AND vis.cl_key = findet.cl_key
    AND tm_view.hi_key = findet.hi_key
    AND prod_view.child_cd = findet.prod_cd
    AND clnt.cl_key = findet.cl_key
    AND prodparent_view.child_cd = prod_view.parent_cd
    GROUP BY vis.uid, findet.yr, findet.ect, vis.ind,
    tm_view.col1_id, tm_view.col1_name,
    tm_view.col2_id, tm_view.col2_name,
    tm_view.col3_id, tm_view.col3_name,
    clnt.cl_id, clnt.cl_nm,
    prodparent_view.parent_cd
    prodparent_view.parent_desc
    prod_view.parent_cd
    prod_view.parent_desc
    prod_view.child_cd
    prod_view.child_desc
    Higher Environment
    | Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time | Pstart| Pstop |
    | 0 | SELECT STATEMENT | | 57M| 65G| | 20M (1)| 66:48:28 | | |
    | 1 | HASH GROUP BY | | 57M| 65G| 73G| 20M (1)| 66:48:28 | | |
    |* 2 | HASH JOIN | | 57M| 65G| | 109K (2)| 00:21:58 | | |
    | 3 | TABLE ACCESS BY INDEX ROWID | HIER | 2100 | 244K| | 172 (0)| 00:00:03 | | |
    |* 4 | INDEX RANGE SCAN | UK_HIER | 2100 | | | 16 (0)| 00:00:01 | | |
    |* 5 | HASH JOIN | | 57M| 59G| | 109K (1)| 00:21:52 | | |
    | 6 | VIEW | VW_GBF_25 | 1908 | 868K| | 2612 (1)| 00:00:32 | | |
    | 7 | HASH GROUP BY | | 1908 | 141K| | 2612 (1)| 00:00:32 | | |
    | 8 | VIEW | | 45107 | 3347K| | 2609 (1)| 00:00:32 | | |
    | 9 | UNION-ALL | | | | | | | | |
    | 10 | HASH UNIQUE | | 22518 | 1473K| 1872K| 1010 (1)| 00:00:13 | | |
    |* 11 | TABLE ACCESS FULL | HIER | 22518 | 1473K| | 650 (1)| 00:00:08 | | |
    | 12 | HASH UNIQUE | | 22518 | 1165K| 1512K| 947 (1)| 00:00:12 | | |
    |* 13 | TABLE ACCESS FULL | HIER | 22518 | 1165K| | 650 (1)| 00:00:08 | | |
    | 14 | HASH UNIQUE | | 71 | 1917 | | 652 (1)| 00:00:08 | | |
    |* 15 | TABLE ACCESS FULL | HIER | 22518 | 593K| | 650 (1)| 00:00:08 | | |
    |* 16 | HASH JOIN | | 64M| 38G| 4936K| 106K (1)| 00:21:16 | | |
    | 17 | VIEW | | 45107 | 4404K| | 2609 (1)| 00:00:32 | | |
    | 18 | UNION-ALL | | | | | | | | |
    | 19 | HASH UNIQUE | | 22518 | 1473K| 1872K| 1010 (1)| 00:00:13 | | |
    |* 20 | TABLE ACCESS FULL | HIER | 22518 | 1473K| | 650 (1)| 00:00:08 | | |
    | 21 | HASH UNIQUE | | 22518 | 1165K| 1512K| 947 (1)| 00:00:12 | | |
    |* 22 | TABLE ACCESS FULL | HIER | 22518 | 1165K| | 650 (1)| 00:00:08 | | |
    | 23 | HASH UNIQUE | | 71 | 1917 | | 652 (1)| 00:00:08 | | |
    |* 24 | TABLE ACCESS FULL | HIER | 22518 | 593K| | 650 (1)| 00:00:08 | | |
    |* 25 | HASH JOIN | | 3021K| 1550M| 15M| 24492 (1)| 00:04:54 | | |
    | 26 | PARTITION HASH ALL | | 491K| 10M| | 1059 (1)| 00:00:13 | 1 | 16 |
    | 27 | MAT_VIEW ACCESS FULL | VIS | 491K| 10M| | 1059 (1)| 00:00:13 | 1 | 16 |
    |* 28 | HASH JOIN | | 388K| 190M| 6056K| 12929 (1)| 00:02:36 | | |
    | 29 | TABLE ACCESS FULL | CLNT | 64540 | 5294K| | 411 (1)| 00:00:05 | | |
    |* 30 | HASH JOIN | | 388K| 159M| | 4072 (1)| 00:00:49 | | |
    | 31 | TABLE ACCESS FULL | DATE_TABLE | 2 | 16 | | 3 (0)| 00:00:01 | | |
    | 32 | VIEW | | 582K| 235M| | 4065 (1)| 00:00:49 | | |
    | 33 | UNION-ALL | | | | | | | | |
    | 34 | NESTED LOOPS | | 272K| 52M| | 1860 (1)| 00:00:23 | | |
    |* 35 | TABLE ACCESS BY INDEX ROWID| TAB_CHECK | 1 | 46 | | 1 (0)| 00:00:01 | | |
    |* 36 | INDEX UNIQUE SCAN | SYS_C0041157 | 1 | | | 0 (0)| 00:00:01 | | |
    | 37 | PARTITION RANGE ALL | | 272K| 40M| | 1859 (1)| 00:00:23 | 1 |1048575|
    | 38 | TABLE ACCESS FULL | ANALYTIC_E | 272K| 40M| | 1859 (1)| 00:00:23 | 1 |1048575|
    | 39 | NESTED LOOPS | | 309K| 58M| | 2205 (1)| 00:00:27 | | |
    |* 40 | TABLE ACCESS BY INDEX ROWID| TAB_CHECK | 1 | 46 | | 1 (0)| 00:00:01 | | |
    |* 41 | INDEX UNIQUE SCAN | SYS_C0041157 | 1 | | | 0 (0)| 00:00:01 | | |
    | 42 | PARTITION RANGE ALL | | 309K| 44M| | 2204 (1)| 00:00:27 | 1 |1048575|
    | 43 | TABLE ACCESS FULL | ANALYTIC_O | 309K| 44M| | 2204 (1)| 00:00:27 | 1 |1048575|
    Development
    | Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time | Pstart| Pstop |
    | 0 | SELECT STATEMENT | | 1696K| 1276M| | 291K (1)| 00:58:20 | | |
    | 1 | HASH GROUP BY | | 1696K| 1276M| 1325M| 291K (1)| 00:58:20 | | |
    |* 2 | HASH JOIN | | 1696K| 1276M| | 9721 (2)| 00:01:57 | | |
    | 3 | VIEW | | 15464 | 1132K| | 1855 (1)| 00:00:23 | | |
    | 4 | UNION-ALL | | | | | | | | |
    | 5 | HASH UNIQUE | | 7681 | 502K| | 618 (1)| 00:00:08 | | |
    |* 6 | TABLE ACCESS FULL | HIER | 7681 | 502K| | 617 (1)| 00:00:08 | | |
    | 7 | HASH UNIQUE | | 7681 | 375K| | 618 (1)| 00:00:08 | | |
    |* 8 | TABLE ACCESS FULL | HIER | 7681 | 375K| | 617 (1)| 00:00:08 | | |
    | 9 | HASH UNIQUE | | 102 | 2448 | | 618 (1)| 00:00:08 | | |
    |* 10 | TABLE ACCESS FULL | HIER | 7681 | 180K| | 617 (1)| 00:00:08 | | |
    |* 11 | HASH JOIN | | 371K| 252M| | 7847 (2)| 00:01:35 | | |
    | 12 | VIEW | | 15464 | 1510K| | 1855 (1)| 00:00:23 | | |
    | 13 | UNION-ALL | | | | | | | | |
    | 14 | HASH UNIQUE | | 7681 | 502K| | 618 (1)| 00:00:08 | | |
    |* 15 | TABLE ACCESS FULL | HIER | 7681 | 502K| | 617 (1)| 00:00:08 | | |
    | 16 | HASH UNIQUE | | 7681 | 375K| | 618 (1)| 00:00:08 | | |
    |* 17 | TABLE ACCESS FULL | HIER | 7681 | 375K| | 617 (1)| 00:00:08 | | |
    | 18 | HASH UNIQUE | | 102 | 2448 | | 618 (1)| 00:00:08 | | |
    |* 19 | TABLE ACCESS FULL | HIER | 7681 | 180K| | 617 (1)| 00:00:08 | | |
    |* 20 | HASH JOIN | | 122K| 71M| | 5987 (2)| 00:01:12 | | |
    |* 21 | TABLE ACCESS FULL | HIER | 7681 | 915K| | 617 (1)| 00:00:08 | | |
    |* 22 | HASH JOIN | | 122K| 57M| 4512K| 5368 (2)| 00:01:05 | | |
    |* 23 | HASH JOIN | | 9556 | 4395K| 3856K| 2409 (2)| 00:00:29 | | |
    | 24 | TABLE ACCESS FULL | CLNT | 74426 | 2979K| | 310 (1)| 00:00:04 | | |
    |* 25 | HASH JOIN | | 9556 | 4012K| | 1710 (2)| 00:00:21 | | |
    | 26 | TABLE ACCESS FULL | DATE_TABLE | 1 | 7 | | 3 (0)| 00:00:01 | | |
    | 27 | VIEW | | 19112 | 7894K| | 1706 (2)| 00:00:21 | | |
    | 28 | UNION-ALL | | | | | | | | |
    | 29 | MERGE JOIN CARTESIAN | | 19111 | 4068K| | 1701 (2)| 00:00:21 | | |
    |* 30 | TABLE ACCESS FULL | TAB_CHECK | 1 | 49 | | 3 (0)| 00:00:01 | | |
    | 31 | BUFFER SORT | | 248K| 40M| | 1698 (2)| 00:00:21 | | |
    | 32 | PARTITION RANGE ALL| | 248K| 40M| | 1698 (2)| 00:00:21 | 1 |1048575|
    | 33 | TABLE ACCESS FULL | ANALYTIC_E | 248K| 40M| | 1698 (2)| 00:00:21 | 1 |1048575|
    | 34 | MERGE JOIN CARTESIAN | | 1 | 537 | | 5 (0)| 00:00:01 | | |
    | 35 | PARTITION RANGE ALL | | 1 | 488 | | 2 (0)| 00:00:01 | 1 |1048575|
    | 36 | TABLE ACCESS FULL | ANALYTIC_O | 1 | 488 | | 2 (0)| 00:00:01 | 1 |1048575|
    | 37 | BUFFER SORT | | 1 | 49 | | 3 (0)| 00:00:01 | | |
    |* 38 | TABLE ACCESS FULL | TAB_CHECK | 1 | 49 | | 3 (0)| 00:00:01 | | |
    | 39 | PARTITION HASH ALL | | 810K| 16M| | 1456 (2)| 00:00:18 | 1 | 16 |
    | 40 | MAT_VIEW ACCESS FULL | VIS | 810K| 16M| | 1456 (2)| 00:00:18 | 1 | 16 |
    -----------------------------------------------------------------------------------------------------------------------------------------

  • 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.
    Thanks

    damorgan, 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.

  • 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 AM

    Please 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

Maybe you are looking for

  • Voicemail not working - Callers can't leave messages

    Hi, I've had my iPhone a couple of weeks but i've only just realised that my voicemail isn't working. I've done the password set-up and can access my voicemail settings by dialling and holding 1 but people calling my phone do not get the opportunity

  • Urgent- o/p of report in excel format

    Hi All, I want to generate o/p of my report in excel format. Please send me the sample code for it at [email protected] Thanks in advance bhushan

  • Looking for a particular font

    I'm looking for this font to use with final cut pro 6.0.1: http://img223.imageshack.us/img223/9837/fonthk4.png where can I download it?

  • Contact showing offline when online

    Hello, I using (newest) Skype on my computer, and one time i used it too on Windows Phone... First time when i get trouble to other see im online but no i will logout all devices online.. Sooo/showplacesand/remotelogout .So, its helped, but anyway, y

  • Swing Applet on Mac OS 9

    I have a Swing applet and I deployed it in weblogic 6.1, when I access this in Mac os 9 , it gives the Applet error : closing in browser. Appart from installing MRJ2.2.5((latest?) and swingall.jar(jfc) , what are the other necessary steps to get the