oracle

help translate this week query from Oracle PL/SQL to SQL Server 2008

I have the following query that runs in my Oracle database and I want to have the equivalent for a SQL Server 2008 database: SELECT TRUNC( /* Midnight Sunday */ NEXT_DAY(SYSDATE, 'SUN') - (7*LEVEL) ) AS week_start, TRUNC( /* 23:59:59 Saturday */ NEXT_DAY(NEXT_DAY(SYSDATE, 'SUN') - (7*LEVEL), 'SAT') + 1 ...

Can Hibernate automatically uppercase a column on read/insert via configuration?

We have some columns with data that must always be in uppercase to ensure uniqueness. I was wondering if hibernate can force all such columns to uppercase via some configuration file change? We actually use a custom UserType for encrypting/decrypting column data for some other table, but I figured that would be overkill just to upperca...

How should I migrate DDL changes from one environment to the next?

I make DDL changes using SQL Developer's GUI. Problem is, I need to apply those same changes to the test environment. I'm wondering how others handle this issue. Currently I'm having to manually write ALTER statements to bring the test environment into alignment with the development environment, but this is prone to error (doing the s...

Wisdom of merging 100s of Oracle instances into one instance

Our application runs on the web, is mostly an inquiry tool, does some transactions. We host the Oracle database. The app has always had a different instance of Oracle for each customer. A customer is a company which pays us to provide our service to the company's employees, typically 10,000-25,000 employees per customer. We intend to hav...

how to connect to two databases of oracle using dblink

i am tring to use db link for that i have first change the name of both databases to sol1(remote) and sol3(local) then i create a db-link on sol3 CREATE DATABASE LINK SOL1.SWORLD CONNECT TO TEST IDENTIFIED BY TEST USING SOL1; LINK CREATED ON SQL /> SELECT * FROM [email protected] MASSAGE SQL COULD NOT RESOLVE THE SERVICE NAME THEN I DR...

ORACLE XML publishing

Hey guys, I was wondering which tool in ORACLE 11g (their latest DBMS) can be used for publishing XML. I am about to download it but would first like to know the name of the XML publisher and where I could get more information about it from. Thanks in advance. S ...

Can anybody tell me how to use TKPROF utility along with syntax and parameters

Can anybody tell me how to use TKPROF utility along with syntax and parameters ...

How does oracle db writer decide whether or not to do multiblock / sequential writes.

Hi, We have a test system which matches our production system like for like. 6 months ago we did some testing on new hardware, and found the performance limit of our system. However, now we are re-doing the testing with a view to adding further hardware, and we have found the system doesnt perform as it used to. The reason for this ...

Need index with sys_connect_by_path function? How to emulate it?

Hi, I have a self referencing table in Oracle 9i, and a view that gets data from it: CREATE OR REPLACE VIEW config AS SELECT c.node_id, c.parent_node_id, c.config_key, c.config_value, (SELECT c2.config_key FROM vera.config_tab c2 WHERE c2.node_id = c.parent_node_id) AS parent_config_key,...

Parameters to tune when retrieving a lot of small BLOBs (2-10kb) from Oracle DB?

We have a table in which we store millions of small BLOBs (2-10kb). And we need to access a portion of this table at a time, iterating through it while retrieving all these BLOBs (this "portion" is usually in the order of 10**5 rows). We use oracle 11g R1. Right now I am thinking about tuning the OracleConnection.setDefaultRowPrefet...

In Oracle, why does this return March 1st?

In Oracle, this returns 03/01/2010. That does not make sense to me. Anybody know why? SELECT TO_DATE( '2010' ,'yyyy' ) AS STRANGE_YEAR_RESULT FROM DUAL I've tried on Oracle 10g and 11g. ...

Oracle Blobs - store size or calculate?

I am writing a generic Http resource hosting service and am storing larger objects as BLOBs in an Oracle database. I want to be able to set the 'Content-Length' header when returning a stored object, which means I need to know the size of the BLOB before I start writing it to the client (I know I could use chunked-encoding, and am in so...

How to key in and display date with hours and minutes into Oracle SQL Developer

I'm using Oracle SQL Developer. I'd like to key in dates with hours and minutes, but the GUI doesn't appear to allow that. While I'm at it, it would be nice to display all date fields as 'YYYY-MM-DD HH24:MI:SS' within the Oracle SQL Developer GUI as well. Thanks! ...

How to set conditional logic in SQL query in order to shuffle the precedence?

How to set conditional logic in SQL query in order to shuffle the precedence? For example if I have table with columns like "id", "name", "event_id" and I have distinct "event_id" like 180, 181, 270, 271 and I need to order in such a way that rows with "event_id" 270 will be at the top, then rows with "even_id" 271 and the rest of the d...

Oracle SQL-Developer: Export "Explain Plan" Images?

I'm trying to export a copy of the Explain Plan from Oracle SQL Developer 2.1.0.63 All I get out is a html file named what I specify, then a newly created folder in the same directory called "images", which is empty. I've taken a squizz at the (cough)tabular(cough) HTML output, found there's half a dozen images specified, but I think t...

Oracle client and IIS problems

Continuing the discussion about the minimum footprint needed to connect to an Oracle DB from .NET. I've managed to set everything up to work without the installation (just by copying the required files). But when I try to run the code as IIS (7.5) application, I get the following error: [Exception: System.Data.OracleClient requires Orac...

System.Data.OracleClient on Windows 7 64

Hi, I'm trying to access an Oracle Database from a program I'm writing on Windows 7 64bit. Whenever it initializes the client, i get a BadImageFormatException complaining that I'm trying to use a 32bit client in a 64bit environment. I've tried to compile the program in any way (Any CPU, 32, 64 bit), but it did not solve the problem. Any ...

How to have a primary key combination that may have null values?

I have two tables A and B as defined bellow. create table A ( A_1 varchar2(10) NOT NULL, A_2 varchar2(10), A_3 varchar2(10), constraint A_PK primary key (A_1,A_2) ) TABLE A DATA A_1 |A_2 |A_3 1111 abc some_text1 1111 null some_text1 1112 abc some_text2 1113 def some_text3 create table B ...

How to use a calculated column in where condition?

Please tell me how to use a calculated column in where condition in oracle 9i? I want to use something like select decode (:pValue,1, select sysdate from dual, select activation_date from account where AcNo = 1234) as calDate where caldate between startDate and endDate; ...

Writing a docx file to a BLOB using Java 1.4 inside Oracle 10g

I'm trying to generate a blank docx file using Java, add some text, then write it to a BLOB that I can return to our document processing engine (a custom mess of PL/SQL and Java). I have to use the 1.4 JVM inside Oracle 10g, so no Java 1.5 stuff. I don't have a problem writing the docx to a file on my local machine, but when I try to w...