centos 安装oracle 11g r2(三)—–表空间创建

创建表空间前要保证监听与数据库实例已经启动

1、启动监听

[oracle@localhost ~]lsnrctl start

LSNRCTL for Linux: Version 11.2.0.1.0 – Production on 01-DEC-2017 09:25:48

Copyright (c) 1991, 2009, Oracle. All rights reserved.

……

Listening Endpoints Summary…

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))

The listener supports no services

The command completed successfully

2、进入数据库

[oracle@localhost~] sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Fri Dec 1 09:25:51 2017

Copyright (c) 1982, 2009, Oracle. All rights reserved.

Connected to an idle instance.

3、启动数据库

SQL> startup

ORACLE instance started.

………

Database mounted.

Database opened.

4、创建名称为 NNC_DATA01 的表空间

[oracle@localhost ~]mkdir /data/database/orcl

SQL>CREATE TABLESPACE NNC_DATA01 DATAFILE ‘/data/database/orcl/nnc_data01.dbf’ SIZE 500M AUTOEXTEND ON next 50m EXTENT MANAGEMENT LOCAL UNIFORM SIZE 256K;

Tablespace created.

SQL>CREATE TABLESPACE NNC_INDEX01 DATAFILE ‘/data/database/orcl/nnc_index01.dbf’ SIZE 500M AUTOEXTEND ON next 50m EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K ;

Tablespace created.

表空间32G限制,增加表空间

SQL>alter tablespace NNC_DATA01 add datafile ‘/data/database/orcl/nnc_data02.dbf’ size 200m autoextend on next 50m MAXSIZE UNLIMITED;

SQL>alter tablespace NNC_DATA01 add datafile ‘/data/database/orcl/nnc_data03.dbf’ size 200m autoextend on next 50m MAXSIZE UNLIMITED;

SQL>alter tablespace NNC_DATA01 add datafile ‘/data/database/orcl/nnc_data04.dbf’ size 200m autoextend on next 50m MAXSIZE UNLIMITED;

SQL>alter tablespace NNC_DATA01 add datafile ‘/data/database/orcl/nnc_data05.dbf’ size 200m autoextend on next 50m MAXSIZE UNLIMITED;

SQL>alter tablespace NNC_INDEX01 add datafile ‘/data/database/orcl/nnc_index02.dbf’ size 200m autoextend on next 50m MAXSIZE UNLIMITED;

5、创建用户名/密码为 nctest /nctest 、BIREADLINK/BIREADLINK的用户

SQL> create USER nctest IDENTIFIED BY nctest DEFAULT TABLESPACE NNC_DATA01 TEMPORARY TABLESPACE temp;

SQL>CREATE USER BIREADLINK IDENTIFIED BY BIREADLINK DEFAULT TABLESPACE NNC_DATA01 TEMPORARY TABLESPACE temp;

SQL>CREATE USER HETUSER1 IDENTIFIED BY HETUSER1 DEFAULT TABLESPACE NNC_DATA01 TEMPORARY TABLESPACE temp;

User created.

6、为用户配置权限

SQL> GRANT CONNECT,RESOURCE TO nctest ;

Grant succeeded.

SQL> GRANT DBA TO nctest ;

Grant succeeded.

7、退出

SQL>exit

[oracle@localhost ~]

文章来源于互联网,如有雷同请联系站长删除:centos 安装oracle 11g r2(三)—–表空间创建

发表评论