SlideShare a Scribd company logo
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Moving 12c database from non-asm storage to asm storage
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1. Check the current files (data, control, logs and temp)
================================================
RMAN> connect target
connected to target database: TESTP (DBID=1042086153)
RMAN> select name from v$datafile;
using target database control file instead of recovery catalog
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/users01.dbf
RMAN> 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
RMAN> select name from v$controlfile;
NAME
-------------------------------------------------------------------------------/u01/app/oracle/oradata/TESTP/control01.ctl
/u01/app/oracle/oradata/TESTP/control02.ctl
RMAN> select name from v$tempfile;
NAME
-------------------------------------------------------------------------------/u01/app/oracle/oradata/TESTP/temp01.dbf
RMAN> show parameter pfile
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "parameter": expecting one of: "all, archivelog, auxiliary, auxname, backup,
channel, compression, controlfile, datafile, db_unique_name, default, device, encryption, exclude, maxsetsize,
retention, snapshot, "
RMAN-01007: at line 1 column 6 file: standard input
RMAN> select value from v$parameter where name='spfile';
VALUE
-------------------------------------------------------------------------------/u01/app/oracle/product/12.1.0/dbhome_1/dbs/spfileTESTP.ora

2. Create the required directories for ASM database
===========================================
From Other Session,
ASMCMD> pwd
+DATA/TESTP
ASMCMD> mkdir DATAFILE CONROLFILE TEMPFILE PARAMETERFILE ONLINELOG
ASMCMD> ls -l
Type Redund Striped Time
Sys Name
N CONROLFILE/
N DATAFILE/
N ONLINELOG/
N PARAMETERFILE/
N TEMPFILE/
3. Configure FRA
================
RMAN> select value from v$parameter where name='spfile';
VALUE
-------------------------------------------------------------------------------/u01/app/oracle/product/12.1.0/dbhome_1/dbs/spfileTESTP.ora
RMAN> create pfile from spfile;
Statement processed
RMAN> alter system set db_recovery_file_dest_size = 1G;
Statement processed
RMAN> alter system set db_recovery_file_dest = '+FRA';
Statement processed
RMAN> alter system set control_files='+DATA/control01.ctl' scope=spfile;
Statement processed
4. Moving files (data and control) from NON ASM to ASM storage.
=========================================================
RMAN> shutdown immediate;
Oracle instance shut down
RMAN> startup nomount;
connected to target database (not started)
Oracle instance started
Total System Global Area
Fixed Size
Variable Size
Database Buffers
Redo Buffers

551165952 bytes

2290608 bytes
289410128 bytes
255852544 bytes
3612672 bytes
RMAN> restore controlfile from '/u01/app/oracle/oradata/TESTP/control01.ctl';
Starting restore at 10-NOV-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=33 device type=DISK
channel ORA_DISK_1: copied control file copy
output file name=+DATA/control01.ctl
Finished restore at 10-NOV-13
RMAN> alter database mount;
Statement processed
released channel: ORA_DISK_1
RMAN> backup as copy database format '+DATA';
Starting backup at 10-NOV-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=33 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u01/app/oracle/oradata/TESTP/system01.dbf
output file name=+DATA/TESTP/DATAFILE/system.272.831128883 tag=TAG20131110T130802 RECID=1
STAMP=831128951
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=/u01/app/oracle/oradata/TESTP/sysaux01.dbf
output file name=+DATA/TESTP/DATAFILE/sysaux.273.831128959 tag=TAG20131110T130802 RECID=2
STAMP=831129026
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/u01/app/oracle/oradata/TESTP/example01.dbf
output file name=+DATA/TESTP/DATAFILE/example.275.831129033 tag=TAG20131110T130802 RECID=3
STAMP=831129061
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=/u01/app/oracle/oradata/TESTP/undotbs01.dbf
output file name=+DATA/TESTP/DATAFILE/undotbs1.276.831129069 tag=TAG20131110T130802 RECID=4
STAMP=831129081
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=+DATA/TESTP/CONTROLFILE/backup.278.831129085 tag=TAG20131110T130802 RECID=5
STAMP=831129090
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00006 name=/u01/app/oracle/oradata/TESTP/users01.dbf
output file name=+DATA/TESTP/DATAFILE/users.267.831129091 tag=TAG20131110T130802 RECID=6
STAMP=831129092
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 10-NOV-13
channel ORA_DISK_1: finished piece 1 at 10-NOV-13
piece handle=+DATA/TESTP/BACKUPSET/2013_11_10/nnsnf0_tag20131110t130802_0.268.831129093
tag=TAG20131110T130802 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 10-NOV-13
RMAN> switch database to copy;
datafile 1 switched to datafile copy "+DATA/TESTP/DATAFILE/system.272.831128883"
datafile 2 switched to datafile copy "+DATA/TESTP/DATAFILE/example.275.831129033"
datafile 3 switched to datafile copy "+DATA/TESTP/DATAFILE/sysaux.273.831128959"
datafile 4 switched to datafile copy "+DATA/TESTP/DATAFILE/undotbs1.276.831129069"
datafile 6 switched to datafile copy "+DATA/TESTP/DATAFILE/users.267.831129091"
Open the database
----------------------RMAN> alter database open;
Statement processed
RMAN> select name from v$datafile;
NAME
-------------------------------------------------------------------------------+DATA/TESTP/DATAFILE/system.272.831128883
+DATA/TESTP/DATAFILE/example.275.831129033
+DATA/TESTP/DATAFILE/sysaux.273.831128959
+DATA/TESTP/DATAFILE/undotbs1.276.831129069
+DATA/TESTP/DATAFILE/users.267.831129091
RMAN> select name from v$controlfile;
NAME
-------------------------------------------------------------------------------+DATA/control01.ctl
5. MOVE redologs to ASM storage
===========================
RMAN> select member,group# from v$logfile;
MEMBER
GROUP#
--------------------------------------------------------------------------------------/u01/app/oracle/oradata/TESTP/redo03.log
3
/u01/app/oracle/oradata/TESTP/redo02.log
2
/u01/app/oracle/oradata/TESTP/redo01.log
1

