Thursday, 7 April 2011

SQLDeveloper 3.0 production is supplied with the thin driver 11.2.0.2
it needs 11.2.0.2 version to use thick which has a few additional features over thin.

To avoid confusion with other Oracle software you can set the ORACLE_HOME in the session you start sqldeveloper in as described below:

The version mismatch is often because SQLDeveloper is trying to use the 'thick' driver and 11.2.0.2 thick is not available,
try
thin by:
1/(uncheck Tools->preferences->Datababae->advanced->use OCI/thick driver, and
2/If necessary, set ORACLE_HOME for your cmd.exe session where sqldev is started from to where sqldeveloper is where %ORACLE_HOME%\jdbc\lib exists, (so SQLDeveloper does not try your existing ORACLE_HOME) and
3/use Connection Type TNS -> Network Alias.
4/You may need to set Tools->preferences->Datababase->advanced->Tnsname directory to the directory containing tnsnames.ora

-Turloch

Edit 25 Sep 2011
P.S. PATH (and LD_LIBRARY_PATH ??) settings may be needed to find the new .dll (Windows) and .so (Linux) files.

Friday, 23 April 2010

Substitution and bind variables

Substitution and bind variables in execute script f5.

(execute statement f9 handles substitution variables '&' the same , but prompts for bind variables ':' in select update delete... (but not anonymous blocks))

Input



undefine a_value
undefine fred
--Substitution variables ie &...
--prompt if not known and set
prompt &&a_value
--set a value explicitly
define new_value = fred
prompt &fred

--Bind variables ie :...
variable my_bind varchar2
begin
:my_bind := 'value';
end;
/
begin
null;
--(use :my_bind within an anonymous block);
end;
/
--or
print :my_bind




Output


> undefine a_value

> undefine fred

> --Substitution variables ie &...

> --prompt if not known and set

> prompt &&a_value

old:prompt &&a_value
new:prompt set_a_value
set_a_value
> --set a value explicitly

> define new_value = fred

> prompt &fred

old:prompt &fred
new:prompt set_fred
set_fred
> --Bind variables ie :...

> variable my_bind varchar2

> begin
:my_bind := 'value';
end;

anonymous block completed
> begin
null;
--(use :my_bind within an anonymous block);
end;

anonymous block completed
> --or

> print :my_bind

MY_BIND
-----
value

Clearing substitution variables

ScriptRunnerContext substitution variables are cleared

1/if you connect the worksheet to another connection and back via the top right connection chooser.
2/You start a new work sheet
3/undefine variable_name

Saturday, 27 February 2010

Using Oracle Client with SQLDeveloper

SQLDeveloper by default has limited connection configuration possibilities (thin jdbc driver) so 'edge cases' may need the Oracle (instant) Client install and full *.ora configuration

- sqldeveloper
- Tools preferences -> database -> advanced -> use oci/thick driver
- oracle client
- connection type TNS->connect identifier
- click kerberos to allow null username/password (or OS authentication but I think that has more consequences)

(and effectively kick the config back to the oracle thick client *.ora files and 'sqlplus' C code (where kerberos may not be configured))

Thursday, 16 July 2009

Radius

Just checked with latest code in development should work in earlier versions:

Note that if you can

sqlplus username/password@database (using Radius)

you should be able to use sqldeveloper in the same way using OCI/Thick driver (see tools->preferences->database->Advanced (Use OCI/Thick driver) for the check box to use OCI/Thick tested, for example, with 11.1.0.7 instant client)

i.e. set up radius server and client, then oracle sqlnet.ora, then sqlplus [see core database administration documents], then sqldeveloper on top should be easy.

Authentication (using user name and password for each connection) via Radius authentication server has been verified over OCI/thick, where username is saved/stored for each attempt at authentication (the password can be saved (bad for security) or prompted). 'Challenge/response' mode is not supported.

-Turloch

Friday, 1 May 2009

Hi,

If your connection entry is unusual you could try these simple things that may cause variation/different code paths:

1/ORACLE_HOME being set /unset by for example a bat script before launching sqldeveloper see in see in sqldeveloper help/about/properties/ oracle.home and jdbc.library to see what oracle sqldeveloper is using
(you could be using sqldeveloper or other oracle install jdbc)

2/Tools/preferences/database/Advanced Parameters/Use oci thick driver set/unset
(you could be using 'pure' jdbc thin or 'mixture of c & java' ie. thick oci driver using another Oracle Home or instant client)

3/use Connection type=advanced then you can enter a fancy description (these descriptions are simple but you could have load balancing for example):
thin is pure java
jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MACHINE_NAME_OR_IP)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=dev11gr1)))
oci8 is thick/c/oci-java
jdbc:oracle:oci8:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MACHINE_NAME_OR_IP)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=dev11gr1)))
(or get SQLDev to look up tnsnames.ora, connection type = tns might work)

Please post your findings and put in an enhancement request (see sqldeveloper forum for details) for particular connection feature support, documented with a test case.

-Turloch

Friday, 13 March 2009

SQLDeveloper Ldap success and failure modes

(slightly clearer update:

Works/Happy day scenario:

1/LDAP Server: your.ldap.com:389:636
(machine:nonssl port:ssl port)
(bug in 154 ssl port required, can be entered but non ssl is used)
(fix in development, ssl port can be left out entirely i.e.
machine:nonssl port)
2/press enter in the LDAP Server field
3/choose context (with a db service)
4/press load->get db service populated with pull down ,
5/select db service enter username/password
6/test gives successfull connection

Error scenarios with bad error messages:

LDAP Server: your.ldap.com:389:636
(machine:nonssl port:ssl port) (bug ssl port required can be entered but nonssl is used) EDIT typo switched to "nonssl is used".
Error_mode:press test: Status -Test failed: Required property 'hostname' is not set on the DataProvider (because no Db service is available and selected)

LDAP Server: your.ldap.com:389:636
press enter
Error_mode:different contexts are available do not select one
press load->get Status: Failure -null (as no context is selected)

Error_mode:choose a context with no db service,
press load->get Status: Failure -setSelectedIndex:0 out of bounds (as there are no db services with this context.

End of update)

LDAP Server: your.ldap.com:389:636
Error_mode:press test: Status -Test failed: Required property 'hostname' is not set on the DataProvider (because no Db service is available and selected)

1/LDAP Server: your.ldap.com:389:636
(machine:nonssl port:ssl port) (bug ssl port required in sqldeveloper, though I do not think ssl is used)
2/press enter
Error_mode:different contexts are available do not select one
press load->get Stataus: Failure -null (as no context is selected)
3/NON Error mode:choose context with a db service
4/press load->get db service populated with pull down , select db service enter username/password -> test(->>>>>>success)

FYI
Error_mode:choose a context with no db service,
press load->get Status: Failure -setSelectedIndex:0 out of bounds (as there are no db services with this contxt.

I think that describes getting the connection details [internally hostname, port and sid] - need to add username/password.