Database 11g

Tuesday, October 20, 2015

ADDING DATAFILE IN RAC



Hi Guys Adding Datafile in Cluster Enviorment and ASM is very simple we have to just mention the Diskgroup Name.


> We are adding datafile in SYSAUX tablespace.

> First check in the diskgroup how much free space is available to add datafile.

> You can see in this output we have 3 diskgroups with total size and free size.

SQL> SELECT name, free_mb, total_mb, free_mb/total_mb*100 as percentage FROM v$asm_diskgroup;

NAME            FREE_MB     TOTAL_MB      PERCENTAGE
---------- ------------ ------------ ------------------------------
DATA                 380,349      511,994              74.2877846
OCRVOTE         102,002      102,397             99.6142465
RECO                 495,530       511,997              96.7837702

> Now find out that diskgroup name which is mapped to SYSAUX tablesapce for adding datafile.


SQL> select tablespace_name,file_name from dba_data_files where tablespace_name='SYSAUX';

TABLESPACE                                FILE_NAME
---------- --------------------------------------------------------------------------
SYSAUX     +DATA/ieclive/datafile/sysaux.264.860628911

> DATA diskgroup is mapped to the sysaux tablespace now Add the datafile in DATA diskgroup.

SQL> alter tablespace SYSAUX add datafile'+DATA' size 5G autoextend on next 1024M;

     Database altered.


> Now Check the datafile is added for Sysaux Tablespace with 5gb size. previous we have only one sysaux.


SQL> select tablespace_name,file_name,bytes/1024/1024/1024 from dba_data_files;

TABLESPACE             FILE_NAME                                     BYTES/1024/1024/1024
---------- --------------------------------------------- --------------------------------------------
SYSTEM              +DATA/ieclive/datafile/system.258.860628911                         5
SYSAUX              +DATA/ieclive/datafile/sysaux.264.860628911                          5
UNDOTBS1    +DATA/ieclive/datafile/undotbs1.262.860628913                          5
SYSAUX                +DATA/ieclive/datafile/sysaux.266.860728913                        5
UNDOTBS2 +DATA/ieclive/datafile/undotbs2.269.860629051                           5
USERS                +DATA/ieclive/datafile/users.256.860630027                           10
USERS               +DATA/ieclive/datafile/users.274.860630073                            10


7 rows selected


Happy Learning...











5 comments:

  1. Only the name of the Disk Group is specified in adding files. How is the "../ieclive/datafile" path was determined? Is there a configuration somewhere that specified the path?

    ReplyDelete
    Replies
    1. Hi Romeo,

      You have to mentioned Tablespace name,Diskgroup name and file size rest of the file name is managed by Oracle.

      Regard's...

      Delete
  2. what if disk-group itself is not having free space..? will it add datafile for tablespaces..??

    ReplyDelete
  3. Hi Kundan,
    You can create NEW diskgroup using ASMCA utility or manually by using "Create diskgroup command.

    Regard's.

    ReplyDelete