亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 1029 | 回復(fù): 0
打印 上一主題 下一主題

oracle 常用命令 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2011-12-23 01:56 |只看該作者 |倒序瀏覽

Oracle 系統(tǒng)命令
1
、連接數(shù)據(jù)庫

Sql代碼

SQL> conn 用戶名/密碼@網(wǎng)絡(luò)服務(wù)名SID [as sysdba/sysoper]   當(dāng)用特權(quán)用戶身份連接的時,必須帶上as sysdba或者as sysoper  

SQL> conn 用戶名/密碼@網(wǎng)絡(luò)服務(wù)名SID [as sysdba/sysoper]   當(dāng)用特權(quán)用戶身份連接的時,必須帶上as sysdba或者as sysoper


2
、顯示當(dāng)前用戶

Sql代碼

SQL> show user;  

SQL> show user;


3
、修改密碼

Sql代碼

管理員自己修改密碼: passw    管理員修改其他用戶密碼: passw  用戶名    

管理員自己修改密碼: passw    管理員修改其他用戶密碼: passw  用戶名 


4
、退出

Sql代碼

SQL> exit;  

SQL> exit;


5
、運行sql腳本

Sql代碼

SQL> start c:\test.sql; 或者SQL> @ c:\test.sql;  

SQL> start c:\test.sql;或者SQL> @ c:\test.sql;


6
、編輯sql腳本

Sql代碼

SQL> edit c:\test.sql;  

SQL> edit c:\test.sql;


7
、將指定查詢內(nèi)容輸出到指定文件中去
emp表中的數(shù)據(jù)放在d:\test.sql這個文件中

Sql代碼

SQL> spool d:\test.sql;  

SQL> select * from emp;  

SQL> sppool off;  

SQL> spool d:\test.sql;

SQL> select * from emp;

SQL> sppool off;



Oracle
用戶管理
切換用戶

Sql代碼

SQL> conn system/manager  

SQL> conn system/manager


創(chuàng)建用戶

Sql代碼

SQL> create user 用戶名  identified by 密碼  

SQL> create user 用戶名  identified by 密碼


修改別人密碼

Sql代碼

SQL> password 用戶名  

SQL> alter user 用戶名 identified by 新密碼  

SQL> password 用戶名

SQL> alter user 用戶名 identified by 新密碼


刪除用戶(自己刪除自己不可以)
如果要刪除用戶,并且同時要刪除用戶所創(chuàng)建在表,那么就需要在刪除時帶一個參數(shù)cascade;

Sql代碼

SQL> drop user 用戶名 [cascade]  

SQL> drop user 用戶名 [cascade]





角色管理權(quán)限
受理連接數(shù)據(jù)庫權(quán)限(connect)給一個用戶

Sql代碼

SQL> grant connect to 用戶名  

SQL> grant connect to 用戶名


授權(quán)username查詢emp權(quán)限

Sql代碼

SQL> grant select on emp to username  

SQL> grant insert on emp to username  

SQL> grant update on emp to username  

SQL> grant delete on emp to username  

SQL> grant select on emp to username

SQL> grant insert on emp to username

SQL> grant update on emp to username

SQL> grant delete on emp to username



授權(quán)usernameemp所有權(quán)限

Sql代碼

SQL> grant all on emp to username  

SQL> grant all on emp to username



權(quán)限傳遞
如果是對象權(quán)限,權(quán)限在傳遞就在后面加with grant option

Sql代碼

SQL> grant select on emp to username with grant option  

SQL> grant select on emp to username with grant option



如果是系統(tǒng)權(quán)限,權(quán)限在傳遞就在后面加with admin option 這使username可以把select權(quán)限傳遞給其他人

Sql代碼

SQL> grant connect on emp to username with admin option  

SQL> grant connect on emp to username with admin option



收回username在我的emp表上在select權(quán)限

Sql代碼

SQL> revoke select on emp from username  

SQL> revoke select on emp from username



profile
規(guī)則
賬戶鎖定
指定賬戶登陸最多可以輸入密碼在次數(shù),也可以指定用戶鎖定在時間()一般用dba在身份去執(zhí)行該命令

Sql代碼

SQL> create profile lock_account limit failed_login_attempts 3 password_lock_time 2;  

lock_account: 名稱隨便取名  

3:最多輸入3次密碼  

2:鎖定2  

其他的都是關(guān)鍵字  

SQL> create profile lock_account limit failed_login_attempts 3 password_lock_time 2;

lock_account:名稱隨便取名

3:最多輸入3次密碼

2:鎖定2

其他的都是關(guān)鍵字



把鎖lock_accountscott.如果用戶連續(xù)輸入3次錯誤密碼,那么你就被鎖定2,2天后才能登陸

Sql代碼

SQL> alter user scott profile lock_account;  

SQL> alter user scott profile lock_account;

 

 

  。。。。。。。。待續(xù)

您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP