新裝 Oracle 建庫(實例)步驟
Oracle版本:11gR2
安裝好Oracle后,需要創建一個實例(也就是庫)。
安裝好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 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