Compiled python executable access blocked to access Oracle database2019 Community Moderator ElectionHow do I connect to a MySQL Database in Python?Non-blocking read on a subprocess.PIPE in pythonHow do I get time of a Python program's execution?Unable to log in to database as SYS with Oracle SQL DeveloperHow can I access a clearquest oracle database from python?SQL Server to Oracle ConnectionORA-01005 error connecting with ODP.NetProblems to Access XE database installed in Windows 7 x64. (Oracle 11g express)Sqlplus command to change oracle database password in kornshell sciptConnect to 2 Oracle Databases in Python

It's a yearly task, alright

How to deal with taxi scam when on vacation?

Connecting top and bottom SMD component pads using via

Bash: What does "masking return values" mean?

What is a good source for large tables on the properties of water?

Is it normal that my co-workers at a fitness company criticize my food choices?

How is the Swiss post e-voting system supposed to work, and how was it wrong?

Have researchers managed to "reverse time"? If so, what does that mean for physics?

Why did it take so long to abandon sail after steamships were demonstrated?

Official degrees of earth’s rotation per day

How to simplify this time periods definition interface?

Meaning of "SEVERA INDEOVI VAS" from 3rd Century slab

Provisioning profile doesn't include the application-identifier and keychain-access-groups entitlements

What does it mean to make a bootable LiveUSB?

Professor being mistaken for a grad student

Calculus II Professor will not accept my correct integral evaluation that uses a different method, should I bring this up further?

Why are there 40 737 Max planes in flight when they have been grounded as not airworthy?

Sword in the Stone story where the sword was held in place by electromagnets

SQL Server Primary Login Restrictions

2D counterpart of std::array in C++17

An Accountant Seeks the Help of a Mathematician

Schematic conventions for different supply rails

My adviser wants to be the first author

Ban on all campaign finance?



Compiled python executable access blocked to access Oracle database



2019 Community Moderator ElectionHow do I connect to a MySQL Database in Python?Non-blocking read on a subprocess.PIPE in pythonHow do I get time of a Python program's execution?Unable to log in to database as SYS with Oracle SQL DeveloperHow can I access a clearquest oracle database from python?SQL Server to Oracle ConnectionORA-01005 error connecting with ODP.NetProblems to Access XE database installed in Windows 7 x64. (Oracle 11g express)Sqlplus command to change oracle database password in kornshell sciptConnect to 2 Oracle Databases in Python










4















I have a script (my_script.py) that accesses an Oracle database with the typical logon process via cx_Oracle.



def make_connect(**creds):
dsn_str = cx_Oracle.makedsn(host, port, sid)
return cx_Oracle.connect(un, pw, dsn_str)


