Oracle資料庫常用SQL

來源:互聯網
上載者:User

標籤:hrp   pll   bom   gzip   imp   不同   查詢   ant   ftp   

Oracle資料庫建立執行個體的過程類似於Sql server建立資料庫,Oracle一個執行個體可以對應多個資料表空間,一個資料表空間對應一個使用者,根據不同的使用者名稱、密碼登入不同的資料表空間。

因此,建立資料表空間後,緊接著要建立使用者並為其指定資料表空間。並授權給該使用者,一般是connect、resource、dba許可權

 grant connect,resource,dba to yun

 

查詢資料庫名稱:

select name from v$database;

 

怎樣查得資料庫的sid、系統內容變數

select name from v$database;

 

建立資料庫時一般要指定sid:

 

 

查詢資料庫下的資料表空間:

select * from dba_tablespaces;

 

刪除資料表空間:

drop tablespace test_data including contents and datafiles cascade constraints;

 

查詢資料庫下的使用者

select * from dba_users;

 

刪除使用者:

drop user TEST2 cascade;

 

cascade : 級聯

 

建立表:

create table student(id int,name VARCHAR(20))

 

插入資料:

insert into student values(1,‘busan‘)

 

修改資料:

update student set name=‘zhangsan‘ where id=1

 

刪除資料:

delete student where id = 2

 

Oracle資料庫常用SQL

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.