0% found this document useful (0 votes)
499 views

Migrate Database FILESYSTEM To ASM

The document summarizes the steps to migrate an Oracle database from a normal file system to the Automatic Storage Management (ASM) disk group. It involves starting the ASM instance, backing up the database, switching it to a copy located on the ASM disk group, and modifying configuration files and parameters to point to the new locations on ASM. Control files, datafiles, and tempfile are moved to ASM, while redo logs remain on the normal file system. The spfile is also migrated to the ASM disk group.

Uploaded by

srsr1981
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
499 views

Migrate Database FILESYSTEM To ASM

The document summarizes the steps to migrate an Oracle database from a normal file system to the Automatic Storage Management (ASM) disk group. It involves starting the ASM instance, backing up the database, switching it to a copy located on the ASM disk group, and modifying configuration files and parameters to point to the new locations on ASM. Control files, datafiles, and tempfile are moved to ASM, while redo logs remain on the normal file system. The spfile is also migrated to the ASM disk group.

Uploaded by

srsr1981
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

MIGRATING DATABASE NONFILE SYSEM TO ASM

PREPARED BY RAHMAN

MIGRATING DATABASE FILE SYSTEM TO ASM


1. start the ASM instance
I. export ORACLE_SID=+ASM
II. sqlplus / as sysdba
SQL> startup
ASM instance started
Total System Global Area 83886080 bytes
Fixed Size
1217836 bytes
Variable Size
57502420 bytes
ASM Cache
25165824 bytes
ASM diskgroups mounted

III. SQL> desc v$asm_disk;


Name
Null? Type
----------------------------------------- -------- ---------------------------- GROUP_NUMBER
DISK_NUMBER
NUMBER
COMPOUND_INDEX
NUMBER
INCARNATION
NUMBER
MOUNT_STATUS
VARCHAR2(7)
HEADER_STATUS
VARCHAR2(12)
MODE_STATUS
VARCHAR2(7)
STATE
VARCHAR2(8)
REDUNDANCY
VARCHAR2(7)
LIBRARY
VARCHAR2(64)
TOTAL_MB
NUMBER
FREE_MB
NUMBER
NAME
VARCHAR2(30)
FAILGROUP
VARCHAR2(30)
LABEL
VARCHAR2(31)
PATH
VARCHAR2(256)
UDID
VARCHAR2(64)
PRODUCT
VARCHAR2(32)
CREATE_DATE
DATE
MOUNT_DATE
DATE
REPAIR_TIMER
NUMBER
READS
NUMBER
WRITES
NUMBER
READ_ERRS
NUMBER
WRITE_ERRS
NUMBER
READ_TIME
NUMBER
WRITE_TIME
NUMBER
BYTES_READ
NUMBER
BYTES_WRITTEN
NUMBER

IV.

NUMBER

SQL> desc v$asm_diskgroup;