RMAN> alter database add logfile group 4 size 50M;
Statement processed
RMAN> alter database add logfile group 5 size 50M;
Statement processed
RMAN> alter database add logfile group 6 size 50M;
Statement processed
RMAN> alter database drop logfile group 1;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of sql statement command at 11/10/2013 13:18:40
ORA-01623: log 1 is current log for instance TESTP (thread 1) - cannot drop
ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/TESTP/redo01.log'
RMAN> alter database drop logfile group 2;
Statement processed
RMAN> alter database drop logfile group 3;
Statement processed
RMAN> alter system checkpoint;
Statement processed
RMAN> alter system switch logfile;
Statement processed
RMAN> alter database drop logfile group 1;
Statement processed
RMAN> select member from v$logfile;
MEMBER
-------------------------------------------------------------------------------+DATA/TESTP/ONLINELOG/group_4.274.831129459
+FRA/TESTP/ONLINELOG/group_4.290.831129463
+DATA/TESTP/ONLINELOG/group_5.277.831129483
+FRA/TESTP/ONLINELOG/group_5.292.831129487
+DATA/TESTP/ONLINELOG/group_6.271.831129501
+FRA/TESTP/ONLINELOG/group_6.291.831129505
6. Migrate temp tablespace to ASM storage
===============================
RMAN> select tablespace_name, file_name from dba_temp_files;
TABLESPACE_NAME
FILE_NAME
-------------------------------------------------------------------------------TEMP
/u01/app/oracle/oradata/TESTP/temp01.dbf
RMAN> alter tablespace TEMP add tempfile '+DATA/TESTP/temp_01.dbf' size 50m;
Statement processed
RMAN> alter database tempfile '/u01/app/oracle/oradata/TESTP/temp01.dbf' drop;
Statement processed
RMAN> select name from v$tempfile;
NAME
-------------------------------------------------------------------------------+DATA/TESTP/temp_01.dbf
7. Migrate SPFILE to ASM storage
==============================
RMAN> select value from v$parameter where name='spfile';
VALUE
--------------------------------------------------------------------------------
/u01/app/oracle/product/12.1.0/dbhome_1/dbs/spfileTESTP.ora
RMAN> create pfile from spfile;
Statement processed
RMAN> create spfile='+DATA/TESTP/spfile' from
pfile='/u01/app/oracle/product/12.1.0/dbhome_1/dbs/initTESTP.ora';
Statement processed
RMAN> run {
BACKUP AS BACKUPSET SPFILE;
RESTORE SPFILE TO "+DATA/TESTP/spfile";
}
2> 3> 4>
Starting backup at 10-NOV-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=51 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 10-NOV-13
channel ORA_DISK_1: finished piece 1 at 10-NOV-13
piece handle=+FRA/TESTP/BACKUPSET/2013_11_10/nnsnf0_tag20131110t135115_0.309.831131477
tag=TAG20131110T135115 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 10-NOV-13
Starting restore at 10-NOV-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: restoring SPFILE
output file name=+DATA/TESTP/spfile
channel ORA_DISK_1: reading from backup piece
+FRA/TESTP/BACKUPSET/2013_11_10/nnsnf0_tag20131110t135115_0.309.831131477
channel ORA_DISK_1: piece
handle=+FRA/TESTP/BACKUPSET/2013_11_10/nnsnf0_tag20131110t135115_0.309.831131477
tag=TAG20131110T135115
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
Finished restore at 10-NOV-13
RMAN> startup
connected to target database (not started)
Oracle instance started
database mounted
database opened
Total System Global Area
Fixed Size
Variable Size
Database Buffers

551165952 bytes

2290608 bytes
297798736 bytes
247463936 bytes
Redo Buffers

3612672 bytes

RMAN> select value from v$parameter where name='spfile';
VALUE
-------------------------------------------------------------------------------+DATA/TESTP/spfile
So all the database files and paramer file is now on ASM storage.

More Related Content

What's hot (19)

DOCX
Oracle 12c far sync standby instance
Monowar Mukul
 
PDF
Postgres 12 Cluster Database operations.
Vijay Kumar N
 
DOC
Flashback (Practical Test)
Anar Godjaev
 
PDF
Test Dml With Nologging
N/A
 
PDF
B35 all you wanna know about rman by francisco alvarez
Insight Technology, Inc.
 
PDF
Oracle Database 11g Product Family
N/A
 
PDF
How to create a pluggable database by cloning an existing local pdb
Marco Vigelini
 
PDF
Colvin RMAN New Features
Enkitec
 
DOCX
Change DB Name
Anar Godjaev
 
DOC
Schema replication using oracle golden gate 12c
uzzal basak
 
PPT
11 Things About11g
fcamachob
 
PPT
Oracle 10g Performance: chapter 09 enqueues
Kyle Hailey
 
PDF
White Paper - What is new at 11g for Backup and Recovery
Francisco Alvarez
 
DOC
Rac nonrac clone
stevejones167
 
PPT
Oracle 10g Performance: chapter 00 sampling
Kyle Hailey
 
PDF
Oracle applications 11i hot backup cloning with rapid clone
Deepti Singh
 
PPT
UKOUG, Oracle Transaction Locks
Kyle Hailey
 
PDF
使用Prm恢复受损的oracle数据表几个例子
maclean liu
 
PPTX
10 ways to improve your rman script
Maris Elsins
 
Oracle 12c far sync standby instance
Monowar Mukul
 
Postgres 12 Cluster Database operations.
Vijay Kumar N
 
Flashback (Practical Test)
Anar Godjaev
 
Test Dml With Nologging
N/A
 
B35 all you wanna know about rman by francisco alvarez
Insight Technology, Inc.
 
Oracle Database 11g Product Family
N/A
 
How to create a pluggable database by cloning an existing local pdb
Marco Vigelini
 
Colvin RMAN New Features
Enkitec
 
Change DB Name
Anar Godjaev
 
Schema replication using oracle golden gate 12c
uzzal basak
 
11 Things About11g
fcamachob
 
Oracle 10g Performance: chapter 09 enqueues
Kyle Hailey
 
White Paper - What is new at 11g for Backup and Recovery
Francisco Alvarez
 
Rac nonrac clone
stevejones167
 
Oracle 10g Performance: chapter 00 sampling
Kyle Hailey
 
Oracle applications 11i hot backup cloning with rapid clone
Deepti Singh
 
UKOUG, Oracle Transaction Locks
Kyle Hailey
 
使用Prm恢复受损的oracle数据表几个例子
maclean liu
 
10 ways to improve your rman script
Maris Elsins
 

Viewers also liked (20)

DOCX
TimesTen in memory database Creation
Monowar Mukul
 
PPTX
Edtc6341 63 esther_sauceda_practice_test5
esauceda12
 
DOCX
Exadata - BULK DATA LOAD Testing on Database Machine
Monowar Mukul
 
