oracle 語句建立資料庫

2021-07-25 14:16:32 字數 2004 閱讀 3401

//建立臨時表空間

create temporary tablespace soa_temp

– - - -建立 使用者new_user,密碼root,預設表空間soa- - - -

create user new_user identified by root

default tablespace soa

- - -或者設定為臨時表空間- - -

temporary tablespace lins

登入擁有dba許可權使用者sys

- - - - 給使用者賦予普通操作的許可權- - - - - -

grant connect,resource to username;

匯入匯出命令及詳解

plsql客戶端匯入匯出詳解

- - - - 檢視當前庫的版本號

select * from v$version

- - - - 檢視當前庫的字符集

select * from nls_database_parameters where parameter = 『nls_characterset』;

(nls_rdbms_version)為版本號

- - - - 檢視當前庫的所有使用者

select * from user$

- - - - 檢視表空間及大小

select t.tablespace_name, round(sum(bytes / (1024 * 1024)), 0) ts_size

from dba_tablespaces t, dba_data_files d

where t.tablespace_name = d.tablespace_name

group by t.tablespace_name;

- - - - 檢視當前使用者的預設表空間

select username,default_tablespace from user_users;

- - - - 檢視當前使用者的操作許可權

select * from user_role_privs

- - - - 檢視當前使用者下的所有表

select * from user_tables;

- - - - 修改表空間大小

//登陸dba許可權的sys使用者執行

drop tablespace soa including contents and datafiles;

- - - - 刪除使用者new_user 及使用者所有的物件

//登陸dba許可權的sys使用者執行

drop user new_user cascade;

alter user rdzx identified by dreamsoft;

- - - - 檢視修改資料庫游標大小

select count(*) from v$open_cursor;

alter system set open_cursors=1000 scope=both;

- - - - 修改使用者密碼

重置使用者密碼。命令為:alter user username identified by password;其中username為使用者名稱,password為新密碼。

- - - - 解鎖使用者

在oracle中,連續十次嘗試登陸不成功,那麼此賬戶將會被鎖定(lock)。當使用被鎖定的賬戶登入時,系統會報錯:ora-28000: the account is locked。

使用命令解鎖使用者。命令為:alter user username account unlock;其中username為被鎖定的使用者名稱。

資料庫語句,建立資料庫

首先連線sql後,ctrl n 新建查詢視窗 例如 圖書 書號,書名,出版社 讀者 卡號,姓名,年齡,所屬單位 借閱 書號,卡號,借閱日期 注意 要先建立乙個資料夾,d testdb create database shu onprimary name shu data 主資料檔案的邏輯名 file...

oracle 建立資料庫

檢驗是否存在 存在的話刪除 drop tablespace tbs epet 建立表空間 create tablespace tbs epet datafile c epet space.dbf size 5m 建立使用者 create user epet identified by epet de...

Oracle建立資料庫

使用者 作業系統使用者 root登陸 切換到oracle 資料庫使用者 sys system scott 命令 作業系統的命令 id pwd sqlplus的命令 前導命令必須熟悉 id 查詢當前使用者 ls l 顯示當前目錄下的檔案或資料夾 pwd 顯示當前所在的目錄 cd 改變當前目錄 more...