1.修改用户名脚本
-------------------------------------
--目的:将用户名BOSS641修改为BOSS660
-------------------------------------
--使用sysdba角色账号登录
--查询要修改的用户信息
SELECT * FROM user$ where NAME='BOSS641'
--记录用户的ID
SELECT * FROM user$ where USER#=767
--修改用户名
UPDATE USER$ SET NAME='BOSS660' WHERE USER#=767;
COMMIT;
--强制刷新
ALTER SYSTEM CHECKPOINT;
ALTER SYSTEM FLUSH SHARED_POOL;
--重置用户的用户密码 (不修改不能登录)
ALTER USER BOSS660 IDENTIFIED BY BOSS660;
2.常见问题
1.ORA-00988: missing or invalid password(s)
问题原因:修改用户密码的时候不需使用单引号
Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
Connected as BOSS660
SQL> ALTER USER BOSS660 IDENTIFIED BY 'BOSS660';
ALTER USER BOSS660 IDENTIFIED BY 'BOSS660'
ORA-00988: missing or invalid password(s)
SQL> ALTER USER BOSS660 IDENTIFIED BY BOSS660;
User altered
SQL>