Tuesday, June 28, 2011

Adding a datafile to a tablespace on ASM

I  had created a database using the ASM diskgroup +DATA for the Oracle datafiles. Next, I wanted to add another datafile to the USERS tablespace.

The commands below show how I went about it.



SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
+DATA/testasm/datafile/system.256.755000669
+DATA/testasm/datafile/sysaux.257.755000671
+DATA/testasm/datafile/undotbs1.258.755000671
+DATA/testasm/datafile/users.259.755000671

SQL> alter tablespace users add datafile '+DATA/testasm/datafile/users.260.755000671' size 4M;
alter tablespace users add datafile '+DATA/testasm/datafile/users.260.755000671' size 4M
*
ERROR at line 1:
ORA-01276: Cannot add file +DATA/testasm/datafile/users.260.755000671.  File
has an Oracle Managed Files file name.


SQL> alter tablespace users add datafile '+DATA' size 100M;

Tablespace altered.


SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
+DATA/testasm/datafile/system.256.755000669
+DATA/testasm/datafile/sysaux.257.755000671
+DATA/testasm/datafile/undotbs1.258.755000671
+DATA/testasm/datafile/users.259.755000671
+DATA/testasm/datafile/users.266.755002021

SQL>

1 comment:

Anonymous said...

Thanks very much. Your post helped.