Oracle 11.2.0.2 new feature-Rename User)

Source: Internet
Author: User

The new feature of user rename is provided from Oracle 11.2.0.2. in earlier versions, If you need rename username, we generally use imp's fromuser, touser, and Data Pump impdp's remap_schemas. If we want to import a schema data to replace the previous schema, and the previous schema needs to be retained, users before rename can.


Sys as sysdba @ devcedb> select * from v $ version;
 
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit Production
PL/SQL Release 11.2.0.3.0-Production
CORE 11.2.0.3.0 Production
TNS for Linux: Version 11.2.0.3.0-Production
NLSRTL Version 11.2.0.3.0-Production
 
1) modify the implicit parameter "_ enable_rename_user" of oracle"
Sys as sysdba @ devcedb> alter system set "_ enable_rename_user" = true scope = spfile;

System altered.

2) Start the database in restrict Mode
Startup restrict force;
Or
 
Alter system enable restricted session;

Sys as sysdba @ devcedb> alter system quiesce restricted;
 
System altered.

3) Modify username
Sys as sysdba @ devcedb> alter user amber rename to ambernew identified by amber;

User altered.


4) disable restrict
Sys as sysdba @ devcedb> alter system disable restricted session;
 
System altered.
In addition, there is also a method to modify the oracle Data dictionary on the Internet, and there is no version limit:
1) modify the data dictionary user $
Update user $ set name = ''where user # = ''; -- exercise caution when changing the data dictionary in the production database.

2) manually generate checkpoints to write update operations to data files
Alter system checkpoint;
 

3) Clear the share pool so that oracle can read the updated data dictionary.
Alter system flush shared_pool; -- exercise caution when operating the production database flush slave pool.
 
As one of the core base tables of oracle, modifying the data dictionary will not cause system instability, resulting in ora-600 errors and so on are not easy to say, so the production must be careful.

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.