溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

oracle如何創(chuàng)建實(shí)例、建庫、建表、擴(kuò)展表空間

發(fā)布時間:2021-11-11 10:17:25 來源:億速云 閱讀:352 作者:小新 欄目:關(guān)系型數(shù)據(jù)庫

這篇文章主要介紹oracle如何創(chuàng)建實(shí)例、建庫、建表、擴(kuò)展表空間,文中介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們一定要看完!

版本:oracle 11g 

一、創(chuàng)建實(shí)例(詳細(xì)參考:http://jingyan.baidu.com/article/20095761798412cb0721b4ff.html)

    打開dbca(db configuration assistance)有兩種方法:

        ./$ORACLE_HOME/bin/dbca

        直接敲dbca(正常安裝+配好環(huán)境變量)╮(╯▽╰)╭

二、查看監(jiān)聽狀態(tài)

    lsnrctl status

    有orcllearn則實(shí)例已正常監(jiān)聽,可以下一步。

三、切換實(shí)例名到orcllearn

    echo $ORACLE_SID
    export ORACLE_SID=orcllearn

四、創(chuàng)建/刪除/擴(kuò)展表空間

#創(chuàng)建表空間
create tablespace DEMOSPACE   
datafile 'E:/oracle_tablespaces/DEMOSPACE_TBSPACE.dbf'   
size 1500M   
autoextend on next 5M
maxsize 3000M;

#刪除表空間 
drop tablespace DEMOSPACE including contents and datafiles

#擴(kuò)展表空間
alter tablespace sales add  
datafile 'E:/oracle_tablespaces/DEMOSPACE_TBSPACE.dbf'
size 800M  
autoextend on next 50M  
maxsize 1000M;

可參考(包含多種建表空間的方式):http://database.51cto.com/art/200910/158936.htm

五、創(chuàng)建用戶

create user li identified by li;
grant create table to li;  
grant create tablespace to li;  
grant create view to li;
grant create session to li;

六、創(chuàng)建表

create table hehe
(
      id number(8) not null,
      name varchar(20) not null ,
      primary key (id)
)

以上是“oracle如何創(chuàng)建實(shí)例、建庫、建表、擴(kuò)展表空間”這篇文章的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對大家有幫助,更多相關(guān)知識,歡迎關(guān)注億速云行業(yè)資訊頻道!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI