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 阅读(551) 评论(0)  编辑  收藏 所属分类: Oracle


只有注册用户登录后才能发表评论。


网站导航: