oracle10g

Is there a way to throttle or limit resources used by a user in Oracle?

廉价感情. 提交于 2019-12-01 20:24:26
I have a multi-user web application and am encountering issues when a third party reporting application queries my Oracle 10g database. The reporting queries are slowing the system and impacting all other users. Is there a way to throttle this user's session so their queries don't impact the other users? you can use the Database Resource Manager to manage workload. Have a look at the Oracle documentation or at this example from Joel Kallman's APEX blog . AFAIK, you can only throttle sessions based on CPU in 10g, which usually isn't the problem with long running queries. The most useful thing

How to convert column into rows in oracle 10g

孤街醉人 提交于 2019-12-01 20:17:56
Suppose I have the result of an Oracle sql query: Month Date ----- ----- Jan 10 Jan 15 Jan 20 Feb 11 Feb 16 Feb 25 I want to display this data in the following format: Jan Jan Jan Feb Feb Feb 10 15 20 11 16 25 How to write the query? Lalit Kumar B Using PIVOT : SQL> WITH sample_data AS( 2 SELECT 'Jan' mnth, 10 dt FROM dual UNION ALL 3 SELECT 'Jan' mnth, 15 dt FROM dual UNION ALL 4 SELECT 'Jan' mnth, 20 dt FROM dual UNION ALL 5 SELECT 'Feb' mnth, 11 dt FROM dual UNION ALL 6 SELECT 'Feb' mnth, 16 dt FROM dual UNION ALL 7 SELECT 'Feb' mnth, 25 dt FROM dual 8 ) 9 -- end of smaple_data mimicking

fetch from function returning a ref cursor to record

血红的双手。 提交于 2019-12-01 20:07:46
I have a function in a package that returns a REF CURSOR to a RECORD. I am trying to call this function from a code block. The calling code looks like this: declare a_record package_name.record_name; cursor c_symbols is select package_name.function_name('argument') from dual; begin open c_symbols; loop fetch c_symbols into a_record; exit when c_symbols%notfound; end loop; close c_symbols; end; The function declaration as part of package_name looks something like this: TYPE record_name IS RECORD( field_a varchar2(20); ); TYPE record_cursor IS REF CURSOR RETURN record_name; FUNCTION getsymbols

Multi-Schema Privileges for a Table Trigger in an Oracle Database

北慕城南 提交于 2019-12-01 19:31:00
I'm trying to write a table trigger which queries another table that is outside the schema where the trigger will reside. Is this possible? It seems like I have no problem querying tables in my schema but I get: Error: ORA-00942: table or view does not exist when trying trying to query tables outside my schema. EDIT My apologies for not providing as much information as possible the first time around. I was under the impression this question was more simple. I'm trying create a trigger on a table that changes some fields on a newly inserted row based on the existence of some data that may or

Oracle - Materialized View alter structure so slow

浪尽此生 提交于 2019-12-01 19:26:04
I have a huge materailized view that I have to adjust. It's a simple adjustment as I'm just adding an NVL function to the select statement. I.e. Original... Select this, that..... I.e. Modified Select NVL(this, orThat) as this, NVL(That, orThis) as that The query takes 26 seconds to run, but due to the amount of rows retrieved (2.3 million) it is dead slow. It ran for almost 5 days straight and then I stopped it. This is a problem, especially since I need to deliver this to a client, and they can't run a script for 5+ days to create a MV. Question: Is there any way to speed up the altering

Getting weird issue with TO_NUMBER function in Oracle

删除回忆录丶 提交于 2019-12-01 19:08:44
问题 I have been getting an intermittent issue when executing to_number function in the where clause on a varchar2 column if number of records exceed a certain number n. I used n as there is no exact number of records on which it happens. On one DB it happens after n was 1 million on another when it was 0.1. million. E.g. I have a table with 10 million records say Table Country which has field1 varchar2 containing numberic data and Id If I do a query as an example select * from country where to

How do you programatically identify a stored procedure's dependencies?

我是研究僧i 提交于 2019-12-01 19:07:27
问题 Is it possible to write a PL/SQL query to identify a complete list of a stored procedures dependencies? I'm only interested in identifying other stored procedures and I'd prefer not to limit the depth of nesting that it gets too either. For example, if A calls B, which calls C, which calls D, I'd want B, C and D reported as dependencies for A. 回答1: On this page, you will find the following query which uses the PUBLIC_DEPENDENCY dictionary table: SELECT lvl , u.object_id , u.object_type , LPAD

OracleCommand command, ExecuteNonQuery issue

℡╲_俬逩灬. 提交于 2019-12-01 19:00:48
I have to clear certain tables in the oracle database however when I'm having issues with running the following code public static void ClearDataTables(IList<string> tableNames) { string connectionString = "CONNECTIONSTRING"; using (OracleConnection connection = new OracleConnection()) { connection.ConnectionString = connectionString; connection.Open(); foreach (string table in tableNames) { OracleCommand command = connection.CreateCommand(); string sql = String.Format("DELETE FROM TOA_REPORTING.{0}", table); command.CommandText = sql; command.ExecuteNonQuery(); } connection.Close(); } } I am

Combine rows when the end time of one is the start time of another (Oracle)

强颜欢笑 提交于 2019-12-01 18:49:44
I just can't seem to get this query figured out. I need to combine rows of time-consecutive states into a single state. This question is similar to the question found here except I am working with Oracle 10 not SQL Server: Combine rows when the end time of one is the start time of another Example data: name start_inst end_inst code subcode Person1 9/12/2011 10:55 9/12/2011 11:49 161 50 Person1 9/12/2011 11:49 9/12/2011 11:55 107 28 Person1 9/12/2011 11:55 9/12/2011 12:07 161 50 Person1 9/12/2011 12:07 9/12/2011 12:26 161 50 Person1 9/12/2011 12:26 9/12/2011 12:57 161 71 Person1 9/12/2011 12:57

Encryption inside oracle

[亡魂溺海] 提交于 2019-12-01 18:45:36
In dot net i can use dll file so that my code is safe from others. But is there any ways so that none can see the code of some of my procedures and triggers ... You can wrap procedure code to make it unreadable. You cannot wrap trigger code, but you can move the trigger code into a stored procedure so that the trigger code contains nothing more than a call to a wrapped procedure. You could try the following approach. Note: I have never tried this approach for hiding code, but could apply in your case. create another schema with synonyms that point to all required code from the original schema.