oracle10g

WM_CONCAT with DISTINCT Clause - Compiled Package versus Stand-Alone Query Issue

烈酒焚心 提交于 2019-12-06 03:37:39
问题 I was writing some program that uses the WM_CONCAT function. When I run this query: SELECT WM_CONCAT(DISTINCT employee_id) FROM employee WHERE ROWNUM < 20; It works fine. When I try to compile the relatively same query in a package function or procedure, it produces this error: PL/SQL: ORA-30482: DISTINCT option not allowed for this function FUNCTION fetch_raw_data_by_range RETURN VARCHAR2 IS v_some_string VARCHAR2(32000); BEGIN SELECT WM_CONCAT(DISTINCT employee_id) INTO v_some_string FROM

Best way to bulk insert data into Oracle database

折月煮酒 提交于 2019-12-06 03:06:59
问题 I am going to create a lot of data scripts such as INSERT INTO and UPDATE There will be 100,000 plus records if not 1,000,000 What is the best way to get this data into Oracle quickly? I have already found that SQL Loader is not good for this as it does not update individual rows. Thanks UPDATE: I will be writing an application to do this in C# 回答1: Load the records in a stage table via SQL*Loader. Then use bulk operations: INSERT INTO SELECT (for example "Bulk Insert into Oracle database")

Does Tomcat use cached versions of pl/sql modules?

天涯浪子 提交于 2019-12-06 02:33:47
Ok imagine this situation. I make a change to a pl/sql module, recompile it and everything is fine. No errors. I then try to access a GUI screen on an application that runs on Tomcat. The screen calls a pl/sql module in an oracle database. When i submit the form which should have called that pl/sql module for processing the data, i get this error ORA-20001: ORA-06508: PL/SQL: could not find program unit being called I checked all packages in $USER_OBJECTS and there is nothing with a status of INVALID. I restarted Tomcat and then it starts working. Does this mean that when i recompiled the

Use gv$session to tell if a query is hanging

…衆ロ難τιáo~ 提交于 2019-12-06 01:48:20
问题 I have a query running in Oracle, which may or may not be hung. It's been running for ~10 hours now, but based on the amount of data I'm loading that may not be unreasonable. I was looking at the session in gv$session and was wondering if there's a way to translate that information to see if there's actually any activity going on, or if the query is stuck waiting for a lock or otherwise hung. I've already read the documentation for this view here. I'm mostly looking for tips from anyone whose

Recursively list concents of Oracle's DBA_DEPENDENCIES view

妖精的绣舞 提交于 2019-12-06 01:33:13
I would like a list of dependent tables (ultimately) of a given view. For example: SELECT NAME, TYPE, REFERENCED_NAME, REFERENCED_TYPE FROM DBA_DEPENDENCIES WHERE OWNER='FOO' AND NAME='VIEW_O1' The results: VIEW_O1 VIEW TABLE_01 TABLE VIEW_O1 VIEW TABLE_02 TABLE VIEW_O1 VIEW TABLE_03 TABLE VIEW_O1 VIEW VIEW_02 VIEW VIEW_O1 VIEW VIEW_03 VIEW I would like it to resemble: VIEW_O1 VIEW TABLE_01 TABLE VIEW_O1 VIEW TABLE_02 TABLE VIEW_O1 VIEW TABLE_03 TABLE VIEW_O1 VIEW VIEW_02 VIEW VIEW_O1 VIEW VIEW_03 VIEW VIEW_O2 VIEW TABLE_03 TABLE VIEW_O2 VIEW TABLE_04 TABLE VIEW_O3 VIEW TABLE_05 TABLE VIEW_O3

Connecting C# app with Oracle 10g: ORA-12154: TNS:could not resolve the connect identifier specified

微笑、不失礼 提交于 2019-12-06 00:18:29
I am a beginner in working with databases. I am trying to access Oracle10g database from a c# application. But when I do so i get this error: ORA-12154: TNS:could not resolve the connect identifier specified" I'm using the following code: string oradb = "Data Source=ORCL;User Id=system;Password=goodbye;"; OracleConnection conn = new OracleConnection(oradb); // C# conn.Open(); Is there an error in the connection string oradb ? Start the Visual Studio , open View menu + Server Explorer. Right mouse click on Data Connection + Add Connection + Select Oracle Database server Name : localhost or name

How Oracle 10g evaluates NULL in boolean expressions

ぐ巨炮叔叔 提交于 2019-12-05 23:45:48
if not (i_ReLaunch = 1 and (dt_enddate is not null)) How this epression will be evaluated in Oracle 10g when the input value of the i_ReLaunch = null and the value of the dt_enddate is not null it is entering the loop. According to the rules in normal c# and all it should not enter the loop as it will be as follows with the values. If( not(false and (true)) = if not( false) =if( true) which implies it should enters the loop But it is not happening Can someone let me know if i am wrong at any place Boolean operations with NULL value in Oracle return UNKNOWN - not true or false. So you have

Getting Hourly statistics using SQL

ぐ巨炮叔叔 提交于 2019-12-05 21:04:21
We have a table, name 'employeeReg' with fields employeeNo | employeeName | Registered_on Here Registered_on is a timestamp. We require an hourly pattern of registrations, over a period of days. eg. 01 Jan 08 : 12 - 01 PM : 1592 registrations 01 Jan 08 : 01 - 02 PM : 1020 registrations Can someone please suggest a query for this. We are using Oracle 10gR2 as our DB server. Jonathan Leffler This is closely related to, but slightly different from, this question about How to get the latest record for each day when there are multiple entries per day . ( One point in common with many, many SQL

How can I extract package source from Oracle database?

人盡茶涼 提交于 2019-12-05 20:29:19
Can any one please help me to extract a package from Oracle database schema through Command Line Interface. Use DBMS_METADATA.GET_DDL: DBMS_METADATA.GET_DDL ( object_type IN VARCHAR2, name IN VARCHAR2, schema IN VARCHAR2 DEFAULT NULL, version IN VARCHAR2 DEFAULT 'COMPATIBLE', model IN VARCHAR2 DEFAULT 'ORACLE', transform IN VARCHAR2 DEFAULT 'DDL') RETURN CLOB; 来源: https://stackoverflow.com/questions/5457849/how-can-i-extract-package-source-from-oracle-database

Programmatically Change Expired Oracle DB Password?

杀马特。学长 韩版系。学妹 提交于 2019-12-05 19:21:28
Where I work, some databases get copied down from our production environment to our test environment, but the DBAs set all the passwords to expired on the (new) test DB right after the copy so that the production passwords are not known. So if I run sqlplus and connect to the test db with a specific username it immediately prompts me for a new password. Is there a way via a java app or shell scripting to automate the changing of an expired oracle 10g database password for a specific user? On Unix If you're on unix, you can do with a shell script. I have tested it like so: drop user foo cascade