Tuesday, June 2, 2015

Oracle Solution Part 2

1:57 AM Posted by Unknown No comments

Do you wanna move your oracle datafile to a new location but donno how !? relax i'm gonna explain it .

first of all you need to check where is your "CURRENT" datafile , do as the following :
  • sqlplus / as sysdba 

         SQL*Plus: Release 11.2.0.4.0 Production on Sat Mar 14 16:33:22 2015
         Copyright (c) 1982, 2013, Oracle. All rights reserved.
         Connected to:
         Oracle Database 11g Release 11.2.0.4.0 - 64bit Production
  • SQL> select name from v$datafile;

         the out put should be similar to the below :
         NAME
         --------------------------------------------------------------------------------
         /oradata/system01.dbf
         /oradata/sysaux01.dbf
         /oradata/undotbs01.dbf
         /oradata/users01.dbf
now that we know where our current datafile is we can change in the new place we want by do the following :
    alter database rename file '/oradadata/system01.dbf' to '/new/oradata/path/system01.dbf';
    alter database rename file '/oradadata/sysaux01.dbf' to '/new/oradata/path/sysaux01.dbf';
do it for the rest of the file if you have more than that.
now when you try to open up your database you may get the error related to the "redo logs", worry not the concept its just as the same as datafile. you will find your current redo log by below query:
  • SQL> select member from v$logfile;

         MEMBER
         --------------------------------------------------------------------------------
         /oradata/redo02.log
         /oradata/redo01.log
now you can rename it ,
alter database rename file '/oradata/redo02.log' to '/new/oradata/path/redo02.log';

alter database rename file '/oradata/redo01.log' to '/new/oradata/path/redo01.log' ; 

0 comments:

Post a Comment