ORA-28000: the account is locked error getting frequently - oracle

I am facing this error given below :
ORA-28000: the account is locked
Is this a DB Issue ? Whenever I unlock the user account using the alter SQL query, that is ALTER USER username ACCOUNT UNLOCK, it will be temporarily OK.
Then after sometime the same account gets locked again. The database is using oracle XE version. Does anybody else have the same issue?

One of the reasons of your problem could be the password policy you are using.
And if there is no such policy of yours then check your settings for the password properties in the DEFAULT profile with the following query:
SELECT resource_name, limit
FROM dba_profiles
WHERE profile = 'DEFAULT'
AND resource_type = 'PASSWORD';
And If required, you just need to change the PASSWORD_LIFE_TIME to unlimited with the following query:
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
And this Link might be helpful for your problem.

Way to unlock the user :
$ sqlplus /nolog
SQL > conn sys as sysdba
SQL > ALTER USER USER_NAME ACCOUNT UNLOCK;
and open new terminal
SQL > sqlplus / as sysdba
connected
SQL > conn username/password //which username u gave before unlock
it will ask new password:password
it will ask re-type password:password
press enter u will get loggedin

Here other solution to only unlock the blocked user. From your command prompt log as SYSDBA:
sqlplus "/ as sysdba"
Then type the following command:
alter user <your_username> account unlock;

Check the PASSWORD_LOCK_TIME parameter. If it is set to 1 then you won't be able to unlock the password for 1 day even after you issue the alter user unlock command.

I have faced this similar issue and resolved it by using following steps :
Open windows command prompt.
Login using the command sqlplus "/ as sysdba"
Then executed the command alter user HR identified by password account unlock
Please note, the password is the password that I have used.
By using above steps you can connect to Oracle Database as user HR with the password password.

Solution 01
Account Unlock by using below query :
SQL> select USERNAME,ACCOUNT_STATUS from dba_users where username='ABCD_DEV';
USERNAME ACCOUNT_STATUS
-------------------- --------------------------------
ABCD_DEV LOCKED
SQL> alter user ABCD_DEV account unlock;
User altered.
SQL> select USERNAME,ACCOUNT_STATUS from dba_users where username='ABCD_DEV';
USERNAME ACCOUNT_STATUS
-------------------- --------------------------------
ABCD_DEV OPEN
Solution 02
Check PASSWORD_LIFE_TIME parameter by using below query :
SELECT resource_name, limit FROM dba_profiles WHERE profile = 'DEFAULT' AND resource_type = 'PASSWORD';
RESOURCE_NAME LIMIT
-------------------------------- ------------------------------
FAILED_LOGIN_ATTEMPTS 10
PASSWORD_LIFE_TIME 10
PASSWORD_REUSE_TIME 10
PASSWORD_REUSE_MAX UNLIMITED
PASSWORD_VERIFY_FUNCTION NULL
PASSWORD_LOCK_TIME 1
PASSWORD_GRACE_TIME 7
INACTIVE_ACCOUNT_TIME UNLIMITED
Change the parameter using below query
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;

Login to SQL Plus client on the oracle database server machine.
enter user-name: system
enter password: password [Only if, if you have not changed your default password while DB installation]
press enter. after which, you will be seeing the connection status.
Now,
SQL> ALTER USER [USER_NAME] ACCOUNT UNLOCK;
press enter.
you will be seeing message: user altered.
Now try login with the user name on db client[sqldeveloper].

Unlock the particular user account with username:
ALTER USER [USER_NAME] ACCOUNT UNLOCK;
Unlock all the user accounts
SELECT 'alter user ' || username || ' account unlock;' FROM dba_users;

Related

Installed Oracle 19c. During install it did not ask for username/passwords. How do I sign into sqlplus?

It never asked for default passwords. I have tried sysdba, sys, system. All ask for passwords.
Try this on windows:
c:> sqlplus /nolog
SQL> connect / as sysdba
SQL> alter user sys identified by ,new password>;
If you get asked for a password when you log in as / you need to create or recreate the password file using orapw. Check the $ORACLE_HOME/database directory for a file called orapw. That is the password file for the database. Create (or recreate) it using:
c:\> orawpd file=$ORACLE_HOME/database/orapwd<SID> password=<password> entries=5
Lost SYS password Tips
How do I find my Oracle 19c password? (Lost SYS password Tips)
login oracle user.
cd $ORACLE_HOME/network/admin.
ed(vi) file sqlnet.ora.
Remark by # at begining of line. SQLNET.AUTHENTICATION_SERVICES = (NONE) => #SQLNET.AUTHENTICATION_SERVICES = (NONE)
sqlplus /nolog or (svrmgrl) command.
connect sys as sysdba, or connect internal.
Start sqlplus with the User-Account, you had install Oracle. sqlplus should connect without username and password. After you are connected, you can ad new users.
sqlplus / as sysdba

SP2-0310: unable to open file "__SUB__CWD__/sales_history/csh_v3.sql"

I am trying to install the sales_history sample schema, but I'm getting errors:
SP2-0310: unable to open file "__SUB__CWD__/sales_history/csh_v3.sql"
SP2-0310: unable to open file "__SUB__CWD__/sales_history/lsh_v3.sql"
SP2-0310: unable to open file "__SUB__CWD__/sales_history/psh_v3.sql"
How can I resolve this issue? The csh_v3.sql has full permissions,
Full session output:
SQL> #?/demo/schema/sales_history/sh_main.sql
specify password for SH as parameter 1:
Enter value for 1: password
specify default tablespace for SH as parameter 2:
Enter value for 2: users
specify temporary tablespace for SH as parameter 3:
Enter value for 3: temp
specify password for SYS as parameter 4:
Enter value for 4: password
specify directory path for the data files as parameter 5:
Enter value for 5: /u01/app/oracle/product/12.2/db_1/demo/schema/sales_history/
writeable directory path for the log files as parameter 6:
Enter value for 6: /u01/app/oracle/product/12.2/db_1/demo/schema/log/
specify version as parameter 7:
Enter value for 7: v3
specify connect string as parameter 8:
Enter value for 8: localhost:1522/techfuturepdb.elom.tg
Session altered.
DROP USER sh CASCADE
*
ERROR at line 1:
ORA-01940: cannot drop a user that is currently connected
old 1: CREATE USER sh IDENTIFIED BY &pass
new 1: CREATE USER sh IDENTIFIED BY password
CREATE USER sh IDENTIFIED BY password
*
ERROR at line 1:
ORA-01920: user name 'SH' conflicts with another user or role name
old 1: ALTER USER sh DEFAULT TABLESPACE &tbs
new 1: ALTER USER sh DEFAULT TABLESPACE users
old 2: QUOTA UNLIMITED ON &tbs
new 2: QUOTA UNLIMITED ON users
User altered.
old 1: ALTER USER sh TEMPORARY TABLESPACE &ttbs
new 1: ALTER USER sh TEMPORARY TABLESPACE temp
User altered.
Grant succeeded.
Grant succeeded.
Grant succeeded.
Grant succeeded.
Grant succeeded.
Grant succeeded.
Grant succeeded.
Grant succeeded.
Grant succeeded.
Grant succeeded.
Grant succeeded.
Grant succeeded.
Grant succeeded.
Connected.
Grant succeeded.
old 1: CREATE OR REPLACE DIRECTORY data_file_dir AS '&data_dir'
new 1: CREATE OR REPLACE DIRECTORY data_file_dir AS '/u01/app/oracle/product/12.2/db_1/demo/schema/sales_history/'
Directory created.
old 1: CREATE OR REPLACE DIRECTORY log_file_dir AS '&log_dir'
new 1: CREATE OR REPLACE DIRECTORY log_file_dir AS '/u01/app/oracle/product/12.2/db_1/demo/schema/log/'
Directory created.
Grant succeeded.
Grant succeeded.
Grant succeeded.
Connected.
Session altered.
Session altered.
SP2-0310: unable to open file "__SUB__CWD__/sales_history/csh_v3.sql"
SP2-0310: unable to open file "__SUB__CWD__/sales_history/lsh_v3.sql"
SP2-0310: unable to open file "__SUB__CWD__/sales_history/psh_v3.sql"
I just renamed the directory and it worked as expected:
mv db-sample-schemas-19.2 "__SUB__CWD__" ;
sqlplus system/Welcome1#node3/pdb1 #"__SUB__CWD__"/mksample.sql

Connecting with Oracle `sqlplus` for a user with no (null) password

