Skip to main content
problematically -> programmatically
Source Link
SQ9MCP
  • 66
  • 1
  • 5

I assume the problem you have is with ORA-28001: the password has expired. It is usually an effect of ALTER USER unittest PASSWORD EXPIRE or simply of the password expired because of the user's profile setting. This is rather tricky situation.

When you connect with SQL*Plus it offers you a prompt asking for the new password and then sets the new passwod like this:

jxa@ub16a|2014$ sqlplus unittest/unittest@//localhost/orclpdb1

SQL*Plus: Release 12.1.0.2.0 Production on Fri Dec 22 13:06:04 2017
Copyright (c) 1982, 2014, Oracle.  All rights reserved.

ERROR:
ORA-28001: the password has expired

Changing password for unittest
New password: 
Retype new password: 
Password changed

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
UNITTEST@ORCLCDB> 

But with JDBC or cx_Oracle this exception leaves you with dead connection and you cannot use it to issue ALTER USER xx IDENTIFIED BY yy REPLACE zz.

So what you need to do is drop the existing connection and reconnect once again with a magic setting. The magic for JDBC is setting OCINewPassword connection property to the new password. Just google for the OCINewPassword and it gets you to examples.

With Python's both cx_Oracle.connect and cx_Oracle.Connection have newpassword= argument which allows to change problematicallyprogrammatically the password when the existingcurrent one is reported expired.

In both cases it is enough to connect with the old password and setting the OCINewPassword (JDBC) or newpassword (Python). It results with the working connection and the user having the password changed to the new one.

This way it opens ways to automate your passwords change for expired oracle users.

I assume the problem you have is with ORA-28001: the password has expired. It is usually an effect of ALTER USER unittest PASSWORD EXPIRE or simply of the password expired because of the user's profile setting. This is rather tricky situation.

When you connect with SQL*Plus it offers you a prompt asking for the new password and then sets the new passwod like this:

jxa@ub16a|2014$ sqlplus unittest/unittest@//localhost/orclpdb1

SQL*Plus: Release 12.1.0.2.0 Production on Fri Dec 22 13:06:04 2017
Copyright (c) 1982, 2014, Oracle.  All rights reserved.

ERROR:
ORA-28001: the password has expired

Changing password for unittest
New password: 
Retype new password: 
Password changed

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
UNITTEST@ORCLCDB> 

But with JDBC or cx_Oracle this exception leaves you with dead connection and you cannot use it to issue ALTER USER xx IDENTIFIED BY yy REPLACE zz.

So what you need to do is drop the existing connection and reconnect once again with a magic setting. The magic for JDBC is setting OCINewPassword connection property to the new password. Just google for the OCINewPassword and it gets you to examples.

With Python's both cx_Oracle.connect and cx_Oracle.Connection have newpassword= argument which allows to change problematically password when the existing one expired.

In both cases it is enough to connect with the old password and setting the OCINewPassword (JDBC) or newpassword (Python). It results with the working connection and the user having the password changed to the new one.

This way it opens ways to automate your passwords change for expired oracle users.

I assume the problem you have is with ORA-28001: the password has expired. It is usually an effect of ALTER USER unittest PASSWORD EXPIRE or simply of the password expired because of the user's profile setting. This is rather tricky situation.

When you connect with SQL*Plus it offers you a prompt asking for the new password and then sets the new passwod like this:

jxa@ub16a|2014$ sqlplus unittest/unittest@//localhost/orclpdb1

SQL*Plus: Release 12.1.0.2.0 Production on Fri Dec 22 13:06:04 2017
Copyright (c) 1982, 2014, Oracle.  All rights reserved.

ERROR:
ORA-28001: the password has expired

Changing password for unittest
New password: 
Retype new password: 
Password changed

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
UNITTEST@ORCLCDB> 

But with JDBC or cx_Oracle this exception leaves you with dead connection and you cannot use it to issue ALTER USER xx IDENTIFIED BY yy REPLACE zz.

So what you need to do is drop the existing connection and reconnect once again with a magic setting. The magic for JDBC is setting OCINewPassword connection property to the new password. Just google for the OCINewPassword and it gets you to examples.

With Python's both cx_Oracle.connect and cx_Oracle.Connection have newpassword= argument which allows to change programmatically the password when the current one is reported expired.

In both cases it is enough to connect with the old password and setting the OCINewPassword (JDBC) or newpassword (Python). It results with the working connection and the user having the password changed to the new one.

