Lock out of Oracle based on Windows usernameschema shows through standard client connection but not through ODBC connection?Oracle out-of-place upgrade on same host: impdp issuesOracle - Need help with RMAN Active Duplication on Windows 32 bit to a 64 bitGlobal locking for multi-master Oracle GoldenGate replicationOracle alternative edition for Windows Server 2012Oracle connection suddenly refused on windows 8Why doesn't “As SYSDBA” work from SQL Developer?ORA-01017 connecting to example schemas on Oracle VM appliance from Windows hostProblems with connecting to a remote Oracle 12c databaseOracle DBLink with username and password

Can a helicopter mask itself from Radar?

Cryptography and patents

Select row of data if next row contains zero

Asking for something with different prices

Accidentally cashed a check twice

What is a simple, physical situation where complex numbers emerge naturally?

The oldest tradition stopped before it got back to him

How to decline physical affection from a child whose parents are pressuring them?

Pros and cons of writing a book review?

Beginner's snake game using PyGame

Creating Fictional Slavic Place Names

Are academic associations obliged to comply with the US government?

Self-Preservation: How to DM NPCs that Love Living?

What is the difference between a game ban and a VAC ban in Steam?

What caused the tendency for conservatives to not support climate change regulations?

California: "For quality assurance, this phone call is being recorded"

Is having a hidden directory under /etc safe?

What is a natural deduction proof from ~(A↔B) to ~(A→B)?

Future enhancements for the finite element method

Coding Challenge Solution - Good Range

When was the word "ambigu" first used with the sense of "meal with all items served at the same time"?

How do I get a list of only the files (not the directories) from a package?

Why use water tanks from a retired Space Shuttle?

What does it mean by "d-ism of Leibniz" and "dotage of Newton" in simple English?



Lock out of Oracle based on Windows username


schema shows through standard client connection but not through ODBC connection?Oracle out-of-place upgrade on same host: impdp issuesOracle - Need help with RMAN Active Duplication on Windows 32 bit to a 64 bitGlobal locking for multi-master Oracle GoldenGate replicationOracle alternative edition for Windows Server 2012Oracle connection suddenly refused on windows 8Why doesn't “As SYSDBA” work from SQL Developer?ORA-01017 connecting to example schemas on Oracle VM appliance from Windows hostProblems with connecting to a remote Oracle 12c databaseOracle DBLink with username and password






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








3















I have this logon trigger to only allow certain users to log in to an Oracle database (even if they have the correct password to enter the database):



CREATE OR REPLACE TRIGGER SYS.LOGON_TRIGGER
AFTER LOGON ON DATABASE
DECLARE
THIS_USER VARCHAR2(50);
BEGIN
SELECT OSUSER INTO THIS_USER FROM V$SESSION WHERE SID = SYS_CONTEXT('USERENV','SID');
IF THIS_USER NOT IN (<List of Users>)
THEN RAISE LOGIN_DENIED;
ENDIF;
END;
/


It works for preventing users from entering most schemas but not all (e.g. the SYS or SYSTEM schemas can still be entered regardless of the user - this logon trigger is seemingly completely bypassed).



Is there a way to lock out these users even for these SYS type schemas?




A bit of context:



Due to decisions made way before I got involved with this, all of the logins for this database have the same password. Additionally, most users use the same login as many of our processes that read/write to this database automatically.



We don't want to simply change the passwords because it would be a very large effort to see what impact changing these passwords actually does to the system. (We would have to modify the code that the processes use to access the database, and there are many of these.) An easier solution for us is to just lock out based on usernames, if possible.










share|improve this question

















  • 3





    A trigger is not going to change the security nightmare that "all of the logins for this database have the same password" is.

    – kevinsky
    May 16 at 17:41











  • @kevinsky In that case, it probably is better to just change the passwords and deal with the impacts. I guess the easiest solution isn't always the best.

    – ImaginaryHuman072889
    May 16 at 17:43






  • 1





    BTW: the osuser is (if you don’t use Kerberos or Similiar methods) only advisory (the driver can send any name it likes) so it is really not a good security mechanism and having strictly separate passwords is the way to go.

    – eckes
    May 16 at 20:24











  • @eckes Thanks, yes I understand this is not an air-tight plan. But our users are not very tech-savvy, so 1) they probably wouldn't be aware that they were being locked out based on username (they would probably just think the password changed), and 2) even if they knew that, I doubt they would know about this workaround that you are pointing out here.

    – ImaginaryHuman072889
    May 17 at 11:35











  • At least you should change the password for the high-privileged user like SYS or SYSTEM

    – Wernfried Domscheit
    May 17 at 13:17

















3















I have this logon trigger to only allow certain users to log in to an Oracle database (even if they have the correct password to enter the database):



CREATE OR REPLACE TRIGGER SYS.LOGON_TRIGGER
AFTER LOGON ON DATABASE
DECLARE
THIS_USER VARCHAR2(50);
BEGIN
SELECT OSUSER INTO THIS_USER FROM V$SESSION WHERE SID = SYS_CONTEXT('USERENV','SID');
IF THIS_USER NOT IN (<List of Users>)
THEN RAISE LOGIN_DENIED;
ENDIF;
END;
/


It works for preventing users from entering most schemas but not all (e.g. the SYS or SYSTEM schemas can still be entered regardless of the user - this logon trigger is seemingly completely bypassed).



Is there a way to lock out these users even for these SYS type schemas?




A bit of context:



Due to decisions made way before I got involved with this, all of the logins for this database have the same password. Additionally, most users use the same login as many of our processes that read/write to this database automatically.



We don't want to simply change the passwords because it would be a very large effort to see what impact changing these passwords actually does to the system. (We would have to modify the code that the processes use to access the database, and there are many of these.) An easier solution for us is to just lock out based on usernames, if possible.










share|improve this question

















  • 3





    A trigger is not going to change the security nightmare that "all of the logins for this database have the same password" is.

    – kevinsky
    May 16 at 17:41











  • @kevinsky In that case, it probably is better to just change the passwords and deal with the impacts. I guess the easiest solution isn't always the best.

    – ImaginaryHuman072889
    May 16 at 17:43






  • 1





    BTW: the osuser is (if you don’t use Kerberos or Similiar methods) only advisory (the driver can send any name it likes) so it is really not a good security mechanism and having strictly separate passwords is the way to go.

    – eckes
    May 16 at 20:24











  • @eckes Thanks, yes I understand this is not an air-tight plan. But our users are not very tech-savvy, so 1) they probably wouldn't be aware that they were being locked out based on username (they would probably just think the password changed), and 2) even if they knew that, I doubt they would know about this workaround that you are pointing out here.

    – ImaginaryHuman072889
    May 17 at 11:35











  • At least you should change the password for the high-privileged user like SYS or SYSTEM

    – Wernfried Domscheit
    May 17 at 13:17













3












3








3








I have this logon trigger to only allow certain users to log in to an Oracle database (even if they have the correct password to enter the database):



CREATE OR REPLACE TRIGGER SYS.LOGON_TRIGGER
AFTER LOGON ON DATABASE
DECLARE
THIS_USER VARCHAR2(50);
BEGIN
SELECT OSUSER INTO THIS_USER FROM V$SESSION WHERE SID = SYS_CONTEXT('USERENV','SID');
IF THIS_USER NOT IN (<List of Users>)
THEN RAISE LOGIN_DENIED;
ENDIF;
END;
/


It works for preventing users from entering most schemas but not all (e.g. the SYS or SYSTEM schemas can still be entered regardless of the user - this logon trigger is seemingly completely bypassed).



Is there a way to lock out these users even for these SYS type schemas?




A bit of context:



Due to decisions made way before I got involved with this, all of the logins for this database have the same password. Additionally, most users use the same login as many of our processes that read/write to this database automatically.



We don't want to simply change the passwords because it would be a very large effort to see what impact changing these passwords actually does to the system. (We would have to modify the code that the processes use to access the database, and there are many of these.) An easier solution for us is to just lock out based on usernames, if possible.










share|improve this question














I have this logon trigger to only allow certain users to log in to an Oracle database (even if they have the correct password to enter the database):



