資料庫的管理

2021-09-08 11:40:02 字數 1400 閱讀 3208

使用exp和imp

匯出表

set nls_lang=simplified chinese_china.al32utf8
exp scott/tiger@mydev tables=emp file=d:\temp\exp_scott_20160318.dmp log=d:\temp\exp_scott_20160318

.log --匯出單張表

exp scott/tiger@mydev tables=(emp,dept) file

=d:\temp\expdat.dmp log

=d:\

temp\exp.log.txt --匯出多張表

exp system/manager@mydev tables=(scott.emp) file=d:\temp\exp.dmp log=d:\temp\log.txt --利用其它使用者匯出,必須具有exp_full_database許可權或dba

exp scott/tiger@mydev tables=emp file=d:\temp\expdat.dmp log=d:\temp\exp.log.txt 

rows=n --只匯出表結構

exp scott/tiger@mydev direct=y tables=emp file=d:\temp\expdata.dmp log=d:\temp\exp.log

--直接匯出方式,資料量大可以考慮

exp scott/tiger@mydev owner=scott file=d:\temp\expdat.dmp log=d:\temp\exp.log.txt --按方案匯出

角色相關

select

*from dba_roles; --查詢所有的角色,55個

select * from dba_sys_privs where grantee='connect'; --乙個角色包含的系統許可權

select * from  role_sys_privs where role='connect';       -- 乙個角色包含的系統許可權,與上面乙個語句效果相同,但是需要用dba許可權

select * from dba_tab_privs where grantee='connect'; --乙個角色包含的物件許可權

select * from dba_sys_privs shere grantee='scott'; --查詢出乙個使用者所具有的角色

檢視當前資料庫的全稱

select

*from global_name;

MySQL資料庫 資料庫的管理

一 建立資料庫 方法1 create database 資料庫名 方法2 create schema 資料庫名 方法3 create database if not exits 資料庫名 default character set charset 如圖 資料庫t1,t2建立成功 二 檢視當前伺服器上...

MySQL資料庫 資料庫管理

建立使用者,指定明文密碼 create user rose localhost identified by rosepwd 檢視使用者是否建立成功 select user,host from mysql.user 建立使用者,不設定密碼 create user rose01 localhost se...

SQL資料庫 管理資料庫

建立完資料庫,如何對它進行管理呢?管理資料庫包括對資料庫修改大小 新增資料檔案或日誌檔案 分離和附加資料庫等,同樣有語句和ssms兩種方法。接下來主要展示用sql語句方法更改,用介面的方式只需要在屬性裡更改就可以 將乙個新的事務日誌檔案xscjl log,初始大小100mb加入xscj中。alter...