I'm using the following script to create a new tablespace with three datafile with 4 MB size for each.
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?
A bigfile tablespace contains only one datafile or tempfile, which can contain up to approximately 4 billion ( 232 ) blocks. The maximum size of the single datafile or tempfile is 128 terabytes (TB) for a tablespace with 32K blocks and 32TB for a tablespace with 8K blocks.
A tablespace in an Oracle database consists of one or more physical datafiles. A datafile can be associated with only one tablespace and only one database. Oracle creates a datafile for a tablespace by allocating the specified amount of disk space plus the overhead required for the file header.
A tablespace belongs to only one database and has at least one datafile that is used to store data for the associated tablespace. We can also define tablespaces as logical storage units made up of one or more datafiles. One tablespace can have up to 1022 datafiles.
To add datafiles to a tablespace, use either the Add Datafile dialog box of Enterprise Manager/GUI, or the SQL command ALTER TABLESPACE. You must have the ALTER TABLESPACE system privilege to add datafiles to a tablespace.
Reading create tablespace syntax you 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 datafile
just for once, then all your file specification separated by commas:
Edited on 2018' Still valid for current create tablespace on release 18 oracle version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With