DOCX
Exadata I/O Resource Manager (Exadata IORM)
Monowar Mukul
 
DOCX
Exadata - Smart Scan Testing
Monowar Mukul
 
PPT
Copyright Crash Course 1st revised ppt 6340.64 Sonia Aldape
soniaaldape
 
DOCX
Exadata Cell metrics
Monowar Mukul
 
DOCX
Upgrade database using cloud_control Provisioning
Monowar Mukul
 
DOCX
SOA Fusion Middleware installation
Monowar Mukul
 
DOCX
Advanced installation 12c rac
Monowar Mukul
 
DOCX
12c: Testing audit features for Data Pump (Export & Import) and RMAN jobs
Monowar Mukul
 
DOCX
12c Flex ASM: Moving to Flex ASM
Monowar Mukul
 
PDF
1247g3hg1238 2011
Kittikul Kengkla
 
PDF
Oracle 12c RAC (Advanced installation - Flex ASM)
Monowar Mukul
 
DOC
Migration Database from SQL SERVER 2012 to Oracle12c with Pluggable Database
Monowar Mukul
 
PPT
4. java intro class
Quan Ho
 
DOCX
Oracle AWR baseline - Basic
Monowar Mukul
 
DOCX
SMS notification setup using EM12c
Monowar Mukul
 
PDF
EM12c Configuration Setup - Step by Step
Monowar Mukul
 
DOCX
TESTING - Drop 12c RAC Database, Database Software and GI
Monowar Mukul
 
TimesTen in memory database Creation
Monowar Mukul
 
Edtc6341 63 esther_sauceda_practice_test5
esauceda12
 
Exadata - BULK DATA LOAD Testing on Database Machine
Monowar Mukul
 
Exadata I/O Resource Manager (Exadata IORM)
Monowar Mukul
 
Exadata - Smart Scan Testing
Monowar Mukul
 
Copyright Crash Course 1st revised ppt 6340.64 Sonia Aldape
soniaaldape
 
Exadata Cell metrics
Monowar Mukul
 
Upgrade database using cloud_control Provisioning
Monowar Mukul
 
SOA Fusion Middleware installation
Monowar Mukul
 
Advanced installation 12c rac
Monowar Mukul
 
12c: Testing audit features for Data Pump (Export & Import) and RMAN jobs
Monowar Mukul
 
12c Flex ASM: Moving to Flex ASM
Monowar Mukul
 
1247g3hg1238 2011
Kittikul Kengkla
 
Oracle 12c RAC (Advanced installation - Flex ASM)
Monowar Mukul
 
Migration Database from SQL SERVER 2012 to Oracle12c with Pluggable Database
Monowar Mukul
 
4. java intro class
Quan Ho
 
Oracle AWR baseline - Basic
Monowar Mukul
 
SMS notification setup using EM12c
Monowar Mukul
 
EM12c Configuration Setup - Step by Step
Monowar Mukul
 
TESTING - Drop 12c RAC Database, Database Software and GI
Monowar Mukul
 
Ad

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

DOCX
Rman cloning when both directory and db name are same.
subhani shaik
 
DOCX
Rman cloning when both directory and db name are same.
subhani shaik
 
DOCX
Cloning database using srdf copy
Amit Vashishth
 
DOC
br_test_lossof-datafile_10g.doc
Lucky Ally
 
PDF
Rman workshop short
Nabi Abdul
 
DOC
Rman cloning guide
Amit87_dba
 
PDF
1z0 034 exam-upgrade oracle9i10g oca to oracle database 11g ocp
Isabella789
 
DOC
Rman duplicate-database-on-the-same-host1
hunghtc83
 
PPTX
Cloning Oracle EBS R12: A Step by Step Procedure
Orazer Technologies
 
PDF
Oracle 12c New Features_RMAN_slides
Saiful
 
PPT
Les 07 Rman Rec
vivaankumar
 
PDF
Mid term & final- preparation- student-review(Oracle)
than sare
 
DOCX
Rman backup and recovery 11g new features
Nabi Abdul
 
PDF
RMAN – The Pocket Knife of a DBA
Guatemala User Group
 
PPT
Les 07 rman_rec
Femi Adeyemi
 
PDF
Collaborate 2012 - RMAN Eliminate the mystery
Nelson Calero
 
PDF
Createclone
oracle documents
 
PPT
Les 06 Perform Rec
vivaankumar
 
