oracle-sqldeveloper

Understanding the results of Execute Explain Plan in Oracle SQL Developer

落爺英雄遲暮 提交于 2019-11-28 02:59:01
I'm trying to optimize a query but don't quite understand some of the information returned from Explain Plan . Can anyone tell me the significance of the OPTIONS and COST columns? In the OPTIONS column, I only see the word FULL. In the COST column, I can deduce that a lower cost means a faster query. But what exactly does the cost value represent and what is an acceptable threshold? Jeffrey Kemp The output of EXPLAIN PLAN is a debug output from Oracle's query optimiser. The COST is the final output of the Cost-based optimiser (CBO), the purpose of which is to select which of the many different

Oracle TNS names not showing when adding new connection to SQL Developer

孤街醉人 提交于 2019-11-28 02:46:46
I'm trying to connect to an oracle database with SQL Developer. I've installed the .Net oracle drivers and placed the tnsnames.ora file at C:\Oracle\product\11.1.0\client_1\Network\Admin I'm using the following format in tnsnames.ora: dev = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.XXX.XXX)(PORT = XXXX)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = idpdev2) ) ) In SQL Developer, when I try to create a new connection, no TNS-names show up as options. Is there something I'm missing? JaseAnderson SQL Developer will look in the following location in this order for a

CHECK constraint on date of birth?

本小妞迷上赌 提交于 2019-11-28 02:02:02
I am creating my employee table in Oracle and for emp_date I would like to make it so the date of birth is not way back in the past and can not be set in the future? Is this too complex to implement in the CREATE TABLE statement? if so then I guess I have to skip it because that is the part where I have to create the constraints. , emp_dob DATE NOT NULL CREATE TABLE employee(emp_id NUMBER(4) PRIMARY KEY , emp_name VARCHAR2(40) NOT NULL , emp_address VARCHAR2(60) NOT NULL , emp_tel NUMBER(11) NOT NULL , CONSTRAINT emp_tel_length CHECK (LENGTH(emp_tel) BETWEEN 9 and 11) , emp_dob DATE NOT NULL ,

Find the length of the longest row in a column in oracle

旧街凉风 提交于 2019-11-27 23:17:19
问题 Does anybody know if there is a way to find what the length of the longest row in a column in Oracle? Basically I need to get the length of the longest row and then use that length plus 1 with SUBSTR to make the output of the column one character longer than the longest string. Thanks EDIT: Thanks for the advice. However, the MAX(LENGTH(column_name)) AS MAXLENGTH approach gives me the number I want but when I try to use it with SUBSTR(column_name,1, MAXLENGTH) I get an invalid identifier

Oracle: export a table with blobs to an .sql file that can be imported again

╄→гoц情女王★ 提交于 2019-11-27 23:04:56
I have a table "Images" with two fields: Name VARCHAR2 Data BLOB I would like to export that table to a .sql file which I could import on another system. I tried to do so using the "Database unload" assistant of Oracle SQL Developer. However the generated file does just have the content for the names in it but not the data. Thus after importing I would end up with all the names but the data field would be null everywhere. I'd really prefer it just to be one file (I saw some examples that included dumping the data to one file per field on the fs...) Is it possible to generate such a script with

Setting up the Oracle database on Macbook Pro (OS X Yosemite)

巧了我就是萌 提交于 2019-11-27 20:50:01
I see that Oracle 11g or 12c doesn't have the download files for OS X. However, there is a version of the SQL Developer available for OS X. What's the point of the SQL Developer when you don't have a database? How do I install the Oracle database (preferable 12c or 11g Express Edition) on OS X? Alex Poole You can't install the database server software directly on OS X 1 . Oracle made a decision some time ago not so support it any more, presumably because it wasn't used enough to justify the costs involved. I seem to recall its demise roughly coincided with Apple dropping their Xserve line, but

Exporting a CLOB to a text file using Oracle SQL Developer

有些话、适合烂在心里 提交于 2019-11-27 20:44:44
I am using Oracle SQL Developer and trying to export a table to a CSV file. Some of the fields are CLOB fields, and in many cases the entries are truncated when the export happens. I'm looking for a way to get the whole thing out, as my end goal is to not use Oracle here (I received an Oracle dump - which was loaded into an oracle db, but am using the data in another format so going via CSV as an intermediary). If there are multiple solutions to this, given that it is a one time procedure for me, I don't mind the more hack-ish type solutions to more involved "do it right" solutions. JD Long if

Oracle : select maximum value from different columns of the same row

半腔热情 提交于 2019-11-27 20:25:25
The whole question is pretty much in the title. For each row of the table I'd like to select the maximum of a subset of columns. For example, from this table name m1 m2 m3 m4 A 1 2 3 4 B 6 3 4 5 C 1 5 2 1 the result would be name max A 4 B 6 C 5 The query must be compatible oracle 8i. Given this test data ... SQL> select * 2 from your_table 3 / NAME M1 M2 M3 M4 ---- ---------- ---------- ---------- ---------- A 1 2 3 4 B 6 3 4 5 C 1 5 2 1 SQL> ... a straightforward GREATEST() call will give the desired result: SQL> select name 2 , greatest(m1,m2,m3,m4) 3 from your_table 4 / NAME GREATEST(M1,M2

Bad screen redrawing in Oracle SQL Developer

随声附和 提交于 2019-11-27 20:24:02
问题 I have a problem with Oracle SQL Developer. When I use it on a Windows Server 2003 machine, it works fine. When I use it on my Windows 7 desktop, I get a lot of redraw problems in the query results grid when I scroll either horizontally or vertically, like so: Edit: ImageShack was the original image host for my screenshot, and it's no longer a valid url. Since my problem is fixed now, I can't repro this. The gist is that the client area of the result grids was repainted as gibberish during

How to enter special characters like “&” in oracle database? [duplicate]

痴心易碎 提交于 2019-11-27 18:42:19
This question already has an answer here: How do I ignore ampersands in a SQL script running from SQL Plus? 7 answers I want to insert special character & in my insert statement. My insert is: INSERT INTO STUDENT(name, class_id) VALUES ('Samantha', 'Java_22 & Oracle_14'); If I try to run this query I am getting a popup and it asks me to enter value for Oracle_14 . How can I enter special characters like & in the insert statement for oracle db? If you are in SQL*Plus or SQL Developer, you want to run SQL> set define off; before executing the SQL statement. That turns of the checking for