void

          新裝 Oracle 建庫(實例)步驟

          Oracle版本:11gR2
          安裝好Oracle后,需要創建一個實例(也就是庫)。
          ORACLE創建實例,使用ORAHOME目錄下的"Configuration and Migration Tools"下的"Database Configuration Assistant"工具。
          建好庫(實例)后,使用用戶名“system”登陸剛才建好的庫。
          執行下面的語句。


          --表空間
          CREATE TABLESPACE nansha
          DATAFILE 'D:\Oracle\oradata\nansha\nansha_data.dbf' size 800M
                   EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO; 
                   
          --索引表空間
          CREATE TABLESPACE nansha_index
          DATAFILE 'D:\Oracle\oradata\nansha\nansha_index.dbf' size 512M         
                   EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;     

          --2.建用戶
          create user chenpeng identified by chenpeng 
          default tablespace nansha;
           
          --3.賦權
          grant connect,resource to chenpeng;
          grant create any sequence to chenpeng;
          grant create any table to chenpeng;
          grant delete any table to chenpeng;
          grant insert any table to chenpeng;
          grant select any table to chenpeng;
          grant unlimited tablespace to chenpeng;
          grant execute any procedure to chenpeng;
          grant update any table to chenpeng;
          grant create any view to chenpeng;

          --PS.賦權DBA
          --
          grant dba to chenpeng

          commit;



          用剛才新建的用戶登陸(新建)庫
          --測試:新建一張表
          create table usptotest 
          pn varchar(10) not null, 
          isd varchar(20) default '' not null , 
          title varchar(150) default '' not null , 
          abst varchar(2000) default '' not null , 
          appno varchar(20) default '' not null , 
          appdate varchar(20) default '' not null , 
          inventor varchar(200) default '' not null , 
          assignee_name varchar(50) default '' not null , 
          assignee_country varchar(20) default '' not null , 
          assignee_city varchar(20) default '' not null , 
          assignee_state varchar(10) default '' not null, 
          primary key (pn) 

          posted on 2014-05-23 16:02 void 閱讀(573) 評論(0)  編輯  收藏 所屬分類: Oracle


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 曲周县| 苏尼特左旗| 融水| 莱州市| 宜春市| 永年县| 长泰县| 呈贡县| 芷江| 霸州市| 天台县| 利津县| 滁州市| 枣庄市| 壶关县| 大名县| 石阡县| 通海县| 宁阳县| 东山县| 彭水| 菏泽市| 辽源市| 新龙县| 安吉县| 达日县| 齐齐哈尔市| 博湖县| 巢湖市| 绥阳县| 延寿县| 信丰县| 遂溪县| 广南县| 黑山县| 海伦市| 锡林郭勒盟| 塔河县| 鸡东县| 永清县| 特克斯县|