Instance versus Schema

Could you describe the difference between an Instance and a Schema? Also, if you require to bring into a single instance two different applications (with same database structure), what will be the advantages/disadvantages that you foresee? The applications may share more than one table/views, thanks

An instance is a collection of inter-related memory structures necessary to have your database behave like a database. In our case we have three whose SIDs (aka 'names') are DEV, TEST & PROD.
A schema is a user account which owns database objects, and a couple can be installed into Oracle by default when an instance is created, namely HR & SCOTT. An instance can have one or more SCHEMAS contained within it (think..table resides in a schema, and the schema resides in the database instance).
We chose to collect all of our applications into a single instance (though we have the three iterations of it DEV, TEST & PROD), separating each application into it's own schema. This would also be fine in your case, as objects can share the same name as long as they're in different schemas.
One instance will greatly simplify your backup strategy, and will also (IMO) allow you to better use hardware resources on your server (assuming you would've put separate instances on the same box).
-Chuck

Similar Messages

  • Difference between Database, instance and schema

    Hi
    I don't know the clear difference between database, instance and schema.. In the broad sense, everything seems to be the same. If anyone can differentiate between them with some example, that will be of great help.
    Thank you.

    Hi,
    In Oracle, people often do use "database" and "instance" interchangeably, or together as one term: "database instance".
    A "schema" is quite different. A schema is a collection of objects (such as tables, indexes or procedures). Every object belongs to exactly one schema, and every schema is a part of exactly one database. (Names may not be unique, however. For example, your database may have one schema named SCOTT, and another schema named USER1. Each of those schemas may have a table named EMP. The EMP table in the SCOTT schema, or SCOTT.EMP, is not the same as the EMP table in the USER1 schema, or USER1.EMP. A different database, my database for example, may also have schemas called SCOTT and USER1, which are completely independent of the SCOTT and USER1 in your database.)

  • HTMLDB as Partner Application to TWO OID instances - Authentication Schemes

    For reasons I won't go into here, we have TWO Oracle OID/SSO instances running - independently.
    I am interested in having HTMLDB / APEX applications capable of authenticate against either one. (one at a time, but on the same engine installation)
    We have done the PARTNER APPLICATION registration which works well against one of the OID instances. Records have been entered into the WWSEC_ENABLER_CONFIG_INFO$ table and everything works as expected.
    What option do I have to register the HTMLDB engine with a SECOND OID/SSO as a partner application and then allow the developers the ability to choose which authentication scheme applies?
    What I have observed is that the package given (custom_auth_sso) has built in
    g_partner_app_name varchar2(2000) := 'HTML_DB';
    Is it possible to duplicate that type of functionality, or is there something deeper ingrained into the engine that I do not understand?
    Regards,
    Tim

    Scott,
    I am working under a model similar to your case number two.
    Application 1 – uses OID A
    Application 2 – uses OID B
    I am going under the assumption that if there were two records in the config_info$ table, that I would need some type of ability to inform the WWV_FLOW_CUSTOM_AUTH_SSO package to switch between them.
    I guess what I am missing is the mechanics. I am trying to avoid having to re-write the WWV_FLOW_CUSTOM_AUTH_SSO package by hand. Besides the package body being compiled, I do not know how that authentication scheme is called by HTMLDB/APEX. I have been using the “Oracle Application Server Single Sign-On (HTML DB Engine as Partner App)” scheme. This leaves most of the Authentication scheme pretty blank with the exception of the Session Not Valid URL ( populated with –PORTAL_SSO-) and the logout URL. Magically it works though.
    If I had TWO schemes registered in the config_info$, how would I indicate which scheme to use?
    Do I have the capability of working with what has already been provided, or am I destined to writing a custom scheme because of the decision which needs to be made?
    Many thanks
    --Tim                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Should i need a new oracle instance or schema?

    Hello All,
    I know that this is may sound like a silly question but i really need to know. In our company we have a server with oracle standard and a instance that holds a financial database. Now, the company bought a new antivirus software and it runs over oracle database. Now, should i create a new schema to own my antivirus tables or should i need create a new database instance?
    I've worked with other database product that has a different concept from oracle, regarding Intance-Database concept. I'm really new from oracle.
    Best regards,
    Rafael Melo - Br

    >
    Now, the company bought a new antivirus software and it runs over oracle database
    >
    What exactly does 'it runs over oracle database' mean?
    You need to read the software documentation to see how to use it.
    >
    Now, should i create a new schema to own my antivirus tables or should i need create a new database instance?
    I've worked with other database product that has a different concept from oracle, regarding Intance-Database concept. I'm really new from oracle.
    >
    An 'instance' and a 'database' are two different, though possibly related, things.
    See the Database Concepts Doc for the definition of 'instance' and 'database'
    http://docs.oracle.com/cd/E11882_01/server.112/e10713/startup.htm
    >
    Introduction to the Oracle Database Instance
    A database instance is a set of memory structures that manage database files. A database is a set of physical files on disk created by the CREATE DATABASE statement. The instance manages its associated data and serves the users of the database.
    Every running Oracle database is associated with at least one Oracle database instance. Because an instance exists in memory and a database exists on disk, an instance can exist without a database and a database can exist without an instance.

  • Database/Instance VS Schema

    Want to use Oracle DB as the database for virtue hosting for mutiple web applications.
    Option One: Create one database (or Instance) with multiple shema(s), with each Schema for a web application to access.
    Option Two: Each web application has its own database (or Instance)
    The Database will be located in the same machine. In general which option is more feasible in terms of maintenance and speed?
    Thanks.
    Scott
    It appears to me the second option is better, but the memory may become an issue, for so many database instance will be loaded to the RAM. The first option may save some memory. But each shema will be hit by many users (such as hundreds). I wonder if use of the schema is feasible.

    In case of downtime of database all your web application are having downtime and each application are on different database in that case only respective application would be down. so, it would be better to keep each webapplication on different database as per the maintenance perspective.
    If you are expecting hit from "hundreds" users then better invest more memory. at least 500 mb to 1GB SGA per DB.

  • Multiple Instances and schemas to One

    Hi,
      Good Morning to all gurus.
    Using Oracle Version 11.2.0.2
    We have a database With 4 instances and Each Instance will be having 10 to 15 schemas Based on Countries. Here in all schemas we will be having Huge data's (count may be 3 to 5 crores for some 10 tables)
    Now am keen to Know If i change the above to a single instance and Single Schema(Common for all countries) What Pros and cons Will be there (Technical).
    Any Links or Answers are highly appreciated.
    HOPE GURUS Here can help me study and understand the above scenarios.
    Regards,
    Simma....

    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2246908001297
    cons: 
    o harder to manage
    o harder to upgrade
    o harder to patch
    o harder to maintain
    o causes your shared pool size to increase 1,000 times (shared sql goes down the tubes)
    o takes more space
    o queries against the dictionary will be impacted
    o latching on the shared pool goes WAY up (latching = locks = serialization device =
    slows you down)
    pros:
    o none that I can think of.
    https://forums.oracle.com/thread/1032030
    Seperate schemas have advantages with security, privacy, seperation of duties, and change control. Seperate schemas also have the advantage of logical granularity / grouping for easier management, upgrade, decommission, scalability, hardware or software migration.
    Yes, you can develop applications faster if you don't have to think about security, scalability etc, but it will come back to haunt you later.
    RobertGeier
    AND
    Separate schemas have the disadvantage of requiring additonal grants and privileges to support the reference of non-owned objects used in stored code and to support FK definitions across tables owned by different users.
    Naming standards and system codes can be used to identify and segregate objects defined under one schema.
    The use of solid naming standards with a well chosen group of owners (schemas) would likely be a good compromise. The choice really depends on how large the applicaiton is going to be object wise and how integrated the objects are going to be. The more integration the less separate owners is beneficial.
    IMHO -- Mark D Powell --

  • Which config. will be best. 1 instance & two schemas. Two instances

    I have a database with 8GB memory and 4 750GHz processors.
    1. One instance and two schemas (one production and one test, both are identical).
    2. Two instances with one schema each.(One Production and one test. both are identical).
    A 4GB SGA will be enough for production environment if that instance is stand alone. (approximately 100/120 users).
    Test env. doesn't need that much SGA and may have only 10 users maximum.
    Please tell me some advantages and disadvantages of both.
    Will Oracle grab more memory from the system beyond SGA when there are more users connected to the database?
    Thanks,
    Paul

    In your case, I would recommend 2 seperate instances for production and test (actually I would recommend seperate machines, but that is a $ issue). I would recommend this, because it will allow you to create both shemas identically, making test and migration simple. In addition, an OOPS won't affect your production instance. Connected user definatly use memory outside the SGA (connection overhead, sort_area_size UGA/PGA etc).

  • DB instance versus Cluster DB

    I am setting up an architect for a large company within OEM, would like to hear some feed back from others:
    when creating the group: you can create the group based in DB instance even for RAC so it's can be more granule then DB cluster, is there any benefit to set up another group for DB cluster?
    thanks,

    I don't think so, whats exactly the need

  • WL Instance versus Physical Server

              I was under the impression that each instance of a WebLogic server in a cluster ran on its own physical
              server. But now I've been told that you can have a cluster of WebLogic servers running on a
              single physical machine!
              Is this advisable? Is it a common configuration?
              To me, this seems to defeat the purpose of clustering.
              Dave
              

    Yes, cluster load-balancing and failover will work for virtual 2 or n tiered architecture. Physical
              tiering is irrelevant here for these software-based clustering behaviors. What physical tiering is
              relevent for, though, is hardware robustness.
              Gene Chuang
              Join Kiko.com!
              "Ganaraja V Bhat" <[email protected]> wrote in message news:[email protected]...
              > We have 2 instances runing on the same box , but while going through the doc Planning for
              Clustering , i
              > see that lot of emphasis is given on the Physical aspect , rather than the logical .But in our
              case
              > everything is on one box , now will the ckustering work at all the levels (servlet/JSP,EJB)
              >
              > Thanks
              > Neeraj
              >
              > Gene Chuang wrote:
              >
              > > Is your web and app the same server instance, or two instances running on the same box? If the
              > > former, then load-balance will definitely not occur. If the latter, then I believe it will.
              > >
              > > --
              > > Gene Chuang
              > > Join Kiko.com!
              > > "Ganaraja V Bhat" <[email protected]> wrote in message news:[email protected]...
              > > > Hello,
              > > > To make things more clear i am giving the details of the arch being used,
              > > > we have 3 GS140 machines(8 CPU) .In each machine we r installing
              > > > Webserver/LDAP/Weblogic , so that they behave in the cluster mode.
              > > > Will this arch facilitate the fail-over and load balancing at webserver/application layer
              > > >
              > > > ang wrote:
              > > >
              > > > > We could implementing all instances in a single physical server. That requires more high
              power
              > > server in order to achive the similar performance as the mulit-physical server configuration.
              It
              > > would be ok for load balance. But not for fail-over. There is no redunanncy for physcial
              server in
              > > this configuration. A single system crash will lose all services to clients.
              > > > >
              > > > > Ganaraja V Bhat <[email protected]> wrote:
              > > > > >David ,
              > > > > > i am also searching for the right answer as in my project we r using cluster wherein all
              the
              > > machines
              > > > > >have webserver/appserve/ldap i am not convinced with this as i got hold of a whitepaper
              which
              > > clearly says
              > > > > >that we need to have diferent physical layer.........but .....needs more clarifications .
              > > > > >
              > > > > >Looking for the comments from u all
              > > > > >
              > > > > >Neeraj
              > > > > >
              > > > > >David Mrozek wrote:
              > > > > >
              > > > > >> I was under the impression that each instance of a WebLogic server in a cluster ran on
              its
              > > own physical
              > > > > >> server. But now I've been told that you can have a cluster of WebLogic servers running
              on a
              > > > > >> single physical machine!
              > > > > >> Is this advisable? Is it a common configuration?
              > > > > >> To me, this seems to defeat the purpose of clustering.
              > > > > >> Dave
              > > > > >
              > > >
              >
              

  • Error while buliding biztalk flat file schema

    Hi Everyone,
    am using a flat file schema i had imported a schemas.
    but when i bulit schemas solution am getting this error.
    Only one SchemaInfo, GroupInfo, RecordInfo or FieldInfo is allowed in the appInfo block

    Hi Rajiv,
    Your error is related is much more related to your own flat file where there is some restriction over grouping the record . 
    I would suggest to go through your Flat File Schema Wizard again to see is there inconsistency you have done while generating schema .
    I would also suggest you to look over below MSDN Articles
    Walkthrough: Creating a Flat File Schema From a Document Instance
    Creating Schemas Using BizTalk Flat File Schema Wizard
    BizTalk Server: Transform text files (Flat Files) into XML – by @Sandro
    Thanks
    Abhishek

  • Validate XML Schema

    Hi,
    I need to load some XML schema definitions to afterwards validate some DOM documents against this schemas. My problem is, when loading those XML schema definitions I have to validate them. How to do this? How to provide an javax.xml.validation.Schema object and check is valid XML schema?
    Thanks in advance.

    The very act of loading the schema into a schema object will validate it. That is, if you get as far as having an instance of Schema, it's valid.

  • Trouble including registered XML Schema in generated XML

    Hello,
    I'm new to XMLDB, and find myself wanting to build an XML document that conforms
    to a paricular XML schema. I'm looking for help in "passing" the shema into the
    xml query, and for advice (i may not be going about things in the best way possible).
    my data comes from three different sources: deliveries, origin of deliveries (warehouse),
    and a user-defined parameter (number of vehicles). I am putting the xml data together via union statements.
    this is slightly undesireable due to the limitations on union (no xmltypes, no clobs)
    and the size limitation of the varchar datatype. If there is a better way of structuring
    the end XML document (all three sources, one output record) then please advise me.
    I am having issues "passing" the registered XML schema to the SYS_XMLGEN function,
    so if you see where I've made a mistake, please point it out.
    Last thing, Oracle version: 9.2.0.4.0 (aka 9iR2)
    --Register a new XML schema
    --Since this is a GLOBAL schema, register it as privileged user (SYS).
    DECLARE
           vrp varchar2(10000) :=
    '<xs:schema targetNamespace="http://example.com/vrp.xsd"
        xmlns:vrp="http://example.com/vrp.xsd"
        xmlns:xs="http://www.w3.org/2001/XMLSchema"
        elementFormDefault="qualified">
        <xs:complexType name="VehicleRoute">
            <xs:sequence>
                <xs:element name="Stops" type="vrp:Stops" minOccurs="1" maxOccurs="1" />
                <xs:element name="Vehicles" type="xs:string" minOccurs="1" maxOccurs="1" />
                <xs:element name="Warehouse" type="vrp:Warehouse" minOccurs="1" maxOccurs="1" />
            </xs:sequence>
        </xs:complexType>
        <xs:complexType name="Stops">
            <xs:sequence>
                <xs:element name="Stop" type="vrp:Stop" minOccurs="1" maxOccurs="unbounded" />
            </xs:sequence>
        </xs:complexType>
        <xs:complexType name="Stop">
            <xs:sequence>
                <xs:element name="Documents" type="vrp:Documents" minOccurs="1" maxOccurs="1" />
                <xs:element name="Stop_Address" type="xs:string" minOccurs="1" maxOccurs="1" />
                <xs:element name="Stop_Minutes" type="xs:double" minOccurs="1" maxOccurs="1" />
            </xs:sequence>
        </xs:complexType>
        <xs:complexType name="Documents">
            <xs:sequence>
                <xs:element name="Document" type="xs:string" minOccurs="1" maxOccurs="unbounded" />
            </xs:sequence>
        </xs:complexType>
        <xs:complexType name="Warehouse">
            <xs:sequence>
                <xs:element name="Warehouse_Address" type="xs:string" minOccurs="1" maxOccurs="1" />
            </xs:sequence>
        </xs:complexType>
        <xs:element name="Vehicle_Route" type="vrp:VehicleRoute" />
    </xs:schema>';  
    begin
      --"CUSTOM" is the name of my database user - the SCHEMA in which this development should occur.
         dbms_xmlschema.registerschema('http://example.com/vrp.xsd', vrp, false, false, false, false, false, 'CUSTOM');
    END;Here is the XML schema (as viewed by the 'CUSTOM' user):
    <xs:schema targetNamespace="http://example.com/vrp.xsd" xmlns:vrp="http://example.com/vrp.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns:oraxdb="http://xmlns.oracle.com/xdb" oraxdb:flags="17" oraxdb:schemaURL="http://example.com/vrp.xsd" oraxdb:schemaOwner="CUSTOM" oraxdb:numProps="10">
      <xs:complexType name="VehicleRoute" oraxdb:SQLType="CLOB">
        <xs:sequence>
          <xs:element name="Stops" type="vrp:Stops" minOccurs="1" maxOccurs="1" oraxdb:propNumber="2225" oraxdb:global="false" oraxdb:memType="258" oraxdb:SQLInline="true" oraxdb:MemInline="false" oraxdb:JavaInline="false"/>
          <xs:element name="Vehicles" type="xs:string" minOccurs="1" maxOccurs="1" oraxdb:propNumber="2226" oraxdb:global="false" oraxdb:memType="1" oraxdb:SQLInline="true" oraxdb:MemInline="true" oraxdb:JavaInline="true"/>
          <xs:element name="Warehouse" type="vrp:Warehouse" minOccurs="1" maxOccurs="1" oraxdb:propNumber="2227" oraxdb:global="false" oraxdb:memType="258" oraxdb:SQLInline="true" oraxdb:MemInline="false" oraxdb:JavaInline="false"/>
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="Stops" oraxdb:SQLType="CLOB">
        <xs:sequence>
          <xs:element name="Stop" type="vrp:Stop" minOccurs="1" maxOccurs="unbounded" oraxdb:propNumber="2228" oraxdb:global="false" oraxdb:memType="258" oraxdb:SQLInline="true" oraxdb:MemInline="false" oraxdb:JavaInline="false"/>
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="Stop" oraxdb:SQLType="CLOB">
        <xs:sequence>
          <xs:element name="Documents" type="vrp:Documents" minOccurs="1" maxOccurs="1" oraxdb:propNumber="2229" oraxdb:global="false" oraxdb:memType="258" oraxdb:SQLInline="true" oraxdb:MemInline="false" oraxdb:JavaInline="false"/>
          <xs:element name="Stop_Address" type="xs:string" minOccurs="1" maxOccurs="1" oraxdb:propNumber="2230" oraxdb:global="false" oraxdb:memType="1" oraxdb:SQLInline="true" oraxdb:MemInline="true" oraxdb:JavaInline="true"/>
          <xs:element name="Stop_Minutes" type="xs:double" minOccurs="1" maxOccurs="1" oraxdb:propNumber="2231" oraxdb:global="false" oraxdb:memType="2" oraxdb:SQLInline="true" oraxdb:MemInline="true" oraxdb:JavaInline="true"/>
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="Documents" oraxdb:SQLType="CLOB">
        <xs:sequence>
          <xs:element name="Document" type="xs:string" minOccurs="1" maxOccurs="unbounded" oraxdb:propNumber="2232" oraxdb:global="false" oraxdb:memType="1" oraxdb:SQLInline="true" oraxdb:MemInline="true" oraxdb:JavaInline="true"/>
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="Warehouse" oraxdb:SQLType="CLOB">
        <xs:sequence>
          <xs:element name="Warehouse_Address" type="xs:string" minOccurs="1" maxOccurs="1" oraxdb:propNumber="2233" oraxdb:global="false" oraxdb:memType="1" oraxdb:SQLInline="true" oraxdb:MemInline="true" oraxdb:JavaInline="true"/>
        </xs:sequence>
      </xs:complexType>
      <xs:element name="Vehicle_Route" type="vrp:VehicleRoute" oraxdb:propNumber="2224" oraxdb:global="true" oraxdb:SQLType="CLOB" oraxdb:SQLName="Vehicle_Route" oraxdb:memType="258"/>
    </xs:schema>Here is sample data for reproducing what I'm seeing:
    --Create the "document" table
    create table vrp_document
    (document_num varchar2(10),
    document_minutes number(10),
    document_address varchar2(30));
    --Sample "document" data
    insert into vrp_document (document_num, document_minutes, document_address)
    values ('TEST1', 30, '1234 ELM ST');
    insert into vrp_document (document_num, document_minutes, document_address)
    values ('TEST2', 20, '1234 ELM ST');
    insert into vrp_document (document_num, document_minutes, document_address)
    values ('TEST3', 40, '1234 MAPLE ST');
    insert into vrp_document (document_num, document_minutes, document_address)
    values ('TEST3', 15, '1234 YEW ST');
    --Create the "warehouse" table
    create table vrp_warehouse
    (warehouse_id varchar2(3),
    warehouse_address varchar2(30));
    --Sample "warehouse" data
    insert into vrp_warehouse (warehouse_id, warehouse_address)
    values ('100', '900 MY OWN WAY');Query to produce XML
    Please note, I realize that for the data provided, the aggregations (and sub queries)
    are a little over the top. They are however necessary for my actual data set.
    SELECT SYS_XMLGEN(xmlagg(XMLTYPE(xmlroute)),  xmlformat.createFormat('Vehicle_Route')).getStringVal() Delivery_XML_Data
    FROM (SELECT XMLELEMENT("Stops",
              XMLAGG(XMLELEMENT("Stop",    
              XMLCONCAT(
                XMLELEMENT("Documents",
                    xmlagg(xmlelement("Document", t.document))),
                  xmlforest(t.document_address "Stop_Address",  
                 SUM(t.document_minutes) "Stop_Minutes"))))).getStringVal() AS xmlroute
    from     (select   s.document_num document, 
                       s.document_address,
                       sum(s.document_minutes) document_minutes
              from     vrp_document s       
              group by s.document_num, s.document_address) t
    GROUP BY t.document_address
    UNION
    SELECT   XMLELEMENT("Warehouse",
             xmlforest(
              w.warehouse_address "Warehouse_Address")).getstringval()
    from     vrp_warehouse w
    WHERE    w.warehouse_id = '100'
    union
    select   xmlelement("Vehicles", '&Number_Of_Vehicles').getstringval()
    FROM     dual) g;This query produces the following (Note. Answer "1" or any other integer for &Number_Of_Vehicles):
    The only other thing I want is to mention the above schema (that is, xmlns:http://example.com/vrp) or however that goes.
    I realize I can "fudge" this by assigning the attribute for various elements, but I think the "right" way would be to modify that call to createFormat().
    <?xml version="1.0"?>
    <Vehicle_Route>
    <Stops>
      <Stop>
        <Documents>
          <Document>TEST1</Document>
          <Document>TEST2</Document>
        </Documents>
        <Stop_Address>1234 ELM ST</Stop_Address>
        <Stop_Minutes>50</Stop_Minutes>
      </Stop>
      <Stop>
        <Documents>
          <Document>TEST3</Document>
        </Documents>
        <Stop_Address>1234 MAPLE ST</Stop_Address>
        <Stop_Minutes>40</Stop_Minutes>
      </Stop>
      <Stop>
        <Documents>
          <Document>TEST3</Document>
        </Documents>
        <Stop_Address>1234 YEW ST</Stop_Address>
        <Stop_Minutes>15</Stop_Minutes>
      </Stop>
    </Stops>
    <Vehicles>1</Vehicles>
    <Warehouse>
      <Warehouse_Address>900 MY OWN WAY</Warehouse_Address>
    </Warehouse>
    </Vehicle_Route>I have tried various permutation of the following with no success:
    Currently, the error is something serious:
    ORA-00600: internal error code, arguments: [kkdotat1], [], [], [], [], [], [], []
    00600. 00000 - "internal error code, arguments: [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s]"
    *Cause:    This is the generic internal error number for Oracle program
    exceptions.     This indicates that a process has encountered an
    exceptional condition.
    *Action:   Report as a bug - the first argument is the internal error number
    SELECT SYS_XMLGEN(xmlagg(XMLTYPE(xmlroute)),  xmlformat.createFormat('Vehicle_Route', 'USE_GIVEN_SCHEMA', 'http://example.com/vrp.xsd', 'http://example.com/vrp.xsd')).getStringVal() Delivery_XML_Data
    . . .Edited by: user2316919 on Jan 21, 2010 3:46 PM

    Cannot find a cleanest solution:
    SQL>  select xmltype('<?xml version="1.0"?>'||
      2                  xmlelement("Vehicle_Route",
      3                     xmlattributes('http://www.w3.org/2001/XMLSchema-instance' AS "xmlns:xsi",
      4                                   'http://example.com/vrp.xsd' AS "xsi:schemaLocation"
      5                                   ),
      6                     xmlagg(xmltype(xmlroute))
      7                     ).extract('/*')
      8                  ) Delivery_XML_Data
      9   FROM (SELECT XMLELEMENT("Stops",
    10             XMLAGG(XMLELEMENT("Stop",    
    11             XMLCONCAT(
    12               XMLELEMENT("Documents",
    13                   xmlagg(xmlelement("Document", t.document))),
    14             xmlforest(t.document_address "Stop_Address",  
    15                SUM(t.document_minutes) "Stop_Minutes"))))).getStringVal() AS xmlroute
    16   from     (select   s.document_num document, 
    17                      s.document_address,
    18                      sum(s.document_minutes) document_minutes
    19             from     vrp_document s       
    20             group by s.document_num, s.document_address) t
    21   GROUP BY t.document_address
    22   UNION
    23   SELECT   XMLELEMENT("Warehouse",
    24             xmlforest(
    25              w.warehouse_address "Warehouse_Address")).getstringval()
    26    from     vrp_warehouse w
    27    WHERE    w.warehouse_id = '100'
    28    union
    29    select   xmlelement("Vehicles", '&Number_Of_Vehicles').getstringval()
    30    FROM     dual) g;
    Immettere un valore per number_of_vehicles: 1
    vecchio  29:   select   xmlelement("Vehicles", '&Number_Of_Vehicles').getstringval()
    nuovo  29:   select   xmlelement("Vehicles", '1').getstringval()
    DELIVERY_XML_DATA
    <?xml version="1.0"?><Vehicle_Route xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schema
    http://example.com/vrp.xsd">
      <Stops>
        <Stop>
          <Documents>
            <Document>TEST1</Document>
            <Document>TEST2</Document>
          </Documents>
          <Stop_Address>1234 ELM ST</Stop_Address>
          <Stop_Minutes>50</Stop_Minutes>
        </Stop>
        <Stop>
          <Documents>
            <Document>TEST3</Document>
          </Documents>
          <Stop_Address>1234 MAPLE ST</Stop_Address>
          <Stop_Minutes>40</Stop_Minutes>
        </Stop>
        <Stop>
          <Documents>
            <Document>TEST3</Document>
          </Documents>
          <Stop_Address>1234 YEW ST</Stop_Address>
          <Stop_Minutes>15</Stop_Minutes>
        </Stop>
      </Stops>
      <Vehicles>1</Vehicles>
      <Warehouse>
        <Warehouse_Address>900 MY OWN WAY</Warehouse_Address>
      </Warehouse>
    </Vehicle_Route>
    {code}
    Max
    [My Italian Oracle blog|http://oracleitalia.wordpress.com/2010/01/17/supporto-di-xml-schema-in-oracle-xmldb/]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • 5.2: custom schema infos not visible in console

    Hello,
    i added a bunch of objectclasses and attribute types to the 99user.ldif file in slapd-instance/config/schema. These change are visible using
    ldapsearch -b cn=schema '(objectclass=*)' to view the schema infos.
    When i use the console to edit/maintain the schema definitions, the 'User Defined Object Classes' list is empty. I cant find my objectclasses in the 'Standard object classes' list either.
    I used the X-ORIGIN 'user defined' value (used different values for field just to be sure) but nothing ....
    Any hints?
    Regards,
    Dirk

    When you click on the schema tab - you get nothing? If this is the case verify you still have ACI's in place that will allow you read access by clicking on the directory tab and viewing the access control for the schema entry.

  • Using sequence in diff schema (OWB 10g R1)

    I am trying to use a sequence belonging to instance A schema 1...in a mapping whose objects (source, target tables) are in instance B schema 2.
    How do i do this in OWB ?
    I imported the sequence from the schema 1 into the mapping using a DBLINK...betn the 2 schemas. i did not deploy the sequence using deployment mgr into target schema. I executed the mapping after deploying other objects...and I am getting an error: sequence doesn't exist.
    i even stated the schema and the particular db link name in the configuration of the particular mapping before executing.
    i am trying to run the following SQL statement (it inserts records appropriately in TOAD) using OWB....but am unable to generate a mapping in OWB with the @CDW.WORLD. That could be the potential problem.
    INSERT INTO TEST_TARGET.TEST_TAB_VW (ATTRIBUTE, VALUE,PROFIT_CENTER,PC_ID)
    VALUES ('TESTING','VAL',300098210,[email protected])
    Your guidance will be invaluable.
    Thank you all.
    Message was edited by:
    fire_fighting

    Urghh,
    developing and not being allowed to create a sequence. You have a tough task.
    I can think of two ways to do this. But I can not test it myself, sorry.
    First, create a source module. One in wich you normally only have source tables and views. Let this point to the database/schema where you have the sequence. with a dblink. Import the defenition of your sequence. Use your sequence in a mapping you make in a dwh module. If you generate the mapping, it should be with the dblink information. Just as it would generate the connection for a source table or view.
    If this does not work. The dirty way is to make the sequence in the dwh module and just use it in your mapping. After deployment of your mapping, edit the mapping source. It is just plain pl/sql. Find every occurence of the sequence and replace it with one on the remote server. Perhaps you can make a macro for it.
    There are many good reasons why you don't want to use post-generation-steps. Maintenance, documentation, error-prone etc.
    But it works. :-)
    Hope this helps.
    Maarten Vinkhuyzen

  • Error while import schema in HANA DB

    Hi...
    I am trying to perform an export-import of a HANA DB user instance at schema level including all objects (in my case tables and synonyms) and data.
    Export and Import works very well except importing a schema which contains a synonym referred to other existing schema .
    Here is a test case
    - Schema A with a Table and Schema B to contain a synonym for schema A's table.
    - Exported both schemas to CSV which is done successfully and everything looked ok in export location.
    - Imported Schema A and then Schema B with the following command.
    Command:
    IMPORT "<bkup_schema>"."*" FROM '<bkp_location>' WITH RENAME SCHEMA <bkup_schema> TO <brand_new_schema>;
    The schema A (with table) imported fine.  Schema B (with synonym) gives the below error :
    "SAP DBTech JDBC: [2048]: column store error: table import failed:  [2003] An index already exists with the same name "
    When trying to use "REPLACE" clause in the command the error changes as below:
    SAP DBTech JDBC: [2048]: column store error: table import failed:  [30117] Binary import failed (cannot execute drop statement)
    Has anybody faced this type of error before??

    Folks, I am running into the same issue. What I figure out was the following:
    1) I turn off the autocommit
    2) I run the import for the first time
    import "<SCHEMA_NAME>"."*" as binary from '<location>' with replace;
    rollback;
    3) I get the error as described
    SAP DBTech JDBC: [2048]: column store error: table import failed:  [30117] Binary import failed (cannot execute drop statement)
    4) I run this import once again and commit and surprisingly the error is gone and the import is successful.
    import "<SCHEMA_NAME>"."*" as binary from '<location>' with replace;
    commit;

Maybe you are looking for