oracle 如何创建包含多个数据文件的表空间?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8496152/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 03:46:45  来源:igfitidea点击:

How to create a tablespace with multiple datafiles?

oracle

提问by Lisa

I'm using the following script to create a new tablespace with three datafile with 4 MB size for each.

我正在使用以下脚本创建一个新表空间,其中包含三个数据文件,每个文件大小为 4 MB。

create tablespace homeworkts 
       datafile 'D:\oradata\orcl\df1.dbf' size 4m , 
       datafile 'D:\oradata\orcl\df2.dbf' size 4m,
       datafile 'D:\oradata\orcl\df3.dbf' size 4m;

But it keeps giving me the error

但它不断给我错误

invalid file name

无效的文件名

for the second datafile.

对于第二个数据文件。

Why?

为什么?

回答by dani herrera

Reading create tablespace syntaxyou should write:

阅读您应该编写的创建表空间语法

create tablespace homeworkts 
datafile 'D:\oradata\orcl\df1.dbf' size 4m, 
         'D:\oradata\orcl\df2.dbf' size 4m, 
         'D:\oradata\orcl\df3.dbf' size 4m;

You should write datafilejust for once, then all your file specification separated by commas:

您应该datafile只写一次,然后用逗号分隔所有文件规范:

enter image description here

在此处输入图片说明

Edited on 2018'Still valid for current create tablespace on release 18 oracle version.

于 2018 年编辑'仍然适用于版本 18 oracle 版本的当前创建表空间

回答by Lisa

It should be like this

应该是这样的

 create tablespace homeworkts datafile 'D:\oradata\orcl\df1.dbf' size 4m, 

'D:\oradata\orcl\df2.dbf' size 4m,

'D:\oradata\orcl\df3.dbf' size 4m;

回答by swagat

create tablespace userdata 
       datafile 'E:\oradata\orcl\df1.dbf' size 100M, 
                'E:\oradata\orcl\df2.dbf' size 200M,
                'E:\oradata\orcl\df3.dbf' size 300M; 

回答by Kedron

CREATE TABLESPACE maximo_data NOLOGGING
DATAFILE 'D:\oracle\product.2.0\oradata\maximo\maximo_data_0.ora' SIZE 16G,
         'D:\oracle\product.2.0\oradata\maximo\maximo_data_1.ora' SIZE 16G
autoextend off
extent management local;