+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Database Migration from ASM storage to ...
RMAN> alter system switch logfile;
using target database control file instead of recovery catalog
Statement processed
RMAN...
4. Change the parameters for NON ASM and create the required directories for database
*.audit_file_dest='/u01/app/oracle/a...
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=+DATA/TESTP/DATAFILE/sysaux.276.831080339...
:
:
;
SQL> alter database move datafile '&pdf' to '&ndf';
Enter value for pdf: /u01/app/oracle/oradata/TESTP/data_D-TESTP_...
SQL> select name from v$datafile;
NAME
-------------------------------------------------------------------------------/u01...
Database altered.
SQL> select member from v$logfile;
MEMBER
--------------------------------------------------------------...
SQL> startup
ORACLE instance started.
Total System Global Area 626327552 bytes
Fixed Size
2291472 bytes
Variable Size
2894...
Upcoming SlideShare
Loading in …5
×

12c database migration from ASM storage to NON-ASM storage

385 views

Published on

Oracle 12c database migration from ASM storage to NON-ASM storage

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
385
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
23
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

12c database migration from ASM storage to NON-ASM storage

  1. 1. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Database Migration from ASM storage to non-ASM storage +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1. Check the current status and all the files (datafiles, controlfiles, logfiles) information. SQL> select parallel from v$instance; PAR --NO SQL> select value from v$parameter where name='cluster_database'; VALUE -------------------------------------------------------------------------------FALSE SQL> select name from v$datafile; NAME -------------------------------------------------------------------------------+DATA/TESTP/DATAFILE/system.278.831080263 +DATA/TESTP/DATAFILE/example.275.831080435 +DATA/TESTP/DATAFILE/sysaux.276.831080339 +DATA/TESTP/DATAFILE/undotbs1.273.831080481 +DATA/TESTP/DATAFILE/users.272.831080511 SQL> select name from v$controlfile; NAME -------------------------------------------------------------------------------+DATA/TESTP/controlfile/testp.ctl SQL> select member from v$logfile; MEMBER -------------------------------------------------------------------------------+FRA/TESTP/ONLINELOG/group_4.290.831082085 +FRA/TESTP/ONLINELOG/group_5.291.831082137 +FRA/TESTP/ONLINELOG/group_6.292.831082151 SQL> select name from v$tempfile; NAME -------------------------------------------------------------------------------+DATA/TESTP/TEMPFILE/temp_01.dbf 2. TAKE A BACKUP of current ASM database (Make sure Controlfile backup is on) [oracle@rac1 ~]$ rman target / Recovery Manager: Release 12.1.0.1.0 - Production on Sun Nov 10 08:47:14 2013 Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved. connected to target database: TESTP (DBID=1042033562)
  2. 2. RMAN> alter system switch logfile; using target database control file instead of recovery catalog Statement processed RMAN> alter system switch logfile; Statement processed RMAN> run { configure channel device type disk format '/u01/app/oracle/BKP/%U'; backup database plus archivelog; } 2> 3> 4> old RMAN configuration parameters: CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/u01/app/oracle/BKP/%U'; new RMAN configuration parameters: CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/u01/app/oracle/BKP/%U'; new RMAN configuration parameters are successfully stored Starting backup at 10-NOV-13 current log archived allocated channel: ORA_DISK_1 : : Finished backup at 10-NOV-13 Starting backup at 10-NOV-13 : : piece handle=/u01/app/oracle/BKP/0gooji8d_1_1 tag=TAG20131110T084756 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03 Finished backup at 10-NOV-13 3. Change parameter and Create pfile for NON ASM database RMAN> alter system set db_file_name_convert=' +DATA/TESTP/DATAFILE/',' /u01/app/oracle/oradata/TESTP' scope=spfile; using target database control file instead of recovery catalog Statement processed RMAN> alter system set log_file_name_convert=' +FRA/TESTP/ONLINELOG/',' /u01/app/oracle/oradata/TESTP' scope=spfile; Statement processed RMAN> select value from v$parameter where name='spfile'; VALUE -------------------------------------------------------------------------------+DATA/TESTP/spfile RMAN> create pfile from spfile; Statement processed
  3. 3. 4. Change the parameters for NON ASM and create the required directories for database *.audit_file_dest='/u01/app/oracle/admin/TESTP/adump' *.core_dump_dest='/u01/app/oracle/admin/TESTP/cdump' *.audit_trail='db' *.compatible='12.1.0.0.0' *.control_files='/u01/app/oracle/oradata/TESTP/testp.ctl'#Restore Controlfile 5. Startup database at nomount RMAN> shutdown immediate; database closed database dismounted Oracle instance shut down RMAN> startup nomount pfile='/u01/app/oracle/product/12.1.0/dbhome_1/dbs/initTESTP.ora'; connected to target database (not started) Oracle instance started Total System Global Area Fixed Size Variable Size Database Buffers Redo Buffers 626327552 bytes 2291472 bytes 289409264 bytes 331350016 bytes 3276800 bytes 6. Mount database RMAN> restore controlfile from '+DATA/TESTP/controlfile/testp.ctl'; Starting restore at 10-NOV-13 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=26 device type=DISK channel ORA_DISK_1: copied control file copy output file name=/u01/app/oracle/oradata/TESTP/control01.ctl Finished restore at 10-NOV-13 RMAN> alter database mount; Statement processed released channel: ORA_DISK_1 7. Open database RMAN> backup as copy database format '/u01/app/oracle/oradata/TESTP/%U'; Starting backup at 10-NOV-13 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=34 device type=DISK channel ORA_DISK_1: starting datafile copy input datafile file number=00001 name=+DATA/TESTP/DATAFILE/system.278.831080263 output file name=/u01/app/oracle/oradata/TESTP/data_D-TESTP_I-1042033562_TS-SYSTEM_FNO-1_0qoojnah tag=TAG20131110T101753 RECID=12 STAMP=831118738 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:15
  4. 4. channel ORA_DISK_1: starting datafile copy input datafile file number=00003 name=+DATA/TESTP/DATAFILE/sysaux.276.831080339 output file name=/u01/app/oracle/oradata/TESTP/data_D-TESTP_I-1042033562_TS-SYSAUX_FNO-3_0roojncs tag=TAG20131110T101753 RECID=13 STAMP=831118822 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:16 channel ORA_DISK_1: starting datafile copy input datafile file number=00002 name=+DATA/TESTP/DATAFILE/example.275.831080435 output file name=/u01/app/oracle/oradata/TESTP/data_D-TESTP_I-1042033562_TS-EXAMPLE_FNO-2_0soojnf8 tag=TAG20131110T101753 RECID=14 STAMP=831118858 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35 channel ORA_DISK_1: starting datafile copy input datafile file number=00004 name=+DATA/TESTP/DATAFILE/undotbs1.273.831080481 output file name=/u01/app/oracle/oradata/TESTP/data_D-TESTP_I-1042033562_TS-UNDOTBS1_FNO4_0toojngb tag=TAG20131110T101753 RECID=15 STAMP=831118876 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25 channel ORA_DISK_1: starting datafile copy input datafile file number=00006 name=+DATA/TESTP/DATAFILE/users.272.831080511 output file name=/u01/app/oracle/oradata/TESTP/data_D-TESTP_I-1042033562_TS-USERS_FNO-6_0uoojnh4 tag=TAG20131110T101753 RECID=16 STAMP=831118885 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01 Finished backup at 10-NOV-13 Starting Control File Autobackup at 10-NOV-13 piece handle=/u01/app/oracle/oradata/TESTP/FRA/TESTP/autobackup/2013_11_10/o1_mf_n_831117950_97xnd8l0_.bk p comment=NONE Finished Control File Autobackup at 10-NOV-13 RMAN> alter database open; Statement processed RMAN> select name from v$datafile; NAME -------------------------------------------------------------------------------/u01/app/oracle/oradata/TESTP/data_D-TESTP_I-1042033562_TS-SYSTEM_FNO-1_0qoojnah /u01/app/oracle/oradata/TESTP/data_D-TESTP_I-1042033562_TS-EXAMPLE_FNO-2_0soojnf8 /u01/app/oracle/oradata/TESTP/data_D-TESTP_I-1042033562_TS-SYSAUX_FNO-3_0roojncs /u01/app/oracle/oradata/TESTP/data_D-TESTP_I-1042033562_TS-UNDOTBS1_FNO-4_0toojngb /u01/app/oracle/oradata/TESTP/data_D-TESTP_I-1042033562_TS-USERS_FNO-6_0uoojnh4 So datafiles have been moved to ASM to NON-ASM database. Rename Datafiles ============== NOTE: I am not using set newname as I am going to use 12c "move" command Connect target / Run { allocate channel tape1 device type sbt; set newname for datafile 1 to '/../system_01.dbf' ; set newname for datafile 2 to '............' ......... set newname for datafile 4 to '...........'
  5. 5. : : ; SQL> alter database move datafile '&pdf' to '&ndf'; Enter value for pdf: /u01/app/oracle/oradata/TESTP/data_D-TESTP_I-1042033562_TS-SYSTEM_FNO1_0qoojnah Enter value for ndf: /u01/app/oracle/oradata/TESTP/system01.dbf old 1: alter database move datafile '&pdf' to '&ndf' new 1: alter database move datafile '/u01/app/oracle/oradata/TESTP/data_D-TESTP_I-1042033562_TSSYSTEM_FNO-1_0qoojnah' to '/u01/app/oracle/oradata/TESTP/system01.dbf' Database altered. SQL> / Enter value for pdf: /u01/app/oracle/oradata/TESTP/data_D-TESTP_I-1042033562_TS-EXAMPLE_FNO2_0soojnf8 Enter value for ndf: /u01/app/oracle/oradata/TESTP/example01.dbf old 1: alter database move datafile '&pdf' to '&ndf' new 1: alter database move datafile '/u01/app/oracle/oradata/TESTP/data_D-TESTP_I-1042033562_TSEXAMPLE_FNO-2_0soojnf8' to '/u01/app/oracle/oradata/TESTP/example01.dbf' Database altered. SQL> / Enter value for pdf: /u01/app/oracle/oradata/TESTP/data_D-TESTP_I-1042033562_TS-SYSAUX_FNO-3_0roojncs Enter value for ndf: /u01/app/oracle/oradata/TESTP/sysaux01.dbf old 1: alter database move datafile '&pdf' to '&ndf' new 1: alter database move datafile '/u01/app/oracle/oradata/TESTP/data_D-TESTP_I-1042033562_TSSYSAUX_FNO-3_0roojncs' to '/u01/app/oracle/oradata/TESTP/sysaux01.dbf' Database altered. SQL> / Enter value for pdf: /u01/app/oracle/oradata/TESTP/data_D-TESTP_I-1042033562_TS-UNDOTBS1_FNO4_0toojngb Enter value for ndf: /u01/app/oracle/oradata/TESTP/undotbs01.dbf old 1: alter database move datafile '&pdf' to '&ndf' new 1: alter database move datafile '/u01/app/oracle/oradata/TESTP/data_D-TESTP_I-1042033562_TSUNDOTBS1_FNO-4_0toojngb' to '/u01/app/oracle/oradata/TESTP/undotbs01.dbf' Database altered. SQL> / Enter value for pdf: /u01/app/oracle/oradata/TESTP/data_D-TESTP_I-1042033562_TS-USERS_FNO-6_0uoojnh4 Enter value for ndf: /u01/app/oracle/oradata/TESTP/user01.dbf old 1: alter database move datafile '&pdf' to '&ndf' new 1: alter database move datafile '/u01/app/oracle/oradata/TESTP/data_D-TESTP_I-1042033562_TSUSERS_FNO-6_0uoojnh4' to '/u01/app/oracle/oradata/TESTP/user01.dbf' Database altered.
  6. 6. SQL> select name from v$datafile; NAME -------------------------------------------------------------------------------/u01/app/oracle/oradata/TESTP/system01.dbf /u01/app/oracle/oradata/TESTP/example01.dbf /u01/app/oracle/oradata/TESTP/sysaux01.dbf /u01/app/oracle/oradata/TESTP/undotbs01.dbf /u01/app/oracle/oradata/TESTP/user01.dbf Redo Log Migration ================ SQL> alter database add logfile '/u01/app/oracle/oradata/TESTP/redo01.log' size 50M reuse; Database altered. SQL> alter database add logfile '/u01/app/oracle/oradata/TESTP/redo02.log' size 50M reuse; Database altered. SQL> alter database add logfile '/u01/app/oracle/oradata/TESTP/redo03.log' size 50M reuse; Database altered. SQL> alter database drop logfile group 4; alter database drop logfile group 4 * ERROR at line 1: ORA-01623: log 4 is current log for instance TESTP (thread 1) - cannot drop ORA-00312: online log 4 thread 1: '+FRA/TESTP/ONLINELOG/group_4.290.831082085' SQL> c/4/5 1* alter database drop logfile group 5 SQL> / Database altered. SQL> c/5/6 1* alter database drop logfile group 6 SQL> / Database altered. SQL> alter system checkpoint; System altered. SQL> alter system switch logfile; System altered. SQL> / System altered. SQL> alter database drop logfile group 4;
  7. 7. Database altered. SQL> select member from v$logfile; MEMBER -------------------------------------------------------------------------------/u01/app/oracle/oradata/TESTP/redo03.log /u01/app/oracle/oradata/TESTP/redo02.log /u01/app/oracle/oradata/TESTP/redo01.log SQL> select name from v$controlfile; NAME -------------------------------------------------------------------------------/u01/app/oracle/oradata/TESTP/control01.ctl TEMPFILE MIGRATION ===================== SQL> select name from v$tempfile; NAME -------------------------------------------------------------------------------+DATA/TESTP/TEMPFILE/temp_01.dbf SQL> alter tablespace temp add tempfile '/u01/app/oracle/oradata/TESTP/temp01.dbf' size 50M reuse; Tablespace altered. SQL> alter database tempfile '+DATA/TESTP/TEMPFILE/temp_01.dbf' drop; Database altered. SQL> select name from v$tempfile; NAME -------------------------------------------------------------------------------/u01/app/oracle/oradata/TESTP/temp01.dbf Check SPFILE (If ASM filesystem then move to NON ASM) -----------------------------------------------------SQL> show parameter spfile; NAME TYPE VALUE ------------------------------------ ----------- -----------------------------spfile string SQL> create spfile from pfile; File created. SQL> shut immediate; Database closed. Database dismounted. ORACLE instance shut down.
  8. 8. SQL> startup ORACLE instance started. Total System Global Area 626327552 bytes Fixed Size 2291472 bytes Variable Size 289409264 bytes Database Buffers 331350016 bytes Redo Buffers 3276800 bytes Database mounted. Database opened. SQL> show parameter spfile NAME TYPE VALUE ------------------------------------ ----------- -----------------------------spfile string /u01/app/oracle/product/12.1.0 /dbhome_1/dbs/spfileTESTP.ora

×