DM8數據庫 創建用戶與刪除用戶

用戶視圖
SQL> desc dba_users;

LINEID     NAME                        TYPE$          NULLABLE
---------- --------------------------- -------------- --------
1          USERNAME                    VARCHAR(128)   N
2          USER_ID                     INTEGER        N
3          PASSWORD                    VARCHAR(8)     Y
4          ACCOUNT_STATUS              VARCHAR(24)    Y
5          LOCK_DATE                   VARCHAR(26)    Y
6          EXPIRY_DATE                 DATETIME(6)    Y
7          DEFAULT_TABLESPACE          VARCHAR(128)   Y
8          TEMPORARY_TABLESPACE        VARCHAR(4)     Y
9          CREATED                     DATETIME(6)    Y
10         PROFILE                     VARCHAR(32767) Y
11         INITIAL_RSRC_CONSUMER_GROUP VARCHAR(1)     Y

LINEID     NAME                TYPE$       NULLABLE
---------- ------------------- ----------- --------
12         EXTERNAL_NAME       VARCHAR(1)  Y
13         PASSWORD_VERSIONS   INTEGER     Y
14         EDITIONS_ENABLED    VARCHAR(1)  Y
15         AUTHENTICATION_TYPE VARCHAR(19) Y
16         NOWDATE             DATETIME(0) Y

16 rows got
SQL> select username,user_id,account_status from dba_users;

LINEID     USERNAME   USER_ID     ACCOUNT_STATUS
---------- ---------- ----------- --------------
1          SYSSSO     50331651    OPEN
2          SYSDBA     50331649    OPEN
3          SYS        50331648    OPEN
4          SYSAUDITOR 50331650    OPEN

used time: 7.868(ms). Execute id is 8.
創建用戶:
SQL> create user test identified by test limit connect_time 3;
密碼要求報錯
create user test identified by test limit connect_time 3;
[-2504]:Error in line: 1
Password length invalid.
used time: 2.490(ms). Execute id is 0.

SQL> create user test identified by teste123456;
executed successfully
used time: 5.843(ms). Execute id is 11.
創建成功

用戶登錄
SQL> conn test/teste123456
Server[LOCALHOST:5236]:mode is normal, state is open
login used time: 3.894(ms)

查詢當前用戶
SQL> select username from user_users;

LINEID     USERNAME
---------- --------
1          TEST

used time: 6.011(ms). Execute id is 12.
查詢當前用戶
SQL> select user();

LINEID     USER()
---------- ------
1          TEST

used time: 0.616(ms). Execute id is 13.

創建表
SQL> create table test as select * from sysobjects;
create table test as select * from sysobjects;
[-5515]:Error in line: 1
No create table privilege.
used time: 0.320(ms). Execute id is 0.
沒有權限

SQL> conn sysdba/Dm1234567;

Server[LOCALHOST:5236]:mode is normal, state is open
login used time: 2.912(ms)
賦權
SQL> grant dba to test;
executed successfully
used time: 5.195(ms). Execute id is 14.
SQL> conn test/teste123456;

Server[LOCALHOST:5236]:mode is normal, state is open
login used time: 3.391(ms)

創建表成功
SQL> create table test as select * from sysobjects;
executed successfully
used time: 7.681(ms). Execute id is 15.

查看
SQL> select count(*) from test;

LINEID     COUNT(*)            
---------- --------------------
1          1324

used time: 0.629(ms). Execute id is 16.


SQL> conn SYSDBA/Dm1234567

Server[LOCALHOST:5236]:mode is normal, state is open
login used time: 3.068(ms)

更改用戶密碼

SQL> alter user sysdba identified by sysdba;
executed successfully
used time: 4.710(ms). Execute id is 17.
SQL> alter user test limit session_per_user 10, connect_idle_time unlimited;
executed successfully
used time: 3.690(ms). Execute id is 18.

刪除用戶
SQL> drop user test;
drop user test;
[-2639]:Error in line: 1
Try to drop depended object [TEST].
used time: 0.643(ms). Execute id is 0.

有內容需要使用cascade
SQL> drop user test cascade;
executed successfully
used time: 30.408(ms). Execute id is 19.
SQL> 

打開dm manager 可以管理

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章