CREATE OR REPLACE TRIGGER SYS.LOGON_TRIGGER
AFTER LOGON ON DATABASE
DECLARE
THIS_USER VARCHAR2(50);
BEGIN
SELECT OSUSER INTO THIS_USER FROM V$SESSION WHERE SID = SYS_CONTEXT('USERENV','SID');
IF THIS_USER NOT IN (<List of Users>)
THEN RAISE LOGIN_DENIED;
ENDIF;
END;
/


It works for preventing users from entering most schemas but not all (e.g. the SYS or SYSTEM schemas can still be entered regardless of the user - this logon trigger is seemingly completely bypassed).



Is there a way to lock out these users even for these SYS type schemas?




A bit of context:



Due to decisions made way before I got involved with this, all of the logins for this database have the same password. Additionally, most users use the same login as many of our processes that read/write to this database automatically.



We don't want to simply change the passwords because it would be a very large effort to see what impact changing these passwords actually does to the system. (We would have to modify the code that the processes use to access the database, and there are many of these.) An easier solution for us is to just lock out based on usernames, if possible.







oracle oracle-11g






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked May 16 at 17:39









ImaginaryHuman072889ImaginaryHuman072889

1256




1256







  • 3





    A trigger is not going to change the security nightmare that "all of the logins for this database have the same password" is.

    – kevinsky
    May 16 at 17:41











  • @kevinsky In that case, it probably is better to just change the passwords and deal with the impacts. I guess the easiest solution isn't always the best.

    – ImaginaryHuman072889
    May 16 at 17:43






  • 1





    BTW: the osuser is (if you don’t use Kerberos or Similiar methods) only advisory (the driver can send any name it likes) so it is really not a good security mechanism and having strictly separate passwords is the way to go.

    – eckes
    May 16 at 20:24











  • @eckes Thanks, yes I understand this is not an air-tight plan. But our users are not very tech-savvy, so 1) they probably wouldn't be aware that they were being locked out based on username (they would probably just think the password changed), and 2) even if they knew that, I doubt they would know about this workaround that you are pointing out here.

    – ImaginaryHuman072889
    May 17 at 11:35











  • At least you should change the password for the high-privileged user like SYS or SYSTEM

    – Wernfried Domscheit
    May 17 at 13:17












  • 3





    A trigger is not going to change the security nightmare that "all of the logins for this database have the same password" is.

    – kevinsky
    May 16 at 17:41











  • @kevinsky In that case, it probably is better to just change the passwords and deal with the impacts. I guess the easiest solution isn't always the best.

    – ImaginaryHuman072889
    May 16 at 17:43






  • 1





    BTW: the osuser is (if you don’t use Kerberos or Similiar methods) only advisory (the driver can send any name it likes) so it is really not a good security mechanism and having strictly separate passwords is the way to go.

    – eckes
    May 16 at 20:24











  • @eckes Thanks, yes I understand this is not an air-tight plan. But our users are not very tech-savvy, so 1) they probably wouldn't be aware that they were being locked out based on username (they would probably just think the password changed), and 2) even if they knew that, I doubt they would know about this workaround that you are pointing out here.

    – ImaginaryHuman072889
    May 17 at 11:35











  • At least you should change the password for the high-privileged user like SYS or SYSTEM

    – Wernfried Domscheit
    May 17 at 13:17







3




3





A trigger is not going to change the security nightmare that "all of the logins for this database have the same password" is.

– kevinsky
May 16 at 17:41





A trigger is not going to change the security nightmare that "all of the logins for this database have the same password" is.

– kevinsky
May 16 at 17:41













@kevinsky In that case, it probably is better to just change the passwords and deal with the impacts. I guess the easiest solution isn't always the best.

– ImaginaryHuman072889
May 16 at 17:43





@kevinsky In that case, it probably is better to just change the passwords and deal with the impacts. I guess the easiest solution isn't always the best.

– ImaginaryHuman072889
May 16 at 17:43




1




1





BTW: the osuser is (if you don’t use Kerberos or Similiar methods) only advisory (the driver can send any name it likes) so it is really not a good security mechanism and having strictly separate passwords is the way to go.

