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


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


          網站導航:
           
          主站蜘蛛池模板: 江陵县| 迁安市| 辽阳市| 晋江市| 浑源县| 琼海市| 南开区| 永修县| 阿图什市| 固安县| 翁牛特旗| 天台县| 怀远县| 寿阳县| 安多县| 宜川县| 云林县| 保山市| 南丰县| 嘉定区| 嘉峪关市| 潞西市| 清新县| 枣强县| 新津县| 定兴县| 察隅县| 依兰县| 甘泉县| 怀来县| 洛阳市| 金堂县| 苏尼特右旗| 石林| 铅山县| 南昌市| 太康县| 漯河市| 宁乡县| 茂名市| 南阳市|