Useful Oracle Commands

Contents

Datafiles

Extending an ASM Datafile

The following example shows how to extend a datafile to the APP_DATA tablespace in the +DATA ASM group.

1. Identify the datafiles for the tablespace you want to increase.

SQL> select file_name,bytes/1024/1024 mb
aaaaaafrom dba_data_files
aaaaaawhere tablespace_name = 'APP_DATA'
aaaaaaorder by file_name;

FILE_NAMEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaMB
------------------------------------------------------------ -------
+DATA/SID/datafile/app_data.259.669898683aaaaaaaaaaaaaaaa20000
+DATA/SID/datafile/app_data.267.636216519aaaaaaaaaaaaaaaa28100

2. Extened the Datafile

SQL> alter database datafile '+DATA/SID/datafile/app_data.259.669898683' resize 30000m;

Tablespace altered.


Adding an ASM Datafile

The following example shows how to add a datafile to the APP_DATA tablespace in the +DATA ASM group.

1. Find out where the current datafiles are defined. In this example the ASM group is +STORE1.

SQL> select file_name,bytes/1024/1024 mb
aaaaaafrom dba_data_files
aaaaaawhere tablespace_name = 'APP_DATA'
aaaaaaorder by file_name;

2. Add the datafile.

SQL> alter tablespace APP_DATA add datafile '+DATA' size 20000m;

Tablespace altered.


Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License