– eckes
May 16 at 20:24





BTW: the osuser is (if you don’t use Kerberos or Similiar methods) only advisory (the driver can send any name it likes) so it is really not a good security mechanism and having strictly separate passwords is the way to go.

– eckes
May 16 at 20:24













@eckes Thanks, yes I understand this is not an air-tight plan. But our users are not very tech-savvy, so 1) they probably wouldn't be aware that they were being locked out based on username (they would probably just think the password changed), and 2) even if they knew that, I doubt they would know about this workaround that you are pointing out here.

– ImaginaryHuman072889
May 17 at 11:35





@eckes Thanks, yes I understand this is not an air-tight plan. But our users are not very tech-savvy, so 1) they probably wouldn't be aware that they were being locked out based on username (they would probably just think the password changed), and 2) even if they knew that, I doubt they would know about this workaround that you are pointing out here.

– ImaginaryHuman072889
May 17 at 11:35













At least you should change the password for the high-privileged user like SYS or SYSTEM

– Wernfried Domscheit
May 17 at 13:17





At least you should change the password for the high-privileged user like SYS or SYSTEM

– Wernfried Domscheit
May 17 at 13:17










2 Answers
2






active

oldest

votes


















4














I suggest a multi-phase approach that can be implemented in stages and will minimize the impact of changing to a more secure approach. I assume that you have a development environment to test in and the support of a manager who is interested and will support the effort.



  • use the existing Oracle audit logging to start logging when users logon and logoff.

  • after a period of time consistent with usage (90 days for a fiscal quarter?, a year end?) identify the unused accounts and lock them

  • identify any service accounts that are not used by people to log on.

  • identify the remaining accounts and try to link usernames to people to job roles

  • create Oracle profiles for service accounts, read only accounts and more privileged user accounts

    • set password expiration, complexity, reuse, failed attempts before lockout for these profiles. For example you may decide that service accounts should never change their password but that it should be 24 characters and only one failed attempt before lockout whereas a person's password should only be 8 characters with three failed attempts before lockout.

    • one by one reassign accounts to the correct profile and force a password change


  • at the same time look at creating roles that grant only enough privileges for accounts to do their job and assign the roles.

This is just the tip of the iceberg for securing the database. The level of effort you put in should be commensurate with the potential damage if the information in the database were breached.






share|improve this answer























  • You bring up many good points here. We do have a test environment and yes my manager will support this. Thanks again.

    – ImaginaryHuman072889
    May 16 at 19:38


















5














The reason why your trigger does not work for users like SYS or SYSTEM is because they have the ADMINISTER DATABASE TRIGGER privilege.



The ADMINISTER DATABASE TRIGGER privilege allows you to create database-level triggers (server error, login, and logout triggers). It also allows you to log in regardless of errors thrown by a login trigger as a failsafe.



So, the answer is: no, you cannot prevent login for such users - at least not with a login trigger.






share|improve this answer























  • Thanks, I figured there was a failsafe, otherwise it would be possible for everyone to be completely locked out. You say that there is no way to prevent a login for these users with a login trigger. Is there another way to accomplish this?

    – ImaginaryHuman072889
    May 17 at 11:23











  • If there were any way at all to prevent SYS from connecting, then there would be a way to lock everyone out, rendering the database totally and 100% non-accessible. You can (and probably should) prevent SYS from connecting via TNS, but that does not require a trigger.

    – EdStevens
    May 17 at 13:05











  • In general, if a user has valid credentials then he can connect to the database. That's the point where you have to embark.

    – Wernfried Domscheit
    May 17 at 13:23











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "182"
;
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%2fdba.stackexchange.com%2fquestions%2f238350%2flock-out-of-oracle-based-on-windows-username%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









4














