Home  >  Article  >  php教程  >  Two methods to set Oracle user password to not expire

Two methods to set Oracle user password to not expire

高洛峰
高洛峰Original
2017-01-06 11:54:361460browse

1. Under SQL Plus, log in as DBA

Username/Password@ServerSID as sysdba

Method 1: (Note that the following must be enclosed in double quotes)

C:/Documents and Settings/ssy>sqlplus sys/system@test as sysdba

SQL*Plus: Release 9.2.0.1.0 - Production on Monday, March 17 18:01 :41 2008 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. Connect to: Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.1.0 - Production

Method 2:

C:/Documents and Settings/ssy>sqlplus /nolog SQL*Plus: Release 9.2.0.1.0 - Production on Monday, March 17 17:59: 08 2008 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

SQL> conn sys/system@test_192.168.80.38 as sysdba 已连接。
SQL> quit

2. Check which proifle the user has, usually default:

sql>SELECT username,PROFILE FROM dba_users;

3. View the password validity period setting of the specified profile (such as default):

sql>SELECT * FROM dba_profiles s WHERE s.profile='DEFAULT' AND resource_name='PASSWORD_LIFE_TIME';

4. Change the password validity period from the default 180 days to "unlimited":

ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;

There is no need to restart the database after the modification, it will take effect immediately.

5. After modification, accounts that have not been prompted with the ORA-28002 warning will not encounter the same prompt again;

Accounts that have been prompted must change their passwords again, for example:

$sqlplus / as sysdba
sql> alter user smsc identified by <原来的密码> ----不用换新密码1、在SQL Plus下,以DBA身份登陆

Username/Password@ServerSID as sysdba

Method 1: (Note that the following must be enclosed in double quotes)

C:/Documents and Settings/ssy>sqlplus sys/system@test as sysdba

SQL*Plus: Release 9.2.0.1.0 - Production on Monday, March 17 18:01: 41 2008 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. Connect to: Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.1.0 - Production

Method 2:

C:/Documents and Settings/ssy>sqlplus /nolog SQL*Plus: Release 9.2.0.1.0 - Production on Monday March 17 17: 59:08 2008 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

SQL> conn sys/system@test_192.168.80.38 as sysdba is connected.
SQL> quit

2. Check which profile the user has, usually default:

sql>SELECT username,PROFILE FROM dba_users;

3. Check the specified profile (such as default) password validity period setting:

sql>SELECT * FROM dba_profiles s WHERE s.profile=&#39;DEFAULT&#39; AND resource_name=&#39;PASSWORD_LIFE_TIME&#39;;

4. Change the password validity period from the default 180 days to "unlimited":

ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;

There is no need to restart the database after modification, it will take effect immediately.

5. After modification, accounts that have not been prompted with the ORA-28002 warning will not encounter the same prompt again;

Accounts that have been prompted must change their passwords again, for example:

$sqlplus / as sysdba
sql> alter user smsc identified by <原来的密码> ----不用换新密码

The above are the two methods that the editor introduces to you to set the Oracle user password to not expire. I hope it will be helpful to you. If you If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank you all for your support of the PHP Chinese website!

For more related articles on two ways to set Oracle user passwords to non-expiry, please pay attention to the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn