Oracle BUG... Snapshots in 8.1.7

I accidently issued a RENAME on a number of snapshots in my DB. It created a TABLE for each of these objects and I can not drop these objects without getting told "ORA-12083 must use DROP MATERIALIZED VIEW to drop "OWNER.TABLE"".
If I try to use drop MAT VIEW I recieve messaage telling me that object is not a snapshot.
Think this is a potential Oracle Bug. How can I drop these tables?
Thanks,
Miller

This is the Oracle Database Lite forum. Can you please repost your question on the general database forum: General Database Discussions

Similar Messages

  • ORA-22805 - (inserting an XMl type FAILS) I suspect this is a oracle Bug

    We're using
    Oracle9i Enterprise Edition Release 9.2.0.7.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.7.0 - Production
    Basically when I try to execute the following
    dbms_xmlschema.registerschema
    ('MySchema.xsd',
    sys.UriFactory.getUri('/Location/MySchema.xsd'),
    genTables=>TRUE);
    this generates a table for us with the name "xmlt_ds_0"
    when we try to insert into this table, we get an error
    INSERT INTO tddb.xmlt_ds_0
    SELECT sys.xmltype.createschemabasedxml(mq.content, 'http://My.Schema.xsd')
    FROM message_queue mq
    WHERE mq.sys_id = 148100
    ORA-22805: cannot insert NULL object into object tables or nested tables
    Now this works for most xml files, it just one or two that fail, however these files that have failed are well formed, and valid (ie: conform to the scehema)
    however, if I try to do this
    create table tempTest of xmltype
    XMLSCHEMA "Myschema.xsd"
    ELEMENT "schedule"
    then insert into this
    INSERT INTO tempTest
    SELECT sys.xmltype.createschemabasedxml(mq.content, 'http://My.Schema.xsd')
    FROM message_queue mq
    WHERE mq.sys_id = 148100
    Basically, this works for the same file, I just dont understand why it wouldn't work in the "resitering the schema" way. I strongly suspect this is a Oracle Bug
    Has any one encountered this before, any help would be appriciated.

    FIRST of all...
    If you create the table via registerschema, then you table will be created case-sensitive (in general take notice that with XMLDB everything can be / will be case-sensitive). So this means you will have to do things the following way (mark the double quotes):
    NSERT INTO tddb."xmlt_ds_0"
    SELECT sys.xmltype.createschemabasedxml(mq.content, 'http://My.Schema.xsd')
    FROM message_queue mq
    WHERE mq.sys_id = 148100Your statement (see below) will generate a table the default way, that is a table in uppercase
    create table tempTest of xmltype
    XMLSCHEMA "Myschema.xsd"
    ELEMENT "schedule"so ...this will create a table with the name "TEMPTEST".
    regarding the ORA-22805...
    - can you post the schema
    - can you post the values that cause the error...

  • Problem while Creating MVLOG with synonym in Oracle 9i:Is it an Oracle Bug?

    Hi All,
    I am facing a problem while Creating MVLOG with synonym in Oracle 9i but for 10G it is working fine. Is it an Oracle Bug? or i am missing something.
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    SQL>
    SQL> create table t ( name varchar2(20), id varchar2(1) primary key);
    Table created.
    SQL> create materialized view log on t;
    Materialized view log created.
    SQL> create public synonym syn_t for t;
    Synonym created.
    SQL> CREATE MATERIALIZED VIEW MV_t
      2  REFRESH ON DEMAND
      3  WITH PRIMARY KEY
      4  AS
      5  SELECT name,id
      6  FROM syn_t;
    Materialized view created.
    SQL> CREATE MATERIALIZED VIEW LOG ON  MV_t
      2  WITH PRIMARY KEY
      3   (name)
      4    INCLUDING NEW VALUES;
    Materialized view log created.
    SQL> select * from v$version;
    BANNER
    Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
    PL/SQL Release 9.2.0.6.0 - Production
    CORE    9.2.0.6.0       Production
    TNS for Solaris: Version 9.2.0.6.0 - Production
    NLSRTL Version 9.2.0.6.0 - Production
    SQL>
    SQL> create table t ( name varchar2(20), id varchar2(1) primary key);
    Table created.
    SQL> create materialized view log on t;
    Materialized view log created.
    SQL> create public synonym syn_t for t;
    Synonym created.
    SQL> CREATE MATERIALIZED VIEW MV_t
    REFRESH ON DEMAND
    WITH PRIMARY KEY
    AS
      2    3    4    5  SELECT name,id
    FROM syn_t;   6
    Materialized view created.
    SQL> CREATE MATERIALIZED VIEW LOG ON  MV_t
    WITH PRIMARY KEY
    (name)
      INCLUDING NEW VALUES;  2    3    4
    CREATE MATERIALIZED VIEW LOG ON  MV_t
    ERROR at line 1:
    ORA-12014: table 'MV_T' does not contain a primary key constraintRegards
    Message was edited by:
    Avinash Tripathi
    null

    Hi Nicloei,
    Thanks for the reply. Actually i don't want any work around (Creating MVLOG on table rather than synonym is fine with me) . I just wanted to know it is actually an oracle bug or something else.
    Regards
    Avinash

  • Oracle bug 7046751

    After experiencing a Spatial query problem with my companies software due to Oracle bug 7046751, I was instructed by Oracle to run the SQL below to recreate ALL_SDO_GEOM_METADATA as a workaround. This worked fine and I could then use our software with Spatial to query, post, etc. However now I need to revert back to how the view would be in a typical 10.2.0.4 install, in order to test what our users will see. Could anyone advise me on a similar SQL statement I could use to recreate ALL_SDO_GEOM_METADA as it was before I recreated it?
    Thanks
    -mcslain
    create or replace view MDSYS.ALL_SDO_GEOM_METADATA as
    SELECT SDO_OWNER OWNER,
    SDO_TABLE_NAME TABLE_NAME,
    SDO_COLUMN_NAME COLUMN_NAME,
    SDO_DIMINFO DIMINFO,
    SDO_SRID SRID
    FROM mdsys.SDO_GEOM_METADATA_TABLE
    WHERE
    +(exists+
    +(select table_name from all_tables+
    where table_name=sdo_table_name
    and owner = sdo_owner
    union all
    select table_name from all_object_tables
    where table_name=sdo_table_name
    and owner = sdo_owner
    union all
    select SYNONYM_NAME from all_synonyms
    where SYNONYM_NAME=sdo_table_name
    and owner = sdo_owner
    union all
    select view_name table_name from all_views
    where view_name=sdo_table_name
    and owner = sdo_owner));

    Here is the SQL I get from my database when I inspect the ALL_SDO_GEOM_METADATA view....
    CREATE OR REPLACE VIEW ALL_SDO_GEOM_METADATA ( OWNER,
    TABLE_NAME, COLUMN_NAME, DIMINFO, SRID
    ) AS SELECT SDO_OWNER OWNER,
    SDO_TABLE_NAME TABLE_NAME,
    SDO_COLUMN_NAME COLUMN_NAME,
    SDO_DIMINFO DIMINFO,
    SDO_SRID SRID
    FROM mdsys.SDO_GEOM_METADATA_TABLE,
    all_tables a
    where a.table_name = sdo_table_name
    and a.owner = sdo_owner
    union all
    SELECT SDO_OWNER OWNER,
    SDO_TABLE_NAME TABLE_NAME,
    SDO_COLUMN_NAME COLUMN_NAME,
    SDO_DIMINFO DIMINFO,
    SDO_SRID SRID
    FROM mdsys.SDO_GEOM_METADATA_TABLE,
    all_object_tables a
    where a.table_name = sdo_table_name
    and a.owner = sdo_owner
    union all
    SELECT /*+ use_hash (a) */
    SDO_OWNER OWNER,
    SDO_TABLE_NAME TABLE_NAME,
    SDO_COLUMN_NAME COLUMN_NAME,
    SDO_DIMINFO DIMINFO,
    SDO_SRID SRID
    FROM mdsys.SDO_GEOM_METADATA_TABLE b,
    all_synonyms a
    where a.synonym_name = sdo_table_name
    and a.owner = sdo_owner
    union all
    SELECT SDO_OWNER OWNER,
    SDO_TABLE_NAME TABLE_NAME,
    SDO_COLUMN_NAME COLUMN_NAME,
    SDO_DIMINFO DIMINFO,
    SDO_SRID SRID
    FROM mdsys.SDO_GEOM_METADATA_TABLE,
    all_views a
    where a.view_name = sdo_table_name
    and a.owner = sdo_owner
    /

  • SOA Suite 11g Clustering error/oracle bug ?

    Hi, i got several experiment to implement soa suite 11g clustering, in my company.. at this moment we still use development mode in our application server. now i'm trying to get into production and also i want cluster the server.. here is the chronology what i do.
    i got 3 server :
    my plan is
    server #1 become an proxy server, let say the name is soa_proxy
    server #2 become an cluster node, let say the name is soa_server1
    server #3 become an cluster node, let say the name is soa_server2
    so i start install & configure it (applications is running under Windows Server 2003)
    1.*soa_proxy*
    - Installing WebLogic server
    - Installing SOA
    - Create Repository with RCU (oracle 10g database)
    2.*soa_server1*
    - Installing WebLogic server
    - Installing SOA
    3.*soa_server2*
    - Installing WebLogic server
    - Installing SOA
    after installation finished, then i create domain in soa_proxy server let say it name 'MyDomain', then i assign the soa_server1 and soa_server2 in cluster node named 'MyCluster', also i assign the soa_proxy server as a HTTP Proxy Server.. i'm following the instructions just like this link Link: [http://download.oracle.com/docs/cd/E12839_01/doc.1111/e13925/config_screens.htm#CJAEABGD]
    all the installation seems good, but when i try to deploy my composite application into the proxy server 'soa_proxy' with JDev, i got error like this
    Image: !http://img9.imageshack.us/img9/2122/error2z.jpg!
    and when i go to Http://hostname:7001/em
    i just see my composite deployed only in 'soa_server2'.
    UPDATE : well, now the error was gone when deploying. but we still got little odd result,
    when i deploy with jdev, it still fine, until i go to the enterprise manager. yess still.. my composite only deplyed in 'soa_server1'. i got some reference that we can copy the domain directory in soa_proxy and then paste into the server that not yet been deployed before. its seems oke..
    i've been thinking, how if i got 10 node of cluster? 50 node of cluster ? should i copy the directory just like that ?? is there another charmed way to do it???
    can somebody help me with this simple case?
    regards
    Wildan
    Edited by: wildsoft on Feb 12, 2010 11:33 AM
    =======
    here is my last trial to deploy the cluster environment, then i just got the same issues, our team here think thats the issues causing by oracle bug in code behind. for reminder what i do last experiment
    1. we deploy/configure the domain (admin console,cluster node) then starting up all the services smoothly without no issues & as we saw in the console monitor we can see the cluster is syncronizing.
    2. then we create simple composite.
    3. we try to deploy the composite to the cluster domain, and what we got is the composite only deployed in one cluster node.
    let me describe to clear it,
    * first trial, when we deploy the composite, here is what we got in em console
    *[-] SoaInfra (SoaServer1)*
    [+] CompositeLabTest
    *[-] SoaInfra (SoaServer2)*
    in JDev we also saw this message (the project CompositeLabTest Deploy Process is skipped), some kind like that
    * second time trial, we try to shut the SoaServer2 down, then restart it, what we got in em console
    *[-] SoaInfra (SoaServer1)*
    [+] CompositeLabTest
    *[-] SoaInfra (SoaServer2)*
    [+] CompositeLabTest
    . so until today my soa suite 11g clustering experience is never going good practice.. any of you may had experience with clustering too, how that can be done? please respon...
    thanks
    regards
    Wildan Abdat
    Edited by: wildsoft on Apr 27, 2010 4:08 PM
    Edited by: wildsoft on Apr 27, 2010 4:13 PM

    Hi there.
    Me too I have a similar problem with cluster deployment.
    I have two different domains in two different phisical machine on the same LAN.
    These domains are equals and the sole difference is regarding the IP configuration:
    domain 1
    machine 172.0.0.1
    soaadmin 172.0.0.1
    soa1 172.0.0.2
    soa1 172.0.0.3
    domain 2
    machine 172.0.1.1
    soaadmin 172.0.1.1
    soa1 172.0.1.2
    soa1 172.0.1.3
    When I try to deploy a new composite from the EM this fails (it remains in waiting for a response like the followed)
    <Jun 18, 2010 10:42:00 AM CEST> <Warning> <org.apache.myfaces.trinidadinternal.context.RequestContextImpl> <BEA-000000> <Could not find partial trigger idArchiveFileBrowserDialog from RichInputText[UIXEditableFacesBeanImpl, id=idArchiveLoc]>
    Processing sar=/tmp/dir2448127768139530528tmp/sca_SOAComposite1_rev1.0.jar
    Adding sar file - /tmp/dir2448127768139530528tmp/sca_SOAComposite1_rev1.0.jar
    Creating HTTP connection to host:172.0.0.2, port:10002
    What I checked:
    In multicast configuration soa1 (domain1) sent the request to all soa servers in the LAN (even in that one that aren't configurated in his domain)
    In unicast configuration soa1 (domain1) sent the request only to the soa2 (domain1) server but it remain in waiting for a response for all the time.
    What it is strange is that if I stop the domain2 the request can be performed and my composite is deployed in both the servers.
    Any idea about this strange behaviour?
    N.B.
    I'm not using Coherence.

  • XML to CSV routine using XSLT.  Oracle bugs?

    I'm trying to write some XSLT so that I can apply it to any given XML using  XMLTransform to generate a flattened CSV structure.  My input can be any XML document, with any number of nested levels so the structure isn't known to the XSLT.  I'm fairly new to XSLT but am having problem with Oracle's version of it.  I've tested on both 10gR2 and 11gR2.
    CSV Rules :
    Adjacent fields must be separated by a comma
    Embedded commas in fields are escaped e.g. 15, Maple Street => "15, Maple Street"
    Embedded quotes in fields are escaped.  e.g. O'Brien => "O'Brien" or John "Jonner" McNabb => "John ""Jonner"" McNabb"
    Embedded CR / LF or CRLF in fields are escaped with quotes.
    Records are separated with CRLF pairs
    Flattening Rules :
    The text of leaf elements (elements without children) are output even if they are empty
    Any element with text is output
    A new line occurs whenever the nesting level changes. i.e. If an element has children.
    When I run the following XML and my XSLT through Oracle I get results inconsistent with results I get when I run the XML and XSLT through online XSLT utils (including W3C's test pages).
    with qryXML as (
      select xmltype(q'[
      <email>
        <to>Steve O'Brien</to>
        <cc/>
        <from>Jane "The Smiler" Griff</from>
        <heading>Reminder</heading>
        <body>Hey, don't forget me this weekend!  I've enclosed some pics from last weekend
      Love Jane
      </body>
        <attachments>
          <attachment>
            <filename>Dance.jpg</filename>
            <encoding>MIME</encoding>
          </attachment>
          <attachment>
            <filename>Signature.txt</filename>
            <encoding/>
          </attachment>
        </attachments>
      </email>
      ]') as XMLDATA from dual)
    select
       XMLTransform(q.XMLDATA,
          xmltype(q'[
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:output method="text"/>
        <xsl:strip-space elements="*"/>
        <xsl:template match="*[text() or not(*)]">
            <xsl:if test="position() &gt; 1">
                <xsl:text>,</xsl:text>
            </xsl:if>
        <xsl:call-template name="display_csv_field">
          <xsl:with-param name="field" select="."/>
        </xsl:call-template>
            <xsl:if test="not(following-sibling::*[text() or not(*)])">
                <xsl:text>
    </xsl:text>         
            </xsl:if>
        </xsl:template>
      <xsl:template name="display_csv_field">
        <xsl:param name="field"/>
        <xsl:variable name="CRLF">
          <xsl:text>&#13;&#10;</xsl:text>
        </xsl:variable>
        <xsl:variable name="CR">
          <xsl:text>&#13;</xsl:text>
        </xsl:variable>
        <xsl:variable name="LF">
          <xsl:text>&#10;</xsl:text>
        </xsl:variable>
        <xsl:variable name="apos">'</xsl:variable>   
        <xsl:choose>
          <xsl:when test="contains( $field, '&quot;' )">
            <!-- Field contains a quote. So escape  -->
            <xsl:text>"</xsl:text>
            <xsl:call-template name="escape_quotes">
              <xsl:with-param name="string" select="$field" />
            </xsl:call-template>
            <xsl:text>"</xsl:text>
          </xsl:when>
          <xsl:when test="contains( $field, ',' ) or
                          contains( $field, $apos ) or
                          contains( $field, $CRLF ) or
                          contains( $field, $CR ) or
                          contains( $field, $LF )" >
            <!-- Field contains a comma, apostrophe and/or a linefeed, so quote -->
            <xsl:text>"</xsl:text>
            <xsl:value-of select="$field" />
            <xsl:text>"</xsl:text>
          </xsl:when>
          <xsl:otherwise>
            <!-- No need to enclose this field in quotes. -->
            <xsl:value-of select="$field" />
          </xsl:otherwise>
        </xsl:choose>
      </xsl:template>
      <xsl:template name="escape_quotes">
        <xsl:param name="string" />
        <xsl:value-of select="substring-before( $string, '&quot;' )" />
        <xsl:text>""</xsl:text>
        <xsl:variable name="substring_after_first_quote"
                      select="substring-after( $string, '&quot;' )" />
        <xsl:choose>
          <xsl:when test="not( contains( $substring_after_first_quote, '&quot;' ) )">
            <xsl:value-of select="$substring_after_first_quote" />
          </xsl:when>
          <xsl:otherwise>
            <!-- The substring after the first quote contains a quote.
                 So, we call ourself recursively to escape the quotes
                 in the substring after the first quote. -->
            <xsl:call-template name="escape_quotes">
              <xsl:with-param name="string" select="$substring_after_first_quote" />
            </xsl:call-template>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:template> 
    </xsl:stylesheet>
    )) from qryXML q  
    Output from Oracle (which appears incorrect)
    &quot;Steve O&apos;Brien&quot;&quot;Jane &quot;&quot;The Smiler&quot;&quot; Griff&quot;Reminder&quot;Hey, don&apos;t forget me this weekend!  I&apos;ve enclosed some pics from last weekend
      Love Jane
      &quot;
    Dance.jpgMIME
    Signature.txt
    Output from most other XSLT test environments (which appears correct):
    "Steve O'Brien",,"Jane ""The Smiler"" Griff",Reminder,"Hey, don't forget me this weekend!  I've enclosed some pics from last weekend
    Love Jane
    Dance.jpg,MIME
    Signature.txt,
    Oracle's XSLT handling appears incorrect in several ways:
    1. There is no comma delimiter separating fields and on investigation, position() is always returning 1, which is incorrect.  From XSLT reference "The position function returns a number equal to the context position from the expression evaluation context." ...."the position, or index number, of the node, relative to all the selected nodes in the node list."  Therefore any node in a node list should be indexable with position.   I am selecting a node list *[text() or not(*)] => Any nodes with text or with no children, yet position of each node in this list is always 1.
    2. My XSLT says the output is text, yet Oracle is still using HTML character escaping which is not text!  &quot; instead of " and &apos; instead of '.  I could search and replace, but I shouldn't have to.
    Can anyone explain why Oracle's XSLT differs from other XSLT processors and offer suggestions to solve these issues.  Are these bugs?

    Here's an example tested on 11.2.0.2 :
    SQL> set scan off
    SQL> set long 5000
    SQL> set lines 200
    SQL> var doc clob
    SQL> begin
      2   :doc := '<email>
      3      <to>Steve O''Brien</to>
      4      <cc/>
      5      <from>Jane "The Smiler" Griff</from>
      6      <heading>Reminder</heading>
      7      <body>Hey, don''t forget me this weekend!  I''ve enclosed some pics from last weekend
      8    Love Jane
      9    </body>
    10      <attachments>
    11        <attachment>
    12          <filename>Dance.jpg</filename>
    13          <encoding>MIME</encoding>
    14        </attachment>
    15        <attachment>
    16          <filename>Signature.txt</filename>
    17          <encoding/>
    18        </attachment>
    19      </attachments>
    20    </email>';
    21  end;
    22  /
    PL/SQL procedure successfully completed.
    SQL> select xmlcast(
      2           xmlquery(
      3           'declare function local:formatField ($e as element()) as xs:string
      4            {
      5              let $t := ora:replace($e, "&quot;", "&quot;&quot;")
      6              return if (    contains($t, "&quot;")
      7                          or contains($t, ",")
      8                          or contains($t, "&apos;")
      9                          or contains($t, "&#13;")
    10                          or contains($t, "&#10;") )
    11                     then concat("&quot;", $t, "&quot;")
    12                     else $e
    13            }; (::)
    14            string-join(
    15              for $i in //*[*[text() or not(node())]]
    16              return
    17                string-join(
    18                  for $j in $i/*[text() or not(node())]
    19                  return local:formatField($j)
    20                , ","
    21                )
    22            , "&#13;&#10;"
    23            )'
    24             passing xmltype(:doc)
    25             returning content
    26           )
    27           as clob
    28         ) as result
    29  from dual ;
    RESULT
    "Steve O'Brien",,"Jane ""The Smiler"" Griff",Reminder,"Hey, don't forget me this
    weekend!  I've enclosed some pics from last weekend
      Love Jane
    Dance.jpg,MIME
    Signature.txt,
    We could also use a single ora:matches function in place of the OR'ed contains but it doesn't appear to work on 11.2.0.3, got an internal error :
    ORA-00600: code d'erreur interne, arguments : [qmxqrs_xvm_popLastFuncArgAsStr:1], [], [], [], [], [], [], [], [], [], [], []

  • Oracle BUG (CASE + remote tables + inline view)

    Oracle 9.2.0.8
    BUG: Oracle inserts NULL when we use CASE statement in the SELECT query and we join a remote table with inline view.
    Script:
    CREATE TABLE t1 (a number(19,4)OK.
    SELECT (case when b = 1 then c else d end)
    FROM t2@Remote LEFT JOIN
    (SELECT a FROM t3@Remote) q ON (t2.a = q.a)123
    456
    789
    3 rows selected.
    INSERT INTO TABLE t1 (a)
    SELECT (case when b = 1 then c else d end)
    FROM t2@Remote LEFT JOIN
    (SELECT a FROM t3@Remote) q ON (t2.a = q.a)3 rows inserted.
    SELECT * FROM t1<null>
    <null>
    <null>
    3 rows selected
    Oracle inserts the correct values if I:
    * replace the CASE with DECODE
    * join with table not with an inline view
    * join local tables
    Someone with registration in the Metalink can post the bug.
    Best regards, Beroetz

    Oracle 9.2.0.8
    BUG: Oracle inserts NULL when we use CASE statement in the SELECT query and we join a remote table with inline view.
    Script:
    CREATE TABLE t1 (a number(19,4)OK.
    SELECT (case when b = 1 then c else d end)
    FROM t2@Remote LEFT JOIN
    (SELECT a FROM t3@Remote) q ON (t2.a = q.a)123
    456
    789
    3 rows selected.
    INSERT INTO TABLE t1 (a)
    SELECT (case when b = 1 then c else d end)
    FROM t2@Remote LEFT JOIN
    (SELECT a FROM t3@Remote) q ON (t2.a = q.a)3 rows inserted.
    SELECT * FROM t1<null>
    <null>
    <null>
    3 rows selected
    Oracle inserts the correct values if I:
    * replace the CASE with DECODE
    * join with table not with an inline view
    * join local tables
    Someone with registration in the Metalink can post the bug.
    Best regards, Beroetz

  • Oracle 8i Snapshots

    Question for anyone who has worked with snapshots between similar and dissimilar Oracle version UNIX environments:
    In what performance order, slowest to fastest, would you rate the following snapshot configurations: Oracle7 to Oracle7, Oracle7 to Oracle8i, Oracle8i to Oracle7, Oracle8i to Oracle8i?
    Any feedback will be greatly appreciated.
    Thank you
    John Manuel
    Oracle DBA
    Sprint Data Management
    Reston, VA
    null

    Updated rows are updated on refresh becasue there can same replication conflict on master site resolved by defined method. So values sent from snapshot site can deffed from values on master site. You problem is that yours trigger is fired on refresh time. You can avoid this by place this if to tou trigger body.
    if dbms_snapshot.i_am_a_refresh then return; end if;
    dbms_snapshot.i_am_a_refresh is True when snapshot is refreshed
    so trigger work only when local update is called.
    Analogicaly on masterr site you can use
    if dbms_reputil.from_remote then return; end if;
    dbms_reputil.from_remote is True when remote transaction are applied on master site.

  • Unable to Execute QUery ORA -00911 Probably Oracle Bug Please confirm

    HI Gurus,
    Unable to run the query:
    Was able to run select query fine, was able to run insert query fine...but when combining and running, its throwng the follwoing error:
    Is this a bug in ORacle?
    Error starting at line 1 in command:
    INSERT INTO MigrationCorrespData1(did) SELECT did from revisions where (dInDate >={ts '2011-09-01 00:00:01'} and dInDate <={ts '2012-01-01 23:59:59'})
    Error at Command Line:1 Column:80
    Error report:
    SQL Error: ORA-00911: invalid character

    It's not a bug, your syntax just isn't Oracle syntax.
    I googled a bit (which you could have done yourself as easily) and it appears that your syntax is JDBC syntax. The Oracle equivalent is timestamp:
    select timestamp'2009-12-08 00:00:00.000' my_ts from dual;
    MY_TS                         
    08-DEC-09 12.00.00.000000000 AMEdited by: InoL on Jun 6, 2012 8:57 AM

  • How Oracle process Snapshot log?

    Hello,
    we are updating a column in a very large table that will result in a very large mlog$.
    The column is not a part of the snapshot.
    We have only one simple snapshot that references this table.
    The testing proved that even this column is not a part of the snapshot Oracle will have to process the mlog$ file anyway.
    Just wonder what will be the process in this case?
    We need to know this to anticipate possible problems with long refresh.

    Make a
    desc your_Mlo$_table
    You will this table has a column CHANGE_VECTOR$$ of type RAW
    I found no documentation of the content of this column.
    Probably it contains only the changes coded in a binary format. That's probably a very perfomant solution in general, but in your specific case maybe a hand-made special replication-solution could be better.
    The hand-made solution can be done like this: A Trigger in the primary-database fires only changes you would to propaged, that is changes on columns you also have on the replication site. The trigger inserts the changes in a self-made log-table. This log table could have the column that should be replicated. Just insert new:column. You must also have the ability to replicated deleted. On the replication site you can create a stored-procedure, which makes a select on your log-table, makes the changes on the replication-site an deletes the replicated records on the primary-site.

  • Oracle bugs?

    I use Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod in windows2003, and I made a script:
    DROP table test_constraint;
    create table test_constraint
    col1          NUMBER(1)
              CONSTRAINT cn_tc_col1 NOT NULL
              CONSTRAINT cc_tc_col1 CHECK (col1 IN (1,2,8)),
    col2          DATE
    CONSTRAINT cn_tc_col2 NOT NULL,
    col3          char(1)
    CONSTRAINT cc_tc_col3 CHECK (col3 IN ('S','D'))
    ALTER TABLE test_constraint
    ADD CONSTRAINT tc_tc_col1_col3 CHECK
    ((col1 = 8 AND col3 IS NOT NULL AND col3 = 'D') OR
    (col1 = 1 AND col3 IS NOT NULL AND col3 = 'S') OR
    (col1 NOT IN (1,8) AND col3 IS NULL ));
    insert into test_constraint values (1,sysdate,'S');
    insert into test_constraint values (8,sysdate,'D');
    insert into test_constraint values (2,sysdate,NULL);
    select * from test_constraint;
    commit;
    create or replace
    TRIGGER tr_test_constraint_br
    BEFORE UPDATE ON test_constraint
    FOR EACH ROW
    BEGIN
    IF :new.col1 = 8 THEN
    :new.col3 := 'D';
    END IF;
    END;
    set serveroutput on;
    DECLARE
    LVCol2     test_constraint.col2%TYPE;
    LVCol3     test_constraint.col3%TYPE;
    BEGIN
    UPDATE test_constraint
    SET col1 = 8,
    col2 = sysdate
    WHERE col1 = 1
    RETURNING col2, col3
    INTO LVCol2,LVCol3;
    dbms_output.put_line('col2 = ' || LVCol2);
    dbms_output.put_line('col3 = ' || LVCol3);
    END;
    it will generate check constraint violated error here. but if you:
    alter table test_constraint disable constraint tc_tc_col1_col3;     
    and execute that pl/sql block again, it works fine.
    Any one knows that it is a bug for Oracle Database 10g Enterprise Edition Release 10.2.0.1.0?

    on 10.2.0.3, it works, as per the documentation
    http://download.oracle.com/docs/cd/B14117_01/server.101/b10743/triggers.htm#i13362
    so, yes, its a bug. apply a patch. upgrade. whatever it takes.

  • Oracle bug? - Oracle opinion welcomed (copy of post in OC4J forum)

    Hi,
    We are trying to run two web modules (A and B) on OC4J 10g standalone (on Windows 2000/XP), but we are facing a big problem.
    After much investigation we really think it is a OC4J bug, but we are opened to any opinion or solution...
    The problem is that a servlet or jsp on the web module B sometimes seems processed by OC4J by a thread created for the other web module A. As a consequence, if in the servlet (in fact in the method of a class instanciated in the servlet...) of B, we perform :
    ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
    then we get the classloader of the web module A, and then we are not able to instantiate a class of B and get a "ClassNotFoundException".
    This problem does not always happens. It is random even if it seems to have much more chance to happen if we execute requests on both modules in a little delay.
    We tried running the two web module in a single EAR or in two separate EAR but it made no difference.
    A debug of OC4J (with Eclipse 2.1) consolidates our mind it is a OC4J problem. Here is the kind of pile of execution we get for a thread HTTPRequestHandler of OC4J :
    [top of pile]
    ServletRequestDispatcher.forwardInternal(ServletRequest, HttpServletResponse) line 317
    HttpRequestHandler.processRequest(ApplicationServerThread, EvermindHttpServlet, ...) line 790
    => in this method we have the attributes :
    - thread.contextClassLoader = the one of web module A
    - request.application.name = module_B_name and request.application.contextPatch = module_B_contextpath
    ApplicationServerThread(Thread).run() line: 536
    We already met classloader problems and resolved them putting some common librairies of A and B in the applib directory. But this can not be envisaged for our new problem. Moreover we want to keep a "parent first" classloading.
    Has someone already met similar problems ?
    Thanks for any help.

    Thanks for the answers.
    I use a OC4J 10g 9.0.4 version but an evaluation version so I have no support id for a TAR.
    Sorry if my problem is difficult to understand (maybe it's my english which is difficult to understand!), but it is really difficult to explain...
    In fact the OC4J output does not show the classloading problem.
    I use Struts in the two WAR modules, and, for those who know Struts, it appears that I sometimes get a nullPointerException because in a Struts action my ActionForm is null (which should never happened). To find why the ActionForm is null I debug my application with Eclipse and I found the ActionForm was instanciated with the following code (classname is the name of a class extending the ActionForm class):
    // Look up the class loader to be used
    ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
    if (classLoader == null) {
    classLoader = RequestUtils.class.getClassLoader();
    // Attempt to load the specified class
    return (classLoader.loadClass(className));
    It appears that classLoader.loadClass(className) throws a ClassNotFoundException, and Struts, instead of throwing the exception, returns a value null for the ActionForm.
    With the debug I watch which classloader was used and I was surprised to see it was the classloader of my other WAR module. Though the struts servlet is well called on the good web application, and all the struts class are in the web-inf/lib directory of each application.
    I'm not sure this will make my problem easier to understand. Thanks for all who will make the effort of understand.
    emmanuel

  • Oracle SQL - Bug

    Hi All,
    I am writing this so that someone someday can take this to Oracle Corp as this is a simple bug which ought to be rectified by Oracle.
    Eg: select * from emp a where a.empno in ( select empno from empl b)
    Here i am using an Isolation Level 1 by using a Sub-Query to only return rows that matches with empno in table Empl but Empl table used in Sub Query does not have a Column by name empno . This should have returned an Oracle error instead it is taking the Column alias of table emp in Main Query.
    Many of us here will think or presume that this is correct as when using Isolation levels but this is not happening that way . There is an Oracle Bug which ought to be rectified in their next release.

    Definitively not a bug, at least bad query writing.
    Use prefix should solve your problem, something like this :
    select * from emp a where a.empno in ( select[b] b.empno from empl b)Furthermore, I wouldn't understand why you want, in the subquery, get the empno from the emp table instead of empl.
    Here was some threads about that, please read one of them here below :
    Re: Bug in Oracle 9.2.0.1.0.
    Moreover, this is not because you said "many of us here" want a correction that Oracle will correct it, because that's not a bug !
    Nicolas.

  • Migrating SYSTEM tablespace from DMTS to LMTS in Oracle 9.2.0.7

    Migrating SYSTEM tablespace from DMTS to LMTS in Oracle 9.2.0.7 using
    brspace -f dbcreate
    SAP version: 4.6C
    Oracle: 9.2.0.7
    OS: AIX 5.3
    BRTools: 6.40(42)    /**  6.40(10) or (12) will be sufficient according to SAP ***/
    IMPORTANT ***************************************
    MUST DO:
    1. Create a Full Backup of your system
    2. Test your Restore and recovery of your backup.
    3. Have a copy of all your tablespaces names on hand
    4. Know your SYS and SYSTEM passwords
    5. Run CheckDB in DB13 to ensure it is completed successfully with no warnings. This reduce the chance of hitting errors in the process
    6. Ensure your UNDO tablespace is big enough
    7. OSS 400241 Problems with ops$ or sapr3 connect to Oracle
    NOTE: OSS 706625(Read this note)
    The migration from a dictionary-managed SYSTEM tablespace to a locally-managed tablespace using the PL/SQL procedure DBMS_SPACE_ADMIN.TABLESPACE_MIGRATE_TO_LOCAL is not supported in the SAP environment.
    In UNIX, logon as ora<sid>
    run command: brspace -f dbcreate
    This command will triggers a Menu. The are seven(7) steps to complete the whole process. Do them in sequence, from step 1 to step 7 faithfully. In Step 1, ensure that your settings of PSAPTEMP, PSAPUNDO etc details such as filenames are correct. The rest I leave it as default and they are fine. Do not change redo log group from 8 to 4 even if you only have 4 redo groups. If not, you might need to restore the system! If the seven steps are complete without errors(warnings is acceptable), congrats. Perform a backup again.
    Problems I encountered that caused me to restore system:
    1./ Problem: I changed the redo group from 8 to 4 and in the later stage after the tablespaces and files are dropped, the system prompted me that 4 is not acceptable! I can't go back then so a restore is performed.
    Solution: Leave the default value 8 as it is
    2./ I was using wireless network and the network breaks thus process breaks.
    Solution: This process in user-interactive and requires you to input confirmation along the way so do it using LAN.
    3./ In the process of dropping  tablespace PSAP<SID>, I encountered:
    BR0301E SQL error -604 at location BrTspDrop-2
    ORA-00601: error occurred at recursive SQL level 1
    ORA-01555: snapshot too old: rollback segment number 22 with name '_SYSSMU22$" too small
    Solution: I have not fixed this yet but I think it is because my PSAPUNDO is too small(800M) so I will increase it to a bigger value e.g. 5GB
    4. Problem: Unable to start sap after successfully migrated. OPS$user problem
    Solution: logon as <sid>adm, run R3trans -x in a directory that <sid>adm has read/write permission. R3trans -x will creates a file call trans.log. Read the details and refer to OSS 400241
    Result: I have successfully performed this on one(1) system and doing this on the another one currently but encounter Problem 3. Will update this further if there are more findings.
    REFERENCE:
    OSS 748434 New BRSPACE function "dbcreate" - recreate database
    OSS 646681 Reorganizing tables with BRSPACE
    OSS 541538 FAX: Reorganizations
    Message was edited by:
            Annie Chan
    Message was edited by:
            Annie Chan
    Message was edited by:
            Annie Chan

    The current one I am implementing is a development system. The database is less than 100GB. 800MB of PSAPUNDO is sufficient for our development usage.
    Follow up on Problem 3:
    I created another undo tablespace PSAPUNDO2(undodata.dbf) with size of 5GB. I switched undo tablespace to PSAPUNDO2 and placed PSAPUNDO(undo.data1) offline. With PSAPUNDO2 online and PSAPUNDO offline, I started brspace -f dbcreate and encountered the error below at Step 2 Export User tablespace:
    BR0301E SQL error -376 at location BrStattabCreate-3
    ORA-00376: file 17 cannot be read at this time
    ORA-01110: data file 17: '/oracle/DVT/sapdata1/undo_1/undo.data1'
    ORA-06512: at 'SYS.DBMS_STATS", line 5317
    ORA-06512: at line 1
    I aborted the process and verified that SAP is able to run with this settings. I started CheckDB in DB13 and it shows me these messages:
    BR0301W SQL error -376 at location brc_dblog_open-5
    ORA-00376: file 17 cannot be read at this time
    ORA-01110: data file 17: '/oracle/DEV/sapdata1/undo_1/undo.data1'
    BR0324W Insertion of database log header failed
    I don't understand then. I have already switched the undo tablespace from PSAPUNDO to PSAPUNDO2. Why the message above still appears? Once I put PSAPUNDO online, CheckDB completes successfully without warning.
    I did show parameter undo_tablespace and the result is PSAPUNDO2(5GB).
    So exactly, what's going on? Can anyone advise?
    ===============================================
    I have managed to clear the message in DB13 after dropping PSAPUNDO tablespace including contents and datafiles. This is mentioned is OSS note 600141 pg 8 as below:
    Note: You cannot just set the old rollback-tablespace PSAPROLL to offline instead of deleting it properly. This results in ORA-00376 in connection with ORA-01110 error messages. PSAPROLL must remain ONLINE until it is deleted. (Oracle bug 3635653)
    Message was edited by:
            Annie Chan

  • (SNAPSHOT) ORA-12004/ORA-12034 처리에 대해서 (7.X-8.X)

    제품 : ORACLE SERVER
    작성날짜 : 2000-11-03
    fast refresh가 안 되는 ORA-12004 처리에 대해서 (7.x - 8.x)
    =========================================================
    snapshot 생성 시 같은 master table에 대해서 일부 snapshot site는 문제없이
    사용을 하고 있는데 추가적으로 생성한 snapshot에 대해서만 fast refresh를
    할 수 없다는 ora-12004 (Oracle8에서는 ORA-12034)가 발생되는 경우가 있다.
    잘되는 snapshot과 같은 조건과, 환경의 경우 왜 새로 생성하는 곳만 문제가
    되는지 설명이 되지 않는 경우가 있다면 다음 문서의 내용이 그 답이 될 수
    있다.
    기본적인 snapshot 환경과 생성에 문제가 없었는지는 <Bul:11186>을 통해 확인하
    는 것이 도움이 된다.
    1. 문제가 발생하는상황
    ~~~~~~~~~~~~~~~~~~~~~~
    문제가 발생하는 snapshot의 master table에 대해서 이미 다른 snapshot이
    만들어져 있고, 그 snapshot은 정상적으로 refresh가 되고 있는 상황,
    그리고 master table의 data가 매우 많아서 새로 snpahsot을 만들거나,
    refresh하는 것이 시간이 오래 걸리는 경우 주로 발생한다.
    2. 문제의 원인
    ~~~~~~~~~~~~~~
    master table의 snapshot log가 있는 table에 대해서, snapshot이 추가로
    생성되고 나면 snapshot을 생성하기 시작한 시간과, 기존의 snapshot이 log를
    refresh해간 시간을 비교하여 새로운 snapshot 생성시작 시간이 더 빠르면
    ora-12004가 발생한다.
    즉, snapshot을 생성하기 시작한 이후의 변경분이 이미 snapshot log에서
    지워진 경우 새로 새성된 snapshot은 그 부분에 대한 변경을 반영할 수 없기
    때문에 이후에 snapshot log 만을 의존해서 변경분만을 가져오는 fast
    refresh를 수행하면 안된다는 것이다.
    실제 이 mechanism이 이용하는 table은 sys user의 sys.mlog$, sys.slog$,
    sys.snap$ table이다.
    snapshot이 생성되기 시작한 시간은 sys.snap$의 snaptime에 기록이 되는데,
    이 시간을 master table의 sys.mlog$의 oldest값과 비교하여 snaptime이 oldest
    보다 이전 시간이면 ora-12004가 발생하는 것이다.
    sys.mlog$의 oldest는 master table의 snapshot log 즉, mlog$_<table_name>에
    저장된 data가 지워지는, 즉 purge되는 작업을 일으킨 마지막 refresh의
    시간을 나타낸다. 하나의 master table에 여러개의 snapshot이 연결되어 있는
    경우 모든 snapshot이 refresh를 해가야 해당 log data를 지우게 되므로,
    일부만 refresh해간 경우에는 oldest값이 변경되지 않는다. mlog$_<table_name>
    에 data가 없는 경우 refresh가 되면 정보는 변경된다.
    oracle8의 경우 primary key base snapshot인 경우 oldest_pk를 확인한다.
    fast refresh snapshot을 생성할때 이러한 oldest와 snaptime의 비교가 이루어
    지게 되는데 snaptime이 oldest보다 늦으면 master site의 sys.slog$에 새로운
    snapshot에 대한 entry가 추가되어 이후부터 정상적으로 refresh가 진행되고,
    snaptime이 더 빠르면 sys.slog$에 기록이 되지 않아 이후에 refresh시에
    slog$정보에서 entry를 찾지 못하여 ora-12004를 발생시키게 되는 것이다.
    즉, snapshot생성시에는 오류 메시지를 만나지 않게 된다.
    fast refresh로 지정된 snapshot이 생성되기 시작했는데도 mlog$_<table_name>의
    data가 지워지는 이유는 이미 같은 master table에 걸려 있는 sys.slog$에
    기록된 snapshot이 모두 refresh를 해가고 나면 그 log가 snapshot log에서
    지워지기 때문인데, snapshot이 아직 생성되기 전에는 sys.slog$에 기록되지
    않아 기존 snapshot만 refresh가 끝나면 지워지게 되기 때문이다.
    그러나 snapshot생성 문장은 처음 master table의 data를 가져오기 시작한
    시점을 유지하기 때문에 snapshot생성 중 변경된 부분에 대해서 변경된
    것을 읽지 않고 rollback segment에서 변경 이전 image를 읽어 snapshot을
    구성한다. snapshot 생성시간이 오래 걸리는 경우 생성 중 다른 transaction에
    의해 변경된 data는 이후에 mlog$에서 fast refresh를 통해 가져가게 되나,
    만약 이때 이미 존재하는 다른 snapshot이 refresh를 수행해 그 log data가
    지워지게 되면 새로 생성된 snapshot은 snapshot log의 data만을 이용해
    refresh해서는 master table과 같은 data를 유지할 수 없게 되는 것이다.
    예를 들어 다음과 같은 작업을 가정하자.
    master table: dept
    기존 snapshot: A site의 dept_snap이라는 snapshot이 dept table에 대해 존재
    새로 생성하는 snapshot이름: B site의 new_snap
    ----------|-----------------|--------------|--------------|-------------
    시간 1:00 1:30 2:00 2:30
    1:00 - B site에서 new_snap생성 시작
    1:30 - master table dept변경
    2:00 - A site에서 기존의 dept_snap이 refresh, 10초 refresh종료
    2:30 - B site의 new_snap생성 종료
    B site의 new_snap는 1시에 snapshot생성을 시작해 2시 30분에 종료되는데,
    이때 1시 30분에 누군가 master table을 변경하여도 new_snap은 이시간의
    변경 전 data를 읽어 snaphot을 구성한다.
    new_snap의 sys.snap$에서 snaptime은 1시가 된다.
    master table의 sys.mlog$는 dept_snap이 2시에 snapshot을 refresh해가고
    mlog$_dept의 row를 지우기 때문에 oldest값으로 2시가 된다.
    new_snap을 refresh시도할 때 master site의 sys.mlog$의 dept에 대한
    oldest값이 2시인데, new_snap의 sys.snap$의 snaptime은 그 이전인
    1시이기 때문에 master site의 sys.slog$에 entry를 추가하지 않고,
    ora-12004를 유발시킨다.
    3. 해결 방법
    ~~~~~~~~~~~~
    결국 문제가 되는 것은 snapshot 생성 중에 같은 table에 대한 다른 snapshot이
    refresh를 하는 것이 문제이다.
    그러므로 생성하고자 하는 snapshot에 대한 master table의 다른 snapshot들을
    refresh하지 못하도록 하거나, refresh하지 않는 시간에 새로운 snapshot을
    생성하여야 한다.
    refresh 못하도록 막는 방법으로는 일시적으로 snapshot job을 broken시킨 후
    snapshot이 생성된 후 다시 broken을 false로 하면 된다.
    10번 job을 broken시키는 것과 다시 해제하는 예이다.
    os>sqlplus scott/tiger
    SQL>select job, what from user_jobs;
    SQL>exec dbms_job.broken(10,true);
    SQL>exec dbms_job.broken(10,false);
    refresh 시에 ora-12004가 발생하여도 다시 complete refresh를 수행하면
    complete refresh 중 다른 snapshot이 refresh를 해가지 않는 경우,
    master site의 sys.slog에 entry가 추가되면서 이후에는 fast refresh가
    수행된다.
    그러나 complete refresh를 수행하는 동안 기존의 다른 snapshot이 refresh를
    해가게 되면, 아직 새로 생성한 snapshto의 정보가 master site의 sys.slog$에
    기록되지 않았기 때문에 새로 생성한 snapshot은 고려하지 않고 바로
    mlog$_<table_name>의 log data를 지우게 된다. 이렇게 되면 여전히
    complete refresh가 끝나도 sys.slog$에 entry가 추가되지 않고, 이후의
    fast refresh는 ora-12004를 발생시키게 된다.

    The current one I am implementing is a development system. The database is less than 100GB. 800MB of PSAPUNDO is sufficient for our development usage.
    Follow up on Problem 3:
    I created another undo tablespace PSAPUNDO2(undodata.dbf) with size of 5GB. I switched undo tablespace to PSAPUNDO2 and placed PSAPUNDO(undo.data1) offline. With PSAPUNDO2 online and PSAPUNDO offline, I started brspace -f dbcreate and encountered the error below at Step 2 Export User tablespace:
    BR0301E SQL error -376 at location BrStattabCreate-3
    ORA-00376: file 17 cannot be read at this time
    ORA-01110: data file 17: '/oracle/DVT/sapdata1/undo_1/undo.data1'
    ORA-06512: at 'SYS.DBMS_STATS", line 5317
    ORA-06512: at line 1
    I aborted the process and verified that SAP is able to run with this settings. I started CheckDB in DB13 and it shows me these messages:
    BR0301W SQL error -376 at location brc_dblog_open-5
    ORA-00376: file 17 cannot be read at this time
    ORA-01110: data file 17: '/oracle/DEV/sapdata1/undo_1/undo.data1'
    BR0324W Insertion of database log header failed
    I don't understand then. I have already switched the undo tablespace from PSAPUNDO to PSAPUNDO2. Why the message above still appears? Once I put PSAPUNDO online, CheckDB completes successfully without warning.
    I did show parameter undo_tablespace and the result is PSAPUNDO2(5GB).
    So exactly, what's going on? Can anyone advise?
    ===============================================
    I have managed to clear the message in DB13 after dropping PSAPUNDO tablespace including contents and datafiles. This is mentioned is OSS note 600141 pg 8 as below:
    Note: You cannot just set the old rollback-tablespace PSAPROLL to offline instead of deleting it properly. This results in ORA-00376 in connection with ORA-01110 error messages. PSAPROLL must remain ONLINE until it is deleted. (Oracle bug 3635653)
    Message was edited by:
            Annie Chan

Maybe you are looking for