oracle

Oracle Data Dump and Data Restore

What's the "standard" (defacto or otherwise) way to dump an Oracle database/instance to an ascii or binary file, and then reimport that file into a separate Oracle instance. I'm looking for the equivalent of mysqldump, but for the Oracle platform. ...

Error connecting to Oracle from Visual Studio

I am not able to connect to Oracle using connection string and the correct password. I've tried the same parameters in SQL developer and sqlplus(commandline) and they are working. I even tried changing the password but no use. Any ideas what might be wrong or where should I start looking? The exact Oracle error is : invalid username/p...

Webrick Very Slow When Accessing Applications From Remote Desktop

I have a rails application that I'm running on my server. When I go to a remote desktop and attempt to load the application, the server takes a good 3-4 minutes to respond with a simple html page. However, when I load up the page locally on the server, the page shows up in just a second. I tried pinging the server from my remote desktop ...

What is the max size that i can provide with the cache clause in oracle sequences?

Hey here is an example: CREATE SEQUENCE S1 START WITH 100 INCREMENT BY 10 CACHE 10000000000000000000000000000000000000000000000000000000000000000000000000 If i fire a query with such a big size even if it creates the sequence s1. What is the max size that I can provide with it??? ...

How to get UTC value for SYSDATE on Oracle

Hello, Probably a classic... Would you know a easy trick to retrieve an UTC value of SYSDATE on Oracle (best would be getting something working on the 8th version as well). For now I've custom function :( Cheers, Stefan ...

Update DB column that is specified at runtime

Hi, I'm trying to update a column in a database, but the column needs to be specified at runtime. For example, given the table: | PKEY | ColumnA | ColumnB | ColumnC | I want to write an stored procedure that will update a given column per PKEY. Such as: updateColumn(pkey, columnName, Value); This could easily be done using java/JDBC...

Index not used due to type conversion?

I have a process that is performing badly due to full table scans on a particular table. I have computed statistics, rebuilt existing indices and tried adding new indices for this table but this hasn't solved the issue. Can an implicit type conversion stop an index being used? What about other reasons? The cost of a full table scan is a...

Oracle Java Stored Procedure Command-line Interaction

I have a funny requirement. We need to have a command-line interaction in a Java Stored Procedure. In spite of granting appropriate permissions using the dbms_java.grant_permission commands, I am encountering java.io.IOException, where I read from System.in using java.io.InputStreamReader. Where is the problem? The Java Source is here...

Difference between two queries when selecting a random sample from oracle

This question answers the question on how to select a random sample from oracle which is exactly what I need. I do not understand however the difference between that solution SELECT * FROM ( SELECT * FROM mytable ORDER BY dbms_random.value ) WHERE rownum <= 1000 and something li...

Oracle connections from a COM+ application

We have an Oracle 10.2.0 server running. There is a schema on the server called FOO. I have created an ODBC connection to the schema using the 10.2.0 client. We have a desktop application that has core database access libraries written by ourselves that uese SQLDriverConnect etc. We also have a COM+ application that makes use of the s...

Is ODP.NET required for Oracle 11g Client?

I may be asking the wrong question here, I'm willing to change it if so. I have a project that is using the Microsoft.NET Oracle provider (our plan is to change to ODP but we haven't done so yet). I am trying to get this project to build on a windows 2008 (x64) build server. It builds just fine but our unit tests fail when they hit st...

SQL: Limit on CASE (number of WHEN, THEN conditions)

Consider the query (it runs on both Oracle and MySQL) UPDATE table1 SET something_id = CASE WHEN table1_id = 1446 THEN 423 WHEN table1_id = 2372 THEN 426 WHEN table1_id = 2402 THEN 428 WHEN table1_id = 2637 THEN 429 WHEN table1_id = 2859 THEN 430 WHEN table1_id = 3659 THEN 433 END WHERE table1_id IN (1446,2372,2402,2...

Version configuration from SQL

How would you create an installation setup that runs against multiple schemas taking into consideration the latest version of the database updates? Ideally: update a single file with a new version number, then send the DBAs an archive containing everything needed to perform the database update. Here is the directory structure: | inst...

Toplink & java storing word or pdf files

I'm creating a simple page with a form. Part of the form requires uploading a pdf or word document. This will be a small file, so ideally I would like to store it in my oracle database. I'm using ejb and toplink for all of my persistence. What object should my entity class have that will hold a word or pdf file, and how do I map it to ...

How to rollback OracleBulkCopy() inserted rows?

Hello, I have tried to roll back external transaction and also tried to abort OracleBulkCopy() but it still inserted all rows. Anyone knows how to do this? Case 1: Didn't work. All row inserted anyway. OracleConnection connection = new OracleConnection(ConnectionString); connection.Open(); OracleTransaction trans = connection.BeginTra...

Display Oracle Reports in an ASP.NET Web Application

Hi, I have a web application written in C#/ASP.Net and the backend DB is Oracle. There are already Oracle Reports written for this, I am just wondering how I go about hooking them up within the code? What is the syntax for this, and how to pass parameters etc? Everywhere I see seems to be using either Crystal or SQL Reporting Service...

How do I escape a reserved word in oracle

In TSQL I could use something like Select [table] from tablename to select a column named "table". How do I do this for reserved words in oracle? Edit: I've tried square braces, double quotes, single quotes, and backquotes, they don't work... As a further clarification, I have a column which someone named comment. As this is a reser...

Creating tables with fields from 2 different tables

I want to create a table that stores values from two different tables; From table 1: cust_id (varchar2), invoice_amt (float) From table 2: cust_id (from table 1), payment_date My table should have 3 fields: cust_id, invoice_amt, payment_date I tried the following, which is obviously wrong. create table temp1 as ( selec...

SQL Query which returns set of tuples that exists for a given data range

I have a table say EmployeeAbsence that has three columns: EmployeeId, LeaveReason and Date. This table records attendance of employees on a daily basis. I want to know the list of employees who took leave in last 14 days. For example, 1 XYZ 2009-07-20 2 XYZ 2009-07-19 -- --- -- 1001 XYZ 2009-07-04 In this case, my query output shoul...

Oracle NUMBER problem: Decimal to Int64 cast

We are developing a standalone application that stores its data in a Database. We use Dataset and TableAdapters for the communication with the Database. One of the basic requirements is the application to be able to use SQL Server, Oracle and MySQL. For this purpose we made the queries in the TAs vendor independent. We use ODBC provider....