oracle10g

How to recreate public synonym “DUAL”?

孤者浪人 提交于 2019-12-02 01:29:58
Using SQLDeveloper 4.0.1.14 to create an export script (separate files & "drops" checked), it generated me those 4 lines among others in DROP.sql : DROP SYNONYM "PUBLIC"."DUAL"; DROP SYNONYM "PUBLIC"."DBMS_SQL"; DROP SYNONYM "PUBLIC"."DBMS_LOCK"; DROP SYNONYM "PUBLIC"."DBMS_OUTPUT"; Now that I have accidentally passed the whole script using SYSTEM user, I can no longer do modification (create or drop tables) to the database, I have that error popping: An error was encountered performing the requested operation: ORA-00604: error occurred at recursive SQL level 1 ORA-00942: table or view does

C# Getting the size of the data returned from and SQL query

断了今生、忘了曾经 提交于 2019-12-02 01:05:09
How can I get the size in bytes of the data returned from the database when executing a query? The reason for this is to compare load on the database server using two different techniques. We were running reports built from the same dataset which would load the entire dataset for every report. Now we are caching the dataset and running reports from the cache. We run reports per client, some datasets are significantly bigger than others, and I need some way to give a measurable metric for the database server load reduction. I have tried looking through DbConnection, DbDataReader and DbCommand

Oracle 10g: parsing 2 columns merging duplicates

蓝咒 提交于 2019-12-02 00:59:42
I'm having a table with 3 columns: DATE_A , DATE_B and ISSUE DATE_A and DATE_B can be filled in 3 possible ways: either both have a value, or only one have, as shown here: DATE_A | DATE_B | ISSUE ----------+-----------+----------- 20130301 | 20140101 | bla 20150801 | null | foo null | 20180701 | bar I need to parse this table to populate a new table, with DATE_A and DATE_B populating both a single column DATE_M . If the DATE_A (or DATE_B ) value to insert into DATE_M already exists in DATE_M , then the source ISSUE must be appended with the existing DATE_M ISSUE . The example below show the

SQL Query With Row_Number, order by and where clause

笑着哭i 提交于 2019-12-02 00:25:31
问题 I have the following SQL query: select ID, COLUMN1, COLUMN2 from (select ID, COLUMN1, COLUMN2, row_number() over (order by 2 DESC) NO from A_TABLE) where NO between 0 and 100 What I am trying to do is to select the first 100 records of the query select ID, COLUMN1, COLUMN2 from ATABLE order by 2 DESC And here are the problems: Apparently, the order by clause is not working. I've noticed that I have to add another order by 2 DESC clause, just after (...) from ATABLE , for my query to work. Is

How to concatenate multiple rows order by sequence in Oracle10g

妖精的绣舞 提交于 2019-12-01 23:38:45
If I have a data like this: GROUP | SEQUENCE | COMMAND ------------------------------ ONE | 3 | <message2>MESSAGE</message2> ONE | 1 | <?xml version="1.0" encoding="UTF-8"?> ONE | 2 | <message1>MESSAGE</message1> TWO | 2 | <message2>MESSAGE</message2> TWO | 1 | <?xml version="1.0" encoding="UTF-8"?> ........ TWO | 10 | <message9>MESSAGE</message9> How can I concatenate the command to be like this: GROUP | COMMAND ----------------- ONE | <?xml version="1.0" encoding="UTF-8"?>,<message1>MESSAGE</message1>,<message2>MESSAGE</message2> TWO | <?xml version="1.0" encoding="UTF-8"?>,<message1>MESSAGE

Oracle 10g - Escape quote in insert statement

☆樱花仙子☆ 提交于 2019-12-01 23:34:04
I am trying to insert people's height into a database in the form of 5'9 How do I properly escape the quote so I can do this. My insert statement looks like this so far. INSERT INTO height(id, height) VALUES(height-seq.nexval, '5\'9'); The backslash does not work obviously and I am pretty new to oracle. Thanks Oracle uses standard SQL: INSERT INTO height(id, height) VALUES(height-seq.nexval, '5''9'); (Yes there are two single quotes) if you are doing this from a front end using some programming language, consider using a parametrized query, if you are in psql or some other tool to do this,

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

醉酒当歌 提交于 2019-12-01 22:16:38
问题 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? 回答1: 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. 回答2: AFAIK, you can only throttle

Is dbms_output.put() being buffered differently from dbms_output.put_line()?

佐手、 提交于 2019-12-01 21:12:25
问题 Im using Aqua Data Studio to debug a stored proc by scattering output statments throughout. I have a delete statement in the package which violate an integrity constraint: DELETE FROM x WHERE x.ID = an_x_with_children; My proc fails with an ORA-02292 on this line, as expected. I want to see the value of the an_x_with_children variable. So I wrap the line with outputs like so: dbms_output.put('Attempting to delete x: ' || an_x_with_children); DELETE FROM x WHERE x.ID = an_x_with_children; dbms

Getting weird issue with TO_NUMBER function in Oracle

半腔热情 提交于 2019-12-01 20:51:48
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_number(field1) = 23 and id >1 and id < 100000 This works But if I do the query select * from country

Error when importing cx_Oracle module [Python]

早过忘川 提交于 2019-12-01 20:38:51
I use Windows 7 64 bit and Oracle 10g. I have installed python-2.7.2.amd64 and cx_Oracle-5.1-10g.win-amd64-py2.7. When I importing cx_Oracle module I get this error: Traceback (most recent call last): File "C:\Osebno\test.py", line 1, in import cx_oracle ImportError: No module named cx_oracle Can someone please tell me what is wrong? Have you tried import cx_Oracle (upper-case O ) instead of import cx_oracle ? Robert McGinley I had this same issue under Windows. I used Dependency Walker to open up the cx_Oracle.pyd file in C:\Python\Libs\site-libraries\ and reviewed the findings that