Understanding ASM (7) ASM migration

Source: Internet
Author: User

Environment:


Sys @ ORCL> select * from v $ version;


BANNER

----------------------------------------------------------------

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-Prod


Sys @ ORCL>! Uname

Linux



(1) modify the Control File Location


Sys @ ORCL> show parameter control_files


NAME TYPE VALUE

-----------------------------------------------------------------------------

Control_files string/u01/app/oracle/oradata/ORCL/c

Ontrolfile/o1_mf_8050hgreen _. ctl

,/U01/app/oracle/flash_recove

Ry_area/ORCL/controlfile/ow.mf

_ 8050hgqh _. ctl



Sys @ ORCL> alter database backup controlfile to '/home/oracle/ctlasm. ctl ';



Sys @ ORCL> alter system set control_files = '+ water' scope = spfile;



Sys @ ORCL> shutdown immediate;




(2) Data File migration

RMAN> startup nomount


RMAN> restore controlfile from '/home/oracle/ctlasm. ctl ';


RMAN> alter database mount;


RMAN> backup as copy database format '+ water ';


RMAN> recover database;


RMAN> switch database to copy;




(3) log file migration

Idle> conn/as sysdba


Idle> alter database open resetlogs;


Idle> alter database add logfile group 4' + WATER/redo04.log 'size 50 m;



Idle> alter database add logfile group 5' + WATER/redo05.log 'size 50 m;



Idle> alter database add logfile group 6' + WATER/redo06.log 'size 50 m;


Idle> select group #, status from v $ log;


GROUP # STATUS

--------------------------

1 UNUSED

2 CURRENT

3 UNUSED

4 UNUSED

5 UNUSED

6 UNUSED


Idle> alter system switch logfile;



Idle> alter system switch logfile;



Idle> alter system switch logfile;


Idle> select group #, status from v $ log;


GROUP # STATUS

--------------------------

1 ACTIVE

2 ACTIVE

3 ACTIVE

4 ACTIVE

5 ACTIVE

6 CURRENT


Idle> alter system checkpoint;


Idle> alter database drop logfile group 1;



Idle> alter database drop logfile group 2;



Idle> alter database drop logfile group 3;



Idle> select member from v $ logfile;


MEMBER

Bytes ----------------------------------------------------------------------------------------------------

+ WATER/redo04.log

+ WATER/redo05.log

+ WATER/redo06.log




(4) temporary file migration

Sys @ ORCL> select file_name, tablespace_name from dba_temp_files;


FILE_NAME TABLESPACE_NAME

-----------------------------------------------------------------------------------------------

/U01/app/oracle/oradata/ORCL/datafile/o1_mf_temp_8050j34j _. tmp TEMP


Sys @ ORCL> alter tablespace temp add tempfile '+ water ';


Sys @ ORCL> select file_name, tablespace_name from dba_temp_files;


FILE_NAME TABLESPACE_NAME

-----------------------------------------------------------------------------------------------

+ WATER/orcl/tempfile/temp.265.798479421 TEMP

/U01/app/oracle/oradata/ORCL/datafile/o1_mf_temp_8050j34j _. tmp TEMP


Sys @ ORCL> alter tablespace temp drop tempfile '/u01/app/oracle/oradata/ORCL/datafile/o1_mf_temp_8050j34j _. tmp ';




⑸ Modify the values of db_create_file_dest, db_recovery_file_dest, and db_recovery_file_dest_size

Sys @ ORCL> alter system set db_create_file_dest = '+ WATER/ORCL/ORADATA' scope = spfile;



Sys @ ORCL> alter system set db_recovery_file_dest = '+ water' scope = spfile;



Sys @ ORCL> alter system set db_recovery_file_dest_size = 1G scope = spfile;



Sys @ ORCL> alter database backup controlfile to '+ water'; -- only one control file exists during migration.



Sys @ ORCL> show parameter control


NAME TYPE VALUE

-----------------------------------------------------------------------------

Control_file_record_keep_time integer 7

Control_files string + WATER/orcl/controlfile/curren

T.256.798477831




Modify parameter file and migrate spfile

Sys @ ORCL> alter system set control_files = '+ WATER/ORCL/ORADATA/CONTROL01.CTL', '+ WATER/ORCL/ORADATA/CONTROL02.CTL' scope = spfile;


Sys @ ORCL> create spfile = '+ WATER/ORCL/spfileorcl. ora' from pfile;


[Oracle @ localhost dbs] $ rm-I spfileorcl. ora


[Oracle @ localhost dbs] $ vim initorcl. ora


[Oracle @ localhost dbs] $ tail-f initorcl. ora

*. Job_queue_processes = 10

*. Open_cursors = 300

*. Pga_aggregate_target = 139460608

*. Processses = 150

*. Remote_login_passwordfile = 'none'

*. Sga_target = 418381824

*. Undo_management = 'auto'

*. Undo_tablespace = 'undotbs1'

*. User_dump_dest = '/u01/app/oracle/admin/orcl/udump'

SPFILE = '+ WATER/ORCL/spfileorcl. ora'




⑺ Check the connection between the ASM instance and the database instance

ASMCMD> lsct

DB_Name Status Software_Version Compatible_version Instance_Name

Orcl CONNECTED 10.2.0.1.0 10.2.0.1.0 orcl




Summary:

The first migration failed because it was only used for learning and the disk space was too small. If the space is rich, you may be generous.


Oracle video tutorial follow: http://u.youku.com/user_video/id_UMzAzMjkxMjE2.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.