Change the validity period of an oracle Password

Source: Internet
Author: User

Changing the validity period of the oracle password may cause exceptions in several existing projects due to a bug in the project. Bug Description: oracle11g. After the silent installation, the user's password is set to 180 days by default. after 180 days, the password will expire and oracle will prompt you to change the password. Our project uses jdbc to connect to the oracle database, and cannot automatically handle the oracle Password error prompt, directly connecting to oracle fails. Solution 1: regularly modify the password of a database user. Solution 2: Set the Database Password to permanently valid. Train of Thought 1 has a certain security protection effect, but because the business does not support modifying the database password configuration in the business department (there are many parts, it is too troublesome to modify, so it is simply not required to modify, think about it), so I decided to adopt idea 2. The specific setting command is as follows: assume that the database user we use is test and the password is test123456 Step 1: log on to the linux server where oracle is located (our oracle is assumed to be on the linux Server ), be sure to use the dba user. Step 2: Run 'sqlplus/as sysdb' Step 3: Enter 'alter profile default limit password_life_time unlimited; 'and press Enter. Step 4: Enter 'alter user test identified by test123456; 'Step 5: Enter 'Quit; 'to exit sqlplus. Step 6: restart various business units. Everything is OK. It should be noted that step 4 may fail, because oracle may set a limit that cannot be repeated with the historical password when changing the password. We can first execute the following command to remove the restriction, then, perform step 4. Although the password does not change before and after the configuration in Step 4, is it necessary? In actual testing, even if step 3 is processed, if step 4 is not executed, the jdbc connection fails. 'Alter profile default limit password_reuse_max unlimited; ''alter profile default limit password_reuse_time unlimited; 'the following conditions must be met when you use the profile and want to reuse the password again: 1) when both password_reuse_time and password_reuse_max are unlimted, You can reset them as needed. 2) When password_reuse_time and password_reuse_max are specified, the password will never be reset when another unlimted is specified. 3) when both password_reuse_time and password_reuse_max are specified to meet password_reuse_max, You can reset the password to meet both password_reuse_time and password_reuse_m. In ax, the password can be reset when password_reuse_time is met but the password is changed, that is, when password_reuse_max is useless once, the password cannot be reset. the above solution is a complementary solution to solve the current network problem. The password validity period must be removed during oralce installation.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.