It seems that sqlplus does not do will with an empty (null) password.
THIS WORKS: sqlplus user1/passpass#DBB
THIS DOES NOT WORK: sqlplus user2/#DBB
From what I can tell, it appears that sqlplus does not like an empty (null) password. Is there a workaround for this?
NB: This is not just a question about avoiding putting the password in plain-text on the sqlplus command line.
sqlplus user2#DBB
then you will be prompted for a password
Did you use either of these?:
Oracle valet. User is identified via password, but the password is not prompted manually.
External authentication. CREATE USER XY IDENTIFIED EXTERNALLY; The user XY must then have OS account on the DB server.
the user should be automatically validated without password in these cases.

database not open

I am trying to create database using Oracle 11g R2 on windows 2008 server, when I run script to create database instance I will get the following error message
ERROR at line 1:
ORA-01109: database not open
grant select on ALL_MVIEW_DETAIL_PARTITION to public with grant option
*
ERROR at line 1:
ORA-01109: database not open
logged on as administrator.`
Thanks,
usermma
Login to Oracle with root
su - oracle
sqlplus / as sysdba
create user username identified by password;
Exception : ORA-01109 Database not open
To resolve this i trie below steps and succesfully created the schema.
Please verify the ORA_HOMEPATH/dbs/sgadef.dbf
Make ensure that after shutting down the Oracle server,if you find any services running on machine by entering below command
ps -ef | grep ora_ | grep DBName(sid)
Kill the processes if you find any by using kill command
kill -9 PID
Please check below file exists in mentioned path; if not please create.
ORACLE_HOMEPATH/dbs/lk<sid>
start mount; If the server is started use close immediate
SQL> alter database close;
Database altered.
SQL> shutdown immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down
SQL> startup mount
ORACLE instance started.
Total System Global Area 126951228 bytes
Fixed Size 454460 bytes
Variable Size 109051904 bytes
Database Buffers 16777216 bytes
Redo Buffers 667648 bytes
Database mounted.
SQL> select open_mode from v$database;
OPEN_MODE
----------
MOUNTED
SQL> alter database open;
Database altered.
Now you can create your own schema as the database is open
SQL> create user schemaname identified by password;
SQL> grant resource,connect to schema name;
grant permission succeded.
I have done above steps to create a schema when database is not open.
Execute below Commands Sequentially....
> sqlplus
username/password = sys/*******
SQL> shutdown immediate;
SQL> startup mount;
SQL> recover database;
SQL> alter database open;
How did you create the script(s)? What does it do? Is there some reason you're not using the Database Configuration Assistant to do this? It may be simply a matter of not having the service for the instance created via oradim.

Connect SQLplus in oracle

I want to connect user sys in sqlplus of oracle but after I connect, I type like this:
sqlplus sys as sysdba
password:123456
Error:
ORA-01030:insufficient privilege
warning:You are no longer to connect oracle.
Does anyone help me to solve my problem?
Your example looks a little garbled; to connect to sqlplus via the command line, with a user sys and password 123456:
sqlplus sys/123456 as sysdba
or
sqlplus "sys/123456 as sysdba"
prior to Oracle 10. If you are already inside sqlplus (as I assume from the fact that your example starts with a SQL>), you use the connect command:
SQL> connect sys/123456 as sysdba
In all cases, if you haven't set the environment variable ORACLE_SID, you need to specify that after the password, like this:
sqlplus sys/123456#<mydbname> as sysdba
where <mydbname> is either of the form <hostname>/<sid>, if you're using Oracle 10 or later, or a valid entry from your tnsnames.ora file (located in $ORACLE_HOME/network/admin) for all versions.
Is your operating system user account that you are logged in as a member of the ORA_DBA group (windows) or the DBA group (*nix)?
If the answer is yes, then the next thing to check is for the existence of the ORACLE_HOME\database\orapwORCL.ora file, which contains the passwords for all of the users defined as sysdba users. If it does not exist, you need to shutdown the database and execute the orapwd utility:
cd ORACLE_HOME\database
orapwd file=orapwORCL.ora password=123456 entries=10
This defines the sys password as 123456. You should then be able to start up the database and connect sys/123456 as sysdba
The password file must exist for password=based authentication on sysdba logins. The reason for this is the fact that sysdba connections must be allowed when the database is not up and the database cannot authenticate you.

Resources