Home  >  Article  >  Database  >  How to set user password in oracle

How to set user password in oracle

PHPz
PHPzOriginal
2023-04-17 09:19:504055browse

After the Oracle database is installed, you need to set up one or more users to access it in order to manage and maintain the database. This article will introduce how Oracle sets user passwords.

In Oracle, the user's password is encrypted and stored in the database. Admin users have the authority to assign new passwords to new users or change existing passwords. There are two ways to set user passwords: using SQL statements or using Oracle Enterprise Manager (OEM). Below are detailed instructions for both methods.

Use SQL statements to set user passwords

Step 1: Connect to Oracle database

First, you must use an authorized user to connect to the Oracle database. On Windows, you can use SQL*Plus or Sqlplusw.exe, and on Linux, you can use the sqlplus command. For example, the following is the command to connect to an Oracle 12c database:

$ sqlplus sys as sysdba

Step 2: Create a new user

To create a new user, you can use the CREATE USER command. The following is the command to create a user with the username "exampleuser":

CREATE USER exampleuser IDENTIFIED BY password;

In this command, "password" is the password to be set for the new user.

Step 3: Change the password of an existing user

To change the password of an existing user, you can use the ALTER USER command. The following is the command to change the password of the user named "exampleuser":

ALTER USER exampleuser IDENTIFIED BY new_password;

In this command, "new_password" is the new password to be set for the new user.

Set user password using Oracle Enterprise Manager

Oracle Enterprise Manager (OEM) is a web application that can be used to manage multiple Oracle databases. Below are the steps to set a user password using OEM.

Step 1: Log in to OEM

First, you must log in to Oracle Enterprise Manager (OEM) using an authorized user.

Step 2: Navigate to the Security section

On the main interface, navigate to the Security section.

Step 3: Select the “User” option

In the “Security” section, select the “User” option.

Step 4: Create a new user or change the password of an existing user

To create a new user, click the "Create" button and provide the username and password you want to create.

To change the password for an existing user, click on the username and then click the Change Password button. Enter a new password and save changes.

Summary

In Oracle database, you can use SQL statements or Oracle Enterprise Manager (OEM) to set user passwords. Using SQL statements gives you greater control over database settings, while using OEM is more convenient and user-friendly. Regardless of which method is used, administrators should change passwords regularly and use strong passwords to increase database security.

The above is the detailed content of How to set user password in oracle. For more information, please follow other related articles on 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