ORA-2800: account is locked error in qtp - oracle

I am getting the following error while connecting to db for checking db timings through QTP scripts:
"Cannot update system time with database time due to error: ERROR: [Oracle][ODBC][Ora]ORA-28000: the account is locked"
But the database SID and credentials given are correct and verified the same in some db client. I am not sure why its throwing error in QTP?
Can anyone please help me resolve the issue?

1) Login to your Oracle Database using admin privileges:
cmd> sqlplus / as sysdba
or
cmd> sqlplus system/{systemPassword}#{OracleSID}
2) Unlock your user's account using the following command:
sql> alter user {yourDbUser} account unlock;
3) Still in SQL*Plus command prompt, prevent account locks to not occur again:
sql> ALTER PROFILE "DEFAULT" LIMIT PASSWORD_LIFE_TIME UNLIMITED;
sql> ALTER PROFILE "DEFAULT" LIMIT FAILED_LOGIN_ATTEMPTS UNLIMITED;
Edit due comment
The above instructions should solve your problem. I'm posting an additional command I've found related to this subject you can try (I'm not confident it is the solution though):
sql> grant connect, resource to {yourDbUser};
You can also check for the status of other locked users in your database. Maybe your tool is trying to connect with some other user that, besides the one you are using, still have this issue.

This solution is for Oracle 10g and error ORA-28000:the account is locked
Type in the SQL Command Line:
conn sys as sysdba
enter password
alter user system account unlock;

Related

cannot login using system/manager in oracle 12c Realease II database

I am trying to login to oracle sqlplus using system/manager but unable to do.
I logged in using sys user and then ran
ALTER USER SYSTEM IDENTIFIED BY manager;
It said user changed but then when I did
CONN SYSTEM/manager
It says invalid login/password.
Please tell me what I am doing wrong
make sure the sec_case_sensitive_logon parameter set to false
Please, post your SQL*Plus session which shows what exactly you did and how Oracle responded - just like in my example:
SQL> show user
USER is "SYS"
SQL> alter user system identified by manager;
User altered.
SQL> conn system/manager
Connected.
SQL>

oracle 11g not able to connect with scott user, showing: invalid username/password; logon denied

whenever I'm trying to connect with scott it is showing invalid username/password,
tried this:
alter user scott account unlock;
SP2-0640: Not connected
alter user scott identified by tiger;
SP2-0640: Not connected
Go to the Installing path of the Oracle 11g In default it is present C: Drive, then move to C:\oraclexe\app\oracle\product\11.2.0\server\rdbms\admin
here you can find a file named scott.sql
Open the SQL Command Line and login as conn system/ (password set during the installation of oracle 11g)
Run the Below script (Note: File name is appended at the end)
# C:\oraclexe\app\oracle\product\11.2.0\server\rdbms\admin\scott.sql
Now you can query the SELECT * FROM all_users; to see the scott schema created
Alternatively you can do this by using SQL developer by creating a connection to SYSTEM and run the above script
After the creation the default username : SCOTT password: TIGER
In the comment part i especially asked for querying
select count(1) from dba_users where username = 'SCOTT';. I'd like to learn if user exists.
For the message you get ORA-01017,
the First possible reason is what message tells us(invalid
username/password).
Secondly, you may not have an account named SCOTT. i.e. the above
query gives 0(zero).
In this case :
you should create mentioned user ( when you're connected to system ):
SQL> conn system/pwd
Connected.
SQL> create user scott identified by tiger;
and grant related privileges :
SQL> grant connect to scott;
SQL> grant resource to scott;
and then you can connect by issuing :
SQL> conn scott/tiger
Connected.
Connect with a DBA Account and Issue an Alter User Command
The error you are seeing indicates you are no longer connected to the database. You were logged in as system#db, but when you tried to connect as scott#db, you no longer have a database connection.
Here I replicate your experience:
SYSTEM#db>conn system#db as sysdba
Enter password:
Connected.
SYS#db>conn scott#db
Enter password:
ERROR:
ORA-01017: invalid username/password; logon denied
#>alter user account scott unlock;
SP2-0640: Not connected
#>alter user scott identified by tiger;
SP2-0640: Not connected
Here I reconnect and then issue an alter user command to unlock the user account and set a new password.
#>conn system#db as sysdba
Enter password:
Connected.
SYS#db>ALTER USER scott IDENTIFIED BY tiger ACCOUNT UNLOCK;
User altered.
SYS#db>conn scott/tiger#db
Connected.
Addendum
My steps provided assumed you had the scott schema installed. If the scott schema does not exist, it would be good to see if the default 11g database sample schemas exist.
The schema account scott is no longer a default schema in the 11g database. The 11g documentation states:
"Oracle used the schema SCOTT with its two prominent tables EMP and
DEPT for many years. With advances in Oracle Database technology,
these tables have become inadequate to show even the most basic
features of Oracle Database and other Oracle products. "
I would recommend reviewing to see if the other default sample schemas are installed. The hr account is most similar to the scott schema.
Here is a list of common sample schema usernames:
username IN (
'HR',
'OE',
'PM',
'SH',
'IX'
)
Check to see if the person whom performed the installation used the database configuration assistant and opted to install the sample schemas.
If the schemas were not created at the time of installation, the document, "Oracle® Database Sample Schemas 11g Release 1 (11.1) B28328-03", describes the steps to do this in chapter 2, Installation.
Open Oracle sql developer.
In the sql developer paste the path of scott.sql file(C:\oraclexe\app\oracle\product\11.2.0\server\rdbms\admin\scott.sql) with '#' infront of it.
# C:\oraclexe\app\oracle\product\11.2.0\server\rdbms\admin\scott.sql
Run script
Script Output -> Connection created by CONNECT script command disconnected
Connect using SQL Command Line
conn scott/TIGER;

SQL Developer - Signed in as DBA but priveleges are removed

These two privileges don't get granted to the DBA:
SYSDBA
SYSOPER
SQL and GUI attempts to grant these privileges return successful messages, but they remain revoked. While signed in as SYS:
Signing in as SYS
Bookshop_DBA privileges appear as such
Granting with GUI
Granting with SQL
Result for both
Messages are returned to say that granting is successful but no changes are made.
Please show us what you're actually doing.
If you're using the dialog as shown, and getting problems, you should be able to report an any ORA- errors.
For example:
And you don't have to guess what SQL Developer is actually doing - click on the SQL page of the edit user dialog.
Before going further, please consider:
you should in general NEVER login as SYSDBA - unless you need to actually shut down or alter a database. Don't use it as an all powerful PRIV to get around security/grant issues
you should know what you're doing before you grant it to someone, or even use it yourself. Read the docs, then read them again. Otherwise, this is how you do very, very bad things to your database.
Running this code from a non-privileged user:
-- SYSTEM PRIVILEGES
GRANT SYSDBA TO "user" ;
GRANT SYSOPER TO "user" ;
Error starting at line : 6 in command -
GRANT SYSDBA TO "user"
Error report -
ORA-01031: insufficient privileges
01031. 00000 - "insufficient privileges"
*Cause: An attempt was made to perform a database operation without
the necessary privileges.
*Action: Ask your database administrator or designated security
administrator to grant you the necessary privileges
Error starting at line : 7 in command -
GRANT SYSOPER TO "user"
Error report -
ORA-01031: insufficient privileges
01031. 00000 - "insufficient privileges"
*Cause: An attempt was made to perform a database operation without
the necessary privileges.
*Action: Ask your database administrator or designated security
administrator to grant you the necessary privileges
So, how do we get around this?
You need to do this for the user who is performing the grants - and you better REALLY trust this user, if you're going to let them do this SYSDBA...
GRANT SYSDBA TO "*user*" WITH ADMIN OPTION;
But, that's NOT ENOUGH.
Per the DOCS:
Because SYSDBA and SYSOPER are the most powerful database privileges,
the WITH ADMIN OPTION is not used in the GRANT statement. That is, the
grantee cannot in turn grant the SYSDBA or SYSOPER privilege to
another user. Only a user currently connected as SYSDBA can grant or
revoke another user's SYSDBA or SYSOPER system privileges. These
privileges cannot be granted to roles, because roles are available
only after database startup. Do not confuse the SYSDBA and SYSOPER
database privileges with operating system roles.
So, in SQL Developer, disconnect.
Change your connection properties:
Now that you're connected as SYSDBA, you can do...perilous things...like grant that to someone else.
PS - Don't ever GRANT SYS anything to a demo schema like HR. And don't have these demo schemas in production environments, they're only there as learning resources.
It may be due to the user you are connected with. SYSDBA and SYSOPER privs can only be granted by a SYSDBA user.

Oracle DBA, Unique situation with ORA-01017: invalid username/password; logon denied

I am facing a very unique situation here in Oracle DB.
I am facing "ORA-01017: invalid username/password; logon denied" error while logging in to my Oracle user using sqlplus.
Basic information about the system:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production.
2 database servers in cluster environment using Oracle clustering.
Please note that while using TOAD the user logs in perfectly however. The DB is accessible from toad using the connection details to login an individual db. It fails from TOAD while using the Cluster Scan-IP.
Following steps were performed before i started getting this issue.
I was getting a warning message from the Oracle for my user to change the password as it is expiring. Usually in situations like this i will reuse the same password however in this case it was not allowing me to reuse the same password. So I followed this link.
Now I am not able to login my user and I am even not able to completely change the password of my user and login.
Please advise with what went wrong.
Hi I am not sure exactly what your problem is, but these are the steps we follow to reuse a password:
get user profile
change profile to default
ALTER PROFILE "DEFAULT" LIMIT PASSWORD_REUSE_TIME UNLIMITED;
ALTER PROFILE "DEFAULT" LIMIT PASSWORD_REUSE_MAX UNLIMITED;
change password
ALTER PROFILE "DEFAULT" LIMIT PASSWORD_REUSE_TIME 120;
change profile back
Good luck!
The issue was caused because of special characters. I didn't imagine that "$" would be such a big deal in passwords. Anyway please find a work around for it here.

ORA-01031 in insert

i was running an insert query on a synonym i got ORA-01031 in sql developer, we are accessing almost all tables through synonym only, but only this one in the schema gave ORA-0103 error. Please guide.
Error report: SQL Error: ORA-01031: insufficient privileges
01031. 00000 - "insufficient privileges"
*Cause: An attempt was made to change the current username or password
without the appropriate privilege. This error also occurs if
attempting to install a database without the necessary operating
system privileges.
When Trusted Oracle is configure in DBMS MAC, this error may occur
if the user was granted the necessary privilege at a higher label
than the current login.
*Action: Ask the database administrator to perform the operation or grant
the required privileges.
For Trusted Oracle users getting this error although granted the
the appropriate privilege at a higher label, ask the database
administrator to regrant the privilege at the appropriate label.
did you execute something like:
GRANT select, insert, update, delete on Table to your_synonym_user;
and this line should be executed by the Table owner or the user with that permission.
It looks very much like the permissions you have to either the underlying table, or the synonym are insufficient, or possibly that your password has expired?

Resources