Direct mode and dedicated connection
Direct mode and dedicated connection
I am using dbexpress in direct mode. Is it possible to establish a dedicated connection?
I have not been able to find anything about it in the documentation or forum.
Thanks in advance.
I have not been able to find anything about it in the documentation or forum.
Thanks in advance.
Re: Direct mode and dedicated connection
You can use the description of the TNS alias when working in Direct Mode in the same way as in OCI Mode. To do this, assign the required value to the DataBase property :
Code: Select all
...
SQLConnection.DriverName := 'DevartOracleDirect';
SQLConnection.Params.Values['DataBase'] := '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=<your HOST>)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=<your SERVICE_NAME>)))';
SQLConnection.Params.Values['User_Name'] := 'scott';
SQLConnection.Params.Values['Password'] := 'tiger';
SQLConnection.Connected := True;
...
Re: Direct mode and dedicated connection
Thanks for your help, but it didn't work.
I have tried and I can connect with parameters in TNS style, but the connection is still shared. If it helps, this is my code:
SQLConnection.Params.Values['DataBase'] := '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<host>)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=<service name>)))';
But when the program connects to Oracle, what Oracle gets is this:
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<host>)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=<service ame>)(CID=(PROGRAM=<exe name>)(HOST=<my PC's name>)(USER=<my Windows username>))))
It seems that, no matter what the value for SERVER is, it is always omitted in the connection.
Any other idea to try?
I have tried and I can connect with parameters in TNS style, but the connection is still shared. If it helps, this is my code:
SQLConnection.Params.Values['DataBase'] := '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<host>)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=<service name>)))';
But when the program connects to Oracle, what Oracle gets is this:
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<host>)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=<service ame>)(CID=(PROGRAM=<exe name>)(HOST=<my PC's name>)(USER=<my Windows username>))))
It seems that, no matter what the value for SERVER is, it is always omitted in the connection.
Any other idea to try?
Re: Direct mode and dedicated connection
We will investigate the described issue and let you know the results shortly
Re: Direct mode and dedicated connection
Thank you for your attention.
If it helps: I have checked both Delphi 7 and XE 10.2 using the latest version of your DLLs ( 6.10.15.0 )
If it helps: I have checked both Delphi 7 and XE 10.2 using the latest version of your DLLs ( 6.10.15.0 )
Re: Direct mode and dedicated connection
We tested the operation of our driver according to your description and found no problems. In our tests, we used Oracle server 12.2.0.1.0, as well as the latest version of our driver. The connection mode was checked by requesting the v$session view :
When connected according to the sample above, this query returns the "DEDICATED" value. Please specify the Oracle server version you are using. What value will the query return to the v$session view when performing similar actions in your environment?
Code: Select all
SELECT SERVER FROM v$session WHERE SCHEMANAME='SCOTT'
Re: Direct mode and dedicated connection
Sorry for the delay. Our DBA was on holiday and I couldn't get help until yesterday (my user didn't have enough privileges to access v$session)
Our Oracle version is the same as yours, oracle 12.c release 2.
I have checked the query you told me and the result is always 'SHARED' (In SQLDeveloper connections I get 'DEDICATED' as expected)
Our Oracle version is the same as yours, oracle 12.c release 2.
I have checked the query you told me and the result is always 'SHARED' (In SQLDeveloper connections I get 'DEDICATED' as expected)
Re: Direct mode and dedicated connection
We again tested the possibility of using the DEDICATED connection with DevartOracleDirect using the following console application:
Then we got the query result (SELECT SID, SERVER, SCHEMANAME FROM v$session WHERE SCHEMANAME='MAXIMG' And PROGRAM='Project1.exe') shown in the screenshot :
Try performing the same actions in your test environment. Make sure again that in the test application and when using any third-party utilities, you connect with absolutely identical connection parameters.
Code: Select all
program Project1;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils, Data.DB, Data.SqlExpr,
DBXDevartOracle;
var
SQLConnection: TSQLConnection;
begin
SQLConnection := TSQLConnection.Create(nil);
try
SQLConnection.ConnectionName :='Devart Oracle Direct';
SQLConnection.DriverName := 'DevartOracleDirect';
SQLConnection.Params.Values['User_Name'] := 'MaximG';
SQLConnection.Params.Values['Password'] := 'MaximG Password';
SQLConnection.Params.Values['Database'] := '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle12c.testdata)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orclpdb.env)))';
SQLConnection.Connected := True;
ReadLn;
finally
SQLConnection.Free;
end;
end.
Then we got the query result (SELECT SID, SERVER, SCHEMANAME FROM v$session WHERE SCHEMANAME='MAXIMG' And PROGRAM='Project1.exe') shown in the screenshot :
Try performing the same actions in your test environment. Make sure again that in the test application and when using any third-party utilities, you connect with absolutely identical connection parameters.