This way it opens ways to automate your passwords change for expired oracle users.

rather heavy rewrite of the answer
Source Link
SQ9MCP
  • 66
  • 1
  • 5

WithI assume the problem you have is with ORA-28001: the password has expired. It is usually an effect of ALTER USER unittest PASSWORD EXPIRE or simply of the password expired because of the user's profile setting. This is rather tricky situation.

When you connect with SQL*Plus it offers you a prompt asking for the new password and then sets the new passwod like this:

jxa@ub16a|2014$ sqlplus unittest/unittest@//localhost/orclpdb1

SQL*Plus: Release 12.1.0.2.0 Production on Fri Dec 22 13:06:04 2017
Copyright (c) 1982, 2014, Oracle.  All rights reserved.

ERROR:
ORA-28001: the password has expired

Changing password for unittest
New password: 
Retype new password: 
Password changed

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
UNITTEST@ORCLCDB> 

But with JDBC or cx_Oracle this exception leaves you may find interestingwith dead connection and you cannot use it to issue ALTER USER xx IDENTIFIED BY yy REPLACE zz.

So what you need to do is drop the existing connection and reconnect once again with a magic setting. The magic for JDBC is setting OCINewPassword connection property to the new password. Just google for the OCINewPassword and it gets you to examples.

With Python's both cx_Oracle.connect and cx_Oracle.Connection have newpassword= argument which allows to change problematically password when the existing one expired.

It is not in-depth answer butIn both cases it sets a foundationis enough to solveconnect with the issue. Just googleold password and setting the OCINewPassword (JDBC) or study cx_Oraclenewpassword (Python). It results with the working connection methods and the user having the password changed to the new one.

This way it opens ways to automate your password changespasswords change for expired oracle users.

With JDBC you may find interesting OCINewPassword connection property.

With Python's cx_Oracle.connect and cx_Oracle.Connection have newpassword= argument which allows to change problematically password when expired.

It is not in-depth answer but it sets a foundation to solve the issue. Just google OCINewPassword or study cx_Oracle connection methods and it opens ways to automate your password changes.

I assume the problem you have is with ORA-28001: the password has expired. It is usually an effect of ALTER USER unittest PASSWORD EXPIRE or simply of the password expired because of the user's profile setting. This is rather tricky situation.

When you connect with SQL*Plus it offers you a prompt asking for the new password and then sets the new passwod like this:

jxa@ub16a|2014$ sqlplus unittest/unittest@//localhost/orclpdb1

SQL*Plus: Release 12.1.0.2.0 Production on Fri Dec 22 13:06:04 2017
Copyright (c) 1982, 2014, Oracle.  All rights reserved.

ERROR:
ORA-28001: the password has expired

Changing password for unittest
New password: 
Retype new password: 
Password changed

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
UNITTEST@ORCLCDB> 

But with JDBC or cx_Oracle this exception leaves you with dead connection and you cannot use it to issue ALTER USER xx IDENTIFIED BY yy REPLACE zz.

So what you need to do is drop the existing connection and reconnect once again with a magic setting. The magic for JDBC is setting OCINewPassword connection property to the new password. Just google for the OCINewPassword and it gets you to examples.

With Python's both cx_Oracle.connect and cx_Oracle.Connection have newpassword= argument which allows to change problematically password when the existing one expired.

In both cases it is enough to connect with the old password and setting the OCINewPassword (JDBC) or newpassword (Python). It results with the working connection and the user having the password changed to the new one.

This way it opens ways to automate your passwords change for expired oracle users.

added 167 characters in body
Source Link
SQ9MCP
  • 66
  • 1
  • 5

With JDBC you may find interesting OCINewPasswordOCINewPassword connection property.

With Python's cx_Oracle.connect and cx_Oracle.Connection have newpassword= argument which allows to change problematically password when expired.

It is not in-depth answer but it sets a foundation to solve the issue. Just google itOCINewPassword or study cx_Oracle connection methods and it opens ways to automate your password changes.

With JDBC you may find interesting OCINewPassword connection property. Just google it and automate your password changes.

With JDBC you may find interesting OCINewPassword connection property.

With Python's cx_Oracle.connect and cx_Oracle.Connection have newpassword= argument which allows to change problematically password when expired.

It is not in-depth answer but it sets a foundation to solve the issue. Just google OCINewPassword or study cx_Oracle connection methods and it opens ways to automate your password changes.

Source Link
SQ9MCP
  • 66
  • 1
  • 5
Loading