Step 4: Change the Oracle user name

Source: Internet
Author: User
Oracle user name change is a rare requirement for Oracle user name modification in four steps, but it is still a required knowledge for beginners, here, we use four simple steps to change and replace the Oracle user name. AD: 2013 cloud computing architect Summit course materials download our Oracle management work often involves changing Oracle users

Oracle user name change is a rare requirement for Oracle user name modification in four steps, but it is still a required knowledge for beginners, here, we use four simple steps to change and replace the Oracle user name. AD: 2013 cloud computing architect Summit course materials download our Oracle management work often involves changing Oracle users

Step 4: Change the Oracle user name


Modifying the Oracle user name is not a common requirement, but it is still a required knowledge for beginners. Here, we use four simple steps to change and replace the Oracle user name.

AD: 2013 cloud computing architect Summit course material download

Our Oracle management work often involves changing the attributes and passwords of Oracle users. However, in some application scenarios, how can we solve this problem? The following four steps are used to modify the Oracle user name.

1. query and change the Oracle user name

 
 
  1. SQL> select user#,name,password from user$ where name ='TICKETS';
  2. USER# NAME PASSWORD
  3. ---------- ------------------------------ ------------------------------
  4. 78 TICKETS 21EDA78F89D6FACD

Ii. Change User Name

 
 
  1. SQL> update user$ set name='TICKETS_BAK' where user#=78;
  2. 1 row updated.
  3. SQL> commit;
  4. Commit complete.

3. Create the same Oracle user name

 
 
  1. SQL> create user tickets identified by "123456"
  2. 2 default tablespace yytickets
  3. 3 temporary tablespace temp;
  4. create user tickets identified by "123456"
  5. *
  6. ERROR at line 1:
  7. ORA-01920: user name 'TICKETS' conflicts with another user or role name

The system prompts "User Name Conflict" and runs the following SQL statement.

 
 
  1. SQL> alter system checkpoint; ---- force write to the data file, that is, let the user $ result (dirty block) modified in step 2. Change the user name) user $ written to the data file
  2. System altered.
  3. SQL> alter system flush shared_pool; ---- when you create user tickets in the Next Step (4. create the same user name), the oracle system automatically modifies the system table user $. And here
    Clear the data dictionary information in the cache (user $ ), the oracle system will forcibly read the actual data in user $ on the data file before modifying the system table user $ (that is, the changed data)
  4. System altered.

4. Create the same user name

 
 
  1. SQL> create user tickets identified by "123456"
  2. 2 default tablespace yytickets
  3. 3 temporary tablespace temp;
  4. User created.
  5. SQL> grant connect,resource to tickets;
  6. Grant succeeded.
  7. SQL> commit;
  8. Commit complete.

In this way, you can find, change, replace, and copy Oracle user names. You need to check and resolve user name conflicts to prevent future risks.

[Edit recommendations]

  1. Oracle username re-indexing method
  2. Explain how to query user tablespaces in Oracle
  3. An analysis of the management method of the Oracle user permission table
  4. Introduction to Oracle database backup and recovery features
  5. Five restrictions on using Oracle External tables

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.