oracle脚本的构建,oracle建数据库文件脚本及建用户授权等

下面的数据库文件路径可根据实际情况改变。如E:\Oracle\oradata\smart\smartdata.dbf数据库安装目录可改为D:\Oracle\oradata\smart\smartdata.dbf.

在UNIX环境下,路径应使用UNIX形式。如:

D:\oracle\oradata\smart\smartdata.dbf

运行SQL PLUS或SQLPlus Worksheet,以system/manager登录。

1、 建立表空间SMARTDATA。命令:

create tablespace SMARTDATA

datafile 'D:\oracle\oradata\smart\smartdata.dbf' size 10M reuse

autoextend on

default storage (initial 128K next 128K maxextents UNLIMITED  pctincrease 0)

MINIMUM EXTENT 128K;

2、 建立表空间SMARTINDEX。命令:

create tablespace SMARTINDEX

datafile 'D:\oracle\oradata\smart\smartindex.dbf' size 10M reuse

autoextend on

default storage (initial 128K next 128K maxextents UNLIMITED  pctincrease 0)

MINIMUM EXTENT 128K;

3、 建立表空间SMARTDATA_HISTORY。命令:

create tablespace SMARTDATA_HISTORY

datafile 'D:\oracle\oradata\smart\smartdata_history.dbf' size 10M reuse

autoextend on

default storage (initial 256K next 256K maxextents UNLIMITED  pctincrease 0)

MINIMUM EXTENT 256K;

4、 建立表空间SMARTINDEX_HISTORY。命令:

create tablespace SMARTINDEX_HISTORY

datafile 'D:\oracle\oradata\smart\smartindex_history.dbf' size 10M reuse

autoextend on

default storage (initial 256K next 256K maxextents UNLIMITED  pctincrease 0)

MINIMUM EXTENT 256K;

5、 建立表空间SMART_TEMP。命令:

create tablespace SMART_TEMP

datafile 'D:\oracle\oradata\smart\smart_temp.dbf' size 10M reuse

autoextend on

default storage (initial 128K next 128K maxextents UNLIMITED  pctincrease 0)

MINIMUM EXTENT 128K;

2.4.2 建立ORACLE用户

运行SQL PLUS或SQLPlus Worksheet,以system/manager登录。

1、建立ORACLE用户和密码:lytu/lytu。命令:

-- Create the user

create user SQMINTEGRATE  identified by SQMINTEGRATE

default tablespace SQM_INTEGRATE

temporary tablespace TEMPSQM

profile DEFAULT;

-- Grant/Revoke role privileges

grant connect to SQMINTEGRATE;

grant dba to SQMINTEGRATE;

grant resource to SQMINTEGRATE;

-- Grant/Revoke system privileges

grant create table to SQMINTEGRATE;

grant delete any table to SQMINTEGRATE;

grant select any table to SQMINTEGRATE;

grant unlimited tablespace to SQMINTEGRATE;

2、修改用户的缺省表空间和临时表空间。命令:

alter user smart default tablespace smartdata temporary tablespace temp;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值