Connect as SYSDBA or SYSOPER
-
- Fresh Boarder
- Posts: 12
- Joined: 20.07.2020, 07:01
Connect as SYSDBA or SYSOPER
Hey,
Does anybody know how to connect to oracle db as SYDBA or SYSOPER?
Does anybody know how to connect to oracle db as SYDBA or SYSOPER?
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: Connect as SYSDBA or SYSOPER
Hello, usually it is just setting UserName to "SYSDBA" and Password to to the password assigned to SYSDBA. What error message do you get?
-
- Fresh Boarder
- Posts: 12
- Joined: 20.07.2020, 07:01
Re: Connect as SYSDBA or SYSOPER
Sorry, how to connect on SYS schema as SYSDBA role with ZEOS without changing Zeos source?
-
- Fresh Boarder
- Posts: 12
- Joined: 20.07.2020, 07:01
Re: Connect as SYSDBA or SYSOPER
... I talk about oracle database connection, no Firebird
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: Connect as SYSDBA or SYSOPER
Hello Piotr,
this is - more or less - what I do on our test server:
This usually gets me connected.
If you want to set the default schema to be SYS, the following might work:
Best regards,
Jan
this is - more or less - what I do on our test server:
Code: Select all
ZConnection.Protocol := 'oracle';
ZConnection.Host := 'localhost';
ZConnection.Database := '';
ZConnection.Port := 0; // meaning use the default port
ZConnection.Username := 'SYSTEM';
ZConnection.Password := '********' // insert your password here
ZConnection.ClientCodepage := 'UTF8';
If you want to set the default schema to be SYS, the following might work:
Code: Select all
ZConnection.Catalog := 'SYS';
Jan
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
Re: Connect as SYSDBA or SYSOPER
Honestly (lack of knowledge) we'd start from the premisse the username and it's grand options is doing the job. After reading viewtopic.php?f=50&t=125819 the sentence is clear.. Patch done https://sourceforge.net/p/zeoslib/code-0/6825/ and https://sourceforge.net/p/zeoslib/code-0/6824/ it should do the job. Patch will be merged to 7.2 next days...
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
-
- Fresh Boarder
- Posts: 12
- Joined: 20.07.2020, 07:01
Re: Connect as SYSDBA or SYSOPER
You don't understand how to switch to SYSDBA or SYSOPER mode during connection, I mean something like TZConnection.Properties.Values ['OCIAuthenticateMode = OCI_SYSDBA']; or TZConnection.AuthenticationMode: = OCI_SYSDBA or how? Where should I put it in the code, because I don't see anything like this anywhere in the TZConnection and nobody on the internet describes it, so either it's that simple or I don't know ...
(How do You connect as SYSDBA / SYSOPER to Oracle Database in Your code?)
(How do You connect as SYSDBA / SYSOPER to Oracle Database in Your code?)
-
- Fresh Boarder
- Posts: 12
- Joined: 20.07.2020, 07:01
Re: Connect as SYSDBA or SYSOPER
... Or else I am asking for the simplest possible example codes that will connect to the SYS schema on the Oracle database.
what should be added in the following?
what should be added in the following?
MenuGlowne.ConnectionsTable[MenuGlowne.gConnectionIndex]:= TZConnection.Create(nil); MenuGlowne.ConnectionsTable[MenuGlowne.gConnectionIndex].Name:=LoginForm.UserEdit.Text+IntToStr(MenuGlowne.gConnectionIndex)+'Connection'; MenuGlowne.ConnectionsTable[MenuGlowne.gConnectionIndex].AutoCommit:= false; MenuGlowne.ConnectionsTable[MenuGlowne.gConnectionIndex].ClientCodepage:= 'UTF8'; MenuGlowne.ConnectionsTable[MenuGlowne.gConnectionIndex].ControlsCodePage:= cCP_UTF8; MenuGlowne.ConnectionsTable[MenuGlowne.gConnectionIndex].Protocol:= 'oracle'; MenuGlowne.ConnectionsTable[MenuGlowne.gConnectionIndex].TransactIsolationLevel:= tiReadCommitted; MenuGlowne.ConnectionsTable[MenuGlowne.gConnectionIndex].UseMetadata:= false; MenuGlowne.ConnectionsTable[MenuGlowne.gConnectionIndex].User:= LoginForm.UserEdit.Text; MenuGlowne.ConnectionsTable[MenuGlowne.gConnectionIndex].Password:= LoginForm.PasswEdit.Text; MenuGlowne.ConnectionsTable[MenuGlowne.gConnectionIndex].Database:= LoginForm.SidEdit.Text; MenuGlowne.ConnectionsTable[MenuGlowne.gConnectionIndex].Connected:= true;
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: Connect as SYSDBA or SYSOPER
Authentication mode is set by the OCIAuthenticateMode property. It hast to be set before the connection to the database is established. OCIAuthenticateMode maps to the mode parameter of OCISessionBegin. The parameter needs to be set as an integer value because it is a field of flags. Possible modes and their values:
- OCI_DEFAULT = 0
- OCI_MIGRATE = 1
- OCI_SYSDBA = 2
- OCI_SYSOPER = 4
- OCI_PRELIM_AUTH = 8
Code: Select all
ZConnection.Properties.Add('OCIAuthenticateMode = 2');
// ... some other code ...
ZConnection.Connect;
-
- Fresh Boarder
- Posts: 12
- Joined: 20.07.2020, 07:01
Re: Connect as SYSDBA or SYSOPER
Tried this, but it doesn't work, it's still the ORA-28009 error.
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: Connect as SYSDBA or SYSOPER
There was a mistake on my side. Delphi TStrings doesn't like spaces in its key-value implementations. So the source code should look something like this:
Please note that there are no spaces. This works for me in my sample application.
Code: Select all
ZConnection.Properties.Add('OCIAuthenticateMode=2');
// ... some other code ...
ZConnection.Connect;
-
- Fresh Boarder
- Posts: 12
- Joined: 20.07.2020, 07:01
Re: Connect as SYSDBA or SYSOPER
btw, besides, I didn't have the right version, after installing CodeTyphon with ZESO 7.5.1 it worked, I didn't take into account that only in version 7.3.0 these changes came in, and I had version 7.2
OK, now is good, many thanks
OK, now is good, many thanks
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: Connect as SYSDBA or SYSOPER
Sorry - but we don't support Code Typhoon. It is a moving target. We only support Delphi and Lazarus.
There never was a Zeos version 7.5. Never ever.
Zeos 7.2 from SVN has the necessary changes.piotr.b.brzeski wrote: ↑05.07.2021, 14:02 I didn't take into account that only in version 7.3.0 these changes came in, and I had version 7.2
Good to know.
Best regards,
Jan