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 - Prodsys@ORCL> !unameLinux

(1) modify the Control File Location

sys@ORCL> show parameter control_filesNAME                                 TYPE        VALUE------------------------------------ ----------- ------------------------------control_files                        string      /u01/app/oracle/oradata/ORCL/c                                                 ontrolfile/o1_mf_8050hgfp_.ctl                                                 , /u01/app/oracle/flash_recove                                                 ry_area/ORCL/controlfile/o1_mf                                                 _8050hgqh_.ctlsys@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 nomountRMAN> 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 sysdbaidle> alter database open resetlogs;idle> alter database add logfile group 4 '+WATER/redo04.log' size 50m;idle> alter database add logfile group 5 '+WATER/redo05.log' size 50m;idle> alter database add logfile group 6 '+WATER/redo06.log' size 50m;idle> select group#,status from v$log;    GROUP# STATUS---------- ----------------         1 UNUSED         2 CURRENT         3 UNUSED         4 UNUSED         5 UNUSED         6 UNUSEDidle> 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 CURRENTidle> 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----------------------------------------------------------------------------------------------------+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    TEMPsys@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    TEMPsys@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'; -- during migration, only one control file SYS @ orcl> show parameter controlname type value =----------- ------------------------------ control_file_record_keep_time integer 7control_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*.processes=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> lsctDB_Name   Status        Software_Version  Compatible_version  Instance_Nameorcl      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.

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.