oracle

Oracle DB on Amazon's EC2 + EBS

I just installed Oracle on my Amazon's Virtual EC2 Linux (Ubuntu) Server. Because i'm not really familiar with Oracle Database Administration I'm wondering what files and how i need to move to ESB so when i shut down or terminate my instance the data won't be lost. I have found THIS tutorial, but i'm not sure if this is what i need. ...

JPA: How do I get a scalar result of type Long-- not BigNumber-- from Oracle NUMBER?

The default mapping from an Oracle NUMBER value is into BigNumber... How can I get a scalar result query to return a Long instead? ...

ASP.NET App behind Oracle SSO - Anonymous access?

We've got an ASP.NET Application that the client would like to protect Via Oracle SSO and also allow anonymous access to the application. None of the standard Oracle SSO plugins have an anonymous access option, so we wrote a custom java SSO plugin to check for Portal/SSO session cookies and do the base Oracle SSOServerAuth, and otherwis...

Finding the days of the week within a date range using oracle SQL

Suppose the following table structure: Event: id: integer start_date: datetime end_date: datetime Is there a way to query all of the events that fall on a particular day of the week? For example, I would like to find a query that would find every event that falls on a Monday. Figuring out if the start_date or end_date falls on ...

Oracle Query Tuning (Duplicate table access)

I'm trying to further tune this query. The query returns the status for three different tests for each sample. However, if I wish to further filter the samples returned, I have to put the conditions in both 'SELECT ... FROM sample ...' queries. Can this query be rewritten referencing the sample table only once? SELECT sample_id, ...

How to utilize WebDev.WebServer.exe (VS Web Server) in x64?

Visual Studio is x86 until at least the 2010 release comes around update: this is still an issue in VS2010, there is no native 64bit Cassini support. My question is can anyone think of a way or know of an independent ASP.NET debug server that's x64 for 2008 or 2010? Background: Our ASP.NET application runs against Oracle as the DB. S...

Can I have a deferrable unique functional index in Oracle?

I'd like to create a deferrable unique functional index in Oracle 10g. I know how to create a unique functional index: create unique index LIST_ITEM_ENTRY_NO_UNIQ on LIST_ITEM (case status when 'cancel' then null else LIST_KEY end, case status when 'cancel' then null else ENTRY_NO end); I know how to create a deferrable...

Hot deploy problem in Tomcat with proxool and oracle

Hi, I have a problem concerning with proxool and oracle driver in Tomcat. The web application I use contains a webservice jar file using metro and a servlet to initialize / start the proxool pool. The proxool pool is configured with an oracle connection. When the service is called, it fetches a connection from the pool, executes a stat...

ORA-27101: shared memory realm does not exist in Oracle 9

I'm getting this error when I try and connect to database in Oracle 9 (running on Windows 2003 server) I've tried to manually start the Oracle service but it refuses to start.... ...

Strategies/Tools for Building Training Database

We are in the process of building a training version of our website and intranet. The sites are heavy with database interaction (update user data, track workflow, etc.) The goal is to have a small number of test accounts that people can log into and run through the tools of the site. After the session is over we would revert the data ...

Generic-like behavior in PL/SQL procedure parameters

Suppose I have some data types defined in PL/SQL: TYPE foo_t IS RECORD (...); TYPE foo_table_t IS TABLE OF foo_t INDEX BY BINARY_INTEGER; TYPE bar_t IS RECORD (...); TYPE bar_table_t IS TABLE OF bar_t INDEX BY BINARY_INTEGER; Is it possible for me to write a procedure capable of accepting any data type derived from TABLE (for example...

Oracle can I use scalar functions in WHERE Clause? or a NULL issue

somehow I get never any results when I call: select * from table_1 t1 where t1.c1 IS NOT NULL and trim(t1.c1) != '' ; trim(t1.c1) != '' part causes problems actually i return nothing. ...

Oracle - how to create date from an already existing date?

Say I issue: select date_field from table1; date_field is like '25.11.2009' I will try to change the positions of date fields with the month and vice versa. (of course for days > 12 some manipulations) TO_DATE( MOD(SUBSTR(TO_CHAR(a.A_DATE, 'DD.MM.YYYY'), 4, 2), 12) || '.' || SUBSTR(TO_CHAR(a.A_DATE, 'DD.MM.YYYY'), 1, 2...

How can I set the application information on a session using the Oracle thin JDBC driver?

I'd like to change the application information that is shown when inspecting Oracle 10g sessions using the Oracle Enterprise Manager application: Application Information Program 'my program' Module 'something' Command UNKNOWN I'm using the JDBC thin driver to connect, and I have to admit I'd rather not use the OC...

What is an elegant way to return a readable 'file size' of a file stored in an oracle blob column using SQL?

How would you write a SQL query to get the size of blob in a more human readable form? The example would be something like a large word document is being stored in a blob on a table. I would want to execute something like: select fnc_getReadableSize(documents.doc) from documents where id = ? output: 23.4 MB ...

Oracle, calling PL/SQL issues from within SQL-Plus file x.sql says my_function "may not be a function"

so simple, if I create my fuction as CREATE OR REPLACE FUNCTION MD5_ENCODE it will run smoothly, but if it satys anonymously within the SQL-Plus block as PL/SQL --> "may not be a function" error. what is this Oracle "feature" again??? many thx. in advance... DECLARE FUNCTION MD5_ENCODE(CLEARTEXT IN VARCHAR2) RETURN VARCHAR2 IS CHK ...

How do I determine the maximum and minimum value for an Oracle NUMBER column?

Is there a simple formula for determining the maximum and minimum values for an Oracle NUMBER column with (p, s)? ...

PLSQL - Drop all database objects of a user

I'm trying to use a procedure (no parameters) to drop all of the user-created database objects located within the schema from where the procedure is launched, but I'm really not sure on how to go about this. Here's what I have so far, but I think I'm going about this the wrong way. create or replace procedure CLEAN_SCHEMA is cursor sc...

Dropping then adding a constraint fails in oracle

I'm trying to move a primary key constraint to a different column in oracle. I tried this: ALTER TABLE MY_TABLE DROP CONSTRAINT c_name; ALTER TABLE MY_TABLE ADD CONSTRAINT c_name PRIMARY KEY ( "COLUMN_NAME" ) ENABLE; This fails on the add constraint with an error saying the the constraint already exists even though i just dropped i...

Oracle Sequences

I'm using a Sequence to generate an id for me, but I use that sequence from my Java application. So say for example my last Id is 200. If I add an entry with .sql by by using 201 as an id instead of doing seq.nextval. What would happen when my java application calls seq.nextval? Is sequence smart enough to check the max available numbe...