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

Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020