SPLIT PARTITION  creating the index in different Table Space

I am splitting the table every month. After splitting the Index is also Splitting. (It is natural). But it is creating in default table Space.
I want to split INDEX and creating into the index table space “ACTIVITY_IND_TS_1”
CREATE TABLE PART
PK_KEY NUMBER(15) NOT NULL,
PK_ID NUMBER(1) NOT NULL
TABLESPACE USERS PARTITION BY RANGE (PK_ID)
PARTITION PK_ID_PRD1 VALUES LESS THAN (1)
LOGGING
TABLESPACE ACTIVITY_TAB_TS_1,
PARTITION PK_ID_PRD2 VALUES LESS THAN (2)
LOGGING
TABLESPACE ACTIVITY_TAB_TS_1,
PARTITION PK_ID_PRD3 VALUES LESS THAN (3)
LOGGING
TABLESPACE ACTIVITY_TAB_TS_1,
PARTITION PK_ID_PRD4 VALUES LESS THAN (4)
LOGGING
TABLESPACE ACTIVITY_TAB_TS_1,
PARTITION PK_ID_PRD_MAXVALUE VALUES LESS THAN (MAXVALUE)
LOGGING
TABLESPACE ACTIVITY_TAB_TS_1
NOCACHE
NOPARALLEL
ENABLE ROW MOVEMENT;
CREATE INDEX PART_IX ON PART(PK_ID)
LOCAL (PARTITION PK_ID_PRD1 TABLESPACE ACTIVITY_IND_TS_1,
PARTITION PK_ID_PRD2 TABLESPACE ACTIVITY_IND_TS_1,
PARTITION PK_ID_PRD3 TABLESPACE ACTIVITY_IND_TS_1,
PARTITION PK_ID_PRD4 TABLESPACE ACTIVITY_IND_TS_1,
PARTITION PK_ID_PRD_MAXVALUE TABLESPACE ACTIVITY_IND_TS_1)
PARALLEL
NOLOGGING;
select unique tablespace_name from user_tab_partitions; -- ACTIVITY_TAB_TS_1
select unique tablespace_name from user_ind_partitions; -- ACTIVITY_IND_TS_1
ALTER TABLE PART SPLIT PARTITION PK_ID_PRD_MAXVALUE
AT (5) INTO (PARTITION PK_ID_PRD5, PARTITION PK_ID_PRD_MAXVALUE);
select unique tablespace_name from user_tab_partitions; -- ACTIVITY_TAB_TS_1
select unique tablespace_name from user_ind_partitions; -- ACTIVITY_TAB_TS_1 ACTIVITY_IND_TS_1
Edited by: sk123 on May 5, 2009 1:05 PM

Hello,
Once you split partition you need to rebuild indexes if you want indexes to be in their own tablespaces
ALTER TABLE PART
SPLIT PARTITION PK_ID_PRD_MAXVALUE AT
(6)
INTO (PARTITION PK_ID_PRD5
       TABLESPACE ACTIVITY_TAB_TS_1
       PARTITION PK_ID_PRD_MAXVALUE);
ALTER INDEX PART_IX
REBUILD PARTITION PK_ID_PRD5
TABLESPACE ACTIVITY_IND_TS_1;
ALTER INDEX PART_IX
REBUILD PARTITION PK_ID_PRD_MAXVALUE
TABLESPACE ACTIVITY_IND_TS_1;Regards

