Data filter when migrating Oracle to SQL

How can I use a data filter (via t-sql or ??) when using SSMA to migrate data from Oracle to SQL Server ?

Hi sqlworker,
SQL Server Migration Assistant for Oracle are designed to migrate data from Oracle to SQL Server, we can convert and synchronize the schema of database, the particular category of the schema, and the attributes of objects. However, we can only use data filter
to help you retrieve from a database table by using the WHERE clause to specify search conditions in SQL. According to your description, we need to verify if you just want to migrate some specific data from Oracle to SQL Server, or just use data filter in
SQL Server after migration. You can post more information for analysis.
For more information, you can review the following article.
migrating
data form Oracle to SQL Serve via SSMA.
Filtering Data Retrieved from Database Table in SQL
Regards,
Sofiya Li
Sofiya Li
TechNet Community Support

Similar Messages

  • Matching data types b/w oracle and sql server

    anyone here knows if there is a list of data types supported by both oracle and sql server (regardless of releases & versions?
    an immediate response would be highly appreciated.
    thanks.

    Hi,
    The following post might be of assistance to you:
    http://msdn.microsoft.com/en-us/library/ms151817.aspx
    If this is what you're looking for, then mark the question as answered and closed.
    Regards,
    Naveed.

  • Issue in BI Publisher when migrating oracle report RDF to BI Publisher

    Hi, I am migrating Oracle RDF report to BI Publisher while migrating this report I am facing problem in viewing data as per my report requirement
    I want my department Name should be my HEADER and all projects of department should display under it.
    for that according to me I should get XML data like this
    <dept1>
    <project1></project1>
    <project2></project2>
    <project3></project3>
    </dept1>
    for some nodes I am getting this expected result but for many node it is giving me result like
    <dept2>
    <project1></project1>
    </dept2>
    <dept2>
    <project2></project2>
    </dept2>
    because of this i could not able to see data in required format for some department.
    may be Order by is not working in Q_Expenditure
    Here is my data template
    <dataTemplate dataSourceRef="PTTrng" name="XXPA4049093f" defaultPackage="XXPA4049093f">
    <properties>
    <property name="xml_tag_case" value="upper"/>
    </properties>
    <parameters>
    <parameter name="P_PROJECT" dataType="character" defaultValue="%"/>
    <parameter name="P_PROJECT_ROLLUP" dataType="character"/>
    <parameter name="P_PROJECT_ROLLUP_YEAR" dataType="character"/>
    <parameter name="P_ORDER_BY" dataType="character" defaultValue="1"/>
    <parameter name="P_REMAIN_BALANCE" dataType="number" defaultValue="-9999999999"/>
    <parameter name="P_FUND" dataType="character" defaultValue="%"/>
    </parameters>
    <lexicals>
    </lexicals>
    <dataQuery>
    <sqlStatement name="Q_Expenditure">
    select TRIM(a.NAME)NAME ,upper(a.id2) ID2,a."Project",a.start_date,a.completion_date,a.organization_id,a.origbud, a.budget,a.commitment,a.visa,a.labor,a.remaining_funds,a.board_rollup,a.description,a.class_code,
    a.class_category,a.fund,
    nvl(b.po_oblig_prior_yr,0) po_oblig_prior_yr2,
    nvl(c.ap_prior_yr_oblig,0) ap_prior_yr_oblig2,
    ( nvl(a.remaining_funds,0) + nvl(b.po_oblig_prior_yr,0) + nvl(c.ap_prior_yr_oblig,0) ) Remaining_funds_Order,
    XXPA4049093f.cf_dept_pct_obligformula(:CS_dept_total_costs, :CS_dept_bud) CF_dept_pct_oblig,
    XXPA4049093f.cf_dept_pct_unobligformula(:CS_dept_remain_funds, :CS_dept_bud) CF_dept_pct_unoblig,
    XXPA4049093f.cf_remain_laborformula(:CS_labor_budget, apps.a.LABOR) CF_remain_labor,
    XXPA4049093f.cf_nonlabor_budgetformula(apps.a.BUDGET, :CS_labor_budget) CF_nonlabor_budget,
    XXPA4049093f.cf_nonlabor_costsformula(apps.a.VISA, apps.a.COMMITMENT, nvl ( b.po_oblig_prior_yr , 0 ), nvl ( c.ap_prior_yr_oblig , 0 )) CF_nonlabor_costs,
    XXPA4049093f.cf_remain_nonlaborformula(XXPA4049093f.cf_nonlabor_budgetformula(apps.a.BUDGET, :CS_labor_budget) ,XXPA4049093f.cf_nonlabor_costsformula(apps.a.VISA, apps.a.COMMITMENT, nvl ( b.po_oblig_prior_yr , 0 ), nvl ( c.ap_prior_yr_oblig , 0 )) ) CF_remain_nonlabor,
    XXPA4049093f.cf_total_costsformula(apps.a.LABOR,XXPA4049093f.cf_nonlabor_costsformula(apps.a.VISA, apps.a.COMMITMENT, nvl ( b.po_oblig_prior_yr , 0 ), nvl ( c.ap_prior_yr_oblig , 0 )) ) CF_total_costs,
    XXPA4049093f.cf_remain_fundsformula(apps.a.BUDGET,XXPA4049093f.cf_total_costsformula(apps.a.LABOR,XXPA4049093f.cf_nonlabor_costsformula(apps.a.VISA, apps.a.COMMITMENT, nvl ( b.po_oblig_prior_yr , 0 ), nvl ( c.ap_prior_yr_oblig , 0 )) ) ) CF_remain_funds,
    XXPA4049093f.cf_proj_pct_obligformula(XXPA4049093f.cf_total_costsformula(apps.a.LABOR,XXPA4049093f.cf_nonlabor_costsformula(apps.a.VISA, apps.a.COMMITMENT, nvl ( b.po_oblig_prior_yr , 0 ), nvl ( c.ap_prior_yr_oblig , 0 )) ) , apps.a.BUDGET) CF_proj_pct_oblig,
    XXPA4049093f.cf_proj_pct_unobligformula(XXPA4049093f.cf_remain_fundsformula(apps.a.BUDGET,XXPA4049093f.cf_total_costsformula(apps.a.LABOR,XXPA4049093f.cf_nonlabor_costsformula(apps.a.VISA, apps.a.COMMITMENT, nvl ( b.po_oblig_prior_yr , 0 ), nvl ( c.ap_prior_yr_oblig , 0 )) ) ) , apps.a.BUDGET) CF_proj_pct_unoblig
    from apps.xxpa_project_status_fund_cy_2 a, xxpa_prior_yr_oblig2_cy b, xxpa_ap_prior_yr_oblig2_cy c
    where
    a.class_category = :P_Project_Rollup
    and a.class_code = :P_Project_Rollup_Year
    and a.id2 like upper(:P_Project)
    and a.remaining_funds >= :P_remain_balance
    and a.id2 = b.id2
    and a.id2 = c.id2
    and a.class_code = b.class_code
    and a.class_code = c.class_code
    and a.fund like :P_Fund
    order by 1
    </sqlStatement><sqlStatement name="Q_1">
    select upper(f.class_code) ID2, sum(d.labor_budget) Labor_budget
    from apps.xxpa_labor_budget_v2006 d,
    pa.pa_project_classes e,
    pa.pa_class_codes f,
    ( select *
    from pa_project_classes
    where class_category = 'Fiscal Year'
    and substr(class_code,-4,4) =
    (select ( segment5 )
    from FINANCIALS_SYSTEM_PARAMS_ALL a, gl_code_combinations b
    where set_of_books_id = 2
    and a.accts_pay_code_combination_id = b.code_combination_id)
    ) ppc
    where d.project_id = e.project_id
    and e.class_category = f.class_category
    and e.class_code = f.class_code
    and e.class_category = 'Project Rollups'
    and d.project_id = ppc.project_id
    and d.project_id in (select project_id
    from pa.pa_project_classes a, xxpa_project_rollups_org b
    where a.class_category = 'Project Rollups'
    and a.class_code = b.class_code
    and b.org_count <= 1)
    and upper ( id2 )like upper(:P_Project)
    group by upper(f.class_code)
    </sqlStatement>
    <link name="Q_LINK" parentQuery="Q_Expenditure" parentColumn="ID2" childQuery="Q_1" childColumn="ID2" condition="="/>
    </dataQuery>
    <dataTrigger name="afterParameterFormTrigger" source="XXPA4049093f.afterpform"/>
    <dataTrigger name="beforeReportTrigger" source="XXPA4049093f.beforereport"/>
    <dataStructure>
    <group name="G_NAME1" dataType="varchar2" source="Q_Expenditure">
    <element name="NAME" dataType="varchar2" value="NAME"/>
    <element name="CS_dept_orig_bud" function="sum" dataType="number" value="G_segment1.ORIGBUD"/>
    <element name="CS_dept_bud" function="sum" dataType="number" value="G_segment1.BUDGET"/>
    <element name="CS_dept_labor_bud" function="sum" dataType="number" value="G_segment1.CS_labor_budget"/>
    <element name="CS_dept_labor" function="sum" dataType="number" value="G_segment1.LABOR"/>
    <element name="CS_dept_labor_remain" function="sum" dataType="number" value="G_segment1.CF_remain_labor"/>
    <element name="CS_dept_nonlabor_bud" function="sum" dataType="number" value="G_segment1.CF_nonlabor_budget"/>
    <element name="CS_dept_nonlabor_costs" function="sum" dataType="number" value="G_segment1.CF_nonlabor_costs"/>
    <element name="CS_dept_nonlabor_remain" function="sum" dataType="number" value="G_segment1.CF_remain_nonlabor"/>
    <element name="CS_dept_total_costs" function="sum" dataType="number" value="G_segment1.CF_total_costs"/>
    <element name="CS_dept_remain_funds" function="sum" dataType="number" value="G_segment1.CF_remain_funds"/>
    <element name="CF_dept_pct_oblig" dataType="number" value="CF_dept_pct_oblig"/>
    <element name="CF_dept_pct_unoblig" dataType="number" value="CF_dept_pct_unoblig"/>
    <group name="G_segment1" dataType="varchar2" source="Q_Expenditure">
    <element name="FUND" dataType="varchar2" value="FUND"/>
    <element name="po_oblig_prior_yr2" dataType="number" value="PO_OBLIG_PRIOR_YR2"/>
    <element name="ap_prior_yr_oblig2" dataType="number" value="AP_PRIOR_YR_OBLIG2"/>
    <element name="Remaining_funds_Order" dataType="number" value="REMAINING_FUNDS_ORDER"/>
    <element name="Project" dataType="varchar2" value="Project"/>
    <element name="ORIGBUD" dataType="number" value="ORIGBUD"/>
    <element name="BUDGET" dataType="number" value="BUDGET"/>
    <element name="COMMITMENT" dataType="number" value="COMMITMENT"/>
    <element name="LABOR" dataType="number" value="LABOR"/>
    <element name="CLASS_CODE" dataType="varchar2" value="CLASS_CODE"/>
    <element name="CLASS_CATEGORY" dataType="varchar2" value="CLASS_CATEGORY"/>
    <element name="REMAINING_FUNDS" dataType="number" value="REMAINING_FUNDS"/>
    <element name="ID2" dataType="varchar2" value="ID2"/>
    <element name="START_DATE" dataType="date" value="START_DATE"/>
    <element name="COMPLETION_DATE" dataType="date" value="COMPLETION_DATE"/>
    <element name="ORGANIZATION_ID" dataType="number" value="ORGANIZATION_ID"/>
    <element name="VISA" dataType="number" value="VISA"/>
    <element name="BOARD_ROLLUP" dataType="varchar2" value="BOARD_ROLLUP"/>
    <element name="DESCRIPTION" dataType="varchar2" value="DESCRIPTION"/>
    <element name="CS_labor_budget" function="sum" dataType="number" value="G_1.LABOR_BUDGET"/>
    <element name="CF_remain_labor" dataType="number" value="CF_remain_labor"/>
    <element name="CF_nonlabor_budget" dataType="number" value="CF_nonlabor_budget"/>
    <element name="CF_nonlabor_costs" dataType="number" value="CF_nonlabor_costs"/>
    <element name="CF_remain_nonlabor" dataType="number" value="CF_remain_nonlabor"/>
    <element name="CF_total_costs" dataType="number" value="CF_total_costs"/>
    <element name="CF_remain_funds" dataType="number" value="CF_remain_funds"/>
    <element name="CF_proj_pct_oblig" dataType="number" value="CF_proj_pct_oblig"/>
    <element name="CF_proj_pct_unoblig" dataType="number" value="CF_proj_pct_unoblig"/>
    <group name="G_1" dataType="varchar2" source="Q_1">
    <element name="LABOR_BUDGET" dataType="number" value="LABOR_BUDGET"/>
    <element name="ID2" dataType="varchar2" value="ID2"/>
    </group>
    </group>
    </group>
    <element name="CS_ORIG_BUDGET" function="sum" dataType="number" value="G_segment1.ORIGBUD"/>
    <element name="CS_APPROVED_BUDGET" function="sum" dataType="number" value="G_segment1.BUDGET"/>
    <element name="CS_LABOR_BUDGET_TOTAL" function="sum" dataType="number" value="G_segment1.CS_labor_budget"/>
    <element name="CS_LABOR_COSTS" function="sum" dataType="number" value="G_segment1.LABOR"/>
    <element name="CS_REMAIN_LABOR" function="sum" dataType="number" value="G_segment1.CF_remain_labor"/>
    <element name="CS_NONLABOR_BUDGET" function="sum" dataType="number" value="G_segment1.CF_nonlabor_budget"/>
    <element name="CS_NONLABOR_COSTS" function="sum" dataType="number" value="G_segment1.CF_nonlabor_costs"/>
    <element name="CS_REMAINING_NONLABOR" function="sum" dataType="number" value="G_segment1.CF_remain_nonlabor"/>
    <element name="CF_pct_oblig" dataType="number" value="XXPA4049093f.cf_pct_obligformula(:CS_TOTAL_COSTS, :CS_APPROVED_BUDGET)"/>
    <element name="CS_TOTAL_COSTS" function="sum" dataType="number" value="G_segment1.CF_total_costs"/>
    <element name="CS_REMAIN_FUNDS" function="sum" dataType="number" value="G_segment1.CF_remain_funds"/>
    <element name="CF_PCT_UNOBLIG" dataType="number" value="XXPA4049093f.cf_pct_unobligformula(:CS_REMAIN_FUNDS, :CS_APPROVED_BUDGET)"/>
    <element name="rp_order_by" dataType="varchar2" value="XXPA4049093f.rp_order_by_p"/>
    </dataStructure>
    </dataTemplate>

    I had to go to my data template and move my groups around.
    Copy Data Template into something like Wordpad, so you can see the hierarchy and cut and paste your groups. Watch your indentions.

  • Migration Oracle to SQL Server

    Hello folks
    I´m planning database migrate from oracle to sql server 2005
    I have windows 2003 server 32bits, R3 4.72 and Oracle 9i, i want to change just database software (oracle to sql)
    Do you have any idea to do this?
    I was thinking use the installation master to do the export database and later instal sql server and import the database via installation master too but im not sure if a will get errors or something like that
    Thanks

    I´m planning database migrate from oracle to sql server 2005
    I have windows 2003 server 32bits, R3 4.72 and Oracle 9i, i want to change just database software (oracle to sql)
    Do you have any idea to do this?
    Heterogeneous migrations must be done by a certified migration consultant, otherwise you will loose support for the migration itself and for the target system. See http://service.sap.com/osdbmigration
    I was thinking use the installation master to do the export database and later instal sql server and import the database via installation master too but im not sure if a will get errors or something like that
    Basically you're right - but there are a few things for source and target system to consider; using just the tools and kernels from the installation DVD is likely to fail since they are too old and must be replaced during the migration with newer tools.
    BTW: there's a separate forum for migrations:
    Markus

  • Failed to disable contraints: Data Move when migrating data

    Get one "Failed to disable constraints: Data Move" error for each table that i try to migrate data for. Using 1.1.3.2766.
    * no other errors
    * no error detail available
    * no explanation given by sql-developer as to cause of problem.
    I'm wondering whether this is occuring because the migration process fails to migrate the primary keys and the constraints in the first place. Is it trying to disable something that it failed to create ?

    I am having the same problem.
    Version 1.2.1
    Build MAIN-32.13
    Oracle version: 10.2.0.3.0 - 64bit (on Solaris 5.10)
    Windows platform: XP Version 2002 Service Pack 2
    Is there any update on when this will be fixed, or are there workarounds?
    I have 2 (out of 1171) tables that are affected, and in both cases the first two rows are loaded and then it just stops. No errors in the errors column and the only thing in the log is Failed to disable constraints.
    Message was edited by:
    user591088

  • How to consolidate data files using data pump when migrating 10g to 11g?

    We have one 10.2.0.4 database to be migrated to a new box running 11.2.0.1. The 10g database has too many data files scattered within too many file systems. I'd like to consolidate the data files into one or two large chunk in one file systems. Both OSs are RHEL 5. How should I do that using Data Pump Export/Import? I knew there is "Remap" option could be used, but it's only one to one mapping. How can I map multiple old data files into one new data file?

    hi
    datapump is terribly slow, make sure you have as much memory as possible allocated for Oracle but the bottleneck can be I/O throughput.
    Use PARALLEL option, set also these ones:
    * DISK_ASYNCH_IO=TRUE
    * DB_BLOCK_CHECKING=FALSE
    * DB_BLOCK_CHECKSUM=FALSE
    set high enough to allow for maximum parallelism:
    * PROCESSES
    * SESSIONS
    * PARALLEL_MAX_SERVERS
    more:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28319/dp_perf.htm
    that's it, patience welcome ;-)
    P.S.
    For maximum throughput, do not set PARALLEL to much more than twice the number of CPUs (two workers for each CPU).
    Edited by: g777 on 2011-02-02 09:53
    P.S.2
    breaking news ;-)
    I am playing now with storage performance and I turned the option of disk cache (also called write-back cache) to ON (goes at least along with RAID0 and 5 and setting it you don't lose any data on that volume) - and it gave me 1,5 to 2 times speed-up!
    Some says there's a risk of lose of more data when outage happens, but there's always such a risk even though you can lose less. Anyway if you can afford it (and with import it's OK, as it ss not a production at that moment) - I recommend to try. Takes 15 minutes, but you can gain 2,5 hours out of 10 of normal importing.
    Edited by: g777 on 2011-02-02 14:52

  • Problem saving data model when using Oracle DB Pivot feature

    I have problem saving a data model - SQL Query that uses the Oracle DB PIVOT feature?
    When I hit save, nothing happends.... have also tried "save as" - nothing is saved
    No error message is shown.
    Is Oracle DB PIVOT not supported by OBIEE?
    The SQL that is causing the problem is this one:
    SELECT * FROM
    SELECT field_name as field,
    CASE
    WHEN col_1 = 'A' THEN 'Name 1'
    WHEN col_1 like 'B_%' THEN 'Name 2'
    END
    as gastype,
    energy
    FROM table_1
    WHERE code = 'K'
    AND trunc(DAYTIME,'YYYY') = trunc(to_date('2012-01-01 00:00:00','YYYY-MM-DD HH24:MI:SS'), 'YYYY')
    AND (col_1 in ('A') or col_1 like 'B_%')
    PIVOT (sum(energy) for (gastype) in ('Name 1' as Name1, 'Name 2' as Name2))
    order by field
    We are using OBIEE 11.1.1.6.7 (Win 2008R2) against Oracle DB 11.2.0.3

    Just a wild guess .. Have you done dbsetup after installing IAS and said you are going to said databases ?

  • Error with date field when inserting records into sql server from webdynpro

    Dear SDN's,
    I am trying to insert the records into sql server through my webDynpro program.
    I have created a date field in a dictionary with the datatype date.
    In my webdynpro program to insert the date i am following the below format.
    String dateString = "2006/12/10";
          java.util.Date d=new java.util.Date(dateString);
          java.sql.Date <b>date</b> = new java.sql.Date(d.getTime());
    int i=stmt.executeUpdate("INSERT INTO TRAVEL_HEADER(TRQID,PROJECTID,<b>REQDT</b>,ADVCE,ETADV,PURTR) values(21, '555-1212', '" + <b>date</b> + "', 5000, '20060501','hi')");
    when i try to execute it, it gives the following error.
    <b>com.sap.sql.log.OpenSQLException: The SQL statement "INSERT INTO "TRAVEL_HEADER" ("TRQID","PROJECTID","REQDT","ADVCE","ETADV","PURTR") VALUES (21,'555-1212','2006-12-10',5000,'20060501','hi')" contains the semantics error[s]: - type check error: new value (element number 3 (CHAR)) is not assignable to column  >>REQDT<< (DATE)</b>
    Please correct me.
    Your help will be appreciated.
    Regards,
    Sireesha.B

    Hi,
    int i=stmt.executeUpdate("INSERT INTO TRAVEL_HEADER(TRQID,PROJECTID,REQDT,ADVCE,ETADV,PURTR) values(21, '555-1212', 'date', 5000, '20060501','hi')");
    try like this.
    I Think in SQL the general format to take date as input like this.
    INSERT INTO X VALUES ('10/30/56')
    thaks,
    Lohi.

  • Find data same kind in Oracle dBase SQL

    Hello all
    I'm working on a project were i need to find data that are cross referencing in between them (Redundant data).
    I explain:
    I have this SQL that i use all the time to extract trailer per carrier ID:
    SELECT NULL,
         NULL,
         TRC.TL_RESOURCE_ID,
         TRC.CARRIER_ID,
         TRC.PERIOD,
         TRC.MAX_LOADS,
         TRC.CONTRACT_MAX_TEAMS,
         TRC.CURRENT_MAX_TEAMS,
         TRC.PERCENT_COMMIT,
         L.NAME,
         R.NAME AS REGION_NAME,
         RD.KEY_NUM,
         RD.LOW_KEY_VALUE,
         RD.HIGH_KEY_VALUE,
         R1.NAME AS REGION_NAME_1,
         RD1.KEY_NUM,
         RD1.LOW_KEY_VALUE,
         RD1.HIGH_KEY_VALUE,
         NULL,
         NULL,
         TRT.TRLR_TYPE_ID,
         to_char(TRT.EFFECTIVE, 'yyyymmdd'),
         TRT.CONTRACT_NUM_VEHICLES,
         TRT.CURRENT_NUM_VEHICLES
    FROM TL_RESOURCE_CARRIER TRC,
         TL_RESOURCE_TRLR TRT,
         LANE L,
         REGION R,
         REGION R1,
         REGION_DETAIL RD,
         REGION_DETAIL RD1
    WHERE TRC.TL_RESOURCE_ID = TRT.TL_RESOURCE_ID
         AND R.ID = RD.REGION_ID
         AND R1.ID = RD1.REGION_ID
         AND TRC.LANE_ID = TRT.LANE_ID
         AND TRC.CARRIER_ID = TRT.CARRIER_ID
         AND L.ID = TRC.LANE_ID
         AND L.ID = TRT.LANE_ID
         AND L.FROM_REGION_ID = RD.REGION_ID
         AND L.TO_REGION_ID = RD1.REGION_ID
         AND TRC.CARRIER_ID = 'UPS';What we see in these fields bellow are Location ID or Postal Code or States value from an origin to a destination:
    RD.LOW_KEY_VALUE, (Origin)
    RD1.LOW_KEY_VALUE, (Destination)
    Ex:
    H7S 2B9 (Postal code)
    QC (State) etc...
    In these 2 fields bellow, i have keys that link to a specific type of data:
    RD.KEY_NUM,
    RD1.KEY_NUM,
    Ex:
    4 (State)
    8 (Postal code) etc...
    In TRC.CARRIER_ID field, i will have the Carrier ID ex: UPS
    Now here comes my problem:
    I have to link this to the location table to validate for example the postal code is in what state for example.
    4 IN (RD.KEY_NUM) AND (EXISTS (SELECT STATE FROM LOCATION WHERE STATE IN (RD.LOW_KEY_VALUE))
    8 IN (RD.KEY_NUM) AND (EXISTS (SELECT ZIP FROM LOCATION WHERE ZIP IN (RD.LOW_KEY_VALUE, ))If i have UPS carrier ID set from origin postal 7 : H7S 2B9 to Destination postal 7 : G0L 2K0
    and also UPS carrier set from origin postal 7 : H7S 2B9 to Destination State : QC
    Since we have the same carrier, and the same origin postal 7 and that the destination postal 7 equal the destination state from the second record, i need to see that i have these 2 lanes that are overlapping.
    I'm trying to extract all duplicated data like this.
    I know this is kind of a big thing but it can be done in multiple set of you want.
    I just need to start from the beginning.
    Can you please help me?
    Thanks again
    Edited by: 974487 on Dec 2, 2012 2:22 PM

    Hello all
    sorry for the big delay.
    I was working on the SQL;
    I have now this error:
    ORA-01427: single-row subquery returns more than one row
    On this part of the code:
    ( select distinct carrier_id, low_key_value, (select state from location would you know what it is?
    Thanks again
    Full code
    with S1   -- with constuction enables to use selected data twice
    AS
    SELECT NULL,
          NULL,
          TRC.TL_RESOURCE_ID,
          TRC.CARRIER_ID,
          TRC.PERIOD,
          TRC.MAX_LOADS,
          TRC.CONTRACT_MAX_TEAMS,
          TRC.CURRENT_MAX_TEAMS,
          TRC.PERCENT_COMMIT,
          L.NAME,
          R.NAME AS REGION_NAME,
          RD.KEY_NUM,
          RD.LOW_KEY_VALUE,
          RD.HIGH_KEY_VALUE,
          R1.NAME AS REGION_NAME_1,
          RD1.KEY_NUM,
          RD1.LOW_KEY_VALUE as LOW_KEY_VALUE_1,            -- as added
          RD1.HIGH_KEY_VALUE as HIGH_KEY_VALUE_1,          -- as added
          NULL,
          NULL,
          TRT.TRLR_TYPE_ID,
          to_char(TRT.EFFECTIVE, 'yyyymmdd'),
          TRT.CONTRACT_NUM_VEHICLES,
          TRT.CURRENT_NUM_VEHICLES
    FROM TL_RESOURCE_CARRIER TRC,
          TL_RESOURCE_TRLR TRT,
          LANE L,
          REGION R,
          REGION R1,
          REGION_DETAIL RD,
          REGION_DETAIL RD1
    WHERE TRC.TL_RESOURCE_ID = TRT.TL_RESOURCE_ID
          AND R.ID = RD.REGION_ID
          AND R1.ID = RD1.REGION_ID
          AND TRC.LANE_ID = TRT.LANE_ID
          AND TRC.CARRIER_ID = TRT.CARRIER_ID
          AND L.ID = TRC.LANE_ID
          AND L.ID = TRT.LANE_ID
          AND L.FROM_REGION_ID = RD.REGION_ID
          AND L.TO_REGION_ID = RD1.REGION_ID
    select s2.*
    from
    select carrier_id, low_key_value, low_key_1_state 
    from
    ( select distinct carrier_id, low_key_value, (select state from location
      where zip = s1.LOW_KEY_VALUE_1
             or city =  s1.LOW_KEY_VALUE_1
             or state = s1.LOW_KEY_VALUE_1
      and rownum = 1   -- because there are more rows with same city or same state
      )  low_key_1_state,  low_key_value_1
    from s1
    group by carrier_id, low_key_value, low_key_1_state
    having count(*) > 1 -- select duplicates
    )       s2

  • Porting Forms/Reports when migrating Oracle 9i DB from AIX 5.2 to AIX 5.3

    Hi,
    Looking for advice on how to port Oracle Forms/Reports modules when moving our Oracle 9i database from AIX 5.2 to AIX 5.3 platform. Details are as below:
    Oracle Forms and Reports v6i (There is no version upgrade in Forms & Reports)
    Database is Oracle 9i (No upgrade in database)
    There is upgrade in hardware only : from AIX 5.2 to AIX 5.3
    The application is having some 8000 forms/reports modules
    Do we need to recompile the forms/reports after porting the 9i database to AIX 5.3 ?
    Any direction would be appreciated .. Thanks !!
    Regards,
    Himansu

    Hi,
    Thanks for the response, we are going to recompile the Forms/Reports in the new environemnt.
    Just wondering how much time it may take to recompile all the 8000 odd forms/reports modules.. ? Will 10 seconds per form/report module be safe enough for the compilation ? Because in a batch file every time it is going to connect to the database while compiling a module, I am assumming it may take some 5 seconds to 10 seconds for the compilation. Thanks for the help again.
    Rgds,
    Himansu

  • How to migrate Oracle to SQL Server

    Hi Guys,
    We are maintaining .sql files for the base tables.Like we have a sequel file region.sql which contains the insert statements for the region table .Like we have around 389 no of tables and 389 corrsponding .sql files and these sequel files are specific to oracle only.Now we have to do the same thing for the sequel server.Can any body tell me how to achive this with minimal effort.Any siggestions are welcome and appreciated.
    I know this is oracle forum , I should not post this still I am doing this because I think this is the best forum to get the ideas
    Thanks,
    Prafulla

    Hi;
    Please see this
    Regard
    Helios

  • Oracle to SQL 2012 migrataion

    Hi,
    I am planning to migrate Oracle 11g to SQL Server 2012. I want to estimate the Sizing requirement based upon actual usage. please let me know how I can get usage data from Oracle which I can use to size SQL Server Servers.
    Thanks
    Ashu

    Hi,
    I am actually looking for template than guidelines.  For migration from Oracle to SQL, I need to size the new hardware which should take equal load. What all parameters I can consider for Oracle in RAC which can be used to arrive at Cores and RAM requirement.
    Thanks
    Ashwani
    Sizing a hardware would actually require you to first migrate Oracle to SQL server and then do a load test to check its capability. If you are asking about space used that would be almost equal ,if you are asking about database growth then again you need
    to analyze database and its traces to find how much actually database is growing. In my case space required was almost same for the databases.
    Did you tried SSMS ( SQL server migration assistance )
    http://technet.microsoft.com/en-us/library/hh313179.aspx
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers
    My TechNet Wiki Articles

  • XSU error oracle.xml.sql.OracleXMLSQLException: Conversion to String failed

    Appication Server: 10g, Database: Oracle 9i and Oracle 10g
    I have a table 'sw_icd2' in the database that has one column of XMLType.
    The code below, attempts to query this table as 'select * from sw_icd2' and display the result. I was able to execute this query in sqlplus.
    But when I run a program using XSU in JDeveloper:
    OracleXMLQuery qry = new OracleXMLQuery(conn, "select * from sw_icd2");
    XMLDocument domDoc = (XMLDocument)qry.getXMLDOM();
    domDoc.print(System.out);
    StringWriter s = new StringWriter(10000);
    domDoc.print(new PrintWriter(s));
    System.out.println(s.toString());
    qry.close();
    I get the following Error:
    "oracle.xml.sql.OracleXMLSQLException: Conversion to String failed"
    Any ideas on how I can resolve this issue? Your help would be appreciated.
    Thanks!

    Okay, it looks like the problem has something to do with the TIMESTAMP data type in tables.
    oracle.xml.sql.query.OracleXMLQuery can't seem to handle tables with the TIMESTAMP data type.
    this code ran fine on my machine :
    import oracle.jdbc.driver.*;
    import oracle.xml.sql.query.OracleXMLQuery;
    import java.lang.*;
    import java.sql.*;
    public class testXMLSQL {
         public static void main(String[] args) {
    try {
    // Create the connection
    System.out.println("before getConnection ");
    Connection conn = getConnection("scott","tiger");
    System.out.println("after getConnection ");
    // Create the query class
    OracleXMLQuery qry = new OracleXMLQuery(conn, "SELECT * FROM EMP");
    System.out.println("after OracleXMLQuery object created ");
    // Get the XML string
    String str = qry.getXMLString();
    // Print the XML output
    System.out.println("The XML output is:\n"+str);
    // Always close the query to get rid of any resources..
    qry.close();
    } catch(SQLException e) {
    System.out.println(e.toString());
    // Get the connection given the user name and password.!
    private static Connection getConnection(String username,
    String password)
    throws SQLException
    // register the JDBC driver..
    DriverManager.registerDriver(new
    oracle.jdbc.driver.OracleDriver());
    // Create the connection using the OCI8 driver
    Connection conn =
    DriverManager.getConnection(
    "jdbc:oracle:thin:@<server_name>:1521:<sid>",
    username,password);
    return conn;
    Then I created another table :
    create table emp_test as select * from emp;
    added a timestamp to it :
    alter table emp_test add (time timestamp(6));
    and filled it with timestamp information :
    update emp_test set time = timestamp'2005-09-22 09:26:50.124';
    ran the same code but changed the SQL to :
    "SELECT * FROM EMP_TEST"
    and got the error message :
    The XML output is:
    <?xml version = '1.0'?>
    <ERROR>oracle.xml.sql.OracleXMLSQLException: Conversion to String failed</ERROR>
    looks like bug in OracleXMLQuery object??

  • Migrating from Oracle to SQL Server - data won't migrate but no errors

    I'm attempting to migrate a database from an Oracle 11g (11.1.0.7.0 64-bit) database to a SQL Server 2008 R2 (10.50.4033.0).  I'm using SSMA, and the Oracle tool was installed on the target SQL Server by the DBA.  I've completed all the steps up
    to and including synchronizing the database, and the empty tables all exist in SQL Server.  When I run the step to migrate the data, I get:
    Migrating data...
    Analyzing metadata...
    Preparing table POLICYS.LOGINS...
    Preparing data migration package...
    Starting data migration Engine
    Starting data migration...
    Data migration operation has finished.
        0 table(s) successfully migrated.
        0 table(s) partially migrated.
        1 table(s) failed to migrate.
    Then a summary box appears, and there is a red X next to the table (I'm trying to just convert 1 small table to begin with.)  What immediately appears to be wrong is that the "To" table is blank.
    I've attempted this multiple times, different tables (initially tried all tables) and tried both Server Side and Client Side migrations with the same result.  There are no errors or warnings on the Error List.
    I've found another online post where the user had the same issue, but in that instance they fixed it by changing the case of the table name. I tried that, but it didn't help.  I'm not sure what is wrong that it won't migrate any data.  Any help
    is appreciated.  TIA
    -George

    Hello,
    Please review the migration process steps from the following tutorial:
    http://blogs.msdn.com/b/ssma/archive/2010/08/27/migrating-oracle-s-sample-hr-schema.aspx
    You can also get help writing an email to
    [email protected] 
    For more information, please read the following article:
    http://msdn.microsoft.com/en-us/library/hh313173(v=sql.110).aspx
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Error when using Oracle Migration WorkBench (Sql Server 2k to Oracle 8i)

    I'm trying to migrate a Sql Server 2k database to an Oracle 8i schema using OMWB. After using BCP to collect metadata information on the source database, I tried to capture the source data model and got a "Capture aborted" message on the progress screen (even though then it appears a dialog window reporting "0 errors and 0 warnings", funny!). Down there is the error log OMWB generated. After reading some posts, I changed some columns of the OMWB dictionary that holds the source database name, but still got the same error. If someone can enlighten me on this toppic, I'd greatly appreciated it.
    Here's the error log of OMWB:
    ** Oracle Migration Workbench
    ** Production
    ** ( Build 20050629 )
    ** OMWB_HOME: D:\Datos\Download\Oracle\Oracle Migration Workbench\omwb
    ** user language: es
    ** user region: null
    ** user timezone:
    ** file encoding: Cp1252
    ** java version: 1.4.2_04
    ** java vendor: Sun Microsystems Inc.
    ** o.s. arch: x86
    ** o.s. name: Windows 2000
    ** o.s. version: 5.0
    ** Classpath:
    ..\lib\boot.jar
    ** Started : Fri Feb 23 17:18:48 GMT-03:00 2007
    ** Workbench Repository : Oracle8i Enterprise Edition Release 8.1.6.0.0 - Production
    With the Partitioning option
    JServer Release 8.1.6.0.0 - Production
    Repository Connection URL: jdbc:oracle:thin:@ServerCms:1521:sigcewbc
    ** The following plugins are installed:
    ** Microsoft Access 2.0/95/97/2000/2002/2003 Plugin, Production Release 10.1.0.4.0
    ** Microsoft SQLServer 2000 Plugin, Production Release 10.1.0.4.0
    ** Microsoft SQLServer 6.5 Plugin, Production Release 10.1.0.4.0
    ** Microsoft SQLServer 7.0 Plugin, Production Release 10.1.0.4.0
    ** Active Plugin : SQLServer2K
    EXCEPTION :SQLServer2KDisconnSourceModelLoad.loadSourceModel(): oracle.mtg.migration.MigrationStopException: java.lang.IndexOutOfBoundsException: Index: 15, Size: 15
    ** Shutdown : Fri Feb 23 18:00:50 GMT-03:00 2007

    Duplicate thread
    Error when using Oracle Migration WorkBench (Sql Server 2k to Oracle 8i)

Maybe you are looking for