SlideShare a Scribd company logo
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

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)
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
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
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 '...........'
:
:
;
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.
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;
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.
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

More Related Content

PDF
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
PPTX
HTTP/2 and SAP Fiori
DOCX
Database firewall policies copy
PPT
PDF
Oracle MAA (Maximum Availability Architecture) 18c - An Overview
PPTX
Understand oracle real application cluster
PDF
Make Your Application “Oracle RAC Ready” & Test For It
PDF
A deep dive about VIP,HAIP, and SCAN
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
HTTP/2 and SAP Fiori
Database firewall policies copy
Oracle MAA (Maximum Availability Architecture) 18c - An Overview
Understand oracle real application cluster
Make Your Application “Oracle RAC Ready” & Test For It
A deep dive about VIP,HAIP, and SCAN

What's hot (20)

PDF
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
PDF
MySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdf
PDF
Oracle Database – Mission Critical
PDF
Practical Medium Data Analytics with Python (10 Things I Hate About pandas, P...
PDF
The Oracle RAC Family of Solutions - Presentation
PPTX
Oracle Database: Checklist Connection Issues
PPTX
Oracle Management Cloud, OMC architecture
PDF
Oracle Clusterware Node Management and Voting Disks
PDF
WebRTC with Java
PDF
Oracle RAC 12c Overview
PDF
Oracle E-Business Suite R12.2.5 on Database 12c: Install, Patch and Administer
PDF
Exadata master series_asm_2020
PPT
BIG IP F5 GTM Presentation
PDF
Future-Proof Your Business Processes by Automating SAP S/4HANA processes with...
PDF
Understanding Oracle RAC 12c Internals OOW13 [CON8806]
PDF
6. oracle exadata security trend ecs (final)
PDF
Oracle MAA Best Practices - Applications Considerations
PPTX
Oracle DBA
PPTX
Oracle Database Performance Tuning Basics
PDF
Storage overview
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
MySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdf
Oracle Database – Mission Critical
Practical Medium Data Analytics with Python (10 Things I Hate About pandas, P...
The Oracle RAC Family of Solutions - Presentation
Oracle Database: Checklist Connection Issues
Oracle Management Cloud, OMC architecture
Oracle Clusterware Node Management and Voting Disks
WebRTC with Java
Oracle RAC 12c Overview
Oracle E-Business Suite R12.2.5 on Database 12c: Install, Patch and Administer
Exadata master series_asm_2020
BIG IP F5 GTM Presentation
Future-Proof Your Business Processes by Automating SAP S/4HANA processes with...
Understanding Oracle RAC 12c Internals OOW13 [CON8806]
6. oracle exadata security trend ecs (final)
Oracle MAA Best Practices - Applications Considerations
Oracle DBA
Oracle Database Performance Tuning Basics
Storage overview
Ad

Viewers also liked (20)

DOCX
TimesTen in memory database Creation
PDF
1247g3hg1238 2011
DOCX
Advanced installation 12c rac
PPTX
Edtc6341 63 esther_sauceda_practice_test5
DOCX
Exadata - Smart Scan Testing
DOCX
Oracle 12c far sync standby instance
DOCX
SOA Fusion Middleware installation
DOCX
12c Flex ASM: Moving to Flex ASM
DOCX
12c: Testing audit features for Data Pump (Export & Import) and RMAN jobs
DOCX
Moving 12c database from NON-ASM to ASM
DOCX
Exadata I/O Resource Manager (Exadata IORM)
DOCX
Upgrade database using cloud_control Provisioning
PDF
Oracle 12c RAC (Advanced installation - Flex ASM)
PPT
Copyright Crash Course 1st revised ppt 6340.64 Sonia Aldape
DOCX
Exadata - BULK DATA LOAD Testing on Database Machine
DOCX
Exadata Cell metrics
DOC
Migration Database from SQL SERVER 2012 to Oracle12c with Pluggable Database
DOCX
SMS notification setup using EM12c
PPT
4. java intro class
DOCX
Testing Orachk for Database Health Monitoring
TimesTen in memory database Creation
1247g3hg1238 2011
Advanced installation 12c rac
Edtc6341 63 esther_sauceda_practice_test5
Exadata - Smart Scan Testing
Oracle 12c far sync standby instance
SOA Fusion Middleware installation
12c Flex ASM: Moving to Flex ASM
12c: Testing audit features for Data Pump (Export & Import) and RMAN jobs
Moving 12c database from NON-ASM to ASM
Exadata I/O Resource Manager (Exadata IORM)
Upgrade database using cloud_control Provisioning
Oracle 12c RAC (Advanced installation - Flex ASM)
Copyright Crash Course 1st revised ppt 6340.64 Sonia Aldape
Exadata - BULK DATA LOAD Testing on Database Machine
Exadata Cell metrics
Migration Database from SQL SERVER 2012 to Oracle12c with Pluggable Database
SMS notification setup using EM12c
4. java intro class
Testing Orachk for Database Health Monitoring
Ad

Similar to 12c database migration from ASM storage to NON-ASM storage (20)

DOCX
Migrate from database file system to asm
PDF
Step by Step Restore rman to different host
DOCX
Cloning database using srdf copy
PPTX
Cloning Oracle EBS R12: A Step by Step Procedure
DOCX
Rman cloning when both directory and db name are same.
DOCX
Rman cloning when both directory and db name are same.
PPT
Les 07 rman_rec
DOC
Rman cloning guide
PDF
Createclone
PPTX
Convert single instance to RAC
PPT
Les 20 dup_db
DOCX
Backup and Restore of database on 2-Node RAC
DOC
br_test_lossof-datafile_10g.doc
PPT
Les 07 Rman Rec
PPT
Les 08 Dupe Db
PPT
15362590.ppt
PDF
Oracle 12c New Features_RMAN_slides
PPTX
Oracle dba online training in india usa canada
DOCX
DOCX
Change DB Name
Migrate from database file system to asm
Step by Step Restore rman to different host
Cloning database using srdf copy
Cloning Oracle EBS R12: A Step by Step Procedure
Rman cloning when both directory and db name are same.
Rman cloning when both directory and db name are same.
Les 07 rman_rec
Rman cloning guide
Createclone
Convert single instance to RAC
Les 20 dup_db
Backup and Restore of database on 2-Node RAC
br_test_lossof-datafile_10g.doc
Les 07 Rman Rec
Les 08 Dupe Db
15362590.ppt
Oracle 12c New Features_RMAN_slides
Oracle dba online training in india usa canada
Change DB Name

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

  • 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. 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. 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. 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. : : ; 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. 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. 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. 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