QueryTimeOut

Hello,
i'm using OCI version 8.1.5 for interfacing a C++ program to database server, executing queries and retrieving output datasets.
i'd like to manage the maximum execution time of a query when i invoke the OCIStmtExecute function.
Is there a way to do it?
Thank in advance
null

Assuming that you've installed the most recent 8.1.5 Oracle client patchkits, the only way I'm aware to do this is to use OCIBreak to kill the call if it takes too long.
Justin

Similar Messages

  • 500 Internal server error while running sqlsrv_query in PHP

    Hello everyone I am having a problem with sqlsrv_query I will be grateful to you please provide some help.
    I am running a query through php:
    $ls_parcel_query = "select  * from  ParcelDetail order by ExtractDate";
    $result = sqlsrv_query($conn, $ls_parcel_query, array(), array("Scrollable"=>"keyset","QueryTimeout"=>300));
    $no_of_rows = sqlsrv_num_rows($result);
    echo "<br/>".$no_of_rows;
    It gives (After 30 seconds):
    500 - Internal server error.
    There is a problem with the resource you are looking for, and it cannot be displayed.
    I have php.ini settings like below:
    max_execution_time = 90
    memory_limit = 128M
    While running this query in SQL SERVER 2008 R2, it successfully gives result in some times in 1 minute and sometimes in 2 minutes.

    Hello,
    A 500 Error will be caused due to many reason.To troubleshooting this issue, you can try to check out the error log and get more information on what is causing the error.
    Reference :
    "500 Internal Server Error" while running PHP
    HTTP Error 500 Internal server for php pages and solution
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • SSRS Timeout issue

    I am using SSRS for generate reports in my .net web application. For one of the report, an error "An error has occurred during report processing." is returned after 100s. The report can be generated successfully in report server
    at around 3 minutes. So, I believed it is caused by timeout issue in one of the processes. However, i have verified the timeout settings but still got no ideas on how to fix it.
    My code is a bit complicated since the connection type of my report's data source is an customized dll. In the dll, i will call an webservice to get data. Below is summary for the flow:
    UI -> Reporting Service -> Customized Dll -> Web service -> SQL/Stored Procedures
    The execution timeount in the web.config of both the reporting service and web service are set to 9000s (<httpRuntime executionTimeout = "9000" />). And coding about timeout of the service is set to 3000s (i.e. ReportingService rs = new ReportingService();
    rs.timeout = 3000000;). In the execution properties of the report, Report Execution Time is set to "Do not timeout report execution" currently.
    I think there is no problem for the customized dll and the web service it calls since it can be generated in report server direclty. But I have no idea about where the timeout occurs. Please kindly help.
    Thanks,
    Shirley

    Hi Shirley,
    According to your description, you encountered time out issue when rendering your report in your web application. Right?
    In Reporting Services, we have report execution timeout value and query timeout value for processing report and dataset. In this scenario, you have already set the report executionTimeout and "Do not timeout report execution" on report level. Since
    this time issue only happens on specific report, it probably cause by processing large amount of data which exceeds the max query timeout. Please go to rsreportserver.config file and change the QueryTimeOut into "0". This file locates at
    xx:\Program Files\Microsoft SQL Server\MSRS12.MSSQLSERVER\Reporting Services\ReportServer
    <Add Key="DatabaseQueryTimeout" Value="0"/>
    Reference:
    Setting Time-out Values for Report and Shared Dataset Processing (SSRS)
    Troubleshooting Timeout errors in Reporting Services
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • OutOfMemory error while executing sql query

    Hello!
    My program gets multiple datas from database in every ten minutes, and stores them in memory for hundreds of users, requesting datas via web-interface simoultaneously.
    I dont have access to change database structures, write stored procedures, etc, just read from db.
    There is a table in database with lot of million rows, and sometimes when I try to execute a SELECT on this table it takes minutes to get back the result.
    To avoid waiting for database server for a long time, I set querytimeout to 30 seconds.
    If the server throws back the execution with Query Timed out Exception, I want to 'forget' this data, and 0 value is acceptable because of fast run is more important. So I put the boolean broken variable to check if there is any problem with db server.
    The size of the used memory is about 150Mb if things going well, but I set the max heap to 512 MB, just in case anything happens.
    I'm logging all threads stacktrace, and free/used/allocated memory size in every 5 seconds.(threadwatching.log) 2.appendix
    Sometimes, not in every case (I dont know what is this depends on), when I get the next phase of refreshing cached datas (you can see it below), the process reaches the fiorst checkpoint (signed in code below), starts to execute the sql query, and never reaches the second checkpoint , but used memory growing 50-60 Mb-os in every 5 seconds, as I can see in threadwatching.log until it reaches the max memory and throws OutOfMemory error: java heap space.
    I'm using DbConnectionBroker for connection pooling, SQLCommandBean for handling Statements, PreparedStatements, etc, and jTDS jdbc connector.
    SQLCommandBean closes statements, resultsets, so these objects doesnt stays open.
    I cant figured out what causes the memory leak, if someone have an idea, please help me.
    1. Part of the cached data refreshing (DataFactory.createPCVPPMforSiemens()):
            PCVElement element = new PCVElement(m, ProcessControlView.PPM);
            String s = DateTime.getDate(interval.getStartDate());
            boolean broken=false;
            int value = 0;
            for (int j = 0; j < 48; j++) {
                try {
                    if (!broken) {
                        d1 = DateTime.getDate(new Date(start + ((j + 1) * 600000)));
                        sqlBean = new SQLCommandBean();
                        conn = broker.getConnection();
                        sqlBean.setConnection(conn);
                        sqlBean.setQueryTimeOut(30);
                        System.out.println(DateTime.getDate(new Date())+" "+m.getName()+"   "+j);// first checkpoint
                        value = SiemensWorks.getPCVPPM(sqlBean, statId, s, d1);
                        System.out.println(DateTime.getDate(new Date())+" "+m.getName()+"   "+j);// second checkpoint
                    } else value=0;
                } catch (Exception ex) {
                    System.out.println("ERROR: DataFactory.createPCVPPMforSiemens 1 :" + ex.getMessage());
                    ex.printStackTrace();
                    value = 0;
                    broken=true;
                } finally {
                    try {
                        broker.freeConnection(conn);
                    } catch (Exception ex) {}
                element.getAvgValues()[j] = value;
            }2. SiemensWorks.getPCVPPM()
        public static int getPCVPPM(SQLCommandBean sqlBean,int statID,String start,String end)
                throws SQLException, UnsupportedTypeException, NoSuchColumnException {
            sqlBean.setSqlValue(SiemensSQL.PCV_PPM);
            Vector values=new Vector();
            values.add(new StringValue(statID+""));
            values.add(new StringValue(start));
            values.add(new StringValue(end));
            sqlBean.setValues(values);
            Vector rows=sqlBean.executeQuery();
            if (rows==null || rows.size()==0) return 0;
            Row row=(Row)rows.firstElement();
            try {
                float ret=Float.parseFloat(row.getString(1));
                if (ret<=0) ret=0;
                return Math.round(ret);
            } catch (Exception ex) {
                return 0;
        }3. Part of Threadwatching.log
    2006-10-13 16:46:56 Name: SMT Refreshing Threads
    2006-10-13 16:46:56 Thread count: 4
    2006-10-13 16:46:56 Active count: 4
    2006-10-13 16:46:56 Active group count: 0
    2006-10-13 16:46:56 Daemon: false
    2006-10-13 16:46:56 Priority: 5
    2006-10-13 16:46:57 Free memory: 192,228,944 bytes
    2006-10-13 16:46:57 Max memory: 332,988,416 bytes
    2006-10-13 16:46:57 Memory in use: 140,759,472 bytes
    2006-10-13 16:46:57 ---------------------------------
    2006-10-13 16:46:57 0. Name: CachedLayerTimer
    2006-10-13 16:46:57 0. Id: 19
    2006-10-13 16:46:57 0. Priority: 5
    2006-10-13 16:46:57 0. Parent: SMT Refreshing Threads
    2006-10-13 16:46:57 0. State: RUNNABLE
    2006-10-13 16:46:57 0. Alive: true
    2006-10-13 16:46:57 java.io.FileOutputStream.close0(Native Method)
    2006-10-13 16:46:57 java.io.FileOutputStream.close(Unknown Source)
    2006-10-13 16:46:57 sun.nio.cs.StreamEncoder$CharsetSE.implClose(Unknown Source)
    2006-10-13 16:46:57 sun.nio.cs.StreamEncoder.close(Unknown Source)
    2006-10-13 16:46:57 java.io.OutputStreamWriter.close(Unknown Source)
    2006-10-13 16:46:57 xcompany.smtmonitor.chart.ChartCreator.createChart(ChartCreator.java:663)
    2006-10-13 16:46:57 xcompany.smtmonitor.chart.ChartCreator.create(ChartCreator.java:441)
    2006-10-13 16:46:57 xcompany.smtmonitor.CachedLayerRefreshenerTask.run(CachedLayerRefreshenerTask.java:463)
    2006-10-13 16:46:57 java.util.TimerThread.mainLoop(Unknown Source)
    2006-10-13 16:46:57 java.util.TimerThread.run(Unknown Source)
    Software runs well until I get the DataFactory.createPCVPPMforSiemens function in my code ->
    2006-10-13 16:47:01 Name: SMT Refreshing Threads
    2006-10-13 16:47:01 Thread count: 4
    2006-10-13 16:47:01 Active count: 4
    2006-10-13 16:47:01 Active group count: 0
    2006-10-13 16:47:01 Daemon: false
    2006-10-13 16:47:01 Priority: 5
    2006-10-13 16:47:02 Free memory: 189,253,304 bytes
    2006-10-13 16:47:02 Max memory: 332,988,416 bytes
    2006-10-13 16:47:02 Memory in use: 143,735,112 bytes
    2006-10-13 16:47:02 ---------------------------------
    2006-10-13 16:47:02 0. Name: CachedLayerTimer
    2006-10-13 16:47:02 0. Id: 19
    2006-10-13 16:47:02 0. Priority: 5
    2006-10-13 16:47:02 0. Parent: SMT Refreshing Threads
    2006-10-13 16:47:02 0. State: RUNNABLE
    2006-10-13 16:47:02 0. Alive: true
    2006-10-13 16:47:02 java.util.LinkedList$ListItr.previous(Unknown Source)
    2006-10-13 16:47:02 net.sourceforge.jtds.util.TimerThread.setTimer(TimerThread.java:174)
    2006-10-13 16:47:02 net.sourceforge.jtds.jdbc.TdsCore.wait(TdsCore.java:3734)
    2006-10-13 16:47:02 net.sourceforge.jtds.jdbc.TdsCore.executeSQL(TdsCore.java:997)
    2006-10-13 16:47:02 net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:320)
    2006-10-13 16:47:02 net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:667)
    2006-10-13 16:47:02 xcompany.database.sql.SQLCommandBean.executeQuery(SQLCommandBean.java:91)
    2006-10-13 16:47:02 xcompany.smtmonitor.data.SiemensWorks.getPCVPPM(SiemensWorks.java:409)
    2006-10-13 16:47:02 xcompany.smtmonitor.data.DataFactory.createPCVPPMforSiemens(DataFactory.java:6103)
    2006-10-13 16:47:02 xcompany.smtmonitor.data.DataFactory.refreshProcessControlView(DataFactory.java:5791)
    2006-10-13 16:47:02 xcompany.smtmonitor.CachedLayerRefreshenerTask.run(CachedLayerRefreshenerTask.java:514)
    2006-10-13 16:47:02 java.util.TimerThread.mainLoop(Unknown Source)
    2006-10-13 16:47:02 java.util.TimerThread.run(Unknown Source)
    2006-10-13 16:47:06 Name: SMT Refreshing Threads
    2006-10-13 16:47:06 Thread count: 4
    2006-10-13 16:47:06 Active count: 4
    2006-10-13 16:47:06 Active group count: 0
    2006-10-13 16:47:06 Daemon: false
    2006-10-13 16:47:06 Priority: 5
    2006-10-13 16:47:08 Free memory: 127,428,192 bytes
    2006-10-13 16:47:08 Max memory: 332,988,416 bytes
    2006-10-13 16:47:08 Memory in use: 205,560,224 bytes
    2006-10-13 16:47:08 ---------------------------------
    2006-10-13 16:47:08 0. Name: CachedLayerTimer
    2006-10-13 16:47:08 0. Id: 19
    2006-10-13 16:47:08 0. Priority: 5
    2006-10-13 16:47:08 0. Parent: SMT Refreshing Threads
    2006-10-13 16:47:08 0. State: RUNNABLE
    2006-10-13 16:47:08 0. Alive: true
    2006-10-13 16:47:08 java.util.LinkedList$ListItr.previous(Unknown Source)
    2006-10-13 16:47:08 net.sourceforge.jtds.util.TimerThread.setTimer(TimerThread.java:174)
    2006-10-13 16:47:08 net.sourceforge.jtds.jdbc.TdsCore.wait(TdsCore.java:3734)
    2006-10-13 16:47:08 net.sourceforge.jtds.jdbc.TdsCore.executeSQL(TdsCore.java:997)
    2006-10-13 16:47:08 net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:320)
    2006-10-13 16:47:08 net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:667)
    2006-10-13 16:47:08 xcompany.database.sql.SQLCommandBean.executeQuery(SQLCommandBean.java:91)
    2006-10-13 16:47:08 xcompany.smtmonitor.data.SiemensWorks.getPCVPPM(SiemensWorks.java:409)
    2006-10-13 16:47:08 xcompany.smtmonitor.data.DataFactory.createPCVPPMforSiemens(DataFactory.java:6103)
    2006-10-13 16:47:08 xcompany.smtmonitor.data.DataFactory.refreshProcessControlView(DataFactory.java:5791)
    2006-10-13 16:47:08 xcompany.smtmonitor.CachedLayerRefreshenerTask.run(CachedLayerRefreshenerTask.java:514)
    2006-10-13 16:47:08 java.util.TimerThread.mainLoop(Unknown Source)
    2006-10-13 16:47:08 java.util.TimerThread.run(Unknown Source)
    2006-10-13 16:47:12 Name: SMT Refreshing Threads
    2006-10-13 16:47:12 Thread count: 4
    2006-10-13 16:47:12 Active count: 4
    2006-10-13 16:47:12 Active group count: 0
    2006-10-13 16:47:12 Daemon: false
    2006-10-13 16:47:12 Priority: 5
    2006-10-13 16:47:15 Free memory: 66,760,208 bytes
    2006-10-13 16:47:15 Max memory: 332,988,416 bytes
    2006-10-13 16:47:15 Memory in use: 266,228,208 bytes
    2006-10-13 16:47:15 ---------------------------------
    2006-10-13 16:47:15 0. Name: CachedLayerTimer
    2006-10-13 16:47:15 0. Id: 19
    2006-10-13 16:47:15 0. Priority: 5
    2006-10-13 16:47:15 0. Parent: SMT Refreshing Threads
    2006-10-13 16:47:15 0. State: RUNNABLE
    2006-10-13 16:47:15 0. Alive: true
    2006-10-13 16:47:15 java.util.LinkedList.addBefore(Unknown Source)
    2006-10-13 16:47:15 java.util.LinkedList.access$300(Unknown Source)
    2006-10-13 16:47:15 java.util.LinkedList$ListItr.add(Unknown Source)
    2006-10-13 16:47:15 net.sourceforge.jtds.util.TimerThread.setTimer(TimerThread.java:175)
    2006-10-13 16:47:15 net.sourceforge.jtds.jdbc.TdsCore.wait(TdsCore.java:3734)
    2006-10-13 16:47:15 net.sourceforge.jtds.jdbc.TdsCore.executeSQL(TdsCore.java:997)
    2006-10-13 16:47:15 net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:320)
    2006-10-13 16:47:15 net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:667)
    2006-10-13 16:47:15 xcompany.database.sql.SQLCommandBean.executeQuery(SQLCommandBean.java:91)
    2006-10-13 16:47:15 xcompany.smtmonitor.data.SiemensWorks.getPCVPPM(SiemensWorks.java:409)
    2006-10-13 16:47:15 xcompany.smtmonitor.data.DataFactory.createPCVPPMforSiemens(DataFactory.java:6103)
    2006-10-13 16:47:15 xcompany.smtmonitor.data.DataFactory.refreshProcessControlView(DataFactory.java:5791)
    2006-10-13 16:47:15 xcompany.smtmonitor.CachedLayerRefreshenerTask.run(CachedLayerRefreshenerTask.java:514)
    2006-10-13 16:47:15 java.util.TimerThread.mainLoop(Unknown Source)
    2006-10-13 16:47:15 java.util.TimerThread.run(Unknown Source)
    2006-10-13 16:47:17 Name: SMT Refreshing Threads
    2006-10-13 16:47:17 Thread count: 4
    2006-10-13 16:47:17 Active count: 4
    2006-10-13 16:47:17 Active group count: 0
    2006-10-13 16:47:17 Daemon: false
    2006-10-13 16:47:17 Priority: 5
    2006-10-13 16:47:20 Free memory: 23,232,496 bytes
    2006-10-13 16:47:20 Max memory: 332,988,416 bytes
    2006-10-13 16:47:20 Memory in use: 309,755,920 bytes
    2006-10-13 16:47:20 ---------------------------------
    2006-10-13 16:47:20 0. Name: CachedLayerTimer
    2006-10-13 16:47:20 0. Id: 19
    2006-10-13 16:47:20 0. Priority: 5
    2006-10-13 16:47:20 0. Parent: SMT Refreshing Threads
    2006-10-13 16:47:20 0. State: RUNNABLE
    2006-10-13 16:47:20 0. Alive: true
    2006-10-13 16:47:20 net.sourceforge.jtds.util.TimerThread.setTimer(TimerThread.java:171)
    2006-10-13 16:47:20 net.sourceforge.jtds.jdbc.TdsCore.wait(TdsCore.java:3734)
    2006-10-13 16:47:20 net.sourceforge.jtds.jdbc.TdsCore.executeSQL(TdsCore.java:997)
    2006-10-13 16:47:20 net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:320)
    2006-10-13 16:47:20 net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:667)
    2006-10-13 16:47:20 xcompany.database.sql.SQLCommandBean.executeQuery(SQLCommandBean.java:91)
    2006-10-13 16:47:20 xcompany.smtmonitor.data.SiemensWorks.getPCVPPM(SiemensWorks.java:409)
    2006-10-13 16:47:20 xcompany.smtmonitor.data.DataFactory.createPCVPPMforSiemens(DataFactory.java:6103)
    2006-10-13 16:47:20 xcompany.smtmonitor.data.DataFactory.refreshProcessControlView(DataFactory.java:5791)
    2006-10-13 16:47:20 xcompany.smtmonitor.CachedLayerRefreshenerTask.run(CachedLayerRefreshenerTask.java:514)
    2006-10-13 16:47:20 java.util.TimerThread.mainLoop(Unknown Source)
    2006-10-13 16:47:20 java.util.TimerThread.run(Unknown Source)
    2006-10-13 16:47:23 Name: SMT Refreshing Threads
    2006-10-13 16:47:23 Thread count: 4
    2006-10-13 16:47:23 Active count: 4
    2006-10-13 16:47:23 Active group count: 0
    2006-10-13 16:47:23 Daemon: false
    2006-10-13 16:47:23 Priority: 5
    2006-10-13 16:47:26 Free memory: 4,907,336 bytes
    2006-10-13 16:47:26 Max memory: 332,988,416 bytes
    2006-10-13 16:47:26 Memory in use: 328,083,768 bytes
    2006-10-13 16:47:26 ---------------------------------
    2006-10-13 16:47:26 0. Name: CachedLayerTimer
    2006-10-13 16:47:26 0. Id: 19
    2006-10-13 16:47:26 0. Priority: 5
    2006-10-13 16:47:26 0. Parent: SMT Refreshing Threads
    2006-10-13 16:47:26 0. State: RUNNABLE
    2006-10-13 16:47:26 0. Alive: true
    2006-10-13 16:47:26 java.util.LinkedList.addBefore(Unknown Source)
    2006-10-13 16:47:26 java.util.LinkedList.access$300(Unknown Source)
    2006-10-13 16:47:26 java.util.LinkedList$ListItr.add(Unknown Source)
    2006-10-13 16:47:26 net.sourceforge.jtds.util.TimerThread.setTimer(TimerThread.java:175)
    2006-10-13 16:47:26 net.sourceforge.jtds.jdbc.TdsCore.wait(TdsCore.java:3734)
    2006-10-13 16:47:26 net.sourceforge.jtds.jdbc.TdsCore.executeSQL(TdsCore.java:997)
    2006-10-13 16:47:26 net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:320)
    2006-10-13 16:47:26 net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:667)
    2006-10-13 16:47:26 xcompany.database.sql.SQLCommandBean.executeQuery(SQLCommandBean.java:91)
    2006-10-13 16:47:26 xcompany.smtmonitor.data.SiemensWorks.getPCVPPM(SiemensWorks.java:409)
    2006-10-13 16:47:26 xcompany.smtmonitor.data.DataFactory.createPCVPPMforSiemens(DataFactory.java:6103)
    2006-10-13 16:47:26 xcompany.smtmonitor.data.DataFactory.refreshProcessControlView(DataFactory.java:5791)
    2006-10-13 16:47:26 xcompany.smtmonitor.CachedLayerRefreshenerTask.run(CachedLayerRefreshenerTask.java:514)
    2006-10-13 16:47:26 java.util.TimerThread.mainLoop(Unknown Source)
    2006-10-13 16:47:26 java.util.TimerThread.run(Unknown Source)
    2006-10-13 16:47:35 Name: SMT Refreshing Threads
    2006-10-13 16:47:37 Thread count: 4
    2006-10-13 16:47:38 Active count: 4
    2006-10-13 16:47:38 Active group count: 0
    2006-10-13 16:47:38 Daemon: false
    2006-10-13 16:47:38 Priority: 5
    2006-10-13 16:47:42 Free memory: 35,316,120 bytes
    2006-10-13 16:47:42 Max memory: 332,988,416 bytes
    2006-10-13 16:47:42 Memory in use: 297,672,296 bytes
    2006-10-13 16:47:42 ---------------------------------
    2006-10-13 16:47:42 0. Name: CachedLayerTimer
    2006-10-13 16:47:42 0. Id: 19
    2006-10-13 16:47:42 0. Priority: 5
    2006-10-13 16:47:42 0. Parent: SMT Refreshing Threads
    2006-10-13 16:47:42 0. State: TIMED_WAITING
    2006-10-13 16:47:42 0. Alive: true
    2006-10-13 16:47:42 java.lang.Object.wait(Native Method)
    2006-10-13 16:47:42 java.util.TimerThread.mainLoop(Unknown Source)
    2006-10-13 16:47:42 java.util.TimerThread.run(Unknown Source)
    4. Tomcat default logging file:
    2006-10-13 16:47:36 ERROR CachedLayerRefreshenerTask: external error: Java heap space
    5. DbConnectionBroker (connection pooling) logging file:
    Handing out connection 1 --> 10/13/2006 04:47:01 PM
    Handing out connection 0 --> 10/13/2006 04:47:01 PM
    Handing out connection 1 --> 10/13/2006 04:47:01 PM
    Handing out connection 0 --> 10/13/2006 04:47:02 PM
    Warning. Connection 0 in use for 3141 ms
    Warning. Connection 0 in use for 24891 ms
    ----> Error: Could not free connection!!!
    I would appreciate for any help.

    What does your query bring back from this table?This is the query:
    SELECT case sum(c.picked) when 0 then 0 else
    ((sum(c.picked)-(sum(c.picked)-(sum(c.vacuum)+sum(c.id
    ent))))*cast((1000000/cast(sum(c.picked) as float))
    as bigint)) end as PPM
    FROM sip_comp c
    LEFT JOIN sip_pcb pc ON pc.id=c.pcbid
    LEFT JOIN sip_period p on p.id=pc.periodid
    WHERE p.stationid=? AND pc.time BETWEEN ? AND ?Has anybody who knows SQL tried EXPLAIN PLAN to optimize this table? You're joining on a table with a million rows and you're wondering why the performance is poor?
    What is the index situation with these tables?
    .> When I execute it from query manager, it takes from 1
    to 60 secs depend on servers availability. So how will that be any different for JDBC and Java?
    ..> You're right. Thats why I am here.
    What I mean by that is we can't read minds, either. You need to get some hard data to tell you where the bottleneck is. Asking at a forum won't help.
    But tell me, if the java process enters to this query
    execution, and doesnt quit until OOM thrown, how can
    be the problem in caching?I was guessing about caching, because I didn't know what the query was.
    You expect a lot.
    .> No.
    Then how do you ever expect to solve this?
    I tried YourKit Profiler at home, where I'm
    developing software, but this OOM never thrown here,
    even if I have the same database size.Then you aren't replicating the problem. You have to run it on the system that has the problem if you're going to solve it.
    YourKit isn't an industry leader. How well do you know how to use it?
    It just happened at the company where the system
    runs, and I cannot run this profiler there because
    the PC where my tomcat runs dramatically slowed.You have to run something to figure out what the problem is. What about Log4J, some trace logging statements and a batch job to harvest the log?
    Bottom line: you've got to be a scientist and get some real data. We can theorize all we want here, but that won't get you to a solution.
    %

  • SQL Server 2008 R2 Replication - not applying snapshot and not updating all repliacted columns

    We are using transactional replicating on SQL Server 2008 R2 (SP1) using a remote distributor. We are replicating from BaanLN, which is an ERP application to up to 5 subscribers, all using push publications. 
    Tables can range from a couple million rows to 12 million rows and 100's of GBs in size. 
    And it's due to the size of the tables that it was designed with a one publisher to one table architecture.  
    Until recently it has been working very smooth (last four years)) but we have come across two issues I have never encountered.
    While this has happen a half dozen times before, it last occurred a couple weeks ago when I was adding three new publications, again a one table per publication architecture.
    We use standard SS repl proc calls to create the publications, which have been successful for years. 
    On this occasion replication created the three publications, assigned the subscribers and even generated the new snapshot for all three new publications. 
    However,  while it appeared that replication had created all the publications correctly from end to end, it actually only applied one of the three snapshot and created the new table on both of the new subscribers (two on each of the
    publications).  It only applied the snapshot to one of the two subscribers for the second publications, and did not apply to any on the third.  
    I let it run for three hours to see if it was a back log issue. 
    Replication was showing commands coming across when looking at the sync verification at the publisher and 
    it would even successfully pass a tracer token through each of the three new publications, despite there not being tables on either subscriber on one of the publishers and missing on one of the subscribers on another.  
    I ended up attempting to reinitialize roughly a dozen times, spanning a day, and one of the two remaining publications was correctly reinitialized and the snapshot applied, but the second of the two (failed) again had the same mysterious result, and
    again looked like it was successful based on all the monitoring. 
    So I kept reinitializing the last and after multiple attempts spanning a day, it too finally was built correctly.  
    Now the story only get a little stranger.  We just found out yesterday that on Friday the 17th 
    at 7:45, the approximate time started the aforementioned deployment of the three new publications, 
    we also had three transaction from a stable and vetted publication send over all changes except for a single status column. 
    This publication has 12 million rows and is very active, with thousands of changes daily. 
    , The three rows did not replicate a status change from a 5 to a 6. 
    We verified that the status was in fact 6 on the publisher, and 
    5 on both subscribers, yet no messages or errors.  All the other rows successfully updated.  
    We fixed it by updating the publication from 6 back to 5 then back to 6 again on those specific rows and it worked.
    The CPU is low and overall latency is minimal on the distributor. 
    From all accounts the replication is stable and smooth, but very busy. 
    The issues above have only recently started.  I am not sure where to look for a problem, and to that end, a solution.

    I suspect the problem with the new publication/subscriptions not initializing may have been a result of timeouts but it is hard to say for sure.  The fact that it eventually succeeded after multiple attempts leads me to believe this.  If this happens
    again, enable verbose agent logging for the Distribution Agent to see if you are getting query timeouts.  Add the parameters
    -OutputVerboseLevel 2 -Output C:\TEMP\DistributionAgent.log to the Distribution Agent Run Agent job step, rerun the agent, and collect the log.
    If you are getting query timeouts, try increasing the Distribution Agent -QueryTimeOut parameter.  The default is 1800 seconds.  Try bumping this up to 3600 seconds.
    Regarding the three transactions not replicating, inspect MSrepl_errors in the distribution database for the time these transactions occurred and see if any errors occurred.
    Brandon Williams (blog |
    linkedin)

  • What are the ODBC connect details for the HR sample database?

    I have installed Oracle Express on Ubuntu 8.10 and read the Getting Started tutorials. Everything worked fine.
    THE DSN
    I need to connect via ODBC, to start with to the HR sample database on my PC.
    The Getting Started tutorial says the userid and password are both hr, but what is the data source name (dsn) to be used with the SQLConnect?
    THE INIs
    The ini files below are the result of googling, not of any insight on my part.
    /etc/odbcinst.ini
    [OracleExpressdrv]
    Driver = /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/lib/libsqora.so.10.1
    Description = Oracle 10g express driver
    /etc/odbc.ini
    [hrdsn]
    Driver = OracleExpressdrv
    Application Attributes = T
    Attributes = W
    BatchAutocommitMode = IfAllSuccessful
    CloseCursor = F
    DisableDPM = F
    DisableMTS = T
    DSN = TestDSN
    EXECSchemaOpt =
    EXECSyntax = T
    Failover = T
    FailoverDelay = 10
    FailoverRetryCount = 10
    FetchBufferSize = 64000
    ForceWCHAR = F
    Lobs = T
    Longs = T
    MetadataIdDefault = F
    QueryTimeout = T
    ResultSets = T
    # ServerName is TNS_alias_from_tnsnames.ora
    ServerName = OraDB
    SQLGetData extensions = F
    Translation DLL =
    Translation Option = 0
    UserID = ken
    THE ENVIRONMENT
    Before running my odbc test program I issued
    LD_LIBRARY_PATH=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/lib;export LD_LIBRARY_PATH
    and checked via env command that the ldlibpath actually had been set correctly.
    After SQLConnect received the following error:
    Usage error: SQLConnect: dsn=hrdsn, user=hr, password=hr <<< output by my test program
    1: st=IM002, nerr=0, msg=
    [unixODBC][Driver Manager]Data source name not found, and no default driver specified
    The first part of the error message hints at there being something wrong with dsn=hrdsn. I don't understand the second part 'and no default driver specified'.
    I am totally stuck. Advice would be most appreciated.

    Oracle® Database Express Edition Installation Guide for Linux talks about Compiling the Oracle ODBC Driver Demos. It tells you to download and install the unixODBC DriverManager from unixODBC. On Ubuntu this is already preinstalled and/or available via the Synaptic Manager. It also instructs you to run a makefile demo_xe.mk to build an odbcdemo program. The makefile did not work for me (hundreds of compilation errors), but I looked at the odbcdemo.c code and could see that dsn=TESTDBDSN for user=hr and password=hr. In other words, by luck the demo program seems to be connecting to the HR sample database.
    I changed the /etc/odbc.ini file to:
    [TestDBDSN]
    Application Attributes = T
    Attributes = W
    BatchAutocommitMode = IfAllSuccessful
    CloseCursor = F
    DisableDPM = F
    DisableMTS = T
    Driver = OracleExpressdrv
    DSN = TestDBDSN
    and also in my test program which now produced the following error:
    Usage error: SQLConnect: dsn=TestDBDSN, user=hr, password=hr
    1: st=IM004, nerr=0, msg=
    [unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed
    which shows that the unixODBC driver manager has loaded the driver and that the driver immediately encountered problems.
    The sql calls issued before the SQLConnect("TestDBDSN", "hr" , "hr") were OK, i.e. these:
    rc0 = SQLAllocHandle ( SQL_HANDLE_ENV , SQL_NULL_HANDLE , &henv ) ;
    rc = SQLSetEnvAttr ( henv, SQL_ATTR_ODBC_VERSION , *)SQL_OV_ODBC3 , 0 ) ;
    rc = SQLAllocHandle ( SQL_HANDLE_DBC , henv , &hdbc ) ;
    SQLSetConnectAttr ( hdbc , SQL_LOGIN_TIMEOUT , (void*)5 , 0 ) ;
    However, the error appears after SQLConnect and yet the rc0 was reported as OK.
    The error message 'Driver's SQLAllocHandle on SQL_HANDLE_HENV failed' is totally unhelpful to me as a user since I don't know the conditions that lead to failure. I really think this calls for some documentation. Such documentation should be complete, self-contained and correct and give ALL OPERATIONAL steps, i.e. I want to know exactly what I have to do. Ambiguous English often referring to undefined terms is not what Oracle beginners like myself want.
    I don't know if this is a bug. It is so fundamental that Oracle ODBC driver writers could/should not have got it wrong. The connect does not even start.
    I have googled for hours, but every lead has failed.
    I don't want to give up on this. What can I do?

  • SQL 2012 and later will fail to publish a database for any tables with a default constraint that references a user defined function.

    Script will create database, 3 database objects and publish. 
    The error is due to the generation script to create the conflict tables that is not stripping out default constraints that reference a UDF. 
    As you can see below, the failure is on the generation script for the conflict table.
    The conflict table should be a bucket table that shouldn’t enforce data integrity. 
    See how the default constraints for the columns someint and somestring were stripped out of the generation logic however the default constraint that utilizes a UDF persist and uses the same object name that was used on the production table (The
    bold line) , this occurs if I explicitly name the constraint or let the system generate the name for me like in the example posted. 
      The only way I could see getting around this right now is to drop all default constraints in the system that uses a UDF, publish then add the constraints back which is vulnerable to invalid data and a lot of moving
    steps.  This all worked with SQL 2000, 2005, 2008, 2008r2, it’s stopped working in SQL 2012 and continues to not work in SQL 2014. 
    Error messages:
    Message: There is already an object named 'DF__repTable__id__117F9D94' in the database.
    Could not create constraint. See previous errors.
    Command Text: CREATE TABLE [dbo].[MSmerge_conflict_MergeRepFailurePublication_repTable](
            [id] [varchar](8) NULL CONSTRAINT [DF__repTable__id__117F9D94]  DEFAULT ([dbo].[repUDF]()),
            [somedata] [varchar](64) NULL,
            [rowguid] [uniqueidentifier] ROWGUIDCOL  NULL,
            [someint] [int] NULL,
            [somestring] [varchar](64) NULL
    Parameters:
    Stack:    at Microsoft.SqlServer.Replication.AgentCore.ReMapSqlException(SqlException e, SqlCommand command)
       at Microsoft.SqlServer.Replication.AgentCore.AgentExecuteNonQuery(SqlCommand command, Int32 queryTimeout)
       at Microsoft.SqlServer.Replication.AgentCore.ExecuteDiscardResults(CommandSetupDelegate commandSetupDelegate, Int32 queryTimeout)
       at Microsoft.SqlServer.Replication.Snapshot.YukonMergeConflictTableScriptingManager.ApplyBaseConflictTableScriptToPublisherIfNeeded(String strConflictScriptPath)
       at Microsoft.SqlServer.Replication.Snapshot.BaseMergeConflictTableScriptingManager.DoConflictTableScriptingTransaction(SqlConnection connection)
       at Microsoft.SqlServer.Replication.RetryableSqlServerTransactionManager.ExecuteTransaction(Boolean bLeaveTransactionOpen)
       at Microsoft.SqlServer.Replication.Snapshot.BaseMergeConflictTableScriptingManager.DoConflictTableScripting()
       at Microsoft.SqlServer.Replication.Snapshot.MergeSmoScriptingManager.GenerateTableArticleCftScript(Scripter scripter, BaseArticleWrapper articleWrapper, Table smoTable)
       at Microsoft.SqlServer.Replication.Snapshot.MergeSmoScriptingManager.GenerateTableArticleScripts(ArticleScriptingBundle articleScriptingBundle)
       at Microsoft.SqlServer.Replication.Snapshot.MergeSmoScriptingManager.GenerateArticleScripts(ArticleScriptingBundle articleScriptingBundle)
       at Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.GenerateObjectScripts(ArticleScriptingBundle articleScriptingBundle)
       at Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.DoScripting()
       at Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.DoScripting()
       at Microsoft.SqlServer.Replication.Snapshot.MergeSnapshotProvider.DoScripting()
       at Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.GenerateSnapshot()
       at Microsoft.SqlServer.Replication.SnapshotGenerationAgent.InternalRun()
       at Microsoft.SqlServer.Replication.AgentCore.Run() (Source: MSSQLServer, Error number: 2714)
    Get help: http://help/2714
    Server COL-PCANINOW540\SQL2012, Level 16, State 0, Procedure , Line 1
    Could not create constraint. See previous errors. (Source: MSSQLServer, Error number: 1750)
    Get help: http://help/1750
    Server COL-PCANINOW540\SQL2012, Level 16, State 0, Procedure , Line 1
    Could not create constraint. See previous errors. (Source: MSSQLServer, Error number: 1750)
    Get help: http://help/1750
    Pauly C
    USE [master]
    GO
    CREATE DATABASE [MergeRepFailure]
    ALTER DATABASE [MergeRepFailure] SET COMPATIBILITY_LEVEL = 110
    GO
    USE [MergeRepFailure]
    GO
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    create view
    [dbo].[repView] as select right(newid(),8) as id
    GO
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE FUNCTION [dbo].[repUDF]()
    RETURNS varchar(8)
    BEGIN
    declare @val varchar(8)
    select top 1 @val = id from [repView]
    return @val
    END
    GO
    create table repTable
    id varchar(8) default([dbo].[repUDF]()),
    somedata varchar(64) null,
    rowguid uniqueidentifier ROWGUIDCOL default(newid()),
    someint int default(1),
    somestring varchar(64) default('somestringvalue')
    GO
    insert into reptable (somedata) values ('whatever1')
    insert into reptable (somedata) values ('whatever2')
    go
    /*test to make sure function is working*/
    select * from reptable
    GO
    /*Publish database*/
    use [MergeRepFailure]
    exec sp_replicationdboption @dbname = N'MergeRepFailure', @optname = N'merge publish', @value = N'true'
    GO
    declare @Descrip nvarchar(128)
    select @Descrip = 'Merge publication of database ''MergeRepFailure'' from Publisher ''' + @@servername +'''.'
    print @Descrip
    -- Adding the merge publication
    use [MergeRepFailure]
    exec sp_addmergepublication @publication = N'MergeRepFailurePublication', @description = N'@Descrip',
    @sync_mode = N'native', @retention = 14, @allow_push = N'true', @allow_pull = N'true', @allow_anonymous = N'true',
    @enabled_for_internet = N'false', @snapshot_in_defaultfolder = N'true', @compress_snapshot = N'false', @ftp_port = 21,
    @ftp_subdirectory = N'ftp', @ftp_login = N'anonymous', @allow_subscription_copy = N'false', @add_to_active_directory = N'false',
    @dynamic_filters = N'false', @conflict_retention = 14, @keep_partition_changes = N'false', @allow_synctoalternate = N'false',
    @max_concurrent_merge = 0, @max_concurrent_dynamic_snapshots = 0, @use_partition_groups = null, @publication_compatibility_level = N'100RTM',
    @replicate_ddl = 1, @allow_subscriber_initiated_snapshot = N'false', @allow_web_synchronization = N'false', @allow_partition_realignment = N'true',
    @retention_period_unit = N'days', @conflict_logging = N'both', @automatic_reinitialization_policy = 0
    GO
    exec sp_addpublication_snapshot @publication = N'MergeRepFailurePublication', @frequency_type = 4, @frequency_interval = 14, @frequency_relative_interval = 1,
    @frequency_recurrence_factor = 0, @frequency_subday = 1, @frequency_subday_interval = 5, @active_start_time_of_day = 500, @active_end_time_of_day = 235959,
    @active_start_date = 0, @active_end_date = 0, @job_login = null, @job_password = null, @publisher_security_mode = 1
    use [MergeRepFailure]
    exec sp_addmergearticle @publication = N'MergeRepFailurePublication', @article = N'repTable', @source_owner = N'dbo', @source_object = N'repTable', @type = N'table',
    @description = null, @creation_script = null, @pre_creation_cmd = N'drop', @schema_option = 0x000000010C034FD1, @identityrangemanagementoption = N'manual',
    @destination_owner = N'dbo', @force_reinit_subscription = 1, @column_tracking = N'false', @subset_filterclause = null, @vertical_partition = N'false',
    @verify_resolver_signature = 1, @allow_interactive_resolver = N'false', @fast_multicol_updateproc = N'true', @check_permissions = 0, @subscriber_upload_options = 0,
    @delete_tracking = N'true', @compensate_for_errors = N'false', @stream_blob_columns = N'false', @partition_options = 0
    GO
    use [MergeRepFailure]
    exec sp_addmergearticle @publication = N'MergeRepFailurePublication', @article = N'repView', @source_owner = N'dbo', @source_object = N'repView',
    @type = N'view schema only', @description = null, @creation_script = null, @pre_creation_cmd = N'drop', @schema_option = 0x0000000008000001,
    @destination_owner = N'dbo', @destination_object = N'repView', @force_reinit_subscription = 1
    GO
    use [MergeRepFailure]
    exec sp_addmergearticle @publication = N'MergeRepFailurePublication', @article = N'repUDF', @source_owner = N'dbo', @source_object = N'repUDF',
    @type = N'func schema only', @description = null, @creation_script = null, @pre_creation_cmd = N'drop', @schema_option = 0x0000000008000001,
    @destination_owner = N'dbo', @destination_object = N'repUDF', @force_reinit_subscription = 1
    GO

    More information, after running a profile trace the following 2 statements, the column with the default on a UDF returns a row while the other default does not.  This might be the cause of this bug.  Is the same logic to generate the object on
    the subscriber used to generate the conflict table?  
    exec sp_executesql N'
    select so.name, schema_name(so.schema_id)
    from sys.sql_dependencies d
    inner join sys.objects so
    on d.referenced_major_id = so.object_id
    where so.type in (''FN'', ''FS'', ''FT'', ''TF'', ''IF'')
    and d.class in (0,1)
    and d.referenced_major_id <> object_id(@base_table, ''U'')
    and d.object_id = object_id(@constraint, ''D'')',N'@base_table nvarchar(517),@constraint nvarchar(517)',@base_table=N'[dbo].[repTable]',@constraint=N'[dbo].[DF__repTable__id__117F9D94]'
    exec sp_executesql N'
    select so.name, schema_name(so.schema_id)
    from sys.sql_dependencies d
    inner join sys.objects so
    on d.referenced_major_id = so.object_id
    where so.type in (''FN'', ''FS'', ''FT'', ''TF'', ''IF'')
    and d.class in (0,1)
    and d.referenced_major_id <> object_id(@base_table, ''U'')
    and d.object_id = object_id(@constraint, ''D'')',N'@base_table nvarchar(517),@constraint nvarchar(517)',@base_table=N'[dbo].[repTable]',@constraint=N'[dbo].[DF__repTable__somein__1367E606]'
    Pauly C

  • Trouble using ODBC on Linux

    Hi there.
    I'm fairly new to ODBC, so I apologize in advance if I am missing
    some cirtical piece of information in my question.
    I am trying to setup ODBC so that I can connect to my Oracle
    database from RODBC (a package within the R statistical package),
    where R is running on my Linux box where I installed the instant
    client.
    I have installed the 10.2.0.3 version of the instant client
    (basic, odbc, and sqlplus pieces) on my Linux machine.
    I have set LD_LIBRARY_PATH to include the new lib directory
    /usr/lib/oracle/10.2.0.3/client/lib
    which contains the libsqora.so.10.1 file.
    uname -a yields the following:
    Linux stacw34 2.6.9-78.0.0.0.1.ELsmp #1 SMP Fri Jul 25 14:41:56 EDT 2008 i686 i686 i386 GNU/Linux
    I have set TNS_ADMIN to point to a directory with a tnsnames.ora
    file that contains the following entry:
    nickel =
    (DESCRIPTION=
    (ADDRESS=
    (PROTOCOL=tcp)
    (HOST=<my_machine>)
    (PORT=1521)
    (CONNECT_DATA=
    (SERVICE_NAME=nickel.regress.rdbms.dev.us.oracle.com)
    I have verified that the tnsnames entry is working correctly
    by connecting to the database using the instant client sqlplus
    executable.
    At this point, I am trying to connect to the database using the
    ODBC piece through RODBC. I have found that the errors I get from R
    seem to be the same as those from isql, so I am trying to use
    isql to find the root of the problem. Is there a better tool
    to validate that ODBC is working on linux?
    Anyway, I installed the odbc piece from the instant client, but
    I had to do some editing by hand due to the way the machine
    is configured. My /etc/odbcinst.ini file contains:
    [PostgreSQL]
    Description          = ODBC for PostgreSQL
    Driver          = /usr/lib/libodbcpsql.so
    Driver64          =
    Setup          = /usr/lib/libodbcpsqlS.so
    Setup64          =
    UsageCount          =
    CPTimeout          =
    CPReuse          =
    FileUsage          = 1
    [Oracle 10g ODBC driver]
    Description = Oracle ODBC driver for Oracle 10g
    Driver = /usr/lib/oracle/10.2.0.3/client/lib/libsqora.so.10.1
    Setup =
    FileUsage =
    CPTimeout =
    CPReuse =
    And my ~/.odbc.ini file contains:
    [nickel]
    Application Attributes = T
    Attributes = W
    BatchAutocommitMode = IfAllSuccessful
    BindAsFLOAT = F
    CloseCursor = F
    DisableDPM = F
    DisableMTS = T
    Driver = Oracle 10g ODBC driver
    DSN = nickel
    EXECSchemaOpt =
    EXECSyntax = T
    Failover = T
    FailoverDelay = 10
    FailoverRetryCount = 10
    FetchBufferSize = 64000
    ForceWCHAR = F
    Lobs = T
    Longs = T
    MetadataIdDefault = F
    QueryTimeout = T
    ResultSets = T
    ServerName =
    SQLGetData extensions = F
    Translation DLL =
    Translation Option = 0
    DisableRULEHint = T
    UserID =
    When I run isql as follows:
    isql -v nickel
    I get the following error:
    ORA-12162: TNS:net service name is incorrectly specified
    It seems to be that this error occurs because I don't have
    ORACLE_SID set. If I set ORACLE_SID to nickel, and then
    run the same command, now I get:
    ORA-12545: Connect failed because target host or object does not exist
    The sqlnet.log file contains the following:
    Fatal NI connect error 12545, connecting to:
    (DESCRIPTION=(ADDRESS=(PROTOCOL=beq)(PROGRAM=/usr/lib/oracle/10.2.0.3/client/lib/bin/oracle)(ARGV0=oraclenickel)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))')(DETACH=NO))(CONNECT_DATA=(CID=(PROGRAM=isql@<myhost>)(HOST=<myhost>)(USER=<myuser>))))
    VERSION INFORMATION:
         TNS for Linux: Version 10.2.0.3.0 - Production
         Oracle Bequeath NT Protocol Adapter for Linux: Version 10.2.0.3.0 - Production
         TCP/IP NT Protocol Adapter for Linux: Version 10.2.0.3.0 - Production
    Time: 20-MAR-2009 14:02:02
    Tracing not turned on.
    Tns error struct:
    ns main err code: 12545
    TNS-12545: Message 12545 not found; No message file for product=network, facility=TNS
    ns secondary err code: 12560
    nt main err code: 515
    TNS-00515: Message 515 not found; No message file for product=network, facility=TNS
    nt secondary err code: 2
    nt OS err code: 0
    I can't figure out what is wrong with my odbc setup which would lead
    isql (and probably RODBC) to use this connect string (beq protocol, etc.).
    I am guessing that is where the problem stems from.
    Can you help me figure out how to find out what I am doing wrong
    when configuring the odbc setup?
    Thanks,
    Ari
    Edited by: amozes on Mar 20, 2009 11:06 AM

    That's easily explained.
    As you find documented in
    http://download.oracle.com/docs/cd/B19306_01/install.102/b15699/post_inst_task.htm#sthref398
    you have to set 'ServerName' in odbc.ini to your TNS alias, in your case:
    ServerName = nickel
    Since you did not give a ServerName, Oracle assumed that you want to connect to a local database.
    As you rightly assume, the ORA-12162 indicates that ORACLE_SID is not set, which is needed for a local connection.
    If you set ORACLE_SID, Oracle will try to establish a local connection by executing a server process $ORACLE_HOME/bin/oracle.
    Since this executable cannot be found, you get the ORA-12545.
    Yours,
    Laurenz Albe
    PS: Your solution is better, as it does not require a tnsnames.ora file.

  • SQL Server 2008 - RS - Loop of multiple Bulk Inserts

    Hi,
    I want to import multiple flat files to a table on SQL Server 2008 R2. However, I don't have access to Integration Services to use a foreach loop, so I'm doing the process using T-SQL. Actually, I'm using manually code to which file to introduce the data on
    tables. My code are like this:
    cREATE TABLE #temporaryTable
        [column1] [varchar](100) NOT NULL,
        [column2 [varchar](100) NOT NULL
    BULK
    INSERT #temp
    FROM 'C:\Teste\testeFile01.txt' 
    WITH
    FIELDTERMINATOR = ';',
    ROWTERMINATOR = '\n',
    FIRSTROW = 1
    GO
    BULK
    INSERT #temp
    FROM 'C:\Teste\testeFile02.txt' 
    WITH
    FIELDTERMINATOR = ';',
    ROWTERMINATOR = '\n',
    FIRSTROW = 1
    GO
    -------------------------------------------------INSERT INTO dbo.TESTE ( Col_1, Col_2)
    Select RTRIM(LTRIM([column1])), RTRIM(LTRIM([column2])) From #temporaryTable
    IF EXISTS(SELECT * FROM #temporaryTable) drop table #temporaryTable
    The problem is that I have 20 flat files to Insert... Do I have any loop solution in T-SQL to insert all the flat files on same table?
    Thanks!

    Here is a working sample of powershell script I adopted from internet( I don't have the source handy now).
    Import-Module -Name 'SQLPS' -DisableNameChecking
    $workdir="C:\temp\test\"
    $svrname = "MC\MySQL2014"
    Try
    #Change default timeout time from 600 to unlimited
    $svr = new-object ('Microsoft.SqlServer.Management.Smo.Server') $svrname
    $svr.ConnectionContext.StatementTimeout = 0
    $table="test1.dbo.myRegions"
    #remove the filename column in the target table
    $q1 = @"
    Use test1;
    IF COL_LENGTH('dbo.myRegions','filename') IS NOT NULL
    BEGIN
    ALTER TABLE test1.dbo.myRegions DROP COLUMN filename;
    END
    Invoke-Sqlcmd -ServerInstance $svr.Name -Database master -Query $q1
    $dt = (get-date).ToString("yyyMMdd")
    $formatfilename="$($table)_$($dt).xml"
    $destination_formatfilename ="$($workdir)$($formatfilename)"
    $cmdformatfile="bcp $table format nul -c -x -f $($destination_formatfilename) -T -t\t -S $($svrname) "
    Invoke-Expression $cmdformatfile
    #Delay 1 second
    Start-Sleep -s 1
    $q2 = @"
    Alter table test1.dbo.myRegions Add filename varchar(500) Null;
    #add the filename column to the target table
    Invoke-Sqlcmd -ServerInstance $svr.Name -Database master -Query $q2
    $files = Get-ChildItem $workdir
    $items = $files | Where-Object {$_.Extension -eq ".txt"}
    for ($i=0; $i -lt $items.Count; $i++) {
    $strFileName = $items[$i].Name
    $strFileNameNoExtension= $items[$i].BaseName
    $query = @"
    BULK INSERT test1.dbo.myRegions from '$($workdir)$($strFileName)' WITH (FIELDTERMINATOR = '\t', FIRSTROW = 2, FORMATFILE = '$($destination_formatfilename)');
    Invoke-Sqlcmd -ServerInstance $svr.Name -Database master -Query $query -querytimeout 65534
    #Delay 10 second
    Start-Sleep -s 10
    # Update the filename column
    Invoke-Sqlcmd -ServerInstance $svr.Name -Database master -querytimeout 65534 -Query "Update test1.dbo.myRegions SET filename= '$($strFileName)' WHERE filename is null; "
    # Move uploaded file to archive
    If ((Test-Path "$($workdir)$($strFileName)") -eq $True) { Move-Item -Path "$($workdir)$($strFileName)" -Destination "$($workdir)Processed\$($strFileNameNoExtension)_$($dt).txt"}
    Catch [Exception]
    write-host "--$strFileName "$_.Exception.Message

  • DB Adapter - JCA Timeout not working?

    Hi ,
    Tried to set jca property for querytimeout as below,(in db adapter jca file)
    <property name="QueryTimeout" value="5"/>
    Call is to a DB stored procedure,when procedure execution takes more than 5 secs,jca timeout excpetion is not getting thrown?
    Can anyone assist on this?Kindly suggest any alternative way too if any?
    Thanks,
    Anitha

    What is the interface of the Stored procedure, if it has any output paramaters, the interface would be synchronous....
    I think in your case, as the stored procedure is not timing out, it is using the value for syncMaxWaitTime property....this is the maximum time a BPEL can wait for a synchronous response...
    See if this helps you...
    BPEL, timeout for DB adapter
    Thanks,
    N

  • Problem with statement.cancel()

    Hi,
    I am using Oracle 10g with the 10.2.0.3 jdbc (OCI) drivers. Though my statement.quertTimeout() works fine, the statement.cancel() does not seem to do anything.
    Could you please guide me as to the cause of this kind of action, since I have read that internally queryTimeout() depends on cancel() to stop qurery execution.
    Thanks in advance

    Hi,
    I am using Oracle 10g with the 10.2.0.3 jdbc (OCI)
    drivers. Though my statement.quertTimeout() works
    fine, the statement.cancel() does not seem to do
    anything.
    Could you please guide me as to the cause of this
    kind of action, since I have read that internally
    queryTimeout() depends on cancel() to stop qurery
    execution.
    Thanks in advanceThe code I am using is:
    package test;
    import java.sql.*;
    import oracle.jdbc.pool.OracleDataSource;
    import oracle.jdbc.driver.*;
    public class OracleQueryTimeout
         public static void main(String[] args)
              long timetaken; // Holds the execution time
              int numFetchedRows = 0;
              // Create a OracleDataSource instance
              OracleDataSource ods;
              try {
                   ods = new OracleDataSource();
                   //Sets the driver type
                   ods.setDriverType("oci");
                   // Sets the database server name
                   ods.setServerName("<my machine name>");
                   // Sets the database name
                   ods.setDatabaseName("orcl");
              // Sets the port number
                   ods.setPortNumber(1521);
                   // Sets the user name
                   ods.setUser("<username>");
                   // Sets the password
                   ods.setPassword("<password>");
                   // Create a connection object
                   Connection connection;
                        connection = ods.getConnection();
         // Sets the auto-commit property for the connection to be false.
                        connection.setAutoCommit(false);
                        Statement stmt = null;
                   String query = "Select * from USER_CATEGORY,MV_SUBSCRIBER_ATTRIBS";
                   stmt=connection.createStatement();
                   stmt.setQueryTimeout(0);
                   // Get time at start of query
                   long initialTime = System.currentTimeMillis();
                   // Execute the Query in query
                   ResultSet rst = stmt.executeQuery(query);
                   long finalTime = System.currentTimeMillis();
                   timetaken = finalTime - initialTime;
                   if(timetaken>0003)
                        stmt.cancel();
                        System.out.println("Statement Cancelled");
                   //Populate the ResultSet object
                   while ( rst.next() )
                        numFetchedRows++;
                        rst.getObject(1);
                   System.out.println("Time taken for query: " + timetaken);
                   System.out.println("Number of rows fetched: " + numFetchedRows);
                   System.out.println(rst);
              } catch (SQLException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    The program hangs when it comes to retrieving the >resultset
    The program gives the following output If I do not go through the resultset:
    Statement Cancelled
    Time taken for query: 50782
    Number of rows fetched: 0
    oracle.jdbc.driver.OracleResultSetImpl@1a85d38Here the cancel method was invoked but to no visible action.

  • Migration (import) of simple Access table+screen to Apex is failing

    Hi,
    I have tried Exporting and then migrating an Access application - but have had repeated failures on the import step. These attempts are on the Oracle Application Express environment for evaluating Apex - I have a Workspace allocation (wsmihail1) on the Oracle database ( my schema is DBS1). User id is [email protected]
    Now, I have tried creating a Real simple Access application - 1 simple table & 1 form & 1 comand button !!
    Still crash::
    In APEX Create Migration Project screen / step :::::
    - try to Import db2.sql ....
    KEEP getting ::
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ERR-1021 Unable to run "function body returning boolean" validation.
    FYI::::
    THE db2.sql file is copied to here:::
    REM This SQL script was generated by the Oracle Migration Workbench
    REM Exporter for Microsoft Access on 19/10/2007 17:02:59
    REM Release: 10.2.0.2.0
    REM Version: Microsoft Access 2002
    REM Do not modify this file as any modification will invalidate the export
    REM and subsequent migration of your Microsoft Access database
    set define off
    set verify off
    set serveroutput on size 1000000
    set feedback off
    WHENEVER SQLERROR EXIT SQL.SQLCODE ROLLBACK
    begin
    WWV_MIG_ACC_LOAD.INS_WWV_MIG_ACCESS (
         p_dbid => 1,
         p_dbname => 'db2',
         p_dbsize => '176KB',
         p_dbpathname => 'C:\db2.mdb',
         p_dbuser => 'db2',
         p_dbpassword => ' ',
         p_isappdb => 1,
         p_isattacheddb => 0,
         p_convertdb => 1,
         p_jetversion => 4.0,
         p_accessversion => 'MS Access 2000',
         p_build => 501,
         p_collatingorder => 1033,
         p_querytimeout => 60,
         p_startupform => NULL,
         p_startupshowstatusbar => 1
    end;
    begin
    WWV_MIG_ACC_LOAD.INS_WWV_MIG_ACC_TABLES (
         p_dbid => 1,
         p_tblid => 1,
         p_tblname => 'Table1',
         p_primarykey => 1,
         p_cnvtablestruct => 1,
         p_cnvmovedata => 1,
         p_cnvri => 1,
         p_cnvvalidation => 1,
         p_cnvdefault => 1,
         p_cnvaddtimestamp => 1,
         p_attachtablebacktoaccess => 1,
         p_savepassword => 0,
         p_cnvmakeupdateable => 1,
         p_retainlocalcopy => 0,
         p_syncwithserver => 1,
         p_ownerid => 1,
         p_validationtext => ' ',
         p_validationrule => ' ',
         p_numberofrows => 4,
         p_cachingtable => 0,
         p_description => ' ',
         p_attributes => 0,
         p_conflicttable => NULL,
         p_datecreated => '20071019164930',
         p_lastupdated => '20071019164934',
         p_recordcount => 4,
         p_orderbyon => 1,
         p_replicafilter => NULL,
         p_sourcetablename => ' ',
         p_updatable => 0
    end;
    begin
    WWV_MIG_ACC_LOAD.INS_WWV_MIG_ACC_COLUMNS (
         p_dbid => 1,
         p_colid => 1,
         p_tblid => 1,
         p_colname => 'ID',
         p_coltype => 4,
         p_coltypedesc => 'Long',
         p_colautoincr => 0,
         p_nextcountervalue => 0,
         p_maxlengthsource => 0,
         p_avglengthsource => 0,
         p_coltextsize => 4,
         p_allowzerolength => 0,
         p_defaultvalue => '0',
         p_colrequired => 1,
         p_colcollatingorder => 1033,
         p_colordposition => 1,
         p_validationrule => ' ',
         p_validationtext => ' ',
         p_columndescription => ' ',
         p_columnhidden => 1,
         p_columnorder => 0,
         p_columnwidth => '-1',
         p_decimalplaces => 255,
         p_foreignname => ' ',
         p_validateonset => 1
    end;
    begin
    WWV_MIG_ACC_LOAD.INS_WWV_MIG_ACC_COLUMNS (
         p_dbid => 1,
         p_colid => 2,
         p_tblid => 1,
         p_colname => 'Desc',
         p_coltype => 10,
         p_coltypedesc => 'Text',
         p_colautoincr => 0,
         p_nextcountervalue => 0,
         p_maxlengthsource => 0,
         p_avglengthsource => 0,
         p_coltextsize => 50,
         p_allowzerolength => -1,
         p_defaultvalue => ' ',
         p_colrequired => 1,
         p_colcollatingorder => 1033,
         p_colordposition => 2,
         p_validationrule => ' ',
         p_validationtext => ' ',
         p_columndescription => ' ',
         p_columnhidden => 1,
         p_columnorder => 0,
         p_columnwidth => '-1',
         p_decimalplaces => 0,
         p_foreignname => ' ',
         p_validateonset => 1
    end;
    begin
    WWV_MIG_ACC_LOAD.INS_WWV_MIG_ACC_INDEXES (
         p_dbid => 1,
         p_indid => 1,
         p_tblid => 1,
         p_indname => 'ID',
         p_cnvindex => 1,
         p_isprimary => 0,
         p_isunique => 0,
         p_isforeign => 0,
         p_ignorenulls => 0,
         p_isrequired => 0,
         p_distinctcount => 4,
         p_isclustered => 0
    end;
    begin
    WWV_MIG_ACC_LOAD.INS_WWV_MIG_ACC_IDX_COLS (
         p_dbid => 1,
         p_indcolid => 1,
         p_indid => 1,
         p_colid => 1,
         p_colorder => 1,
         p_tblid => 1,
         p_colname => 'ID'
    end;
    begin
    WWV_MIG_ACC_LOAD.INS_WWV_MIG_ACC_INDEXES (
         p_dbid => 1,
         p_indid => 2,
         p_tblid => 1,
         p_indname => 'PK_Table1',
         p_cnvindex => 1,
         p_isprimary => 1,
         p_isunique => 1,
         p_isforeign => 0,
         p_ignorenulls => 0,
         p_isrequired => 1,
         p_distinctcount => 4,
         p_isclustered => 0
    end;
    begin
    WWV_MIG_ACC_LOAD.INS_WWV_MIG_ACC_IDX_COLS (
         p_dbid => 1,
         p_indcolid => 2,
         p_indid => 2,
         p_colid => 1,
         p_colorder => 1,
         p_tblid => 1,
         p_colname => 'ID'
    end;
    begin
    WWV_MIG_ACC_LOAD.INS_WWV_MIG_ACC_TAB_PERM (
         p_dbid => 1,
         p_tblid => 1,
         p_userid => 1,
         p_permissionid => 1,
         p_permission => 1048319,
         p_permission_desc => ' DB_SEC_CREATE DB_SEC_FULLACCESS DB_SEC_DELETE DB_SEC_READSEC DB_SEC_WRITESEC DB_SEC_WRITEOWNER DB_SEC_FRMRPT_READDEF DB_SEC_FRMRPT_WRITEDEF DB_SEC_MAC_READDEF DB_SEC_MAC_WRITEDEF DB_SEC_MAC_EXECUTE DB_SEC_MOD_READDEF DB_SEC_MOD_WRITEDEF '
    end;
    begin
    WWV_MIG_ACC_LOAD.INS_WWV_MIG_ACC_FORMS (
         p_dbid => 1,
         p_formid => 1,
         p_formname => 'MyForm',
         p_afterdelconfirm => ' ',
         p_afterinsert => ' ',
         p_afterupdate => ' ',
         p_allowadditions => 0,
         p_allowdeletions => 0,
         p_allowedits => 0,
         p_allowediting => 0,
         p_allowfilters => 0,
         p_allowupdating => 1,
         p_autocenter => 0,
         p_autoresize => 0,
         p_backcolor => -2147483633,
         p_beforedelconfirm => ' ',
         p_beforeinsert => ' ',
         p_beforeupdate => ' ',
         p_borderstyle => 2,
         p_formcaption => 'MyForm',
         p_closebutton => 0,
         p_controlbox => 0,
         p_count => 5,
         p_currentview => 0,
         p_cycle => 0,
         p_dataentry => 1,
         p_datasheetbackcolor => 16777215,
         p_datasheetcellseffect => 0,
         p_datasheetfontheight => 10,
         p_datasheetfontitalic => 1,
         p_datasheetfontname => 'Arial',
         p_datasheetfontunderline => 1,
         p_datasheetfontweight => 400,
         p_datasheetforecolor => 0,
         p_datasheetgridlinesbehavior => 3,
         p_datasheetgridlinescolor => 12632256,
         p_defaultediting => 2,
         p_defaultview => 0,
         p_dividinglines => 0,
         p_fastlaserprinting => 0,
         p_filter => ' ',
         p_filteron => 1,
         p_frozencolumns => 1,
         p_gridX => 10,
         p_gridY => 10,
         p_hasmodule => 0,
         p_helpcontextid => 0,
         p_helpfile => ' ',
         p_hwnd => 590738,
         p_insideheight => 2265,
         p_insidewidth => 5490,
         p_keypreview => 1,
         p_layoutforprint => 1,
         p_logicalpagewidth => 9012,
         p_maxbutton => 0,
         p_menubar => ' ',
         p_minbutton => 0,
         p_minmaxbuttons => 3,
         p_modal => 1,
         p_navigationbuttons => 0,
         p_onactivate => ' ',
         p_onapplyfilter => ' ',
         p_onclick => ' ',
         p_onclose => ' ',
         p_oncurrent => ' ',
         p_ondblclick => ' ',
         p_ondeactivate => ' ',
         p_ondelete => ' ',
         p_onerror => ' ',
         p_onfilter => ' ',
         p_ongotfocus => ' ',
         p_onkeydown => ' ',
         p_onkeypress => ' ',
         p_onkeyup => ' ',
         p_onload => ' ',
         p_onlostfocus => ' ',
         p_onmousedown => ' ',
         p_onmousemove => ' ',
         p_onmouseup => ' ',
         p_onopen => ' ',
         p_onresize => ' ',
         p_ontimer => ' ',
         p_onunload => ' ',
         p_openargs => 'True',
         p_orderby => ' ',
         p_orderbyon => 1,
         p_painting => 0,
         p_palettesource => '(Default)',
         p_picture => '(NONE)',
         p_picturealignment => 2,
         p_picturesizemode => 0,
         p_picturetiling => 1,
         p_picturetype => 0,
         p_popup => 1,
         p_recordlocks => 0,
         p_recordselectors => 0,
         p_recordsettype => 0,
         p_recordsource => 'Table1',
         p_rowheight => -1,
         p_scrollbars => 3,
         p_shortcutmenu => 0,
         p_shortcutmenubar => ' ',
         p_showgrid => 0,
         p_tag => ' ',
         p_timerinterval => 0,
         p_toolbar => ' ',
         p_viewsallowed => 0,
         p_visible => 0,
         p_whatsthisbutton => 1,
         p_width => 4044,
         p_windowheight => 2970,
         p_windowwidth => 5910
    end;
    begin
    WWV_MIG_ACC_LOAD.INS_WWV_MIG_ACC_FORMS_CONTROLS (
         p_dbid => 1,
         p_formid => 1,
         p_controlid => 1,
         p_controlname => 'ID',
         p_controltype => 109,
         p_eventprocprefix => 'ID',
         p_inselection => 1,
         p_left => 1677,
         p_parent => 'MyForm',
         p_section => 0,
         p_tag => ' ',
         p_top => 114,
         p_visible => 0,
         p_backcolor => -2147483643,
         p_backstyle => 1,
         p_boundcolumn => NULL,
         p_ctrlcaption => ' ',
         p_columncount => NULL,
         p_columnheads => ' ',
         p_columnwidths => ' ',
         p_controlsource => 'ID',
         p_controltiptext => ' ',
         p_defaultvalue => ' ',
         p_displaywhen => 0,
         p_enabled => 0,
         p_fontbold => 1,
         p_fontitalic => 1,
         p_fontname => 'MS Sans Serif',
         p_fontsize => 8,
         p_fontunderline => 1,
         p_fontwheight => NULL,
         p_forecolor => -2147483640,
         p_format => ' ',
         p_height => 255,
         p_helpcontextid => 0,
         p_limittolist => 1,
         p_linkchildfields => ' ',
         p_linkmasterfields => ' ',
         p_listrows => NULL,
         p_multirow => 1,
         p_onchange => ' ',
         p_onclick => ' ',
         p_ondblclick => ' ',
         p_onkeydown => ' ',
         p_onkeypress => ' ',
         p_onkeyup => ' ',
         p_onmousedown => ' ',
         p_onmousemove => ' ',
         p_onmouseup => ' ',
         p_optionvalue => NULL,
         p_pageindex => NULL,
         p_picture => ' ',
         p_picturealignment => NULL,
         p_pictureresizemode => NULL,
         p_picturetiling => 1,
         p_picturetype => NULL,
         p_rowsource => ' ',
         p_rowsourcetype => ' ',
         p_shortcutmenubar => ' ',
         p_sourceobject => ' ',
         p_statusbartext => ' ',
         p_style => NULL,
         p_tabfixedheight => NULL,
         p_tabfixedwidth => NULL,
         p_tabindex => 0,
         p_tabstop => 0,
         p_textalign => 0,
         p_textfontcharset => 0,
         p_width => 900
    end;
    begin
    WWV_MIG_ACC_LOAD.INS_WWV_MIG_ACC_FORMS_CONTROLS (
         p_dbid => 1,
         p_formid => 1,
         p_controlid => 2,
         p_controlname => 'ID_Label',
         p_controltype => 100,
         p_eventprocprefix => 'ID_Label',
         p_inselection => 1,
         p_left => 57,
         p_parent => 'ID',
         p_section => 0,
         p_tag => ' ',
         p_top => 114,
         p_visible => 0,
         p_backcolor => -2147483633,
         p_backstyle => 0,
         p_boundcolumn => NULL,
         p_ctrlcaption => 'ID',
         p_columncount => NULL,
         p_columnheads => ' ',
         p_columnwidths => ' ',
         p_controlsource => ' ',
         p_controltiptext => ' ',
         p_defaultvalue => ' ',
         p_displaywhen => 0,
         p_enabled => 1,
         p_fontbold => 1,
         p_fontitalic => 1,
         p_fontname => 'MS Sans Serif',
         p_fontsize => 8,
         p_fontunderline => 1,
         p_fontwheight => NULL,
         p_forecolor => -2147483630,
         p_format => ' ',
         p_height => 255,
         p_helpcontextid => 0,
         p_limittolist => 1,
         p_linkchildfields => ' ',
         p_linkmasterfields => ' ',
         p_listrows => NULL,
         p_multirow => 1,
         p_onchange => ' ',
         p_onclick => ' ',
         p_ondblclick => ' ',
         p_onkeydown => ' ',
         p_onkeypress => ' ',
         p_onkeyup => ' ',
         p_onmousedown => ' ',
         p_onmousemove => ' ',
         p_onmouseup => ' ',
         p_optionvalue => NULL,
         p_pageindex => NULL,
         p_picture => ' ',
         p_picturealignment => NULL,
         p_pictureresizemode => NULL,
         p_picturetiling => 1,
         p_picturetype => NULL,
         p_rowsource => ' ',
         p_rowsourcetype => ' ',
         p_shortcutmenubar => ' ',
         p_sourceobject => ' ',
         p_statusbartext => ' ',
         p_style => NULL,
         p_tabfixedheight => NULL,
         p_tabfixedwidth => NULL,
         p_tabindex => NULL,
         p_tabstop => 1,
         p_textalign => 0,
         p_textfontcharset => 0,
         p_width => 1560
    end;
    begin
    WWV_MIG_ACC_LOAD.INS_WWV_MIG_ACC_FORMS_CONTROLS (
         p_dbid => 1,
         p_formid => 1,
         p_controlid => 3,
         p_controlname => 'Desc',
         p_controltype => 109,
         p_eventprocprefix => 'Desc',
         p_inselection => 1,
         p_left => 1677,
         p_parent => 'MyForm',
         p_section => 0,
         p_tag => ' ',
         p_top => 456,
         p_visible => 0,
         p_backcolor => -2147483643,
         p_backstyle => 1,
         p_boundcolumn => NULL,
         p_ctrlcaption => ' ',
         p_columncount => NULL,
         p_columnheads => ' ',
         p_columnwidths => ' ',
         p_controlsource => 'Desc',
         p_controltiptext => ' ',
         p_defaultvalue => ' ',
         p_displaywhen => 0,
         p_enabled => 0,
         p_fontbold => 1,
         p_fontitalic => 1,
         p_fontname => 'MS Sans Serif',
         p_fontsize => 8,
         p_fontunderline => 1,
         p_fontwheight => NULL,
         p_forecolor => -2147483640,
         p_format => ' ',
         p_height => 255,
         p_helpcontextid => 0,
         p_limittolist => 1,
         p_linkchildfields => ' ',
         p_linkmasterfields => ' ',
         p_listrows => NULL,
         p_multirow => 1,
         p_onchange => ' ',
         p_onclick => ' ',
         p_ondblclick => ' ',
         p_onkeydown => ' ',
         p_onkeypress => ' ',
         p_onkeyup => ' ',
         p_onmousedown => ' ',
         p_onmousemove => ' ',
         p_onmouseup => ' ',
         p_optionvalue => NULL,
         p_pageindex => NULL,
         p_picture => ' ',
         p_picturealignment => NULL,
         p_pictureresizemode => NULL,
         p_picturetiling => 1,
         p_picturetype => NULL,
         p_rowsource => ' ',
         p_rowsourcetype => ' ',
         p_shortcutmenubar => ' ',
         p_sourceobject => ' ',
         p_statusbartext => ' ',
         p_style => NULL,
         p_tabfixedheight => NULL,
         p_tabfixedwidth => NULL,
         p_tabindex => 1,
         p_tabstop => 0,
         p_textalign => 0,
         p_textfontcharset => 0,
         p_width => 2310
    end;
    begin
    WWV_MIG_ACC_LOAD.INS_WWV_MIG_ACC_FORMS_CONTROLS (
         p_dbid => 1,
         p_formid => 1,
         p_controlid => 4,
         p_controlname => 'Desc_Label',
         p_controltype => 100,
         p_eventprocprefix => 'Desc_Label',
         p_inselection => 1,
         p_left => 57,
         p_parent => 'Desc',
         p_section => 0,
         p_tag => ' ',
         p_top => 456,
         p_visible => 0,
         p_backcolor => -2147483633,
         p_backstyle => 0,
         p_boundcolumn => NULL,
         p_ctrlcaption => 'Desc',
         p_columncount => NULL,
         p_columnheads => ' ',
         p_columnwidths => ' ',
         p_controlsource => ' ',
         p_controltiptext => ' ',
         p_defaultvalue => ' ',
         p_displaywhen => 0,
         p_enabled => 1,
         p_fontbold => 1,
         p_fontitalic => 1,
         p_fontname => 'MS Sans Serif',
         p_fontsize => 8,
         p_fontunderline => 1,
         p_fontwheight => NULL,
         p_forecolor => -2147483630,
         p_format => ' ',
         p_height => 255,
         p_helpcontextid => 0,
         p_limittolist => 1,
         p_linkchildfields => ' ',
         p_linkmasterfields => ' ',
         p_listrows => NULL,
         p_multirow => 1,
         p_onchange => ' ',
         p_onclick => ' ',
         p_ondblclick => ' ',
         p_onkeydown => ' ',
         p_onkeypress => ' ',
         p_onkeyup => ' ',
         p_onmousedown => ' ',
         p_onmousemove => ' ',
         p_onmouseup => ' ',
         p_optionvalue => NULL,
         p_pageindex => NULL,
         p_picture => ' ',
         p_picturealignment => NULL,
         p_pictureresizemode => NULL,
         p_picturetiling => 1,
         p_picturetype => NULL,
         p_rowsource => ' ',
         p_rowsourcetype => ' ',
         p_shortcutmenubar => ' ',
         p_sourceobject => ' ',
         p_statusbartext => ' ',
         p_style => NULL,
         p_tabfixedheight => NULL,
         p_tabfixedwidth => NULL,
         p_tabindex => NULL,
         p_tabstop => 1,
         p_textalign => 0,
         p_textfontcharset => 0,
         p_width => 1560
    end;
    begin
    WWV_MIG_ACC_LOAD.INS_WWV_MIG_ACC_FORMS_CONTROLS (
         p_dbid => 1,
         p_formid => 1,
         p_controlid => 5,
         p_controlname => 'Command4',
         p_controltype => 104,
         p_eventprocprefix => 'Command4',
         p_inselection => 1,
         p_left => 2891,
         p_parent => 'MyForm',
         p_section => 0,
         p_tag => ' ',
         p_top => 56,
         p_visible => 0,
         p_backcolor => NULL,
         p_backstyle => NULL,
         p_boundcolumn => NULL,
         p_ctrlcaption => 'Command4',
         p_columncount => NULL,
         p_columnheads => ' ',
         p_columnwidths => ' ',
         p_controlsource => ' ',
         p_controltiptext => ' ',
         p_defaultvalue => ' ',
         p_displaywhen => 0,
         p_enabled => 0,
         p_fontbold => 1,
         p_fontitalic => 1,
         p_fontname => 'MS Sans Serif',
         p_fontsize => 8,
         p_fontunderline => 1,
         p_fontwheight => NULL,
         p_forecolor => 0,
         p_format => ' ',
         p_height => 340,
         p_helpcontextid => 0,
         p_limittolist => 1,
         p_linkchildfields => ' ',
         p_linkmasterfields => ' ',
         p_listrows => NULL,
         p_multirow => 1,
         p_onchange => ' ',
         p_onclick => '[Event Procedure]',
         p_ondblclick => ' ',
         p_onkeydown => ' ',
         p_onkeypress => ' ',
         p_onkeyup => ' ',
         p_onmousedown => ' ',
         p_onmousemove => ' ',
         p_onmouseup => ' ',
         p_optionvalue => NULL,
         p_pageindex => NULL,
         p_picture => '(NONE)',
         p_picturealignment => NULL,
         p_pictureresizemode => NULL,
         p_picturetiling => 1,
         p_picturetype => 0,
         p_rowsource => ' ',
         p_rowsourcetype => ' ',
         p_shortcutmenubar => ' ',
         p_sourceobject => ' ',
         p_statusbartext => ' ',
         p_style => NULL,
         p_tabfixedheight => NULL,
         p_tabfixedwidth => NULL,
         p_tabindex => 2,
         p_tabstop => 0,
         p_textalign => NULL,
         p_textfontcharset => 0,
         p_width => 964
    end;
    begin
    WWV_MIG_ACC_LOAD.INS_WWV_MIG_ACC_FORMS_MODULES (
         p_dbid => 1,
         p_moduleid => 1,
         p_formid => 1,
         p_modulename => 'Form_MyForm',
         p_countofdeclarationlines => 1,
         p_countoflines => 21,
         p_lines => 'Option Compare Database
    NULL
    Private Sub Command4_Click()
    NULL
    Dim varX As Variant
    varX = MsgBox(Chr(34)Click [OK] to quit app or [Cancel] to stay.Chr(34), vbYesNo)
    If varX = vbYes Then
    MsgBox Chr(34)Exit appChr(34)
    Application.Quit
    Else
    NULL
    MsgBox Chr(34)StayChr(33)Chr(34)
    NULL
    End If
    NULL
    End Sub
         p_moduletype => 1
    end;
    begin
    WWV_MIG_ACC_LOAD.INS_WWV_MIG_ACC_FORMS_PERM (
         p_dbid => 1,
         p_formid => 1,
         p_userid => 1,
         p_permissionid => 1,
         p_permission => 1048575,
         p_permission_desc => ' DB_SEC_CREATE DB_SEC_FULLACCESS DB_SEC_DELETE DB_SEC_READSEC DB_SEC_WRITESEC DB_SEC_WRITEOWNER DB_SEC_FRMRPT_EXECUTE DB_SEC_FRMRPT_READDEF DB_SEC_FRMRPT_WRITEDEF DB_SEC_FRMRPT_EXECUTE DB_SEC_MAC_READDEF DB_SEC_MAC_WRITEDEF DB_SEC_MAC_EXECUTE DB_SEC_MOD_READDEF DB_SEC_MOD_WRITEDEF '
    end;
    begin
    WWV_MIG_ACC_LOAD.INS_WWV_MIG_ACC_GROUPS (
         p_dbid => 1,
         p_groupid => 1,
         p_grpname => 'Admins'
    end;
    begin
    WWV_MIG_ACC_LOAD.INS_WWV_MIG_ACC_GROUPS (
         p_dbid => 1,
         p_groupid => 2,
         p_grpname => 'Users'
    end;
    begin
    WWV_MIG_ACC_LOAD.INS_WWV_MIG_ACC_USERS (
         p_dbid => 1,
         p_userid => 1,
         p_username => 'admin'
    end;
    begin
    WWV_MIG_ACC_LOAD.INS_WWV_MIG_ACC_GRPSMEMBERS (
         p_dbid => 1,
         p_grpmbrid => 1,
         p_userid => 1,
         p_groupid => 1
    end;
    begin
    WWV_MIG_ACC_LOAD.INS_WWV_MIG_ACC_GRPSMEMBERS (
         p_dbid => 1,
         p_grpmbrid => 2,
         p_userid => 1,
         p_groupid => 2
    end;
    +++++++++++++++++++++++++++++++++++++++++++
    The associated .xml file is :::
    <?xml version="1.0" encoding="UTF-8" ?>
    - <!-- this file was generated by the Oracle Migration Workbench Exporter for Microsoft Access 10.2.0.2.0 on 19/10/2007 17:02:59
    -->
    - <!-- Do not modify this file as any modification will invalidate the export and subsequent migration of your Microsoft Access database
    -->
    - <DATABASES>
    - <DATABASE>
    <DBID>1</DBID>
    <DBNAME>db2</DBNAME>
    <DBSIZE>1</DBSIZE>
    <DBPATHNAME>C:\db2.mdb</DBPATHNAME>
    <DBUSER>db2</DBUSER>
    <DBPASSWORD>oracle</DBPASSWORD>
    <ISAPPDB>1</ISAPPDB>
    <ISATTACHEDDB>0</ISATTACHEDDB>
    <CONVERTDB>1</CONVERTDB>
    <VERSION>4.0</VERSION>
    <ACCESSVERSION>MS Access 2000</ACCESSVERSION>
    <BUILD>501</BUILD>
    <COLLATINGORDER>1033</COLLATINGORDER>
    <QUERYTIMEOUT>60</QUERYTIMEOUT>
    <STARTUPFORM />
    <STARTUPSHOWSTATUSBAR>1</STARTUPSHOWSTATUSBAR>
    - <TABLES>
    - <TABLE PRIMARY_KEY="1">
    <TBLID>1</TBLID>
    <DBID>1</DBID>
    <TBLNAME>Table1</TBLNAME>
    <CNVTABLESTRUCT>1</CNVTABLESTRUCT>
    <CNVMOVEDATA>1</CNVMOVEDATA>
    <CNVRI>1</CNVRI>
    <CNVVALIDATION>1</CNVVALIDATION>
    <CNVDEFAULT>1</CNVDEFAULT>
    <CNVADDTIMESTAMP>1</CNVADDTIMESTAMP>
    <ATTACHTABLEBACKTOACCESS>1</ATTACHTABLEBACKTOACCESS>
    <SAVEPASSWORD>0</SAVEPASSWORD>
    <CNVMAKEUPDATEABLE>1</CNVMAKEUPDATEABLE>
    <RETAINLOCALCOPY>0</RETAINLOCALCOPY>
    <SYNCWITHSERVER>1</SYNCWITHSERVER>
    <OWNERID>1</OWNERID>
    <VALIDATIONTEXT />
    <VALIDATIONRULE />
    <NUMBEROFROWS>4</NUMBEROFROWS>
    <CACHINGTABLE>0</CACHINGTABLE>
    <DESCRIPTION />
    <ATTRIBUTES>0</ATTRIBUTES>
    <CONFLICTTABLE />
    <DATECREATED>19/10/2007 16:49:30</DATECREATED>
    <LASTUPDATED>19/10/2007 16:49:34</LASTUPDATED>
    <RECORDCOUNT>4</RECORDCOUNT>
    <ORDERBYON>1</ORDERBYON>
    <REPLICAFILTER />
    <SOURCETABLENAME />
    <UPDATABLE>0</UPDATABLE>
    - <COLUMNS>
    - <COLUMN>
    <COLID>1</COLID>
    <TBLID>1</TBLID>
    <DBID>1</DBID>
    <COLNAME>ID</COLNAME>
    <COLTYPE>4</COLTYPE>
    <COLTYPEDESC>Long</COLTYPEDESC>
    <COLAUTOINCR>0</COLAUTOINCR>
    <NEXTCOUNTERVALUE>0</NEXTCOUNTERVALUE>
    <MAXLENGTHSOURCE>0</MAXLENGTHSOURCE>
    <AVGLENGTHSOURCE>0</AVGLENGTHSOURCE>
    <COLTEXTSIZE>4</COLTEXTSIZE>
    <ALLOWZEROLENGTH>0</ALLOWZEROLENGTH>
    <DEFAULTVALUE>0</DEFAULTVALUE>
    <COLREQUIRED>1</COLREQUIRED>
    <COLCOLLATINGORDER>1033</COLCOLLATINGORDER>
    <COLORDPOSITION>1</COLORDPOSITION>
    <VALIDATIONRULE />
    <VALIDATIONTEXT />
    <COLUMNDESCRIPTION />
    <COLUMNHIDDEN>1</COLUMNHIDDEN>
    <COLUMNORDER>0</COLUMNORDER>
    <COLUMNWIDTH>-1</COLUMNWIDTH>
    <DECIMALPLACES>255</DECIMALPLACES>
    <FOREIGNNAME />
    <VALIDATEONSET>1</VALIDATEONSET>
    </COLUMN>
    - <COLUMN>
    <COLID>2</COLID>
    <TBLID>1</TBLID>
    <DBID>1</DBID>
    <COLNAME>Desc</COLNAME>
    <COLTYPE>10</COLTYPE>
    <COLTYPEDESC>Text</COLTYPEDESC>
    <COLAUTOINCR>0</COLAUTOINCR>
    <NEXTCOUNTERVALUE>0</NEXTCOUNTERVALUE>
    <MAXLENGTHSOURCE>0</MAXLENGTHSOURCE>
    <AVGLENGTHSOURCE>0</AVGLENGTHSOURCE>
    <COLTEXTSIZE>50</COLTEXTSIZE>
    <ALLOWZEROLENGTH>-1</ALLOWZEROLENGTH>
    <DEFAULTVALUE />
    <COLREQUIRED>1</COLREQUIRED>
    <COLCOLLATINGORDER>1033</COLCOLLATINGORDER>
    <COLORDPOSITION>2</COLORDPOSITION>
    <VALIDATIONRULE />
    <VALIDATIONTEXT />
    <COLUMNDESCRIPTION />
    <COLUMNHIDDEN>1</COLUMNHIDDEN>
    <COLUMNORDER>0</COLUMNORDER>
    <COLUMNWIDTH>-1</COLUMNWIDTH>
    <DECIMALPLACES>0</DECIMALPLACES>
    <FOREIGNNAME />
    <VALIDATEONSET>1</VALIDATEONSET>
    </COLUMN>
    </COLUMNS>
    - <INDEXES>
    - <INDEX>
    <INDID>1</INDID>
    <TBLID>1</TBLID>
    <DBID>1</DBID>
    <INDNAME>ID</INDNAME>
    <CNVINDEX>1</CNVINDEX>
    <ISPRIMARY>0</ISPRIMARY>
    <ISUNIQUE>0</ISUNIQUE>
    <ISFOREIGN>0</ISFOREIGN>
    <IGNORENULLS>0</IGNORENULLS>
    <ISREQUIRED>0</ISREQUIRED>
    <DISTINCTCOUNT>4</DISTINCTCOUNT>
    <ISCLUSTERED>0</ISCLUSTERED>
    - <INDEX_COLUMNS>
    - <INDEX_COLUMN>
    <INDCOLID>1</INDCOLID>
    <INDID>1</INDID>
    <COLID>1</COLID>
    <DBID>1</DBID>
    <COLORDER>1</COLORDER>
    <TBLID>1</TBLID>
    <COLNAME>ID</COLNAME>
    </INDEX_COLUMN>
    </INDEX_COLUMNS>
    </INDEX>
    - <INDEX>
    <INDID>2</INDID>
    <TBLID>1</TBLID>
    <DBID>1</DBID>
    <INDNAME>PK_Table1</INDNAME>
    <CNVINDEX>1</CNVINDEX>
    <ISPRIMARY>1</ISPRIMARY>
    <ISUNIQUE>1</ISUNIQUE>
    <ISFOREIGN>0</ISFOREIGN>
    <IGNORENULLS>0</IGNORENULLS>
    <ISREQUIRED>1</ISREQUIRED>
    <DISTINCTCOUNT>4</DISTINCTCOUNT>
    <ISCLUSTERED>0</ISCLUSTERED>
    - <INDEX_COLUMNS>
    - <INDEX_COLUMN>
    <INDCOLID>2</INDCOLID>
    <INDID>2</INDID>
    <COLID>1</COLID>
    <DBID>1</DBID>
    <COLORDER>1</COLORDER>
    <TBLID>1</TBLID>
    <COLNAME>ID</COLNAME>
    </INDEX_COLUMN>
    </INDEX_COLUMNS>
    </INDEX>
    </INDEXES>
    - <PERMISSIONS>
    - <USRS>
    - <USR>
    <USRNAME>admin</USRNAME>
    <PERMISSION>1048319</PERMISSION>
    </USR>
    </USRS>
    - <GRPS>
    - <GRP>
    <USRNAME>Admins</USRNAME>
    <PERMISSION>1048319</PERMISSION>
    </GRP>
    - <GRP>
    <USRNAME>Users</USRNAME>
    <PERMISSION>1048319</PERMISSION>
    </GRP>
    </GRPS>
    </PERMISSIONS>
    </TABLE>
    </TABLES>
    <QUERIES />
    <RELATIONS />
    <MODULES />
    - <GROUPS>
    - <GROUP>
    <GROUPID>1</GROUPID>
    <GRPNAME>Admins</GRPNAME>
    - <GROUPUSERS>
    <GROUPUSER>admin</GROUPUSER>
    </GROUPUSERS>
    </GROUP>
    - <GROUP>
    <GROUPID>2</GROUPID>
    <GRPNAME>Users</GRPNAME>
    - <GROUPUSERS>
    <GROUPUSER>admin</GROUPUSER>
    </GROUPUSERS>
    </GROUP>
    </GROUPS>
    - <USERS>
    - <USER>
    <USERID>1</USERID>
    <USERNAME>admin</USERNAME>
    </USER>
    </USERS>
    </DATABASE>
    <ATTACHED_TABLES />
    </DATABASES>

    Hi Mike,
    Hopefully I can help to clarify a few things for you. An MS Access application migration essentially involves 3 steps, to be completed in the following order:
    1. Export the database and application information from your MS Access MDB file using the Exporter tool for MS Access. This tool generates two files: an XML file containing the database schema information, and a SQL script containing the application metadata. You've already completed this step.
    2. Migrate the database schema to Oracle. Using Oracle SQL Developer Migration Workbench, load the XML file generated in step 1, to capture & convert the MS Access database objects to Oracle.
    3. Migrate the application to Oracle Application Express. Using Oracle Application Express Application Migrations, create a Migration Project to retrieve the application metadata from the SQL script generated in step 1. The Migration Project should be associated with the Oracle schema containing the migrated database objects (from step 2).
    It sounds like you have carried out steps 1 and 3, but skipped step 2. I would recommend that you do the following:
    * Download the latest release of Oracle SQL Developer, version 1.2.1, from OTN - http://www.oracle.com/technology/software/products/sql/index.html. It incorporates the Migration Workbench. Review the accompanying documentation from the Help > Table of Contents menu item, specifically the chapter "Migrating Third Party Databases".
    * Create a Migration Repository, which is used by the Migration Workbench during the migration process. In order to do so, you need to create a database user for the Migration Repository. I would recommend reviewing the documentation for further information on this. The section titled "Before You Start Migrating: General Information" will assist you.
    * From the menu bar go to Migration > Capture Microsoft Access Exported XML, where you should browse to the location of the XML file generated by the Exporter tool in step 1. This captures the MS Access database schema information, and create a Captured Model of the information.
    * Right-click on the captured model, and select "Convert to Oracle Model" from its context menu. This creates a converted model, which is a representation of the structure of the destination Oracle database.
    * From the menu bar go to Tools > Preferences, to launch the Preferences dialog. On the Preferences dialog go to Migration > Generation Options, and select the "Least Privilege Schema Migration" and click OK.
    * Right-click on the Converted Model & select "Generate" from its context menu. This will generate the DDL statements to create the migrated database objects. I would recommend that you save the statements as a SQL script.
    * Create a new Oracle connection in Oracle SQL Developer, providing the connection details to the schema associated with your Oracle APEX workspace. Then run the SQL script containing the output from the "Generate" step. This will create the objects in the schema associated with your Oracle APEX workspace.
    * Log in to the Oracle APEX workspace, and I would recommend creating a new Migration Project. You should then be in a position to review the information retrieved from your MS Access application forms & reports.
    I hope this helps. Apologies for the length of the posting, but hopefully the points I've outlined will make the process a little clearer for you.
    Regards,
    Hilary

  • ODBC crash on Solaris

    I have a repeatable crash on Solaris Sparc 32 bit.
    I use a table created by
    CREATE TABLE "IAN"."PICDAR_MANIFEST"
    (     "OBJECT_NAME" VARCHAR2(64 BYTE),
         "OBJECT_TYPE" VARCHAR2(10 BYTE),
         "COUNT" NUMBER,
         "FILE_NAME" VARCHAR2(32 BYTE),
         "FIELD_NAME" VARCHAR2(32 BYTE),
         PRIMARY KEY ("OBJECT_NAME")
    USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "IAN" ENABLE
    ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "IAN" ;
    and populated using
    Insert into PICDAR_MANIFEST (OBJECT_NAME,OBJECT_TYPE,COUNT,FILE_NAME,FIELD_NAME) values ('publicationtext_AUDIT','COUNTER',98,null,null);
    I have configured the ODBC using instant client 10.2.0.3 using
    odbcinst.ini
    [Oracle 10g ODBC Driver]
    Description = Oracle ODBC driver for Oracle 10g
    Driver = /m/jbod1/oracle/instantclient_10_2/libsqora.so.10.1
    Setup =
    FileUsage =
    CPTimeout =
    CPReuse =
    and
    odbc.ini
    [Ian]
    Application Attributes = T
    Attributes = W
    BatchAutocommitMode = IfAllSuccessful
    CloseCursor = F
    DisableDPM = F
    DisableMTS = T
    Driver = Oracle 10g ODBC Driver
    DSN = Noddles
    EXECSchemaOpt =
    EXECSyntax = T
    Failover = T
    FailoverDelay = 10
    FailoverRetryCount = 10
    FetchBufferSize = 64000
    ForceWCHAR = F
    Lobs = T
    Longs = T
    MetadataIdDefault = F
    QueryTimeout = T
    ResultSets = T
    ServerName = aserver:1522/IAN.ASERVER.ACOMPANY.CO.UK
    SQLGetData extensions = F
    Translation DLL =
    Translation Option = 0
    UserID =
    When I connect using UnixODBC's isql and execute select * from picdar_manifest it crashes at
    #0 0xfe6d979c in bcoConvertFromFloat () from /m/jbod1/oracle/instantclient_10_2/libsqora.so.10.1
    #1 0xfe6d8acc in bcoConvertOciToOdbc () from /m/jbod1/oracle/instantclient_10_2/libsqora.so.10.1
    #2 0xfe6d829c in bcoConvert () from /m/jbod1/oracle/instantclient_10_2/libsqora.so.10.1
    #3 0xfe734314 in bcoTypeCopyLibToSqlc () from /m/jbod1/oracle/instantclient_10_2/libsqora.so.10.1
    #4 0xfe6f50c4 in bcoReturnColData () from /m/jbod1/oracle/instantclient_10_2/libsqora.so.10.1
    #5 0xfe6f94c0 in bcoDBgetdata () from /m/jbod1/oracle/instantclient_10_2/libsqora.so.10.1
    #6 0xfe6f8fec in bcoSQLGetData () from /m/jbod1/oracle/instantclient_10_2/libsqora.so.10.1
    #7 0xfe69f7bc in SQLGetData () from /m/jbod1/oracle/instantclient_10_2/libsqora.so.10.1
    #8 0x000248a8 in SQLGetData (statement_handle=0x171ca8, column_number=3, target_type=1,
    target_value=0xffbef2b8, buffer_length=301, strlen_or_ind=0xffbef2b0) at SQLGetData.c:439
    #9 0x00015c90 in WriteBodyNormal (hStmt=0x171ca8) at isql.c:886
    #10 0x00016d84 in main (argc=501760, argv=0x7a800) at isql.c:433
    This is clearly in the Oracle driver.
    I don't believe I am doing anything wrong because doing exactly the same thing on Linux works just fine (also using instant client release 10.2.0.3).
    Has anyone else seen a similar problem?
    Is there a solution?
    Cheers,
    Ian

    I'm not from Oracle, but I'll try and help you nevertheless :)
    First, Solaris and other real UNIX systems are much more picky about memory than Linux. I've seen countless applications fail when going from Linux to Solaris, HP-UX, or AIX; almost all of which are just using memory incorrectly. Linux is just more forgiving, which means you need to do more memory bound/leak checking. Nevertheless, that's just a bit of info on UNIX vs. Linux in application porting; it shouldn't have anything to do with Oracle's ODBC driver though.
    The thing is, I'm seeing odd memory issues with 10.2.0.3 on Linux (x86_64) as well. What version are you using on Linux?

  • ODBC config problems

    I am trying to set up ODBC on Red Hat Enterprise Linux ES release 4 (Nahant Update 4). My odbc.ini and odbcinst.ini are modelled after those provided by Oracle. I display them below.
    I have 2 problems.
    1. /usr/bin/iodbctest fails because it doesn't know about bcuMsgBoxError.
    $ /usr/bin/iodbctest
    iODBC Demonstration program
    This program shows an interactive SQL processor
    Driver Manager: 03.52.0507.0105
    Enter ODBC connect string (? shows list): ?
    DSN | Driver
    Oracle | Oracle 10g driver
    Enter ODBC connect string (? shows list): DSN=Oracle;UID=craig;PWD=<removed>
    1: SQLDriverConnect = [iODBC][Driver Manager]/oracle/product/10.2.0/db_1/lib/libsqora.so.10.1: undefined symbol: bcuMsgBoxError (0) SQLSTATE=00000
    2: SQLDriverConnect = [iODBC][Driver Manager]Specified driver could not be loaded (0) SQLSTATE=IM003
    The specified driver, /oracle/product/10.2.0/db_1/lib/libsqora.so.10.1, exists.
    2./usr/bin/ODBCConfig crashes and nothing is written to the log file.
    When I open ODBCConfig, click on the “System DSN” tab, click on the Oracle line, click on the Configure button, ODBCConfig crashes without displaying any errors.
    Any suggestions are appreciated. More details are given below.
    Thanks,
    Griff
    My odbc.ini and odbcinst.ini are modelled after those in odbc_update_ini.sh. This script is available from http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html in the instantclient-odbc-linux32-10.2.0.3-20061115.zip.
    $ cat /etc/odbcinst.ini
    [Oracle_10g_Driver]
    Description = ODBC driver for Oracle in odbcinst.ini
    Driver = /oracle/product/10.2.0/db_1/lib/libsqora.so.10.1
    Setup =
    FileUsage =
    CPTimeout =
    CPReuse =
    # added by ODBCConfig
    [ODBC]
    Trace = Yes
    TraceFile = /tmp/odbc_trace.txt
    ForceTrace = Yes
    Pooling = No
    $ cat /etc/odbc.ini
    [ODBC Data Sources]
    Oracle = Oracle 10g driver
    [Oracle]
    Description = Oracle in /etc/odbc.ini
    Driver = Oracle_10g_Driver
    DSN = Oracle
    Application Attributes = T
    Attributes = W
    BatchAutocommitMode = IfAllSuccessful
    BindAsFLOAT = F
    CloseCursor = F
    DisableDPM = F
    DisableMTS = T
    EXECSchemaOpt =
    EXECSyntax = T
    Failover = T
    FailoverDelay = 10
    FailoverRetryCount = 10
    FetchBufferSize = 64000
    ForceWCHAR = F
    Lobs = T
    Longs = T
    MetadataIdDefault = F
    QueryTimeout = T
    ResultSets = T
    ServerName =
    SQLGetData extensions = F
    Translation DLL =
    Translation Option = 0
    DisableRULEHint = T
    UserID =
    $ echo $ORACLE_HOME
    /oracle/product/10.2.0/db_1
    $ echo $ORACLE_SID
    CRAIGSDB
    $ echo $LD_LIBRARY_PATH
    /oracle/product/10.2.0/db_1/lib
    $ echo $TNS_ADMIN
    /oracle/product/10.2.0/db_1/network/admin
    $ ls -l $TNS_ADMIN | grep -i \\.ora
    -rw-r----- 1 oracle oinstall 502 Apr 24 13:36 listener.ora
    -rw-r----- 1 oracle oinstall 183 Apr 20 23:37 sqlnet.ora
    -rw-r----- 1 oracle oinstall 549 Apr 24 13:36 tnsnames.ora
    $ rpm -qa | grep -i odbc
    libiodbc-3.52.5-1
    unixODBC-2.2.11-1.RHEL4.1
    MyODBC-2.50.39-21.RHEL4.1
    libiodbc-admin-3.52.5-1
    php-odbc-4.3.9-3.22.4
    libiodbc-devel-3.52.5-1
    qt-ODBC-3.3.3-10.RHEL4
    unixODBC-kde-2.2.11-1.RHEL4.1
    $ rpm -qa | grep -i ora
    libtheora-1.0alpha3-5
    oracle-instantclient-basic-10.2.0.3-1
    rpm -qa | grep -i libsqora returns nothing but /oracle/product/10.2.0/db_1/lib/libsqora.so.10.1 exists.

    First, make sure you can connect through your sqlplus regular client, and make sure your instance, and listener are properly configured, up and running. Issue the next commands:
    lsnrctl services
    tnsping yourTNSAlias
    sqlplus username/password@TNSAlias
    Next, on your connect string I don't see your dbname alias configured, is it correct?
    Example:
    DSN=ora9;UID=scott;PWD=tiger;DATABASE=ora9u
    The datbase name is missing on your connect string:
    DSN=Oracle;UID=craig;PWD=<removed>
    Is your alias configured at your tnsnames.ora file?

  • Oracle instant Client and unixODBC for Linux has Error

    Hi experts,
    I have two Redhat EL 5. On the first Rehat(xxx.xxx.xxx.121 --> called Redhat1) I have installed Oracle 10g database server. On the second Redhat(xxx.xxx.xxx.123 --> called Redhat2) I want to connect to Oracle database server on xxx.xxx.xxx.121 via ODBC. But it does not work. Pls help me!
    I have done steps as following:
    Login to Redhat2 as root and type commands:
    1)Install Instant Client + sqlplus
    # rpm -ivh oracle-instantclient-basic-10.2.0.4-1.i386.rpm
    # rpm -ivh oracle-instantclient-sqlplus-10.2.0.4-1.i386.rpm
    2)Setting environment variable
    # LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.4/client/lib:${LD_LIBRARY_PATH}; export LD_LIBRARY_PATH
    # SQLPATH=/usr/lib/oracle/10.2.0.4/client/lib:${SQLPATH}; export SQLPATH
    3)Testing connection to Redhat1(Oracle DB server) using sqlplus
    # sqlplus abc/[email protected]:1521/lab2
    Connected.
    5)Begin to install unixODBC
    # rpm -ivh oracle-instantclient-odbc-10.2.0.4-1.i386.rpm
    # rpm -ivh unixODBC-2.2.11-7.1.i386.rpm
    # rpm -ivh unixODBC-devel-2.2.11-7.1.i386.rpm
    # rpm -ivh unixODBC-kde-2.2.11-7.1.i386.rpm
    6)After installation above packages I check for existing of odbc.ini and odbcinst.ini in /etc --> ok
    # ls /etc | grep odbc
    odbc.ini
    odbcinst.ini
    7) Tar unixODBC-2.2.14-linux-x86-32.tar.gz and copy file to /usr/local/bin, /usr/local/include, /usr/local/lib
    # tar -xzf unixODBC-2.2.14-linux-x86-32.tar.gz
    # ls /usr/local/bin/
    dltest isql iusql odbc_config odbcinst
    # ls /usr/local/include
    autotest.h odbcinstext.h odbcinst.h sqlext.h sql.h sqltypes.h sqlucode.h unixodbc_conf.h uodbc_extras.h uodbc_stats.h
    # ls /usr/local/lib
    libboundparam.la libgtrtst.la libodbccr.la libodbcinst.la libodbc.la
    libboundparam.so libgtrtst.so libodbccr.so libodbcinst.so libodbc.so
    libboundparam.so.1 libgtrtst.so.1 libodbccr.so.1 libodbcinst.so.1 libodbc.so.1
    libboundparam.so.1.0.0 libgtrtst.so.1.0.0 libodbccr.so.1.0.0 libodbcinst.so.1.0.0 libodbc.so.1.0.0
    # NLS_LANG=AMERICAN_AMERICA.UTF8; export NLS_LANG
    # TNS_ADMIN=/root; export TNS_ADMIN
    # ODBCINI=/etc/odbc.ini; export ODBCINI
    7)Retest sqlplus to Redhad1(Oracle database server) with local tnsname
    # sqlplus vonphoto/vonphoto@lab2
    SQL*Plus: Release 10.2.0.4.0 - Production on Sat Mar 27 03:20:55 2010
    Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    8) Edit odbc.ini and odbcinst.ini
    ---odbcinst.ini
    # Included in the unixODBC package
    [Oracle 10g ODBC driver]
    Description = Oracle ODBC driver for Oracle 10g
    Driver = /usr/lib/oracle/10.2.0.4/client/lib/libsqora.so.10.1
    Setup =
    FileUsage =
    CPTimeout =
    CPReuse =
    ---odbc.ini
    [ora_dns]
    Driver = Oracle 10g ODBC driver
    DSN = ora_dns
    ServerName = xxx.xxx.xxx.121
    UserID = vonphoto
    Application Attributes = T
    Attributes = W
    BatchAutocommitMode = IfAllSuccessful
    BindAsFLOAT = F
    CloseCursor = F
    DisableDPM = F
    DisableMTS = T
    EXECSchemaOpt =
    EXECSyntax = T
    Failover = T
    FailoverDelay = 10
    FailoverRetryCount = 10
    FetchBufferSize = 64000
    ForceWCHAR = F
    Lobs = T
    Longs = T
    MetadataIdDefault = F
    QueryTimeout = T
    ResultSets = T
    SQLGetData extensions = F
    Translation DLL =
    Translation Option = 0
    DisableRULEHint = T
    TraceFile = /backup/sql.log
    Trace = Yes
    9)Testing the driver and the data source
    # odbcinst -q -d
    [Oracle 10g ODBC driver]
    # odbcinst -q -s
    [ora_dns]
    10) Test connection via ODBC from Redhat2(xxx.xxx.xxx.123) to Redhat1(xxx.xxx.xxx.121)
    # isql -v ora_dns
    isql: error while loading shared libraries: libreadline.so.3: cannot open shared object file: No such file or directory
    I have spent 4 days to search on the internet. But it still error.
    Pls help me.

    Apologies - thought it was a database to database connection that you were trying to create.
    isql: error while loading shared libraries: libreadline.so.3: cannot open shared object file: No such file or directoryThe readline library is in package readline-4.3-13 on RHEL4 and in readline-5.1-1.1 for RHEL5 on my servers (minor version number are of course dependent on the kernel version used).
    This is also not an ODBC or Oracle issue. It seems that isql is using rlwrap or similar - this requires the readline library. And possibly LD_LIBRARY_PATH to be set too.

Maybe you are looking for

  • Can't get itunes library to playback more than one song at a time

    Has anyone had this problem? I am in the iTunes library and I can't get any songs to play unless they are selected. Even then, it will only play one song and then stop. I have "shuffle" activated and I have "repeat" activated. I have tried uninstalli

  • Xorg 1.8 + Synaptics --- Erroneous Error Messages?

    I upgraded to Xorg 1.8, and it seems to working fine. I do get some errors when I start though: SynPS/2 Synaptics TouchPad no synaptics even device found (EE) SynPS/2 Synaptics TouchPad: no supported touchpad found (EE) PreInit failed for input devic

  • How to add image as radio button label instead of text

    In a pure AS3 project, is there a way to add use an image placed in the library/ Flex/AIR SDK compiler path instead of text as a radio button label? I've tried substituting character may unicode like: rb1.label = String.fromCharCode("0x2592"); But ho

  • IPhoto shows zero photos on ipad

    Howdy, I'm using a new MacBook Pro running OS X (10.10) and trying to download photographs from an even new iPad running iOS 7.1.1.  Most online instructions say that you can connect the devices with a USB cable and run either iPhoto or ImageCapture.

  • SDM stopped?

    Hi there, We have a strange problem with the Netweaver Administrationpanel: We've started the SDM-Service manually and it's running without problems (for example the JSPM can Deploy packages, etc). The Netweaver Administrationpanel shows SDM as stopp