在Oracle 11G R2裏啓用示例賬戶scott

Oracle裏,默認有個示例賬戶scott。不過在oracle11g r2裏,默認是被禁用了。直接登的話,會獲得以下情形。sql

SQL> conn scott/tiger
ERROR:
ORA-28000: the account is lockedoracle

該帳戶如今默認是被鎖定狀態。下面簡單說下如何啓用它。app

1,以sysdba進入sqlpluside

$ /u01/app/oracle/product/11.2.0/dbhome_1/bin/sqlplus "/as sysdba"it

2,解鎖scott 賬戶class

SQL> alter user scott account unlock ;密碼

3,修改密碼。第一次登入的時候,會提示密碼已通過去。這時候輸入新的密碼。數據

SQL> conn scott/tiger;
ERROR:
ORA-28001: the password has expired db

Changing password for scott
New password:
Retype new password:
Password changed
Connected.
SQL> word

4,訪問EMP表。scott裏有個表EMP,裝了一些示例數據。

SQL> desc emp;
Name                                      Null?    Type
----------------------------------------- -------- ----------------------------
EMPNO                                     NOT NULL NUMBER(4)
ENAME                                              VARCHAR2(10)
JOB                                                VARCHAR2(9)
MGR                                                NUMBER(4)
HIREDATE                                           DATE
SAL                                                NUMBER(7,2)
COMM                                               NUMBER(7,2)
DEPTNO                                             NUMBER(2)

SQL>

相關文章
相關標籤/搜索