使用 Oracle SQL Developer 更改密码

发布于 2024-09-06 03:32:52 字数 213 浏览 8 评论 0 原文

我的许多用户不使用 SQLPlus。我无法给他们更改用户。我们的密码每 60 天就会过期。

我无法让 SQLPlus 命令“密码”在 SQL Developer 中工作。

  1. 当我点击运行时,出现无效命令错误
  2. 当我点击运行脚本时,没有任何反应。

我不想给他们写一个包来更改他们的密码,因为我们有很多数据库。我有更好的选择吗?

Many of my users do not use SQLPlus. I cannot give them alter user. We expire passwords every 60 days.

I can't get the SQLPlus command "password" to work in SQL developer.

  1. When I hit run, I get an invalid command error
  2. When I hit run script, nothing happens.

I don't want to write them a package to change their passwords since we have a lot of databases. Do I have a better option?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(15

灼痛 2024-09-13 03:32:53

您可以在 DBA_USERS 表中找到该用户,例如

SELECT profile
FROM dba_users
WHERE username = 'MacsP'

现在转到 sys/system(管理员)并使用查询

ALTER USER PRATEEK
IDENTIFIED BY "new_password"
REPLACE "old_password"

来验证帐户状态,只需通过

SELECT * FROM DBA_USERS.

即可查看用户的状态。

you can find the user in DBA_USERS table like

SELECT profile
FROM dba_users
WHERE username = 'MacsP'

Now go to the sys/system (administrator) and use query

ALTER USER PRATEEK
IDENTIFIED BY "new_password"
REPLACE "old_password"

To verify the account status just go through

SELECT * FROM DBA_USERS.

and you can see status of your user.

花辞树 2024-09-13 03:32:53

您现在可以在 SQL Developer 4.1.0.17,不需要 PL/SQL,假设您有另一个具有管理权限的帐户:

  1. 使用备用管理用户在 SQL Developer 4.1.0.17 中创建到数据库的连接连接
  2. 后展开“其他用户”部分,然后右键单击密码已过期的用户。选择“编辑用户”。
  3. 取消选中“密码已过期...”复选框,输入用户的新密码,然后单击“保存”。
  4. 工作完成了!您可以通过连接密码已过期的用户进行测试,以确认密码现在再次有效。

You can now do this in SQL Developer 4.1.0.17, no PL/SQL required, assuming you have another account that has administrative privileges:

  1. Create a connection to the database in SQL Developer 4.1.0.17 with an alternative administrative user
  2. Expand the "Other Users" section once connected, and right-click the user whose password has expired. Choose "Edit User".
  3. Uncheck the "Password Expired..." checkbox, type in a new password for the user, and hit "Save".
  4. Job done! You can test by connecting with the user whose password had expired, to confirm it is now valid again.
高跟鞋的旋律 2024-09-13 03:32:53

对于那些可能没有 sysdba 或 sys 设置密码并经常使用第三方客户端的人来说,需要注意一下。
这里有一些关于在没有密码的情况下登录命令行 sqlplus 的信息,对我有帮助。
顺便说一句,我正在使用 fedora 21。

locate sqlplus

就我而言,sqlplus 位于此处:

/u01/app/oracle/product/11.2.0/xe/config/scripts/sqlplus.sh

现在运行

cd /u01/app/oracle/product/11.2.0/xe/config/scripts
./sqlplus.sh / as sysdba

现在您需要使用旧凭据连接到数据库。
您可以在输出中找到 Oracle 提供的模板:

Use "connect username/password@XE" to connect to the database.

在我的例子中,我有用户“oracle”和密码“oracle”,所以我的输入看起来像“

connect oracle/oracle@XE

完成”。现在输入新密码两次。
然后,如果您不想让密码再过期,您可以运行

ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;

One note for people who might not have the set password for sysdba or sys and regularly use a third party client.
Here's some info about logging into command line sqlplus without a password that helped me.
I am using fedora 21 by the way.

locate sqlplus

In my case, sqlplus is located here:

/u01/app/oracle/product/11.2.0/xe/config/scripts/sqlplus.sh

Now run

cd /u01/app/oracle/product/11.2.0/xe/config/scripts
./sqlplus.sh / as sysdba

Now you need to connect to database with your old credentials.
You can find Oracle provided template in your output:

Use "connect username/password@XE" to connect to the database.

In my case I have user "oracle" with password "oracle" so my input looks like

connect oracle/oracle@XE

Done. Now type your new password twice.
Then if you don't want your password to expire anymore you could run

ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
拥醉 2024-09-13 03:32:53

我使用版本 21.2.0.187(2021 年 7 月发布)。

有一个重置按钮,可让您将密码重置为新密码,如下图所示。您可以通过在连接上右键单击鼠标来访问它。

我重置密码,然后使用新密码登录。

输入图片此处描述
输入图片此处描述

I use version 21.2.0.187 (released on july 2021).

There is a reset button that enable you to reset password to a new password as shown in the next figures. you can reach it by right click mouse on the connection.