I suggest a multi-phase approach that can be implemented in stages and will minimize the impact of changing to a more secure approach. I assume that you have a development environment to test in and the support of a manager who is interested and will support the effort.



  • use the existing Oracle audit logging to start logging when users logon and logoff.

  • after a period of time consistent with usage (90 days for a fiscal quarter?, a year end?) identify the unused accounts and lock them

  • identify any service accounts that are not used by people to log on.

  • identify the remaining accounts and try to link usernames to people to job roles

  • create Oracle profiles for service accounts, read only accounts and more privileged user accounts

    • set password expiration, complexity, reuse, failed attempts before lockout for these profiles. For example you may decide that service accounts should never change their password but that it should be 24 characters and only one failed attempt before lockout whereas a person's password should only be 8 characters with three failed attempts before lockout.

    • one by one reassign accounts to the correct profile and force a password change


  • at the same time look at creating roles that grant only enough privileges for accounts to do their job and assign the roles.

This is just the tip of the iceberg for securing the database. The level of effort you put in should be commensurate with the potential damage if the information in the database were breached.






share|improve this answer























  • You bring up many good points here. We do have a test environment and yes my manager will support this. Thanks again.

    – ImaginaryHuman072889
    May 16 at 19:38















4














I suggest a multi-phase approach that can be implemented in stages and will minimize the impact of changing to a more secure approach. I assume that you have a development environment to test in and the support of a manager who is interested and will support the effort.



  • use the existing Oracle audit logging to start logging when users logon and logoff.

  • after a period of time consistent with usage (90 days for a fiscal quarter?, a year end?) identify the unused accounts and lock them

  • identify any service accounts that are not used by people to log on.

  • identify the remaining accounts and try to link usernames to people to job roles

  • create Oracle profiles for service accounts, read only accounts and more privileged user accounts

    • set password expiration, complexity, reuse, failed attempts before lockout for these profiles. For example you may decide that service accounts should never change their password but that it should be 24 characters and only one failed attempt before lockout whereas a person's password should only be 8 characters with three failed attempts before lockout.

    • one by one reassign accounts to the correct profile and force a password change


  • at the same time look at creating roles that grant only enough privileges for accounts to do their job and assign the roles.

This is just the tip of the iceberg for securing the database. The level of effort you put in should be commensurate with the potential damage if the information in the database were breached.






share|improve this answer























  • You bring up many good points here. We do have a test environment and yes my manager will support this. Thanks again.

    – ImaginaryHuman072889
    May 16 at 19:38













4












4








4







I suggest a multi-phase approach that can be implemented in stages and will minimize the impact of changing to a more secure approach. I assume that you have a development environment to test in and the support of a manager who is interested and will support the effort.



  • use the existing Oracle audit logging to start logging when users logon and logoff.

  • after a period of time consistent with usage (90 days for a fiscal quarter?, a year end?) identify the unused accounts and lock them

  • identify any service accounts that are not used by people to log on.

  • identify the remaining accounts and try to link usernames to people to job roles

  • create Oracle profiles for service accounts, read only accounts and more privileged user accounts

    • set password expiration, complexity, reuse, failed attempts before lockout for these profiles. For example you may decide that service accounts should never change their password but that it should be 24 characters and only one failed attempt before lockout whereas a person's password should only be 8 characters with three failed attempts before lockout.

    • one by one reassign accounts to the correct profile and force a password change


  • at the same time look at creating roles that grant only enough privileges for accounts to do their job and assign the roles.

This is just the tip of the iceberg for securing the database. The level of effort you put in should be commensurate with the potential damage if the information in the database were breached.






share|improve this answer













I suggest a multi-phase approach that can be implemented in stages and will minimize the impact of changing to a more secure approach. I assume that you have a development environment to test in and the support of a manager who is interested and will support the effort.



  • use the existing Oracle audit logging to start logging when users logon and logoff.

  • after a period of time consistent with usage (90 days for a fiscal quarter?, a year end?) identify the unused accounts and lock them

  • identify any service accounts that are not used by people to log on.

  • identify the remaining accounts and try to link usernames to people to job roles

  • create Oracle profiles for service accounts, read only accounts and more privileged user accounts

    • set password expiration, complexity, reuse, failed attempts before lockout for these profiles. For example you may decide that service accounts should never change their password but that it should be 24 characters and only one failed attempt before lockout whereas a person's password should only be 8 characters with three failed attempts before lockout.

    • one by one reassign accounts to the correct profile and force a password change


  • at the same time look at creating roles that grant only enough privileges for accounts to do their job and assign the roles.

