Monday, May 08, 2006

Migrate Plan My Database(ORACLE RAC(32bits) <===> RAC (64bits)) by use Physical Standby Database

I have used oracle 10G. I had some problem, so migrate to new RAC.

1. create Physical standby by use RAC to RAC
http://surachart.blogspot.com/2006/04/standby-database-rac-feature-for-my.html
http://www.oracle.com/technology/deploy/availability/pdf/MAA_WP_10g_RACPrimaryRACStandby.pdf

2. switch database (by use Physical Standby Failover)

- Close every applications are connected to Primary Database

- Switch log file

SQL> alter system archive log current;

- Check GAP of log files

SQL> SELECT THREAD#, LOW_SEQUENCE#, HIGH_SEQUENCE# FROM V$ARCHIVE_GAP;

- Check sequence

SQL> SELECT UNIQUE THREAD# AS THREAD, MAX(SEQUENCE#)
OVER (PARTITION BY thread#) AS LAST from V$ARCHIVED_LOG;

or

SQL> SELECT THREAD#, MAX(SEQUENCE#) FROM V$LOG_HISTORY GROUP BY THREAD#;

SQL> archive log list;

- If sure, no connection from application ,then shutdown Primary Database.

# srvctl stop database -d DB -o immediate

- Shutdown other standby instances, without one node.

SQL> shutdown immediate;

- Cancel Recover on standby database

SQL> alter database recover managed standby database cancel;

This cancels the normal managed recovery. To get the Standby RedoLog
Information is still required. use this command:

SQL> alter database recover managed standby database finish;

If a Standby RedoLog is not used fro any reason, then run;

SQL> alter database recover managed standby database finish skip standby logfile;

- Switch to Primary

SQL> alter database commit to switchover to primary;

if the commit to switchover fails for any reason you have to use the activate command

SQL> alter database activate standby database;

- restart database(migrate mode, for 32bits to 64bits) by use nocluster

SQL> alter system set cluster_database=FALSE scope=spfile;

SQL> shutdown immediate;

SQL> startup migrate;

SQL> @$ORACLE_HOME/rdbms/admin/utlirp.sql

- restart database for compile all pacakges and on archivelog

SQL> shutdown immediate;

SQL> startup mount;

SQL> alter database archivelog;

SQL> alter database open;

SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql

- restart database to cluster

SQL> alter system set cluster_database=TRUE scope=spfile;

SQL> shutdown immediate;

# srvctl start database -d DB

- recreate TEMPORARY tablespace

SQL> drop tablespace temp including contents and datafiles;

SQL> create temporary tablespace temp tempfile ‘/ocfs/DB/temp01.dbf’ size 500M ;

- Verify Database and on application connect to NEW DATABASE

*** that's OK  ;)

No comments: