ORACLE数据库复制或克隆后,经常需要修改用户名和密码,下面总结下修改的方法和步骤:
1、查询系统表USER$
SELECT NAME,USER# FROM user$ WHERE UPPER(TRIM(NAME)) = ‘USER NAME‘;
2、修改用户名
UPDATE user$ SET NAME = ‘NEW NAME‘ WHERE USER# =(SELECT USER# FROM user$ WHERE UPPER(TRIM(NAME)) = ‘USER NAME‘);
COMMIT;
3、清除缓存
ALTER SYSTEM CHECKPOINT;
ALTER SYSTEM FLUSH SHARED_POOL;
COMMIT;
4、修改用户密码并解除账户锁定
ALTER USER USERNAME IDENTIFIED BY ‘NEW PASSWORD‘;
ALTER USER USERNAME ACCOUNT UNLOCK; --解除账户锁定
COMMIT;
修改完毕~~~使用新用户和秘密登录即可……
时间: 2024-11-10 00:10:08