This is just the tip of the iceberg for securing the database. The level of effort you put in should be commensurate with the potential damage if the information in the database were breached.







share|improve this answer












share|improve this answer



share|improve this answer










answered May 16 at 17:53









kevinskykevinsky

3,2342145




3,2342145












  • You bring up many good points here. We do have a test environment and yes my manager will support this. Thanks again.

    – ImaginaryHuman072889
    May 16 at 19:38

















  • You bring up many good points here. We do have a test environment and yes my manager will support this. Thanks again.

    – ImaginaryHuman072889
    May 16 at 19:38
















You bring up many good points here. We do have a test environment and yes my manager will support this. Thanks again.

– ImaginaryHuman072889
May 16 at 19:38





You bring up many good points here. We do have a test environment and yes my manager will support this. Thanks again.

– ImaginaryHuman072889
May 16 at 19:38













5














The reason why your trigger does not work for users like SYS or SYSTEM is because they have the ADMINISTER DATABASE TRIGGER privilege.



The ADMINISTER DATABASE TRIGGER privilege allows you to create database-level triggers (server error, login, and logout triggers). It also allows you to log in regardless of errors thrown by a login trigger as a failsafe.



So, the answer is: no, you cannot prevent login for such users - at least not with a login trigger.






share|improve this answer























  • Thanks, I figured there was a failsafe, otherwise it would be possible for everyone to be completely locked out. You say that there is no way to prevent a login for these users with a login trigger. Is there another way to accomplish this?

    – ImaginaryHuman072889
    May 17 at 11:23











  • If there were any way at all to prevent SYS from connecting, then there would be a way to lock everyone out, rendering the database totally and 100% non-accessible. You can (and probably should) prevent SYS from connecting via TNS, but that does not require a trigger.

    – EdStevens
    May 17 at 13:05











  • In general, if a user has valid credentials then he can connect to the database. That's the point where you have to embark.

    – Wernfried Domscheit
    May 17 at 13:23















5














The reason why your trigger does not work for users like SYS or SYSTEM is because they have the ADMINISTER DATABASE TRIGGER privilege.



The ADMINISTER DATABASE TRIGGER privilege allows you to create database-level triggers (server error, login, and logout triggers). It also allows you to log in regardless of errors thrown by a login trigger as a failsafe.



So, the answer is: no, you cannot prevent login for such users - at least not with a login trigger.






share|improve this answer























  • Thanks, I figured there was a failsafe, otherwise it would be possible for everyone to be completely locked out. You say that there is no way to prevent a login for these users with a login trigger. Is there another way to accomplish this?

    – ImaginaryHuman072889
    May 17 at 11:23











  • If there were any way at all to prevent SYS from connecting, then there would be a way to lock everyone out, rendering the database totally and 100% non-accessible. You can (and probably should) prevent SYS from connecting via TNS, but that does not require a trigger.

    – EdStevens
    May 17 at 13:05











  • In general, if a user has valid credentials then he can connect to the database. That's the point where you have to embark.

    – Wernfried Domscheit
    May 17 at 13:23













5












5








5







The reason why your trigger does not work for users like SYS or SYSTEM is because they have the ADMINISTER DATABASE TRIGGER privilege.



The ADMINISTER DATABASE TRIGGER privilege allows you to create database-level triggers (server error, login, and logout triggers). It also allows you to log in regardless of errors thrown by a login trigger as a failsafe.



So, the answer is: no, you cannot prevent login for such users - at least not with a login trigger.






share|improve this answer













The reason why your trigger does not work for users like SYS or SYSTEM is because they have the ADMINISTER DATABASE TRIGGER privilege.



The ADMINISTER DATABASE TRIGGER privilege allows you to create database-level triggers (server error, login, and logout triggers). It also allows you to log in regardless of errors thrown by a login trigger as a failsafe.



So, the answer is: no, you cannot prevent login for such users - at least not with a login trigger.







share|improve this answer












share|improve this answer



share|improve this answer










answered May 16 at 20:05









Wernfried DomscheitWernfried Domscheit

1,312612




1,312612












  • Thanks, I figured there was a failsafe, otherwise it would be possible for everyone to be completely locked out. You say that there is no way to prevent a login for these users with a login trigger. Is there another way to accomplish this?

    – ImaginaryHuman072889
    May 17 at 11:23











  • If there were any way at all to prevent SYS from connecting, then there would be a way to lock everyone out, rendering the database totally and 100% non-accessible. You can (and probably should) prevent SYS from connecting via TNS, but that does not require a trigger.

    – EdStevens
    May 17 at 13:05











  • In general, if a user has valid credentials then he can connect to the database. That's the point where you have to embark.

    – Wernfried Domscheit
    May 17 at 13:23

















  • Thanks, I figured there was a failsafe, otherwise it would be possible for everyone to be completely locked out. You say that there is no way to prevent a login for these users with a login trigger. Is there another way to accomplish this?

    – ImaginaryHuman072889
    May 17 at 11:23











  • If there were any way at all to prevent SYS from connecting, then there would be a way to lock everyone out, rendering the database totally and 100% non-accessible. You can (and probably should) prevent SYS from connecting via TNS, but that does not require a trigger.

    – EdStevens
    May 17 at 13:05











  • In general, if a user has valid credentials then he can connect to the database. That's the point where you have to embark.

    – Wernfried Domscheit
    May 17 at 13:23
















Thanks, I figured there was a failsafe, otherwise it would be possible for everyone to be completely locked out. You say that there is no way to prevent a login for these users with a login trigger. Is there another way to accomplish this?

– ImaginaryHuman072889
May 17 at 11:23





Thanks, I figured there was a failsafe, otherwise it would be possible for everyone to be completely locked out. You say that there is no way to prevent a login for these users with a login trigger. Is there another way to accomplish this?

– ImaginaryHuman072889
May 17 at 11:23













If there were any way at all to prevent SYS from connecting, then there would be a way to lock everyone out, rendering the database totally and 100% non-accessible. You can (and probably should) prevent SYS from connecting via TNS, but that does not require a trigger.

– EdStevens
May 17 at 13:05





If there were any way at all to prevent SYS from connecting, then there would be a way to lock everyone out, rendering the database totally and 100% non-accessible. You can (and probably should) prevent SYS from connecting via TNS, but that does not require a trigger.

– EdStevens
May 17 at 13:05













In general, if a user has valid credentials then he can connect to the database. That's the point where you have to embark.

– Wernfried Domscheit
May 17 at 13:23





In general, if a user has valid credentials then he can connect to the database. That's the point where you have to embark.

– Wernfried Domscheit
May 17 at 13:23

















draft saved

draft discarded
















































Thanks for contributing an answer to Database Administrators Stack Exchange!


  • 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%2fdba.stackexchange.com%2fquestions%2f238350%2flock-out-of-oracle-based-on-windows-username%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

Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

Bruxelas-Capital Índice Historia | Composición | Situación lingüística | Clima | Cidades irmandadas | Notas | Véxase tamén | Menú de navegacióneO uso das linguas en Bruxelas e a situación do neerlandés"Rexión de Bruxelas Capital"o orixinalSitio da rexiónPáxina de Bruselas no sitio da Oficina de Promoción Turística de Valonia e BruxelasMapa Interactivo da Rexión de Bruxelas-CapitaleeWorldCat332144929079854441105155190212ID28008674080552-90000 0001 0666 3698n94104302ID540940339365017018237

What should I write in an apology letter, since I have decided not to join a company after accepting an offer letterShould I keep looking after accepting a job offer?What should I do when I've been verbally told I would get an offer letter, but still haven't gotten one after 4 weeks?Do I accept an offer from a company that I am not likely to join?New job hasn't confirmed starting date and I want to give current employer as much notice as possibleHow should I address my manager in my resignation letter?HR delayed background verification, now jobless as resignedNo email communication after accepting a formal written offer. How should I phrase the call?What should I do if after receiving a verbal offer letter I am informed that my written job offer is put on hold due to some internal issues?Should I inform the current employer that I am about to resign within 1-2 weeks since I have signed the offer letter and waiting for visa?What company will do, if I send their offer letter to another company