I rest the password, then login with the new password.

enter image description here
enter image description here

晨敛清荷 2024-09-13 03:32:52

使用 SQL Developer 更新密码的正确语法是:

更改用户 用户名 识别者 新密码 替换
旧密码

您可以在此处查看此命令的更多选项: ALTER USER- Oracle 文档

The correct syntax for updating the password using SQL Developer is:

alter user user_name identified by new_password replace
old_password ;

You can check more options for this command here: ALTER USER-Oracle DOCS

弱骨蛰伏 2024-09-13 03:32:52

在 SQL 工作表中:

  • 输入“password”(不带引号)

  • 突出显示,按 CTRL+ ENTER

  • 出现密码更改屏幕。

In an SQL worksheet:

  • Type in "password" (without the quotes)

  • Highlight, hit CTRL+ENTER.

  • Password change screen comes up.

演出会有结束 2024-09-13 03:32:52

SQL Developer 有一个内置的重置密码选项,可能适合您的情况。它还需要将 Oracle Instant Client 添加到工作站。当即时客户端位于 SQL Developer 启动时的路径中时,您将启用以下选项:

SQL Developer:显示重置密码的下拉菜单option

Oracle Instant Client 不需要管理员权限即可安装,只需能够写入目录并将该目录添加到用户路径中。大多数用户都有权执行此操作。

回顾:为了在 Oracle SQL Developer 上使用重置密码:

  1. 您必须将 Oracle Instant Client 解压到某个目录中
  2. 您必须将 Oracle Instant Client 目录添加到用户路径
  3. 然后必须重新启动 Oracle SQL Developer

此时您可以右键单击数据源并重置您的密码。

请参阅 http://www .thatjeffsmith.com/archive/2012/11/resetting-your-oracle-user-password-with-sql-developer/ 查看完整演练

另请参阅 oracle 文档中的评论: http://docs.oracle.com/cd/E35137_01/appdev.32 /e35117/dialogs.htm#RPTUG41808

让 SQL Developer(在版本 4.0.1 上测试)识别并使用 OS X 上的 Instant Client 的替代配置是:

  1. 在首选项 -> 设置 Instant Client 的路径数据库->高级->
    使用 Oracle 客户端
  2. 验证实例客户端是否可以使用配置成功加载... ->测试...首选项对话框中的选项
  3. (OS X) 请参阅此问题来解决与 DYLD_LIBRARY_PATH 环境变量相关的问题。我使用以下命令,然后重新启动 SQL Developer 以获取更改:

    $ launchctl setenv DYLD_LIBRARY_PATH /path/to/oracle/instantclient_11_2

SQL Developer has a built-in reset password option that may work for your situation. It requires adding Oracle Instant Client to the workstation as well. When instant client is in the path when SQL developer launches you will get the following option enabled:

SQL Developer: Drop Down menu showing reset password option

Oracle Instant Client does not need admin privileges to install, just the ability to write to a directory and add that directory to the users path. Most users have the privileges to do this.

Recap: In order to use Reset Password on Oracle SQL Developer:

  1. You must unpack the Oracle Instant Client in a directory
  2. You must add the Oracle Instant Client directory to the users path
  3. You must then restart Oracle SQL Developer

At this point you can right click a data source and reset your password.

See http://www.thatjeffsmith.com/archive/2012/11/resetting-your-oracle-user-password-with-sql-developer/ for a complete walk-through

Also see the comment in the oracle docs: http://docs.oracle.com/cd/E35137_01/appdev.32/e35117/dialogs.htm#RPTUG41808

An alternative configuration to have SQL Developer (tested on version 4.0.1) recognize and use the Instant Client on OS X is:

  1. Set path to Instant Client in Preferences -> Database -> Advanced ->
    Use Oracle Client
  2. Verify the Instance Client can be loaded succesfully using the Configure... -> Test... options from within the preferences dialog
  3. (OS X) Refer to this question to resolve issues related to DYLD_LIBRARY_PATH environment variable. I used the following command and then restarted SQL Developer to pick up the change:

    $ launchctl setenv DYLD_LIBRARY_PATH /path/to/oracle/instantclient_11_2

穿越时光隧道 2024-09-13 03:32:52

您的用户仍然可以通过“alter user onlyTheirUserNameidentified by newpassword”来更改密码。他们不必拥有 ALTER USER 权限即可更改自己的密码。

Your users can still change their passwords by "alter user onlyTheirUserName identified by newpassword". They do not have to have the ALTER USER privilege to change their own password.

画尸师 2024-09-13 03:32:52

根据管理设置,您可能必须使用 REPLACE 选项指定旧密码

alter user <username> identified by <newpassword> replace <oldpassword> 

Depending on the admin settings, you may have to specify your old password using the REPLACE option

alter user <username> identified by <newpassword> replace <oldpassword> 
梦里南柯 2024-09-13 03:32:52

说得更清楚一点:

如果用户名:abcdef,旧密码:a123b456,新密码:m987n654

alter user abcdefidentified by m987n654 Replace a123b456;

To make it a little clear :

If the username: abcdef and the old password : a123b456, new password: m987n654

alter user abcdef identified by m987n654 replace a123b456;

薄暮涼年 2024-09-13 03:32:52

我意识到有很多答案,但我找到了一个可能对某些人有帮助的解决方案。我遇到了同样的问题,我正在本地计算机上运行 oracle sqldevelopment 并且我有很多用户。我碰巧记住了其中一位用户的密码,并用它来重置其他用户的密码。

步骤:

  1. 使用有效的用户和密码连接到数据库,在我的情况下,除了“system”之外的所有用户都已过期,并且我记得密码

  2. 在树中查找“Other_users”节点,如下图所示

在此处输入图像描述

3.在“Other_users”树中找到您想要重置密码的用户,右键单击注释并选择“编辑用户”

在此处输入图像描述

4.填写新密码编辑用户对话框并单击“应用”。确保您未选中“密码已过期(用户下次登录时必须更改)”。

输入图像描述这里

这对我有用,它不如其他解决方案好,因为您需要能够登录至少一个帐户,但它确实有效。

I realise that there are many answers, but I found a solution that may be helpful to some. I ran into the same problem, I am running oracle sql develop on my local computer and I have a bunch of users. I happen to remember the password for one of my users and I used it to reset the password of other users.

Steps:

  1. connect to a database using a valid user and password, in my case all my users expired except "system" and I remember that password

  2. find the "Other_users" node within the tree as the image below displays

enter image description here

3.within the "Other_users" tree find your users that you would like to reset password of and right click the note and select "Edit Users"

enter image description here

4.fill out the new password in edit user dialog and click "Apply". Make sure that you have unchecked "Password expired (user must change next login)".

enter image description here

And that worked for me, It is not as good as other solution because you need to be able to login to at least one account but it does work.

预谋 2024-09-13 03:32:52

我确认这在 SQL Developer 3.0.04 中有效。我们的密码需要有一个特殊字符,因此在我们的例子中需要双引号字符串。当然,这仅在密码尚未过期并且您当前已登录的情况下才有效。

ALTER USER MYUSERID
IDENTIFIED BY "new#password"
REPLACE "old#password"

I confirmed this works in SQL Developer 3.0.04. Our passwords are required to have a special character, so the double-quoted string is needed in our case. Of course, this only works if the password has not already expired and you are currently logged in.

ALTER USER MYUSERID
IDENTIFIED BY "new#password"
REPLACE "old#password"
空袭的梦i 2024-09-13 03:32:52

如果(SQL Developer 的)重置密码选项不起作用,请尝试此解决方案:

步骤 1:打开“运行 SQL 命令行”(从 SQL Developer 安装包附带的开始菜单)

步骤 2:运行以下命令:

在此处输入图像描述

注意:如果密码已过期,更改<用户>密码选项将自动出现。

Try this solution if the Reset Password option (of SQL Developer) did not work:

Step 1: Open Run SQL Command Line (from the start menu, which comes with SQL Developer installation package)

Step 2: Run the following commands:

enter image description here

Note: If password has already expired, Changing password for <user> option will automatically come.

玩世 2024-09-13 03:32:52

内置重置密码选项可能对用户不起作用。在这种情况下,可以使用以下 SQL 语句重置密码:

ALTER user "user" identified by "NewPassword" replace "OldPassword";

The built-in reset password option may not work for user. In this case the password can be reset using following SQL statement:

ALTER user "user" identified by "NewPassword" replace "OldPassword";
一瞬间的火花 2024-09-13 03:32:52

还有另一种方法可以通过命令提示符重置密码 ...

1) 在开始菜单中转到 Oracle 数据库文件夹(在我的例子中是 Oracle Database 11g Express Edition) 。

2) 在该文件夹中单击“运行 SQL 命令行”

Oracle 数据库文件夹图像

3) 输入连接用户名/密码”(您的用户名和旧密码,不带引号)

4) 显示的消息是...

错误:
ORA-28001: 密码已过期

更改 hr 的密码

-->新密码:

输入用户名、密码图片

5) 输入新密码

6) 重新输入新密码

7 ) 显示的消息是...

密码已更改
已连接。

SQL>

8) 转到 Sql 开发人员 -->输入新密码 -->已连接

There is another way to reset the password through command prompt ...

1) Go to the Oracle Database Folder ( In my case Oracle Database 11g Express Edition) in the START MENU.

2) Within that folder click "Run SQL Commandline"

Oracle Database Folder image

3) Type "connect username/password" (your username and old password without the quotation marks)

4) The message displayed is ...

ERROR:
ORA-28001: the password has expired

Changing password for hr

--> New password:

Enter Username, Password image

5) Type the new password

6) Retype the new password

7) Message displayed is ...

Password changed
Connected.

SQL>

8) GO TO Sql developer --> type the new password --> connected

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文