oracle10g

Oracle MIN as analytic function - odd behavior with ORDER BY?

不羁岁月 提交于 2019-12-19 17:39:58
问题 This particular case was distilled from an example where the programmer assumed that for two shipments into a tank car, line #1 would be loaded first. I corrected this to allow for the loading to be performed in any order - however, I discovered that MIN() OVER (PARTITION BY) allows an ORDER BY in Oracle (this is not allowed in SQL Server), and additionally, it alters the behavior of the function, causing the ORDER BY to apparently be added to the PARTITION BY . WITH data AS ( SELECT 1 AS

ORACLE : Io exception: The Network Adapter could not establish the connection

妖精的绣舞 提交于 2019-12-19 16:13:23
问题 We are getting this error sporadically. With the same TNS, we are able to make proper connections to the database. But we see this in the logs while make connections some times. Following is the stack trace. This is db connection to Oracle from a Linux machine and java application Any help is appreciated. java.sql.SQLException: Io exception: The Network Adapter could not establish the connection at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) at oracle.jdbc

ORACLE : Io exception: The Network Adapter could not establish the connection

烂漫一生 提交于 2019-12-19 16:09:28
问题 We are getting this error sporadically. With the same TNS, we are able to make proper connections to the database. But we see this in the logs while make connections some times. Following is the stack trace. This is db connection to Oracle from a Linux machine and java application Any help is appreciated. java.sql.SQLException: Io exception: The Network Adapter could not establish the connection at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) at oracle.jdbc

How to include the column USER_VIEWS.TEXT in a where clause

梦想与她 提交于 2019-12-19 10:36:11
问题 This seems like it should have been an easy thing to figure out but I am struggling to find any answers. I want to be able to query against the USER_VIEWS table in Oracle to find other views that are using a particular table. Something like: SELECT view_name, text FROM user_views WHERE text LIKE'%MY_TABLE%' I get the error: ORA-00932: inconsistent datatypes: expected NUMBER got LONG The datatype for TEXT is LONG and in TOAD it shows WIDEMEMO. I have tried casting it, to_char and concatenating

When to use Oracle hints?

南楼画角 提交于 2019-12-19 10:27:48
问题 I'm doing some refactoring on a Oracle Schema (oracle version 10), and I see a lot of views that use hints *+ALL_ROWS*/ . In others views there are also other kind of hints. Why I should use an hints? the DB doesn't make the best choice in base of the query? many thanks! 回答1: That's a good question, but there's no single answer to it because there are different categories of hint for which different advice would apply. http://docs.oracle.com/cd/E11882_01/server.112/e16638/hintsref.htm

How to compute a column value in oracle 10g?

那年仲夏 提交于 2019-12-19 10:12:05
问题 create table ord_tbl ( ord_id number(10) primary key, ord_name varchar2(20), quantity number(20), cost_per_item number(30), total_cost number(30)--This colm shud be (quantity*cost_per_item), ord_date date ) So when I insert rows then the 'total_cost' should automatically get generated and inserted into a table 回答1: 10g doesn't have this feature. Instead, use a view: create table ord_tbl ( ord_id number(10) primary key, ord_name varchar2(20), quantity number(20), cost_per_item number(30), ord

SQL to delete the duplicates in a table

ぐ巨炮叔叔 提交于 2019-12-19 09:58:33
问题 I have a table transaction which has duplicates. i want to keep the record that had minimum id and delete all the duplicates based on four fields DATE, AMOUNT, REFNUMBER, PARENTFOLDERID. I wrote this query but i am not sure if this can be written in an efficient way. Do you think there is a better way? I am asking because i am worried about the run time. DELETE FROM TRANSACTION WHERE ID IN (SELECT FIT2.ID FROM (SELECT MIN(ID) AS ID, FIT.DATE, FIT.AMOUNT, FIT.REFNUMBER, FIT.PARENTFOLDERID FROM

SQL to delete the duplicates in a table

廉价感情. 提交于 2019-12-19 09:58:28
问题 I have a table transaction which has duplicates. i want to keep the record that had minimum id and delete all the duplicates based on four fields DATE, AMOUNT, REFNUMBER, PARENTFOLDERID. I wrote this query but i am not sure if this can be written in an efficient way. Do you think there is a better way? I am asking because i am worried about the run time. DELETE FROM TRANSACTION WHERE ID IN (SELECT FIT2.ID FROM (SELECT MIN(ID) AS ID, FIT.DATE, FIT.AMOUNT, FIT.REFNUMBER, FIT.PARENTFOLDERID FROM

How to profile end to end performance of Oracle stored procedure

萝らか妹 提交于 2019-12-19 09:12:11
问题 I want to know how long my stored procedure is taking to execute from the time an external process hits the database and says execute this to the time the database returns back to the process and says here ya go. Is there a simple easy way to do this very basic task? Of course a report of what is happening during the stored procedure execution and how much of the stored procedure's time is spent doing each task (inserts, plsql string manipulation etc.) would be a bonus, but I really just want

How to profile end to end performance of Oracle stored procedure

和自甴很熟 提交于 2019-12-19 09:12:06
问题 I want to know how long my stored procedure is taking to execute from the time an external process hits the database and says execute this to the time the database returns back to the process and says here ya go. Is there a simple easy way to do this very basic task? Of course a report of what is happening during the stored procedure execution and how much of the stored procedure's time is spent doing each task (inserts, plsql string manipulation etc.) would be a bonus, but I really just want