oracle11g

Oracle SqlDeveloper JDK path

感情迁移 提交于 2019-12-17 16:13:06
问题 I have recently installed sqldeveloper but i'm getting the below warning window when I try to launch it. This is causing the sqldeveloper to run very very slow and it hangs frequently I have tried editing the file sqldeveloper.cong as suggested in the window above but does not work Original SetJavaHome ../../jdk Update 1 SetJavaHome C:\Program Files\Java\jdk1.7.0_60\bin\ and all other variations but still getting the above warning window Update 2 SetJavaHome C:\Program Files (x86)\Java\jre7

Oracle: Replacing non-numeric chars in a string

拥有回忆 提交于 2019-12-17 16:04:55
问题 I have a field in my database where users have saved free-form telephone numbers. As a result, the data has all sorts of different formatting: (area) nnn-nnnn area-nnn-nnnn area.nnn.nnnn etc I would like to strip out all the non-numeric characters and just store the digits, but I can't find a simple way to do this. Is it possible without using one REPLACE for each char? 回答1: You can use REGEXP_REPLACE since Oracle 10: SELECT REGEXP_REPLACE('+34 (947) 123 456 ext. 2013', '[^0-9]+', '') FROM

split string into several rows

本小妞迷上赌 提交于 2019-12-17 14:44:22
问题 I have a table with a string which contains several delimited values, e.g. a;b;c . I need to split this string and use its values in a query. For example I have following table: str a;b;c b;c;d a;c;d I need to group by a single value from str column to get following result: str count(*) a 1 b 2 c 3 d 2 Is it possible to implement using single select query? I can not create temporary tables to extract values there and query against that temporary table. 回答1: From your comment to

split string into several rows

拈花ヽ惹草 提交于 2019-12-17 14:43:08
问题 I have a table with a string which contains several delimited values, e.g. a;b;c . I need to split this string and use its values in a query. For example I have following table: str a;b;c b;c;d a;c;d I need to group by a single value from str column to get following result: str count(*) a 1 b 2 c 3 d 2 Is it possible to implement using single select query? I can not create temporary tables to extract values there and query against that temporary table. 回答1: From your comment to

return resultset from function

风流意气都作罢 提交于 2019-12-17 13:29:32
问题 I need to return a resultset from function and work with this resultset just like with an ordinary table. So I need something like following: select * from table(querydb('select * from dual')) The querydb function should return a resultset of a query passed to it. Can it be implemented in oracle? Would be grateful for any information. 回答1: If you need a result set and a ref cursor won't do with a datatype called sys.anydataset. i.e what you seem to want is a pipelined function, but of course

Oracle RAC and sequences

谁都会走 提交于 2019-12-17 10:29:20
问题 I have various database applications that use sequences, I´m migrating these applications to Oracle RAC from 10g without RAC to 11g with RAC. I need ordered sequences and gaps are tolerated. I'm thinking in cache sequences with order, I don´t know what are the effect in performance. Do you think this is a good option? What are your experience with sequences and RAC? Thanks, 回答1: Exactly what do you mean by "ordered" in this context? By default, each node in the cluster has a separate cache of

How to create a user in Oracle 11g and grant permissions

帅比萌擦擦* 提交于 2019-12-17 10:12:14
问题 Can someone advise me on how to create a user in Oracle 11g and only grant that user the ability only to execute one particular stored procedure and the tables in that procedure. I am not really sure how to do this! 回答1: Connect as SYSTEM. CREATE USER username IDENTIFIED BY apassword; GRANT CONNECT TO username; GRANT EXECUTE on schema.procedure TO username; You may also need to: GRANT SELECT [, INSERT] [, UPDATE] [, DELETE] on schema.table TO username; to whichever tables the procedure uses.

Why does the wm_concat not work here?

老子叫甜甜 提交于 2019-12-17 10:06:16
问题 I have this query : (SELECT OBJECT_ID from cr_object_group_entries_vw where object_group_id IN (SELECT ITEM FROM TABLE(CR_FN_SPLIT_STRING('28,56',',')))) that returns : But when I do : SELECT wm_concat(object_id) FROM (SELECT OBJECT_ID from cr_object_group_entries_vw where object_group_id IN (SELECT ITEM FROM TABLE(CR_FN_SPLIT_STRING('28,56',',')))) I get a blank result... what am I doing wrong? 回答1: You must avoid wm_concat function because it is undocumented and discovered as workaround at

Oracle - How to create a materialized view with FAST REFRESH and JOINS

拜拜、爱过 提交于 2019-12-17 09:19:50
问题 So I'm pretty sure Oracle supports this, so I have no idea what I'm doing wrong. This code works: CREATE MATERIALIZED VIEW MV_Test NOLOGGING CACHE BUILD IMMEDIATE REFRESH FAST ON COMMIT AS SELECT V.* FROM TPM_PROJECTVERSION V; If I add in a JOIN, it breaks: CREATE MATERIALIZED VIEW MV_Test NOLOGGING CACHE BUILD IMMEDIATE REFRESH FAST ON COMMIT AS SELECT V.*, P.* FROM TPM_PROJECTVERSION V INNER JOIN TPM_PROJECT P ON P.PROJECTID = V.PROJECTID Now I get the error: ORA-12054: cannot set the ON

Nth max salary in Oracle

那年仲夏 提交于 2019-12-17 07:26:54
问题 To find out the Nth max sal in oracle i'm using below query SELECT DISTINCE sal FROM emp a WHERE ( SELECT COUNT(DISTINCE sal) FROM emp b WHERE a.sal<=b.sal)=&n; But According to me by using the above query it will take more time to execute if table size is big. i'm trying to use the below query SELECT sal FROM ( SELECT DISTINCE sal FROM emp ORDER BY sal DESC ) WHERE rownum=3; but not getting output.. any suggetions please .. Please share any link on how to optimise queries and decrease the