oracle11g

Oracle, Blob data are missing in my export file

心已入冬 提交于 2019-12-23 09:39:33
问题 I use Oracle 11g, I am trying to export my data(only the data, not table create scripts etc.) So it can be imported by customer to their database When I use Oracle Sql developer's export database, it only exports the data but my BLOB's are missing! There are a lot of image files in one of my tables which I want to export as well. I wonder If I really need to use oracle exp imp tool; http://docs.oracle.com/cd/B28359_01/server.111/b28319/exp_imp.htm#i1004777 Any idea? 回答1: From the

How to use temporal validity in Oracle 12c?

心已入冬 提交于 2019-12-23 09:33:29
问题 How to design a table in Oracle 11g so that it is compatible later on with the new "Temporal validity" feature in Oracle 12c? The online documentation of Oracle 12c specifies how to define temporal validity inthe SQL Language guide (http://docs.oracle.com/cd/E16655_01/server.121/e17209/statements_7002.htm#CJADHJHB) ALTER TABLE my_table ADD (PERIOD FOR my_valid_time (my_valid_start, my_valid_end) ); So one could use the good old valid_from and valid_till columns already in 11g and beef them up

LIMIT / OFFSET in Oracle 11G

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 09:27:42
问题 I'm trying to update a table in Oracle and I'm running into some difficulty. I'm porting over my code from MySQL and some of the commands that MySQL allows are not supported in Oracle. Here is the MySQL code: update table1 t1 set c5 = (select ContractID from table2 t2 where t1.assetid = t2.assetid and t1.lastdate >= t2.lastdate and t1.firstdate= t2.firstdate order by lastdate asc limit 1 offset 4); The subquery returns a list of ContractIDS, sorted by lastdate and I only want a particular one

Is it possible to use sql%rowcount for SELECT?

依然范特西╮ 提交于 2019-12-23 09:04:25
问题 The code below may return more than one row. Will sql%rowcount return the number of rows fetched? select * from emp where empname = 'Justin' and dept='IT' if sql%rowcount>0 ... This is my sample proc; am I using sql%rowcount in correct way? CREATE PROCEDURE Procn(in_Hid IN VARCHAR2,outInststatus OUT VARCHAR2,outSockid IN NUMBER,outport OUT VARCHAR2,outIP OUT VARCHAR2,outretvalue OUT NUMBER) AS BEGIN select INST_STATUS into outInststatus from TINST_child where INST_ID = in_Hid and INST_STATUS

How to select on table and count occurrences some values

喜欢而已 提交于 2019-12-23 07:47:54
问题 I am asking you for a help because I do not know SQL very well. I need to count occurrences some values from table column to achieve effect like statistics table which will look like at the picture below: Needed result: Comment: My Result Table needs to have first two columns (contry and site) comes from first table "Violations" and next 5 columns which will contain numbers (count) of occurrences status_id in "Violations" in each of possible values of id from Status table. Explanation: So, I

How to return a redundant row for duplicate ID in single row in Oracle

怎甘沉沦 提交于 2019-12-23 05:52:28
问题 I have a Audit kind of table where we store some information based on some triggers in other tables. ID, Changed_Column, OldValue, NewValue will be available. Now there is a possibility for same Id there will be 3-4 duplicates since the changed column will have different values I wants to merge them into single row and take data For exmaple, ID ChangedColumn OldValue NewValue 1 Name Bob Roy 1 Age 26 28 1 Section B C When we select now it will display all the rows into separte but I wants to

How to return a redundant row for duplicate ID in single row in Oracle

房东的猫 提交于 2019-12-23 05:52:06
问题 I have a Audit kind of table where we store some information based on some triggers in other tables. ID, Changed_Column, OldValue, NewValue will be available. Now there is a possibility for same Id there will be 3-4 duplicates since the changed column will have different values I wants to merge them into single row and take data For exmaple, ID ChangedColumn OldValue NewValue 1 Name Bob Roy 1 Age 26 28 1 Section B C When we select now it will display all the rows into separte but I wants to

Parameter variable schema oracle

徘徊边缘 提交于 2019-12-23 05:34:10
问题 I'm newbie using Oracle. I have a question: in SQL Server, we can use: DECLARE DBNAME1 VARCHAR(20) DECLARE DBNAME2 VARCHAR(20) SET @DBNAME1 ='TEST_DB' SET @DBNAME2 ='TEST_DB2' INSERT INTO @DBNAME1.TABLECORE SELECT * FROM @DBNAME2.TABLENONCORE T What is the equivalent of this script in if @DBNAME == Schema in Oracle? 回答1: We can manage it but creating db link on dbname2 : create public database link dbname2 connect to myschema using 'abc-scan.mycompany.com.tr:1521/dbname2.mycompany.com.tr';

Following query giving DB CPU utilization impact, can I reduce data in table will help me to reduce DB CPU performance

前提是你 提交于 2019-12-23 05:25:36
问题 I am using following query in which , table which is being referred that have 50Million+ records. By creating history table will help me out to better CPU performance ? or is there any other option apart from Partition. Or Query plan tweak is the only option ? SELECT MIN(minbkt), maxbkt, SUBSTRB(DUMP(MIN(val), 16, 0, 32), 1, 120) minval, SUBSTRB(DUMP(MAX(val), 16, 0, 32), 1, 120) maxval, SUM(rep) sumrep, SUM(repsq) sumrepsq, MAX(rep) maxrep, COUNT(*) bktndv, SUM(CASE WHEN rep = 1 THEN 1 ELSE

Can one schema have multiple users? [duplicate]

亡梦爱人 提交于 2019-12-23 05:16:18
问题 This question already has answers here : Difference between a user and a schema in Oracle? (15 answers) Closed 5 years ago . I have a question I wanted to know the exact difference between user and schema? Can one schema have multiple users, if yes how? Can someone please explain with good examples. 回答1: In Oracle user is equivalent to schema. So the answer is no. Once you create a user eg. scott all objects created by user scott are within his schema. You can access objects from scotts