PDF
UKOUG - RMAN Back to Basics - Oct 2017
Zahid Anwar (OCM)
 
PDF
Rman Reporting Opertions - LIST & REPORT
Syed SadathUllah
 
Rman cloning when both directory and db name are same.
subhani shaik
 
Rman cloning when both directory and db name are same.
subhani shaik
 
Cloning database using srdf copy
Amit Vashishth
 
br_test_lossof-datafile_10g.doc
Lucky Ally
 
Rman workshop short
Nabi Abdul
 
Rman cloning guide
Amit87_dba
 
1z0 034 exam-upgrade oracle9i10g oca to oracle database 11g ocp
Isabella789
 
Rman duplicate-database-on-the-same-host1
hunghtc83
 
Cloning Oracle EBS R12: A Step by Step Procedure
Orazer Technologies
 
Oracle 12c New Features_RMAN_slides
Saiful
 
Les 07 Rman Rec
vivaankumar
 
Mid term & final- preparation- student-review(Oracle)
than sare
 
Rman backup and recovery 11g new features
Nabi Abdul
 
RMAN – The Pocket Knife of a DBA
Guatemala User Group
 
Les 07 rman_rec
Femi Adeyemi
 
Collaborate 2012 - RMAN Eliminate the mystery
Nelson Calero
 
Createclone
oracle documents
 
Les 06 Perform Rec
vivaankumar
 
UKOUG - RMAN Back to Basics - Oct 2017
Zahid Anwar (OCM)
 
Rman Reporting Opertions - LIST & REPORT
Syed SadathUllah
 
Ad

Recently uploaded (20)

PPTX
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
PDF
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
PDF
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
PPTX
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PDF
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
PPTX
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
PPT
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
PPTX
GRADE-3-PPT-EVE-2025-ENG-Q1-LESSON-1.pptx
EveOdrapngimapNarido
 
PPTX
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
PPT
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
PDF
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
PPTX
care of patient with elimination needs.pptx
Rekhanjali Gupta
 
PPTX
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
PDF
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PPTX
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
PPTX
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
PPTX
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
PDF
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
PPTX
Neurodivergent Friendly Schools - Slides from training session
Pooky Knightsmith
 
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
GRADE-3-PPT-EVE-2025-ENG-Q1-LESSON-1.pptx
EveOdrapngimapNarido
 
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
care of patient with elimination needs.pptx
Rekhanjali Gupta
 
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
Neurodivergent Friendly Schools - Slides from training session
Pooky Knightsmith
 