Similar Messages

  • Split creation of the index

    Hi !
    I have a table with more 50 GO of documents and i will create an index for full text search.
    The problem is that the creation take a long time and it is problem to create it in a production environment.
    It is possible to split the creation of the index. for example 10 GO by 10 GO.
    Thanks a lot for your answers.
    L.A

    For locally partitioned text indexes, you can rebuild each partition separately. If you have lots of memory and CPUs, then you might be able to rebuild all the partitions simultaneously. As raford suggested, it is a two step process:
    1. create the index with nopopulate
    2. rebuild each partition in a separate session
    eg
    ALTER INDEX xxx REBUILD PARTITION xxx PARAMETERS ('replace memory 200M');
    Using this technique, I can rebuild a 7M doc/35GB index in about 3 hours.
    The index rate for each partition is about 17 docs/sec. I don't know if this is particularly good or bad as a rate per se. I've tried adding "PARALLEL 4" to my rebuild statements and, for at least one partition, it jumped to an astonding 79 docs/sec rate. But contention lock and wait problems ensued for the other partitions, so I need to do more testing of this option.

  • How can I use create/createInsert for two different tables

    Hi All,
    I am showing different fields in the UI from different tables. I am able to fetch the data from all the tables and able to modify and save the data.
    Now, the problem when I want to create/insert some data into those columns(from different tables) I am facing issues.
    How can I proceed further??

    Hi Shay,
    Thank you very much for your quick response.
    Actually I am totally new in ADF world and I am trying to implement some applications in ADF.
    I created an UI based on some 3 tables(there is foreign key relation between them) and some other tables. I am able to modify and save my application if there is any data in all the tables.
    My Actual issues are
    1) I removed all the data from the tables. There is a submit(CreateInsert) button, what I expected is on click of the button I should see all the fields in editable mode. But I was able to see only few fields and also in readonly mode. So here my issue is how can i create and save these data.
    2) Consider on my landing page I have just CommandLink/CommandButton. After clicking that page I should get the above screen in create mode(I mean to say all fields in editable mode). How can achieve this?
    Thanks & Regards,
    Ravi.

  • Is it worth creating secondary index on BKPF table ?

    Hello,
    One of my clients is using ECC version 5.0. I have a requirement wherein I need to fetch the data from BKPF table based on AWKEY, BUKRS and GJAHR. There is no standard secondary index available.
    I have decided to create a secondary index on these fields in the following order:
    1) MANDT
    2) AWKEY
    3) BUKRS
    4) GJAHR
    I know that creating secondary indexes does improve performance during data retrieval. But when I checked the total number of entries in BKPF table in production system, there are more than 20 lac 2 million records.
    I am worried that creation of secondary index will create another table of such a large size in production that has data sorted on the above fields. Also, the RAM of production system is 6 GB.
    Please suggest if creation of secondary index is a good measure OR should I recommend the client to increase the system RAM?
    Regards,
    Danish.
    Edited by: Thomas Zloch on Oct 3, 2011 3:01 PM

    Hi,
    Secondary Index on BKPF-AWKEY has been successfully created in production. The report which used to timeout in foreground as well as in background is now executing in less than 10 seconds !!
    Client is very much satisfied with this. But, there is one problem that we are facing now is that when the user is changing an existing billing document via VF02, on SAVE, system takes a very long time to save the changes done.
    We monitored the processes via SM50 and found that there was a sequential read on BKPF table.
    Before transporting the index in production, system approximately took not more than 5 seconds to save the Billing Document. But now system takes more than 20 minutes just to save the billing document via VF02.
    I really don't know what has gone wrong. I can't figure out if I have missed any step while creating the index.
    I did the following,
    1) Created a Secondary index on BKPF, saved it in the transport request and activated it. Since the index was not existing in database ORACLE, I activated and adjusted the table via SE14. Now, index exists on database as well. Working perfectly in development.
    2) Imported the transport request to Production. Checked in SE11. Index was existing and active. Also, index existed in database ORACLE.
    Have I missed anything ? Is it required to activate and adjust the database via SE14 in production too ?
    Regards,
    Danish.

  • Please help me create the indexes for this XML

    Hi Mark and others,
    What is the way to create the correct index for this kind of XML (I posted earlier)? I created the indexes without using those prefixes without any problems but they do not seem to be used during processing. For 300 statutes, it took about 10 minutes! For the smplier verion, I created indexes and it took no more than 30 seconds to process more than 4000 statutes.
    <AllStatuteQueryResponse xmlns="http://crimnet.state.mn.us/mnjustice/statute/service/3.0">
    <ns1:Statutes xmlns:ns1="http://crimnet.state.mn.us/mnjustice/statute/messages/3.0">
    <ns1:Statutes>
    <ns2:StatuteId xmlns:ns2="http://crimnet.state.mn.us/mnjustice/statute/3.0">1</ns2:StatuteId>
    <ns3:Chapter xmlns:ns3="http://crimnet.state.mn.us/mnjustice/statute/3.0">84</ns3:Chapter>
    <ns4:Section xmlns:ns4="http://crimnet.state.mn.us/mnjustice/statute/3.0">82</ns4:Section>
    <ns5:Subdivision xmlns:ns5="http://crimnet.state.mn.us/mnjustice/statute/3.0">1a</ns5:Subdivision>
    <ns6:Year xmlns:ns6="http://crimnet.state.mn.us/mnjustice/statute/3.0">0</ns6:Year>
    <ns7:LegislativeSessionCode xmlns:ns7="http://crimnet.state.mn.us/mnjustice/statute/3.0">
    <ns7:StatuteCode>
    <ns7:code>4</ns7:code>
    <ns7:description>4</ns7:description>
    </ns7:StatuteCode>
    </ns7:LegislativeSessionCode>
    <ns8:SessionTextIndicator xmlns:ns8="http://crimnet.state.mn.us/mnjustice/statute/3.0">false</ns8:SessionTextIndicator>
    <ns9:HeadNoteIndicator xmlns:ns9="http://crimnet.state.mn.us/mnjustice/statute/3.0">false</ns9:HeadNoteIndicator>
    <ns10:EffectiveDate xmlns:ns10="http://crimnet.state.mn.us/mnjustice/statute/3.0">1859-01-01</ns10:EffectiveDate>
    <ns11:EnactmentDate xmlns:ns11="http://crimnet.state.mn.us/mnjustice/statute/3.0">1859-01-01</ns11:EnactmentDate>
    <ns12:RepealedIndicator xmlns:ns12="http://crimnet.state.mn.us/mnjustice/statute/3.0">false</ns12:RepealedIndicator>
    <j:DocumentLocationURI xmlns:j="http://www.it.ojp.gov/jxdm/3.0.2">
    <j:ID xsi:type="j:TextType" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">http://www.revisor.leg.state.mn.us/stats/84/82.html</j:ID>
    </j:DocumentLocationURI>
    <ns13:SummaryDescriptionText xmlns:ns13="http://crimnet.state.mn.us/mnjustice/statute/3.0">Snowmobiles-Snowmobile registration</ns13:SummaryDescriptionText>
    <ns14:StatuteFunction xmlns:ns14="http://crimnet.state.mn.us/mnjustice/statute/3.0">
    <ns14:StatuteIntegrationId>1</ns14:StatuteIntegrationId>
    Thanks!
    Ben

    Hi Mark, here is the schema. I did not register the schema, because when I processed the simpler version, I did not either and I just created the indexes. I did not create an VARRAY in the table. The DDL is simply create table CStatute_XML(id number, xmldoc xmltype).
    Schema:
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- CriMNet -->
    <!-- Minnesota Criminal Justice Statute Web Service Data Dictionary -->
    <!-- Dave Everson -->
    <!-- Version 3.0 -->
    <xsd:schema targetNamespace="http://crimnet.state.mn.us/mnjustice/statute/3.0" elementFormDefault="qualified" attributeFormDefault="unqualified" version="3.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://crimnet.state.mn.us/mnjustice/statute/3.0">
         <xsd:element name="StatuteCode">
              <xsd:annotation>
                   <xsd:documentation>
                        This complex type is a generic structure representing code value sets defined in the Minnesota Criminal Justice Statute Service.
                        A single element of the value set contains both a code value (e.g. F) and a description (e.g. Felony).
                        The following concepts within the MNCJSS are represented by this complex type:
                             OffenseSummary
                             OffenseSummarySeverityLevel
                             LegislativeSession
                             Function
                             OffenseLevel
                             OffenseSeverityLevel
                             DetailedOffenseCode
                             GeneralOffenseCode
                   </xsd:documentation>
              </xsd:annotation>
              <xsd:complexType>
                   <xsd:sequence>
                        <xsd:element name="code" type="xsd:string"/>
                        <xsd:element name="description" type="xsd:string"/>
                   </xsd:sequence>
              </xsd:complexType>
         </xsd:element>
         <xsd:element name="StatuteId" type="xsd:integer">
              <xsd:annotation>
                   <xsd:documentation>Primary Key reference to Minnesota Criminal Justice Statute Service disseminated by CriMNet</xsd:documentation>
                   <xsd:appinfo>Statute.statuteId</xsd:appinfo>
              </xsd:annotation>
         </xsd:element>
         <xsd:element name="StatuteIntegrationId" type="xsd:integer">
              <xsd:annotation>
                   <xsd:documentation>Primary Key reference to the StatuteFunction object within the Minnesota Criminal Justice Statute Service disseminated by CriMNet</xsd:documentation>
                   <xsd:appinfo>StatuteFunction.statuteIntegrationId</xsd:appinfo>
              </xsd:annotation>
         </xsd:element>
         <xsd:element name="FunctionCode">
              <xsd:annotation>
                   <xsd:documentation>TBD</xsd:documentation>
                   <xsd:appinfo>StatuteFunction.Function</xsd:appinfo>
              </xsd:annotation>
              <xsd:complexType>
                   <xsd:sequence>
                        <xsd:element ref="StatuteCode"/>
                   </xsd:sequence>
              </xsd:complexType>
         </xsd:element>
         <xsd:element name="OffenseSummaryCode">
              <xsd:annotation>
                   <xsd:documentation>TBD</xsd:documentation>
                   <xsd:appinfo>StatuteFunction.OffenseSummary</xsd:appinfo>
              </xsd:annotation>
              <xsd:complexType>
                   <xsd:sequence>
                        <xsd:element ref="StatuteCode"/>
                   </xsd:sequence>
              </xsd:complexType>
         </xsd:element>
         <xsd:element name="OffenseSummarySeverityLevelCode">
              <xsd:annotation>
                   <xsd:documentation>TBD</xsd:documentation>
                   <xsd:appinfo>StatuteFunction.OffenseSummary.OffenseSummarySeverityLevel</xsd:appinfo>
              </xsd:annotation>
              <xsd:complexType>
                   <xsd:sequence>
                        <xsd:element ref="StatuteCode"/>
                   </xsd:sequence>
              </xsd:complexType>
         </xsd:element>
         <xsd:element name="OffenseLevelCode">
              <xsd:annotation>
                   <xsd:documentation>TBD</xsd:documentation>
                   <xsd:appinfo>StatuteFunction.OffenseLevel</xsd:appinfo>
              </xsd:annotation>
              <xsd:complexType>
                   <xsd:sequence>
                        <xsd:element ref="StatuteCode"/>
                   </xsd:sequence>
              </xsd:complexType>
         </xsd:element>
         <xsd:element name="OffenseSeverityLevelCode">
              <xsd:annotation>
                   <xsd:documentation>TBD</xsd:documentation>
                   <xsd:appinfo>StatuteFunction.OffenseSeverityLevel</xsd:appinfo>
              </xsd:annotation>
              <xsd:complexType>
                   <xsd:sequence>
                        <xsd:element ref="StatuteCode"/>
                   </xsd:sequence>
              </xsd:complexType>
         </xsd:element>
         <xsd:element name="LegislativeSessionCode">
              <xsd:annotation>
                   <xsd:documentation>TBD</xsd:documentation>
                   <xsd:appinfo>StatuteChapterSection.LegislativeSession</xsd:appinfo>
              </xsd:annotation>
              <xsd:complexType>
                   <xsd:sequence>
                        <xsd:element ref="StatuteCode"/>
                   </xsd:sequence>
              </xsd:complexType>
         </xsd:element>
         <xsd:element name="GeneralOffenseCode" nillable="true">
              <xsd:annotation>
                   <xsd:documentation>An integer (1-9) identifier of a general statute category code used for statistical analysis.</xsd:documentation>
                   <xsd:appinfo>StatuteFunction.DetailedOffenseCode.GeneralOffenseCode</xsd:appinfo>
              </xsd:annotation>
              <xsd:complexType>
                   <xsd:sequence>
                        <xsd:element ref="StatuteCode"/>
                   </xsd:sequence>
              </xsd:complexType>
         </xsd:element>
         <xsd:element name="DetailedOffenseCode" nillable="true">
              <xsd:annotation>
                   <xsd:documentation>An identification number associated with a statute offense type in the form of nnn.nnn. From a list of 350. Corresponds to the StatuteOffinseTypeText.</xsd:documentation>
                   <xsd:appinfo>StatuteFunction.DetailedOffenseCode</xsd:appinfo>
              </xsd:annotation>
              <xsd:complexType>
                   <xsd:sequence>
                        <xsd:element ref="StatuteCode"/>
                   </xsd:sequence>
              </xsd:complexType>
         </xsd:element>
         <xsd:element name="Chapter" type="xsd:string">
              <xsd:annotation>
                   <xsd:documentation>A numeric identifier of a chapter within a statute.</xsd:documentation>
                   <xsd:appinfo>Statute.chapter; StatuteChapterSection.chapter</xsd:appinfo>
              </xsd:annotation>
         </xsd:element>
         <xsd:element name="Section" type="xsd:string" nillable="true">
              <xsd:annotation>
                   <xsd:documentation>An integer number identifier of a section of a chapter of a statute.</xsd:documentation>
                   <xsd:appinfo>Statute.section; StatuteChapterSection.section</xsd:appinfo>
              </xsd:annotation>
         </xsd:element>
         <xsd:element name="Subdivision" type="xsd:string" nillable="true">
              <xsd:annotation>
                   <xsd:documentation>An identifier of a subdivision within a code book.</xsd:documentation>
                   <xsd:appinfo>Statute.subdivision</xsd:appinfo>
              </xsd:annotation>
         </xsd:element>
         <xsd:element name="HeadNoteIndicator" type="xsd:boolean">
              <xsd:annotation>
                   <xsd:documentation></xsd:documentation>
                   <xsd:appinfo>StatuteChapterSection.headNote</xsd:appinfo>
              </xsd:annotation>
         </xsd:element>     
         <xsd:element name="Year" type="xsd:int">
              <xsd:annotation>
                   <xsd:documentation>TBD</xsd:documentation>
                   <xsd:appinfo>StatuteChapterSection.year</xsd:appinfo>
              </xsd:annotation>
         </xsd:element>
         <xsd:element name="EffectiveDate" type="xsd:date" nillable="true">
              <xsd:annotation>
                   <xsd:documentation>The date a statute came into effect</xsd:documentation>
                   <xsd:appinfo>Statute.effectiveDate</xsd:appinfo>
              </xsd:annotation>
         </xsd:element>
         <xsd:element name="ExpirationDate" type="xsd:date" nillable="true">
              <xsd:annotation>
                   <xsd:documentation>The date a statute was not longer effective.</xsd:documentation>
                   <xsd:appinfo>Statute.effectiveDate</xsd:appinfo>
              </xsd:annotation>
         </xsd:element>
         <xsd:element name="EnactmentDate" type="xsd:date" nillable="true">
              <xsd:annotation>
                   <xsd:documentation>A date a statute was signed into law.</xsd:documentation>
                   <xsd:appinfo>Statute.enactmentDate</xsd:appinfo>
              </xsd:annotation>
         </xsd:element>
         <xsd:element name="RepealedIndicator" type="xsd:boolean">
              <xsd:annotation>
                   <xsd:documentation>A date a statute number was repealed, amended, or renumbered.</xsd:documentation>
                   <xsd:appinfo>Statute.repealedFlag</xsd:appinfo>
              </xsd:annotation>
         </xsd:element>
         <xsd:element name="HeadNote" type="xsd:boolean">
              <xsd:annotation>
                   <xsd:documentation></xsd:documentation>
                   <xsd:appinfo>Statute.headNote</xsd:appinfo>
              </xsd:annotation>
         </xsd:element>
         <xsd:element name="SummaryDescriptionText" type="xsd:string" nillable="true">
              <xsd:annotation>
                   <xsd:documentation>A long description of a statute.</xsd:documentation>
                   <xsd:appinfo>Statute.summaryText</xsd:appinfo>
              </xsd:annotation>
         </xsd:element>
         <xsd:element name="LegislativeText" type="xsd:string" nillable="true">
              <xsd:annotation>
                   <xsd:documentation>The legislative of a statute.</xsd:documentation>
                   <xsd:appinfo>StatuteChapterSection.legislativeText</xsd:appinfo>
              </xsd:annotation>
         </xsd:element>     
         <xsd:element name="SessionTextIndicator" type="xsd:boolean">
              <xsd:annotation>
                   <xsd:documentation></xsd:documentation>
                   <xsd:appinfo>StatuteChapterSection.sessionTextFlag</xsd:appinfo>
              </xsd:annotation>
         </xsd:element>     
         <xsd:element name="FunctionText" type="xsd:string" nillable="true">
              <xsd:annotation>
                   <xsd:documentation></xsd:documentation>
                   <xsd:appinfo>StatuteFunction.functionText</xsd:appinfo>
              </xsd:annotation>
         </xsd:element>
         <xsd:element name="JuvenileOnlyIndicator" type="xsd:boolean">
              <xsd:annotation>
                   <xsd:documentation>An indicator identifying whether a statute applies to juveniles only.</xsd:documentation>
                   <xsd:appinfo>StatuteFunction.juvenileOnlyFlag</xsd:appinfo>
              </xsd:annotation>
         </xsd:element>
         <xsd:element name="CrimeOfViolenceIndicator" type="xsd:boolean">
              <xsd:annotation>
                   <xsd:documentation>An indicator identifying whether a statute is a crime of violence under Minnesota statute 624 section 712 subdivision 5.</xsd:documentation>
                   <xsd:appinfo>StatuteFunction.crimeOfViolenceFlag</xsd:appinfo>
              </xsd:annotation>
         </xsd:element>
         <xsd:element name="EnhanceableIndicator" type="xsd:boolean">
              <xsd:annotation>
                   <xsd:documentation>An indicator identifying whether the charges are enhanceable by specific factors (the definition of enhanceable is pending review).</xsd:documentation>
                   <xsd:appinfo>StatuteFunction.enhanceableFlag</xsd:appinfo>
              </xsd:annotation>
         </xsd:element>
         <xsd:element name="TargetedMisdemeanorIndicator" type="xsd:boolean">
              <xsd:annotation>
                   <xsd:documentation>An indicator identifying whether a statute is a targeted misdemeanor as defined in Minnnesota Statute 299C.10, subdivision. 1(d).</xsd:documentation>
                   <xsd:appinfo>StatuteFunction.targetedMisdemeanorFlag</xsd:appinfo>
              </xsd:annotation>
         </xsd:element>
         <xsd:element name="MandatoryAppearanceIndicator" type="xsd:boolean">
              <xsd:annotation>
                   <xsd:documentation></xsd:documentation>
                   <xsd:appinfo>StatuteFunction.mandatoryAppearanceFlag</xsd:appinfo>
              </xsd:annotation>
         </xsd:element>
         <xsd:element name="RegisterableOffenseIndicator" type="xsd:boolean">
              <xsd:annotation>
                   <xsd:documentation></xsd:documentation>
                   <xsd:appinfo>StatuteFunction.registerableOffenseFlag</xsd:appinfo>
              </xsd:annotation>
         </xsd:element>
         <xsd:element name="StatuteFunction">
              <xsd:annotation>
                   <xsd:documentation></xsd:documentation>
                   <xsd:appinfo>StatuteFunction</xsd:appinfo>
              </xsd:annotation>
              <xsd:complexType>
                   <xsd:sequence>
                        <xsd:element ref="StatuteIntegrationId" />
                        <xsd:element ref="FunctionCode"/>
                        <xsd:element ref="FunctionText" minOccurs="0" maxOccurs="1"/>                    
                        <xsd:element ref="CrimeOfViolenceIndicator"/>
                        <xsd:element ref="EnhanceableIndicator"/>
                        <xsd:element ref="TargetedMisdemeanorIndicator"/>
                        <xsd:element ref="RegisterableOffenseIndicator"/>                    
                        <xsd:element ref="JuvenileOnlyIndicator"/>
                        <xsd:element ref="MandatoryAppearanceIndicator"/>                                        
                        <xsd:element ref="OffenseLevelCode" minOccurs="0" maxOccurs="1"/>
                        <xsd:element ref="GeneralOffenseCode" minOccurs="0" maxOccurs="1"/>
                        <xsd:element ref="DetailedOffenseCode" minOccurs="0" maxOccurs="1"/>
                        <xsd:element ref="OffenseSummaryCode" minOccurs="0" maxOccurs="1"/>
                        <xsd:element ref="OffenseSummarySeverityLevelCode" minOccurs="0" maxOccurs="1"/>
                        <xsd:element ref="OffenseSeverityLevelCode" minOccurs="0" maxOccurs="1"/>
                   </xsd:sequence>
              </xsd:complexType>
         </xsd:element>
    </xsd:schema>
    Query:
    first part to get the statute ID numbers,
    insert into CriMNet_Statutes
         select cs.StatuteId, cs.Chapter, cs.Section, cs.Subdivision, cs.Year, cs.LegCode,
              cs.LegDesc, cs.SessionTextIndicator, cs.HeadNoteIndicator,
              to_date(cs.EffectiveDate, 'yyyy/mm/dd') as eDate,
              to_date(cs.EnactmentDate, 'yyyy/mm/dd') as EnDate,
              cs.RepealedIndicator, cs.SummaryDescriptionText
         from Cstatute_xml,          
         xmltable
              xmlnamespaces
                   default 'http://crimnet.state.mn.us/mnjustice/statute/3.0',     
                   --- or 'http://crimnet.state.mn.us/mnjustice/statute/3.0' as "cs"
                   'http://crimnet.state.mn.us/mnjustice/statute/service/3.0' as "cx",
                   'http://crimnet.state.mn.us/mnjustice/statute/messages/3.0' as "ns1"                    
              '/cx:AllStatuteQueryResponse/ns1:Statutes/ns1:Statutes'               
              --- '/AllStatuteQueryResponse//ns:Statutes' --- produces an extra row
              passing SXMLDOC
              columns
              StatuteId     varchar2(10)     path '//StatuteId',
              Chapter          varchar2(10)     path '//Chapter',
              Section          varchar2(20)     path '//Section',
              Subdivision     varchar2(20)     path '//Subdivision',
              Year          number          path '//Year',     
              LegCode          varchar2(10)     path '//LegislativeSessionCode/StatuteCode/code',
              LegDesc          varchar2(10)     path '//LegislativeSessionCode/StatuteCode/description',
              SessionTextIndicator varchar2(10) path '//SessionTextIndicator',
              HeadNoteIndicator varchar2(10)     path '//HeadNoteIndicator',
              EffectiveDate     varchar2(15)     path '//EffectiveDate',
              EnactmentDate     varchar2(15)     path '//EnactmentDate',
              RepealedIndicator varchar2(10)     path '//RepealedIndicator',
              SummaryDescriptionText varchar2(150) path '//SummaryDescriptionText'     
         ) cs;
    Second part to get the function code for each statute ID (one ID to many function codes).
    declare
              v_statuteID     number;
              v_statuteIDC     varchar2(10);
              cursor c_cmns is
              select statuteid from CriMNet_Statutes;
         begin
              for v_cmns in c_cmns loop
                   v_StatuteID := v_cmns.StatuteID;
                   v_statuteIDC := to_char(v_statuteID);
                   insert into CriMNet_Statute_Function
                   select v_StatuteID, cf.* from Cstatute_xml,
                   xmltable
                        xmlnamespaces
                             'http://crimnet.state.mn.us/mnjustice/statute/3.0' as "cs",
                             'http://crimnet.state.mn.us/mnjustice/statute/service/3.0' as "cx",
                             'http://crimnet.state.mn.us/mnjustice/statute/messages/3.0' as "ns1"                         
                        'for $cxm in /cx:AllStatuteQueryResponse/ns1:Statutes/ns1:Statutes[cs:StatuteId = $val/pStatuteId]/cs:StatuteFunction
                        return
                        <cs:CSFunction>
                             <cs:StatuteIntegrationId>{$cxm//cs:StatuteIntegrationId}</cs:StatuteIntegrationId>
                             <cs:FunctionCode>{$cxm//cs:FunctionCode/cs:StatuteCode/cs:code}</cs:FunctionCode>
                             <cs:FunctionDesc>{$cxm//cs:FunctionCode/cs:StatuteCode/cs:description}</cs:FunctionDesc>
                             <cs:CrimeOfViolenceIndicator>{$cxm//cs:CrimeOfViolenceIndicator}</cs:CrimeOfViolenceIndicator>
                             <cs:EnhanceableIndicator>{$cxm//cs:EnhanceableIndicator}</cs:EnhanceableIndicator>
                             <cs:TargetedMisdIndicator>{$cxm//cs:TargetedMisdemeanorIndicator}</cs:TargetedMisdIndicator>
                             <cs:RegisterableOffIndicator>{$cxm//cs:RegisterableOffenseIndicator}</cs:RegisterableOffIndicator>
                             <cs:JuvenileOnlyIndicator>{$cxm//cs:JuvenileOnlyIndicator}</cs:JuvenileOnlyIndicator>
                             <cs:MandatoryAppIndicator>{$cxm//cs:MandatoryAppearanceIndicator}</cs:MandatoryAppIndicator>
                             <cs:OffenseLevelCode>{$cxm//cs:OffenseLevelCode/cs:StatuteCode/cs:code}</cs:OffenseLevelCode>
                             <cs:OffenseLevelDesc>{$cxm//cs:OffenseLevelCode/cs:StatuteCode/cs:description}</cs:OffenseLevelDesc>
                             <cs:GeneralOffenseCode>{$cxm//cs:GeneralOffenseCode/cs:StatuteCode/cs:code}</cs:GeneralOffenseCode>
                             <cs:GeneralOffenseDesc>{$cxm//cs:GeneralOffenseCode/cs:StatuteCode/cs:description}</cs:GeneralOffenseDesc>
                             <cs:DetailedOffenseCode>{$cxm//cs:DetailedOffenseCode/cs:StatuteCode/cs:code}</cs:DetailedOffenseCode>
                             <cs:DetailedOffenseDesc>{$cxm//cs:DetailedOffenseCode/cs:StatuteCode/cs:description}</cs:DetailedOffenseDesc>
                             <cs:OffenseSummaryCode>{$cxm//cs:OffenseSummaryCode/cs:StatuteCode/cs:code}</cs:OffenseSummaryCode>
                             <cs:OffenseSummaryDesc>{$cxm//cs:OffenseSummaryCode/cs:StatuteCode/cs:description}</cs:OffenseSummaryDesc>
                             <cs:OffenseSumSeverityLevelCode>{$cxm//cs:OffenseSummarySeverityLevelCode/cs:StatuteCode/cs:code}</cs:OffenseSumSeverityLevelCode>
                             <cs:OffenseSumSeverityLevelDesc>{$cxm//cs:OffenseSummarySeverityLevelCode/cs:StatuteCode/cs:description}</cs:OffenseSumSeverityLevelDesc>
                        </cs:CSFunction>'                              
                        passing SXMLDOC, xmlelement("pStatuteId", v_statuteIDC) as "val"
                        columns
                        StatuteIntegrationId     number     path '/cs:CSFunction/cs:StatuteIntegrationId',
                        FunctionCode          varchar2(10) path '/cs:CSFunction/cs:FunctionCode',
                        FunctionDesc          varchar2(30)     path '/cs:CSFunction/cs:FunctionDesc',
                        CrimeOfViolenceIndicator varchar2(10)     path '/cs:CSFunction/cs:CrimeOfViolenceIndicator',
                        EnhanceableIndicator     varchar2(10)     path '/cs:CSFunction/cs:EnhanceableIndicator',
                        TargetedMisdIndicator     varchar2(10)     path '/cs:CSFunction/cs:TargetedMisdIndicator',
                        RegisterableOffIndicator varchar2(10)     path '/cs:CSFunction/cs:RegisterableOffIndicator',
                        JuvenileOnlyIndicator     varchar2(10)     path '/cs:CSFunction/cs:JuvenileOnlyIndicator',
                        MandatoryAppIndicator     varchar2(10)     path '/cs:CSFunction/cs:MandatoryAppIndicator',
                        OffenseLevelCode     varchar2(10)     path '/cs:CSFunction/cs:OffenseLevelCode',
                        OffenseLevelDesc     varchar2(40)     path '/cs:CSFunction/cs:OffenseLevelDesc',
                        GeneralOffenseCode     varchar2(10)     path '/cs:CSFunction/cs:GeneralOffenseCode',
                        GeneralOffenseDesc     varchar2(60)     path '/cs:CSFunction/cs:GeneralOffenseDesc',
                        DetailedOffenseCode     varchar2(10)     path '/cs:CSFunction/cs:DetailedOffenseCode',
                        DetailedOffenseDesc     varchar2(60)     path '/cs:CSFunction/cs:DetailedOffenseDesc',
                        OffenseSummaryCode     varchar2(10)     path '/cs:CSFunction/cs:OffenseSummaryCode',
                        OffenseSummaryDesc     varchar2(60)     path '/cs:CSFunction/cs:OffenseSummaryDesc',
                        OffenseSumSeverityLevelCode varchar2(10)     path '/cs:CSFunction/cs:OffenseSumSeverityLevelCode',
                        OffenseSumSeverityLevelDesc varchar2(30)     path '/cs:CSFunction/cs:OffenseSumSeverityLevelDesc'          
                   ) cf;
                   ---dbms_output.put_line('Statute ID = ' || v_StatuteID);
              end loop;
         end;
    You mentioned that I should include the namespace in the existsnode function but I did not. I am going to try after including it. Thanks.
    Ben

  • Creating spatial index on spatial table

    Hi there. Just a quick query on creating spatial indexes on spatial tables. I have a table called System_Sessions which has the following four fields and types:
    USER_ID NUMBER(10)
    SESSION_ID NUMBER(10)
    SESSION_BOUNDARY MDSYS.SDO_GEOMETRY (polygon)
    START_POINT MDSYS.SDO_GEOMETRY (point)
    I am inserting one row per user session into this table. I also need to retrieve the session ids of previous sessions involving a particular user based on the session's start point. The query i am running is an sdo_within_distance query which looks as follows:
    Select session_id from joeweaker.system_sessions where user_id = 1003 and SDO_WITHIN_DISTANCE(start_point,
    (MDSYS.SDO_GEOMETRY(2001, 8265, MDSYS.SDO_POINT_TYPE
    (-105.0,40.0, NULL),NULL, NULL)), 'DISTANCE = 10000')='TRUE';
    However I encounter the following error whenever I attempt to execute this query:
    ORA-13226: interface not supported without a spatial index
    ORA-06512: at "MDSYS.MD", line 1723
    ORA-06512: at "MDSYS.MDERR", line 8
    ORA-06512: at "MDSYS.SDO_3GL", line 255
    I know I haven't built the spatial index on the table so I was hoping that somebody might show me how to do this. Thnaks a lot, Joe

    Thnaks a lot Dan for the prompt reply. I have done as you advised and everything appears to be fine. However I have a second table called Session_Interest_Areas which appears as follows:
    USER_ID----NUMBER(10)
    SESSION_ID----NUMBER(10)
    AREA_ID----NUMBER(10)
    AREA_BOUNDARY----MDSYS.SDO_GEOMETRY
    I inserted the necessary detail into the user_sdo_geom_metadata table and then attempted to create the index as follows (exactly the same format as my other spatial tables:
    create index session_interest_areas_idx on
    session_interest_areas (area_boundary)
    indextype is mdsys.spatial_index;
    When I execute this query I get the following stream of error messages:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-13249: internal error in Spatial index: [mdidxrbd]
    ORA-13249: Error in Spatial index: index build failed
    ORA-13249: Error in spatial index: [mdrcrtxfergm]
    ORA-13249: Error in spatial index: [mdpridxtxfergm]
    ORA-13200: internal error [ROWID:AAAHocAAJAAAAC8AAA] in spatial indexing.
    ORA-13206: internal error [] while creating the spatial index
    ORA-13373: Element of type Extent is not supported for Geodetic data
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD_9I", line 7
    ORA-06512: at line 1
    Why does this give me an error when the same approach worked fine for my other spatial tables? Is it something to do with the SRID? Also the index appears to have been created so I presume it has been created incorrectly. Thanks for your time, Joe

  • Create unique index on flow table

    Hi
    I always get this error 'Create unique index on flow table ERROR" while implementing SCD2. Please help me.I have made an Update Key which is a combination of 4 columns that want a new row to be inserted if there is a change in data.One of the above columns is the EMPLOYEE ID,
    My surrogate key is the table's primary key but I have not defined it as a key in mapping and also I have turned off the Primary Key Constraint Option in Controls Panel as NO.
    Where am I wrong? Also please tell me what to take care off while making Natural Key ?

    There are two solutions:
    1. Only use uppercase in the table name
    2. go in Topology>Physical Architecture and edit the technology, then click on
    the "Language" tab and set "Object Delimiter" to empty.
    Thanks,
    Sutirtha

  • Question about create the index in shp2sdo...

    hi, i'm new in oracle and gis
    when i use shp2sdo, to convert the shapefile to oracle spatial.. i have problem in create the index...
    i have a error when i execute the statement like this :
    SQL> select mdsys.sdo_tune.estimate_tiling_level('peta','geom',10000,'avg_gid_extent') from dual;
    why ??
    the error is table or vies does not exist...
    why ?? what i must to do ???

    SQL> select mdsys.sdo_tune.estimate_tiling_level('peta','geom',10000,'avg_gid_extent') from dual; For a start, put the table and column name in upper case - Oracle stores object names in capitals in the data dictionary, regardless of the case that was used to create them.

  • Please help me to create the index

    hi gurus,
    i have one table with one raw datatype column. It will stores encrypted data.
    I created a view which shows decryted data of the above table. I need create an index on decrypted data for avoiding full table scan. Please help me to create the index.
    thanks in advance..

    Perhaps you could create a function-based index, although if you're going to make it so easy to read the decrypted version I'm not sure why you want to encrypt it in the first place.

  • What is the difference between the drop and create the index and rebuild index ?

    Hi All,
    what is the difference between drop and create index & rebuild index ? i think both are same...Please clarify if both are same or any difference...
    Thanks in Advance,
    rup

    Both are same. Rebuilding an index drops and re-creates the index. 
    Ref:
    SSMS - https://technet.microsoft.com/en-us/library/ms187874(v=sql.105).aspx
    TSQL - https://msdn.microsoft.com/en-us/library/ms188388.aspx
    I would suggest you to also refer one of the best index maintenance script as below:
    https://ola.hallengren.com/sql-server-index-and-statistics-maintenance.html

  • How to create User and Database in different Table spaces

    How to create User and Database in different Table spaces using oracle 10g
    Regards
    daya

    I am sorry but your question does not seem to make much sense.
    Can you please rephrase your question?

  • Creating the index at end of book

    I am  looking at how to finish my first cook book and realize one of the last touches is to create an index of the  terms mentioned in the book. I'm not done yet, so the pages are shifting around a lot as I finish up, so I see there is no point in doing this yet.
    I am searching in the forums and the only threads I found in relation to this are pretty dated. The only solution that seems to be discussed is indexbrutal / now Indexmatic on the indiscripts website. I am reading some of the docs, looks a bit complicated to setup. It also doesn't mention compatibility with the current version I am working with (CC). It says "CS5+"...
    From what I see, first you have to create your own list of words you want to index, thats fine, I will do that when its time. However, for me the bulk of the work is to assemble the references to each page its on. Is there any built in or more current methods for creating the index at the back of the book?

    That would work, but yeah you would think there would be a way to address this more efficiently.
    It would be nice to see a bit more sophistication in the panel. It seems to help you index all occurrences of the word but only if you do so when you first enter the word. What if you add more content?
    I ran into this concept as well when defining sections. If you edit the pages, the section remains on the page you defined it. I would like to anchor it to the heading on the page it relates to, in case that heading moves, the section would move as well. It seems there as well, its not worth doing this until you are dont with the content of the book. Seems kind of clunky to me.. what about revisions & "2nd editions"... looks to me like you would be best to delete the sections, TOC and index and start over.

  • Creating the index takes forever

    Hi,
    I'm trying to index ~1100 PDF documents, who size varies between 20KB and 4MB, those PDF are stored in two directories on our Web server, so I use a URL_DATASTORE to get them. I have a column that contains the correct URL to the PDF, the column is a VARCHAR2(2000). 55% of documents are in French, the 45% remaining are English documents. I created this set of preferences :
    begin
    ctx_ddl.create_preference('AAPDF_DATA_PREF','URL_DATASTORE');
    ctx_ddl.set_attribute('AAPDF_DATA_PREF','NO_PROXY','acaiq.com');
    ctx_ddl.set_attribute('AAPDF_DATA_PREF','Timeout','60');
    end;
    begin
    ctx_ddl.create_preference('LEXIQUE_ANGLAIS','BASIC_LEXER');
    ctx_ddl.set_attribute('LEXIQUE_ANGLAIS','index_themes','no');
    ctx_ddl.set_attribute('LEXIQUE_ANGLAIS','index_text','yes');
    ctx_ddl.set_attribute('LEXIQUE_ANGLAIS','theme_language','english');
    end;
    begin
    ctx_ddl.create_preference('LEXIQUE_FRANCAIS','BASIC_LEXER');
    ctx_ddl.set_attribute('LEXIQUE_FRANCAIS','index_themes','no');
    ctx_ddl.set_attribute('LEXIQUE_FRANCAIS','index_text','yes');
    ctx_ddl.set_attribute('LEXIQUE_FRANCAIS','theme_language','french');
    end;
    begin
    ctx_ddl.create_preference('LEXIQUE_GLOBAL','MULTI_LEXER');
    ctx_ddl.add_sub_lexer('LEXIQUE_GLOBAL','DEFAULT','LEXIQUE_ANGLAIS');
    ctx_ddl.add_sub_lexer('LEXIQUE_GLOBAL','french','LEXIQUE_FRANCAIS','fre');
    end;
    begin
    ctx_ddl.create_preference('PREF_FUZZY', 'BASIC_WORDLIST');
    ctx_ddl.set_attribute('PREF_FUZZY','FUZZY_MATCH','FRENCH');
    ctx_ddl.set_attribute('PREF_FUZZY','FUZZY_SCORE','30');
    ctx_ddl.set_attribute('PREF_FUZZY','FUZZY_NUMRESULTS','200');
    ctx_ddl.set_attribute('PREF_FUZZY','SUBSTRING_INDEX','TRUE');
    ctx_ddl.set_attribute('PREF_FUZZY','STEMMER','FRENCH');
    end;
    And I created the index with this DML :
    CREATE INDEX ACAIQ.aapdf_index ON AA_PDF(AAPDF_CONTENU) INDEXTYPE IS ctxsys.context PARALLEL 1 PARAMETERS ('datastore AAPDF_DATA_PREF lexer LEXIQUE_GLOBAL language column AAPDF_LANGUE_ISO wordlist PREF_FUZZY memory 10M');
    The problem is that it takes forever to create the index. I started the create process yesterday after lunch, and it still running :-/ I looked at my Web server logs and I do see my Oracle server fetching the PDF, but it fetch ~12 PDF per hour.
    I'm doing this on our test server, it's a P4 1.4 Ghz with RedHat Linux 8 and Oracle 9i 9.2.02. It's not a fast server, but still I don't think it's normal to take 24 hours to index about 1 GB of data.

    I recreated the index with a 50M memory parameter instead of 10M. It don't speed up the process, in 40 minutes it only indexed 17 documents.
    vmstat stats when indexing the PDF documents :
    # vmstat -n 15
    procs memory swap io system cpu
    r b w swpd free buff cache si so bi bo in cs us sy id
    1 2 0 116104 6796 18120 489684 0 0 3 0 3 7 4 7 2
    0 3 0 116104 6776 18200 489256 0 0 62 1500 671 317 48 3 49
    1 1 0 116104 7084 18216 489728 0 0 37 1578 673 333 44 3 53
    0 1 0 116104 6776 18256 489256 0 0 24 1577 669 322 50 3 47
    1 0 0 116104 6908 18300 489876 0 0 18 1375 662 305 33 3 65
    0 1 0 116104 7000 18328 488136 0 0 19 1425 662 314 33 3 64
    0 1 0 116104 7812 18356 488892 0 0 31 1066 609 207 44 2 53
    1 1 0 116104 6776 18380 489168 1 0 19 1198 648 285 19 2 79
    0 1 0 116104 6776 18412 488212 0 0 23 1193 627 244 41 2 57
    2 0 0 116104 6776 18432 489324 0 0 34 1524 664 313 48 3 49
    1 0 0 116104 6780 18456 488572 0 0 26 1430 660 308 39 3 58
    2 0 0 116104 6776 18500 488424 0 0 32 1484 667 316 45 3 52
    1 1 0 116104 6776 18516 487488 0 0 11 1301 650 287 28 3 69
    0 1 0 116104 6776 18560 488316 0 0 35 1183 637 264 30 2 68
    0 1 0 116104 6776 18584 487344 0 0 34 1363 645 276 47 3 50
    2 0 0 116104 6776 18604 488424 0 0 22 1437 660 306 39 3 58

  • How to create better index on a table--

    Hi
    I have table called CS_LM_CUST.Every day I am getting 1,50,00
    records every day.And all the records I am inserting.And every
    two months data I am doing purging.My requirement is to load
    chaged data between 2 days i.e current day feed minus previous
    day feed difference data only I need to do.
    For taking the differrence data I have given the sql statement
    like this.
    SELECT
    CUST_NO,ORIG_BR_COD,LANG_COD,NATL_CTRY_COD,CUST_NAM,DMCL_CTRY_COD
    ,CUST_GFCID,CUST_GFPID,STD_INDS_COD FROM CS_LM_CUST WHERE
    ORIG_BR_COD = p_Branch AND REC_EXTRC_DT = CurrentDate
    MINUS
    SELECT
    CUST_NO,ORIG_BR_COD,LANG_COD,NATL_CTRY_COD,CUST_NAM,DMCL_CTRY_COD
    ,CUST_GFCID,CUST_GFPID,STD_INDS_COD FROM CS_LM_CUST WHERE
    ORIG_BR_COD = p_Branch AND REC_EXTRC_DT = PreviousDate
    And for updating the differed data sql statement is given like
    this.
    UPDATE CS_LM_CUST
              SET newrec_flg = 'Y'
              WHERE cust_no = g_CSLMCUST.cust_no AND
              orig_br_cod = g_CSLMCUST.ORIG_BR_COD AND
              rec_extrc_dt = g_CSLMCUST.rec_extrc_dt;
    Index has been created on cust_no,orig_br_cod,rec_extn_dt.But
    the updating part is taking lot of time.Nearly 45mts.Could any
    one suggest better indexing on this table which will satisfy
    DML statement like SELECT,UPDATE.
    The table below fields
    CUST_NO
    REC_TYP
    LANG_COD
    NATL_CTRY_COD
    REC_EXTRC_DT
    CUST_NAM
    DMCL_CTRY_COD
    CUST_GFCID
    CUST_GFPID
    ORIG_BR_COD
    SYS_NAM
    DATA_TYP
    STD_INDS_COD
    ACTN_TYP
    EVENT_TYP
    MSG_DT_TM_STMP
    FORMAT_OK_FLG
    MSG_ID
    NEWREC_FLG
    I have tried alot for creating all the possible ways.But it
    satisfy either SELECT or UPDATE at a time.
    Thanks & Regards
    Srinivas Nimishakavi

    Hi, General practice is clustered index would be created by Primary key if one created. That would identify the row ie., no duplicate rows. You can create composite key (combination of more than one column) as primary key.  Other widely used practice
    is to use surrogate key  like identity key which assigned unique number. Please note that you only got one clustered index .
    " Clustered indexes sort and store the data rows in the table or view based on their key values. These are the columns included in the index definition. There can be only one clustered index per table, because the data rows themselves can be sorted in only
    one order. "
    Since you already got quite few non-clustered indexes, you have to rebuild/reorganize once you create clustered index.

  • Creating LOV from 2 different tables

    I tried doing some searches on this, but haven't been able to find an answer. Can I create an LOV (to populate a select list) from two different tables? Both tables have the exact same column names/datatypes, just different data.
    Or if this isn't possible, should I just create a new table, and then do a union query to populate it with the values from both of these tables? Just wondering if anyone's had experience with this situation. Thanks!

    Hmm. That is weird. Wonder why it's not working for me.
    The SORT_ORDER column appears in both tables. I was hoping to be able to sort by the number value that appears in this column in both tables (could duplicate values in this table be causing an issue?).
    I even tried changing it to:
    SELECT DISPLAY_AS d1, CONTENT_KEY v1
    FROM SER_LISTS_JOB_TYPE
    WHERE ACTIVE = 'YES'
    UNION
    SELECT DISPLAY_AS d2, CONTENT_KEY v2
    FROM SER_LISTS_COMPANY_TYPE
    WHERE ACTIVE = 'YES'
    ORDER BY SORT_ORDERBut still get the same error message.
    Message was edited by:
    taneal
    OK. It appears the ORDER BY SORT_ORDER was causing the issue. I took it out and it worked. The only problem is that I have 1 duplicate entry, called "Other" that now appears twice in my LOV. Any thoughts on this? The value of CONTENT_KEY is different, but the value for DISPLAY_AS is the same. Is there anyway to pull out one of these?

Maybe you are looking for