How to add datafile in Oracle tablespace

Adding of datafile in Oracle Tablespace


 desc dba_data_files;

 Name                                      Null?    Type

 ----------------------------------------- -------- ----------------------------

 FILE_NAME                                          VARCHAR2(513)

 FILE_ID                                            NUMBER

 TABLESPACE_NAME                                    VARCHAR2(30)

 BYTES                                              NUMBER

 BLOCKS                                             NUMBER

 STATUS                                             VARCHAR2(9)

 RELATIVE_FNO                                       NUMBER

 AUTOEXTENSIBLE                                     VARCHAR2(3)

 MAXBYTES                                           NUMBER

 MAXBLOCKS                                          NUMBER

 INCREMENT_BY                                       NUMBER

 USER_BYTES                                         NUMBER

 USER_BLOCKS                                        NUMBER

 ONLINE_STATUS                                      VARCHAR2(7)


select file_name from dba_data_files where tablespace_name='&1';


you will get datafile present in database related to tablespace provided.

Need to create new one after that -


alter tablespace tablespace_name add datafile 'Datafile location' size 1G autoextend on next 500M maxsize 8G;

size, next and maxsize you can provide by yourself as per your requirement.



Comments