Moving 12c database from NON-ASM to ASM

  • 1. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Moving 12c database from non-asm storage to asm storage ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1. Check the current files (data, control, logs and temp) ================================================ RMAN> connect target connected to target database: TESTP (DBID=1042086153) RMAN> select name from v$datafile; using target database control file instead of recovery catalog 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/users01.dbf RMAN> 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 RMAN> select name from v$controlfile; NAME -------------------------------------------------------------------------------/u01/app/oracle/oradata/TESTP/control01.ctl /u01/app/oracle/oradata/TESTP/control02.ctl RMAN> select name from v$tempfile; NAME -------------------------------------------------------------------------------/u01/app/oracle/oradata/TESTP/temp01.dbf RMAN> show parameter pfile RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-00558: error encountered while parsing input commands RMAN-01009: syntax error: found "parameter": expecting one of: "all, archivelog, auxiliary, auxname, backup, channel, compression, controlfile, datafile, db_unique_name, default, device, encryption, exclude, maxsetsize, retention, snapshot, " RMAN-01007: at line 1 column 6 file: standard input
  • 2. RMAN> select value from v$parameter where name='spfile'; VALUE -------------------------------------------------------------------------------/u01/app/oracle/product/12.1.0/dbhome_1/dbs/spfileTESTP.ora 2. Create the required directories for ASM database =========================================== From Other Session, ASMCMD> pwd +DATA/TESTP ASMCMD> mkdir DATAFILE CONROLFILE TEMPFILE PARAMETERFILE ONLINELOG ASMCMD> ls -l Type Redund Striped Time Sys Name N CONROLFILE/ N DATAFILE/ N ONLINELOG/ N PARAMETERFILE/ N TEMPFILE/ 3. Configure FRA ================ RMAN> select value from v$parameter where name='spfile'; VALUE -------------------------------------------------------------------------------/u01/app/oracle/product/12.1.0/dbhome_1/dbs/spfileTESTP.ora RMAN> create pfile from spfile; Statement processed RMAN> alter system set db_recovery_file_dest_size = 1G; Statement processed RMAN> alter system set db_recovery_file_dest = '+FRA'; Statement processed RMAN> alter system set control_files='+DATA/control01.ctl' scope=spfile; Statement processed 4. Moving files (data and control) from NON ASM to ASM storage. ========================================================= RMAN> shutdown immediate; Oracle instance shut down RMAN> startup nomount; connected to target database (not started) Oracle instance started Total System Global Area Fixed Size Variable Size Database Buffers Redo Buffers 551165952 bytes 2290608 bytes 289410128 bytes 255852544 bytes 3612672 bytes
  • 3. RMAN> restore controlfile from '/u01/app/oracle/oradata/TESTP/control01.ctl'; Starting restore at 10-NOV-13 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=33 device type=DISK channel ORA_DISK_1: copied control file copy output file name=+DATA/control01.ctl Finished restore at 10-NOV-13 RMAN> alter database mount; Statement processed released channel: ORA_DISK_1 RMAN> backup as copy database format '+DATA'; Starting backup at 10-NOV-13 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=33 device type=DISK channel ORA_DISK_1: starting datafile copy input datafile file number=00001 name=/u01/app/oracle/oradata/TESTP/system01.dbf output file name=+DATA/TESTP/DATAFILE/system.272.831128883 tag=TAG20131110T130802 RECID=1 STAMP=831128951 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=/u01/app/oracle/oradata/TESTP/sysaux01.dbf output file name=+DATA/TESTP/DATAFILE/sysaux.273.831128959 tag=TAG20131110T130802 RECID=2 STAMP=831129026 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:15 channel ORA_DISK_1: starting datafile copy input datafile file number=00002 name=/u01/app/oracle/oradata/TESTP/example01.dbf output file name=+DATA/TESTP/DATAFILE/example.275.831129033 tag=TAG20131110T130802 RECID=3 STAMP=831129061 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=/u01/app/oracle/oradata/TESTP/undotbs01.dbf output file name=+DATA/TESTP/DATAFILE/undotbs1.276.831129069 tag=TAG20131110T130802 RECID=4 STAMP=831129081 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15 channel ORA_DISK_1: starting datafile copy copying current control file output file name=+DATA/TESTP/CONTROLFILE/backup.278.831129085 tag=TAG20131110T130802 RECID=5 STAMP=831129090 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07 channel ORA_DISK_1: starting datafile copy input datafile file number=00006 name=/u01/app/oracle/oradata/TESTP/users01.dbf output file name=+DATA/TESTP/DATAFILE/users.267.831129091 tag=TAG20131110T130802 RECID=6 STAMP=831129092 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set including current SPFILE in backup set channel ORA_DISK_1: starting piece 1 at 10-NOV-13 channel ORA_DISK_1: finished piece 1 at 10-NOV-13
  • 4. piece handle=+DATA/TESTP/BACKUPSET/2013_11_10/nnsnf0_tag20131110t130802_0.268.831129093 tag=TAG20131110T130802 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 10-NOV-13 RMAN> switch database to copy; datafile 1 switched to datafile copy "+DATA/TESTP/DATAFILE/system.272.831128883" datafile 2 switched to datafile copy "+DATA/TESTP/DATAFILE/example.275.831129033" datafile 3 switched to datafile copy "+DATA/TESTP/DATAFILE/sysaux.273.831128959" datafile 4 switched to datafile copy "+DATA/TESTP/DATAFILE/undotbs1.276.831129069" datafile 6 switched to datafile copy "+DATA/TESTP/DATAFILE/users.267.831129091" Open the database ----------------------RMAN> alter database open; Statement processed RMAN> select name from v$datafile; NAME -------------------------------------------------------------------------------+DATA/TESTP/DATAFILE/system.272.831128883 +DATA/TESTP/DATAFILE/example.275.831129033 +DATA/TESTP/DATAFILE/sysaux.273.831128959 +DATA/TESTP/DATAFILE/undotbs1.276.831129069 +DATA/TESTP/DATAFILE/users.267.831129091 RMAN> select name from v$controlfile; NAME -------------------------------------------------------------------------------+DATA/control01.ctl 5. MOVE redologs to ASM storage =========================== RMAN> select member,group# from v$logfile; MEMBER GROUP# --------------------------------------------------------------------------------------/u01/app/oracle/oradata/TESTP/redo03.log 3 /u01/app/oracle/oradata/TESTP/redo02.log 2 /u01/app/oracle/oradata/TESTP/redo01.log 1 RMAN> alter database add logfile group 4 size 50M; Statement processed RMAN> alter database add logfile group 5 size 50M; Statement processed RMAN> alter database add logfile group 6 size 50M; Statement processed RMAN> alter database drop logfile group 1; RMAN-00571: ===========================================================
  • 5. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of sql statement command at 11/10/2013 13:18:40 ORA-01623: log 1 is current log for instance TESTP (thread 1) - cannot drop ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/TESTP/redo01.log' RMAN> alter database drop logfile group 2; Statement processed RMAN> alter database drop logfile group 3; Statement processed RMAN> alter system checkpoint; Statement processed RMAN> alter system switch logfile; Statement processed RMAN> alter database drop logfile group 1; Statement processed RMAN> select member from v$logfile; MEMBER -------------------------------------------------------------------------------+DATA/TESTP/ONLINELOG/group_4.274.831129459 +FRA/TESTP/ONLINELOG/group_4.290.831129463 +DATA/TESTP/ONLINELOG/group_5.277.831129483 +FRA/TESTP/ONLINELOG/group_5.292.831129487 +DATA/TESTP/ONLINELOG/group_6.271.831129501 +FRA/TESTP/ONLINELOG/group_6.291.831129505 6. Migrate temp tablespace to ASM storage =============================== RMAN> select tablespace_name, file_name from dba_temp_files; TABLESPACE_NAME FILE_NAME -------------------------------------------------------------------------------TEMP /u01/app/oracle/oradata/TESTP/temp01.dbf RMAN> alter tablespace TEMP add tempfile '+DATA/TESTP/temp_01.dbf' size 50m; Statement processed RMAN> alter database tempfile '/u01/app/oracle/oradata/TESTP/temp01.dbf' drop; Statement processed RMAN> select name from v$tempfile; NAME -------------------------------------------------------------------------------+DATA/TESTP/temp_01.dbf 7. Migrate SPFILE to ASM storage ============================== RMAN> select value from v$parameter where name='spfile'; VALUE --------------------------------------------------------------------------------
  • 6. /u01/app/oracle/product/12.1.0/dbhome_1/dbs/spfileTESTP.ora RMAN> create pfile from spfile; Statement processed RMAN> create spfile='+DATA/TESTP/spfile' from pfile='/u01/app/oracle/product/12.1.0/dbhome_1/dbs/initTESTP.ora'; Statement processed RMAN> run { BACKUP AS BACKUPSET SPFILE; RESTORE SPFILE TO "+DATA/TESTP/spfile"; } 2> 3> 4> Starting backup at 10-NOV-13 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=51 device type=DISK channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set including current SPFILE in backup set channel ORA_DISK_1: starting piece 1 at 10-NOV-13 channel ORA_DISK_1: finished piece 1 at 10-NOV-13 piece handle=+FRA/TESTP/BACKUPSET/2013_11_10/nnsnf0_tag20131110t135115_0.309.831131477 tag=TAG20131110T135115 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 10-NOV-13 Starting restore at 10-NOV-13 using channel ORA_DISK_1 channel ORA_DISK_1: starting datafile backup set restore channel ORA_DISK_1: restoring SPFILE output file name=+DATA/TESTP/spfile channel ORA_DISK_1: reading from backup piece +FRA/TESTP/BACKUPSET/2013_11_10/nnsnf0_tag20131110t135115_0.309.831131477 channel ORA_DISK_1: piece handle=+FRA/TESTP/BACKUPSET/2013_11_10/nnsnf0_tag20131110t135115_0.309.831131477 tag=TAG20131110T135115 channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: restore complete, elapsed time: 00:00:03 Finished restore at 10-NOV-13 RMAN> startup connected to target database (not started) Oracle instance started database mounted database opened Total System Global Area Fixed Size Variable Size Database Buffers 551165952 bytes 2290608 bytes 297798736 bytes 247463936 bytes
  • 7. Redo Buffers 3612672 bytes RMAN> select value from v$parameter where name='spfile'; VALUE -------------------------------------------------------------------------------+DATA/TESTP/spfile So all the database files and paramer file is now on ASM storage.