通過SQL 指令碼建立資料庫方案 oracle

2021-03-31 16:53:13 字數 532 閱讀 3096

//在unix下建立資料庫方案,先建立表空間,在建立使用者,在授權

create tablespace 表空間名稱 datafile 'newqujiang.dbf'  size 5000m;建立表空間

create user 使用者名稱 identified by 密碼 default tablespace 表空間名 temporary tablespace temp; 建立使用者

grant  dba to 使用者名稱 with admin option;使用者授權admin

grant  connect to 使用者名稱 with admin option;使用者授權connect

//匯入資料

imp 使用者名稱/密碼@資料庫別名

//匯出資料

exp 資料庫名稱/密碼 @別名

//刪除,刪除時,先刪除表空間在刪除使用者

drop tablespace 表空間名稱 including contents and datafiles;//刪除表空間

drop user 使用者名稱 cascade;//刪除使用者

SQL 建立資料庫指令碼

在sql語言中註釋使用 sql 不區分大小寫 建立資料庫 檢查在當前伺服器系統中的所有資料裡面是否有名稱為netstudent的資料庫 ifexists select from sysdatabases where name netstudent 如果有刪除該資料庫 drop database ne...

通過SQL建立資料庫 資料表

insert into class cname,cdescription values t001 這是一個高階班,人數50 insert into class cname,cdescription values t002 這是一個高階班,人數60 drop database myschool cre...

用sql指令碼建立sqlserver資料庫範例語句

下面是建立一個sqlserver資料庫的 模板,加上一個建立表的模板。開發的時候可以拷貝過去直接改動一下就可以用了。希望能幫上忙!複製 如下 use master go if exists select 1 from sysdatabases where nwghxjame n hktemp beg...

C 通過讀取Mysql指令碼建立資料庫

region script helper private bool executescriptfile string pathtoscriptfile,out string errormsg catch exception ex connection.close reader.close error...

查詢資料庫物件建立指令碼的SQL

select text from syscomments where id select id from sysobjects where name vw orderitem vw orderitem為檢視的名稱 可以查詢表名,檢視名,儲存過程名等 select from sysobjects wh...