This question already has answers here:
How do I turn off Oracle password expiration?
(6 answers)
Closed 9 years ago.
There is some construction
ALTER USER scott PASSWORD EXPIRE
But how can I similair set password to unexpired state?
The following statement causes a user's password to expire:
ALTER USER user PASSWORD EXPIRE;
If you cause a database user's password to expire with PASSWORD EXPIRE, then the user (or the DBA) must change the password before attempting to log in to the database following the expiration. Tools such as SQL*Plus allow the user to change the password on the first attempted login following the expiration.
ALTER USER scott IDENTIFIED BY password;
Will set/reset the users password.
See the alter user doc for more info
If you create a user using a profile like this:
CREATE PROFILE my_profile LIMIT
PASSWORD_LIFE_TIME 30;
ALTER USER scott PROFILE my_profile;
then you can change the password lifetime like this:
ALTER PROFILE my_profile LIMIT
PASSWORD_LIFE_TIME UNLIMITED;
I hope that helps.
While applying the new profile to the user,you should also check for resource limits are "turned on" for the database as a whole i.e.RESOURCE_LIMIT = TRUE
Let check the parameter value.
If in Case it is :
SQL> show parameter resource_limit
NAME TYPE VALUE
------------------------------------ ----------- ---------
resource_limit boolean FALSE
Its mean resource limit is off,we ist have to enable it.
Use the ALTER SYSTEM statement to turn on resource limits.
SQL> ALTER SYSTEM SET RESOURCE_LIMIT = TRUE;
System altered.
Related
I have an oracle DB user in DBA_USERS table whose password is expiring in some future date.
I want to change the Profile of the user to the one which has non-expiring password.
If I Alter the profile of the user to the non expiring one, does the expiry date which was there in the DBA_USERS table for this user previously before altering the profile have any effect ?
Should i update the value in the expiry date column in DBA_USERS also to null.
Whenever password expiration date is created in the oracle for any user, it will not changed if you change the profile of the user.
Password expiration date is updated when you change the password of the user and new password expiration date is set according to the profile assigned to the user.
So you must have to perform following steps in order.
Assign the profile with non expiring password to the user.
Change the password of the user.(same or different password according to your requirement)
Then next password expiration date is changed according to new profile and that will be null/non expiring/unlimited
I have created the following query to check the status on the PASSWORD_LIFE_TIME field from dba_profiles table.
How I ensured that the password never expires was to do this. Is the alter profile query correct?
ALTER PROFILE my_profile LIMIT PASSWORD_LIFE_TIME UNLIMITED;
select du.USERNAME,du.profile, dp.LIMIT
from dba_users du
left outer join dba_profiles dp on dp.PROFILE = du.PROFILE
where du.USERNAME = 'SYSTEM' and resource_name LIKE 'PASSWORD_LIFE_TIME';
The alter profile query is correct. The password for the profile my_profile never expires due to password life time. You need to assign the profile my_profile to the user system with alter user system profile my_profile;
I am using Oracle SQL Developer and I run into the ORA-28000 error and my account got blocked, but I resolved it from SQL plus by using the following commands:
SQL> alter user user1 account unlock;
SQL> grant connect, resource to user1;
The thing is that I want to prevent this from happening again. Where can I see the threshold of the failed login attempts that exists so that I would either raise it or delete it completely?
In the sql developer, menu in the Users option, you can edit the user and edit the amount of attempts, if the password expires, etc. However I can only log in with the system user, sys could not connect.
FAILED_LOGIN_ATTEMPTS and similar are properties of the profile associated with your user. You can check the settings with this query:
select u.profile
, p.resource_name
, p.limit
from dba_users u
join dba_profiles p
on u.profile = p.profile
where p.resource_type = 'PASSWORD';
These limits are set for the profile: you can change them but the new limits will cascade to all users with this profile:
alter profile whatever limit FAILED_LOGIN_ATTEMPTS 12;
Alternatively you can modify the user so it has a more forgiving profile:
alter user joesoap profile default;
I have installed Oracle SQL Developer 11g and I have created many connections and I try to create user which will have access on only one specified connection
How can i do that?
You need to create a profile that limits the number of sessions:
create profile only_one_connection
limit sessions_per_user 1;
Then you need to alter the user and assign that profile to the user:
alter user only_one
profile only_one_connection;
This assumes you have already created the user only_one and granted the create session privilege. You can also assign the profile when creating the user
The scenario
CREATE SCHEMA testschema;
CREATE ROLE testrole LOGIN;
GRANT ALL ON SCHEMA testschema TO testrole;
ALTER ROLE testrole SET search_path = testschema;
Now if I initiate the connection (log in) as testrole then:
SHOW search_path;
Gives the desired result:
search_path
-------------
testschema
(1 row)
However, if I initiate connection (log in) as a superuser and do:
SET SESSION AUTHORIZATION testrole;
SHOW search_path;
Results in:
search_path
----------------
"$user",public
(1 row)
(or whatever the search path of the superuser is)
My question is, why does SET SESSION AUTHORIZATION not affect the current search_path?
Is it a bug, by design or am I simply doinitwrong?
From the little I've found, the workaround of SET SEARCH path = schemaname after SET SESSION... seems to be the only solution, but that kind of defeats the purpose of having persistent search paths assigned to roles.
This is by design. I quote the manual on ALTER ROLE
This only happens at login time; executing SET ROLE or SET SESSION
AUTHORIZATION does not cause new configuration values to be set.