There is no problem accessing the database through this method when the script is run from an IDE, but as soon as I package it into an executable (with PyInstaller, although I don't think this matters), I am getting the following error:



ORA-20045: LOGON BLOCKED



I believe this is because the executable that is accessing the database is not python.exe that is running the code but rather my_script.exe. The code works as expected if I change my_script.exe to python.exe, meaning I believe python.exe is whitelisted by the database for access.



I don't know enough about what particular system variable or environ variable declares itself to the Oracle database for access, but I have tried changing sys.executable to python.exe, or sys.argv[0] to python.exe, but I think there is something deeper that I might need to change (if I could change anything at all to get access).



Any suggestions would be more than helpful. The exe will be on systems with domain access to the database but because it's only python.exe that is whitelisted their access will be denied.










share|improve this question

















  • 4





    Oracle exceptions in the ORA-20000 to ORA-21299 range are generic user-defined exceptions raised by calling raise_application_error. You might have a LOGON trigger or something similar that's preventing you from connecting. Try running this query to look for the code that's generating this error: select * from all_source where text like '%-20045%'

    – kfinity
    Mar 6 at 19:04






  • 1





    Ask your DBAs to change the trigger to check the driver name that initiated the connection instead of the program name. This will be (very) marginally more secure but much less annoying to users: SELECT UNIQUE sid, client_driver FROM v$session_connect_info ORDER BY sid; The de facto standard for the CLIENT_DRIVER column is 'name : version'. Note older versions of the DB will only show the first 9 or so characters that the driver actually sets, so you might not see the version when you use Oracle DB 11.

    – Christopher Jones
    Mar 6 at 21:27















4















I have a script (my_script.py) that accesses an Oracle database with the typical logon process via cx_Oracle.



def make_connect(**creds):
dsn_str = cx_Oracle.makedsn(host, port, sid)
return cx_Oracle.connect(un, pw, dsn_str)


There is no problem accessing the database through this method when the script is run from an IDE, but as soon as I package it into an executable (with PyInstaller, although I don't think this matters), I am getting the following error:



ORA-20045: LOGON BLOCKED



I believe this is because the executable that is accessing the database is not python.exe that is running the code but rather my_script.exe. The code works as expected if I change my_script.exe to python.exe, meaning I believe python.exe is whitelisted by the database for access.



I don't know enough about what particular system variable or environ variable declares itself to the Oracle database for access, but I have tried changing sys.executable to python.exe, or sys.argv[0] to python.exe, but I think there is something deeper that I might need to change (if I could change anything at all to get access).



Any suggestions would be more than helpful. The exe will be on systems with domain access to the database but because it's only python.exe that is whitelisted their access will be denied.










share|improve this question

















  • 4





    Oracle exceptions in the ORA-20000 to ORA-21299 range are generic user-defined exceptions raised by calling raise_application_error. You might have a LOGON trigger or something similar that's preventing you from connecting. Try running this query to look for the code that's generating this error: select * from all_source where text like '%-20045%'

    – kfinity
    Mar 6 at 19:04






  • 1





    Ask your DBAs to change the trigger to check the driver name that initiated the connection instead of the program name. This will be (very) marginally more secure but much less annoying to users: SELECT UNIQUE sid, client_driver FROM v$session_connect_info ORDER BY sid; The de facto standard for the CLIENT_DRIVER column is 'name : version'. Note older versions of the DB will only show the first 9 or so characters that the driver actually sets, so you might not see the version when you use Oracle DB 11.

    – Christopher Jones
    Mar 6 at 21:27













4












4








4


1






I have a script (my_script.py) that accesses an Oracle database with the typical logon process via cx_Oracle.



def make_connect(**creds):
dsn_str = cx_Oracle.makedsn(host, port, sid)
return cx_Oracle.connect(un, pw, dsn_str)


There is no problem accessing the database through this method when the script is run from an IDE, but as soon as I package it into an executable (with PyInstaller, although I don't think this matters), I am getting the following error:



ORA-20045: LOGON BLOCKED



I believe this is because the executable that is accessing the database is not python.exe that is running the code but rather my_script.exe. The code works as expected if I change my_script.exe to python.exe, meaning I believe python.exe is whitelisted by the database for access.



I don't know enough about what particular system variable or environ variable declares itself to the Oracle database for access, but I have tried changing sys.executable to python.exe, or sys.argv[0] to python.exe, but I think there is something deeper that I might need to change (if I could change anything at all to get access).



Any suggestions would be more than helpful. The exe will be on systems with domain access to the database but because it's only python.exe that is whitelisted their access will be denied.










share|improve this question














I have a script (my_script.py) that accesses an Oracle database with the typical logon process via cx_Oracle.



def make_connect(**creds):
dsn_str = cx_Oracle.makedsn(host, port, sid)
return cx_Oracle.connect(un, pw, dsn_str)


There is no problem accessing the database through this method when the script is run from an IDE, but as soon as I package it into an executable (with PyInstaller, although I don't think this matters), I am getting the following error:



ORA-20045: LOGON BLOCKED



I believe this is because the executable that is accessing the database is not python.exe that is running the code but rather my_script.exe. The code works as expected if I change my_script.exe to python.exe, meaning I believe python.exe is whitelisted by the database for access.



I don't know enough about what particular system variable or environ variable declares itself to the Oracle database for access, but I have tried changing sys.executable to python.exe, or sys.argv[0] to python.exe, but I think there is something deeper that I might need to change (if I could change anything at all to get access).



Any suggestions would be more than helpful. The exe will be on systems with domain access to the database but because it's only python.exe that is whitelisted their access will be denied.







python python-3.x oracle oracle11g cx-oracle






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 6 at 18:37









Michael McIntyreMichael McIntyre

565




565







  • 4





    Oracle exceptions in the ORA-20000 to ORA-21299 range are generic user-defined exceptions raised by calling raise_application_error. You might have a LOGON trigger or something similar that's preventing you from connecting. Try running this query to look for the code that's generating this error: select * from all_source where text like '%-20045%'

    – kfinity
    Mar 6 at 19:04






  • 1





    Ask your DBAs to change the trigger to check the driver name that initiated the connection instead of the program name. This will be (very) marginally more secure but much less annoying to users: SELECT UNIQUE sid, client_driver FROM v$session_connect_info ORDER BY sid; The de facto standard for the CLIENT_DRIVER column is 'name : version'. Note older versions of the DB will only show the first 9 or so characters that the driver actually sets, so you might not see the version when you use Oracle DB 11.

    – Christopher Jones
    Mar 6 at 21:27












  • 4





    Oracle exceptions in the ORA-20000 to ORA-21299 range are generic user-defined exceptions raised by calling raise_application_error. You might have a LOGON trigger or something similar that's preventing you from connecting. Try running this query to look for the code that's generating this error: select * from all_source where text like '%-20045%'

    – kfinity
    Mar 6 at 19:04






  • 1





    Ask your DBAs to change the trigger to check the driver name that initiated the connection instead of the program name. This will be (very) marginally more secure but much less annoying to users: SELECT UNIQUE sid, client_driver FROM v$session_connect_info ORDER BY sid; The de facto standard for the CLIENT_DRIVER column is 'name : version'. Note older versions of the DB will only show the first 9 or so characters that the driver actually sets, so you might not see the version when you use Oracle DB 11.

    – Christopher Jones
    Mar 6 at 21:27







4




4





Oracle exceptions in the ORA-20000 to ORA-21299 range are generic user-defined exceptions raised by calling raise_application_error. You might have a LOGON trigger or something similar that's preventing you from connecting. Try running this query to look for the code that's generating this error: select * from all_source where text like '%-20045%'

– kfinity
Mar 6 at 19:04





Oracle exceptions in the ORA-20000 to ORA-21299 range are generic user-defined exceptions raised by calling raise_application_error. You might have a LOGON trigger or something similar that's preventing you from connecting. Try running this query to look for the code that's generating this error: select * from all_source where text like '%-20045%'

– kfinity
Mar 6 at 19:04




1




1





Ask your DBAs to change the trigger to check the driver name that initiated the connection instead of the program name. This will be (very) marginally more secure but much less annoying to users: SELECT UNIQUE sid, client_driver FROM v$session_connect_info ORDER BY sid; The de facto standard for the CLIENT_DRIVER column is 'name : version'. Note older versions of the DB will only show the first 9 or so characters that the driver actually sets, so you might not see the version when you use Oracle DB 11.

– Christopher Jones
Mar 6 at 21:27





Ask your DBAs to change the trigger to check the driver name that initiated the connection instead of the program name. This will be (very) marginally more secure but much less annoying to users: SELECT UNIQUE sid, client_driver FROM v$session_connect_info ORDER BY sid; The de facto standard for the CLIENT_DRIVER column is 'name : version'. Note older versions of the DB will only show the first 9 or so characters that the driver actually sets, so you might not see the version when you use Oracle DB 11.

– Christopher Jones
Mar 6 at 21:27












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55030048%2fcompiled-python-executable-access-blocked-to-access-oracle-database%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55030048%2fcompiled-python-executable-access-blocked-to-access-oracle-database%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

1928 у кіно

Захаров Федір Захарович

Ель Греко