Name
Null? Type
----------------------------------------- -------- ---------------------------- GROUP_NUMBER
NAME
VARCHAR2(30)
SECTOR_SIZE
NUMBER
BLOCK_SIZE
NUMBER
ALLOCATION_UNIT_SIZE
NUMBER
STATE
VARCHAR2(11)
TYPE
VARCHAR2(6)
TOTAL_MB
NUMBER
FREE_MB
NUMBER
REQUIRED_MIRROR_FREE_MB NUMBER
USABLE_FILE_MB
NUMBER
OFFLINE_DISKS
NUMBER
UNBALANCED
VARCHAR2(1)
COMPATIBILITY
VARCHAR2(60)
DATABASE_COMPATIBILITY
VARCHAR2(60

NUMBER

V. sql>select name,total_mb,free_mb from v$asm_disk group

MIGRATING DATABASE NONFILE SYSEM TO ASM

PREPARED BY RAHMAN

NAME
TOTAL_MB FREE_MB
------------------------------ ---------- ---------DISK
10228
6194

2. start the Normal database


I. export ORACLE_SID=orcl
II. sqlplus / as sysdba
III. sql>select name from V$database
o orcl
IV. sql>select name from v$datafile;
o /u01/app/oradata/orcl/system01.dbf
o /u01/app/oradata/orcl/sysaux01.dbf
o /u01/app/oradata/orcl/users01.dbf
o /u01/app/oradata/orcl/undo01.dbf
V. sql>select name from v$controlfile
o /u01/app/oradata/orcl/control01.ctl
o /u01/app/oradata/orcl/control02.ctl
o /u01/app/oradata/orcl/control03.ctl
VI. sql>select member from v$logfile
o /u01/app/oradata/orcl/redo01.log
o /u01/app/oradata/orcl/redo02.log
o /u01/app/oradata/orcl/redo03.log
VII. sql>show parameter db_create_file;
VIII. sql>show parameter control_files;
IX. sql>archive log list;
X. sql>alter system set control_files=+DISK scope=spfile
XI. sql>alter system set db_create_file_dest=+DISK
XII. sql>exit
3. $export ORACLE_SID=orcl
4. $ORACLE_HOME/dbs/rman
o Rman>backup current controlfile format /u01/app/oracle/control.ctl;
o Rman>shutdown immediate;
o Rman>startup nomount;
o Rman>restore controlfile from /u01/app/oracle/control.ctl;
o Rman>alter database mount;
o Rman>backup as copy database format +DISK;
o Rman>Report schema;
o Rman>Switch database to copy;
o Rman>report schema;
o Rman>alter database open resetlogs;
o Rman>recover database;
o Rman>alter database open resetlogs;
o Rman>exit;
2

MIGRATING DATABASE NONFILE SYSEM TO ASM

PREPARED BY RAHMAN

5. $export ORACLE_SID=orcl
6. $sqlplus / as sysdba
Sql>select name from v$database;
Sql>select name from V$datafile;
Datafiles moved to ASM disk
NAME
+DISK/orcl/datafile/system.271.780612825
+DISK/orcl/datafile/undotbs1.273.780612897
+DISK/orcl/datafile/sysaux.272.780612871
+DISK/orcl/datafile/users.274.780612899

Sql>select name from v$controlfile;


Controlfiles moved to ASM disk
NAME
+DISK/orcl/controlfile/current.270.780612771

Sql>select member from v$logfile;


Logfiles does not moved to ASM disk
I. Select member from v$logfile;
/u01/app/oradata/orcl/redo01.log
/u01/app/oradata/orcl/redo02.log
/u01/app/oradata/orcl/redo03.log
II. Sql>Select group#,status from v$log;
Drop the unused or inactive state log groups
GROUP# STATUS
---------- ---------------1 INACTIVE
2 INACTIVE
3 CURRENT

III.
IV.
V.
VI.

Sql>alter database drop logfile group1


Sql>alter database add logfile group 1 +DISK size 20m;
Sql>alter system switch logfile;
Sql>Select member from v$logfile;

Sql>select name from v$tempfile;


Tempfiles doesnt moved to ADM disk
I.
Sql>alter database tempfile $ORACLE_BASE/oradata/temp01.dbf drop
including datafiles;
II.
Sql>alter tablespace temp add tempfile +DISK size 20m;
III.
Sql>select name from v$tempfile;
NAME
-------------------------------------------------------------------------------+DISK/orcl/tempfile/temp.275.780613543

Sql>show parameter spfile;


NAME
TYPE
VALUE
------------------------------------ ----------- -----------------------------spfile
string
/u01/app/oracle/product/10.2.0/db_1/dbs/orcl/spfileorcl.ora

Sql>create pfile from spfile;


3

MIGRATING DATABASE NONFILE SYSEM TO ASM

PREPARED BY RAHMAN

Sql>create spfile=+DISK/ORCL/spfileorcl.ora from pfile;


Sql>shut immediate;
7. $cd $ORACLE_HOME/dbs/
o Edit the pfile and delete all the contents in the pfile and add the location of spfile which
is contain ASM disk
8. Sql>startup;
Sql>show parameter spfile;
NAME
TYPE
VALUE
------------------------------------ ----------- -----------------------------spfile
string +DISK/orcl/spfileorcl.ora

9. Sql>alter database set db_recover_file_dest=+DISK;


NAME

TYPE

VALUE

------------------------------------ ----------- -----------------------------db_recovery_file_dest

string

+DISK

db_recovery_file_dest_size

big integer 2G

You might also like