安裝數據庫的時候很多用戶是鎖定的,下面介紹一下如何解鎖用戶:
以sysdba登陸:(可以通過show user 查看當前用戶)
select username,account_status from dba_users -- 查看所有用戶狀態 ;
alter user hr account unlock --解鎖用戶
alter user hr identified by 123456 --更換密碼
alter user hr account lock --加鎖
create role plustrace --創建角色
grant select on v_$table to plustrace --賦權給角色
grant plustrace to hr --將角色權限賦給用戶
drop role plustrace --刪除角色
set autotrace on --執行命令的時候啓動追蹤