Wednesday, October 29, 2014

How to add a Datafile into the ADG Environment in new mount Point

Steps to add datafile in primary database at different mount point

1. Create Directory in primary and standby database.
2. Check the db_file_name_convert parameter in standby database (show parameter db_file_name_convert).

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_file_name_convert                 string      /u01/app/oracle/oradata/prim/,
                                                  /u01/app/oracle/oradata/stan/
                                               

3. Cancel the Replication in standby using the following command.
alter database recover managed standby database cancel;

4. Change the db_file_name_convert parameter value according to the created new directory

alter system set db_file_name_convert='/u01/app/oracle/oradata/prim/','/u01/app/oracle/oradata/stan/', '/u01/datafs/prim/','/u01/datafs/stan2/'  scope =spfile;

5. Shutdown the standby database.
6. startup the database in mount state.

7. Check the db_file_name_convert parameter in standby database (show parameter db_file_name_convert).

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_file_name_convert                 string      /u01/app/oracle/oradata/prim/,
                                                  /u01/app/oracle/oradata/stan/
                                                 , /u01/datafs/prim/, /u01/data
                                                 fs/stan2/

8. Start the Replication process using the following command.

alter database recover managed standby database disconnect from session;
or
alter database recover managed standby database using current logfile disconnect;

9. add the datafile using following query.
alter tablespace users add datafile '/u01/datafs/prim/users.dbf' size 1G autoextend on next 100K maxsize 2G;

10.  Check the Replication status using the following query.

select sequence#, applied from v$archived_log order by sequence#;