Thursday, February 17, 2011

Reverting new primary back to standby

The process is pretty much the same as if you are switching over from original primary database to physical standby.

Following our previous examples. We have H2 as the new primary.
We shall switch it back to the standby.

Check the contents of archive destination for boston (on H2)

/arch/boston
-rw-r----- 1 oracle oinstall 309248 Feb 8 10:16 1_19_741607100.dbf
-rw-r----- 1 oracle oinstall 5253120 Feb 8 10:16 1_18_741607100.dbf
-rw-r----- 1 oracle oinstall 2229248 Feb 8 11:20 1_20_741607100.dbf
-rw-r----- 1 oracle oinstall 9216 Feb 8 11:21 1_21_741607100.dbf
-rw-r----- 1 oracle oinstall 224256 Feb 8 11:22 1_17_741607100.dbf
-rw-r----- 1 oracle oinstall 471552 Feb 9 04:57 1_22_741607100.dbf
-rw-r----- 1 oracle oinstall 101376 Feb 9 04:57 1_23_741607100.dbf
-rw-r----- 1 oracle oinstall 8559616 Feb 9 06:15 1_24_741607100.dbf
-rw-r----- 1 oracle oinstall 116224 Feb 9 06:21 1_25_741607100.dbf
-rw-r----- 1 oracle oinstall 14848 Feb 9 06:21 1_26_741607100.dbf
-rw-r----- 1 oracle oinstall 12288 Feb 9 06:21 1_27_741607100.dbf
-rw-r----- 1 oracle oinstall 1024 Feb 9 06:26 1_28_741607100.dbf
-rw-r----- 1 oracle oinstall 41472 Feb 9 06:27 1_29_741607100.dbf
-rw-r----- 1 oracle oinstall 19968 Feb 9 06:27 1_30_741607100.dbf
-rw-r----- 1 oracle oinstall 209920 Feb 9 06:39 1_31_741607100.dbf
-rw-r----- 1 oracle oinstall 456704 Feb 9 06:55 1_32_741607100.dbf
-rw-r----- 1 oracle oinstall 1334272 Feb 9 07:15 1_33_741607100.dbf
-rw-r----- 1 oracle oinstall 50688 Feb 9 07:15 1_34_741607100.dbf
-rw-r----- 1 oracle oinstall 5035520 Feb 9 09:39 1_35_741607100.dbf
-rw-r----- 1 oracle oinstall 45088256 Feb 9 22:07 1_36_741607100.dbf
-rw-r----- 1 oracle oinstall 40347648 Feb 10 13:02 1_37_741607100.dbf
-rw-r----- 1 oracle oinstall 41274880 Feb 10 22:07 1_38_741607100.dbf
-rw-r----- 1 oracle oinstall 40055296 Feb 11 14:49 1_39_741607100.dbf
-rw-r----- 1 oracle oinstall 41124864 Feb 11 22:06 1_40_741607100.dbf
-rw-r----- 1 oracle oinstall 40373248 Feb 12 10:13 1_41_741607100.dbf
-rw-r----- 1 oracle oinstall 40055808 Feb 12 17:31 1_42_741607100.dbf
-rw-r----- 1 oracle oinstall 40054784 Feb 12 22:59 1_43_741607100.dbf
-rw-r----- 1 oracle oinstall 41642496 Feb 13 10:16 1_44_741607100.dbf
-rw-r----- 1 oracle oinstall 43699200 Feb 13 18:42 1_45_741607100.dbf
-rw-r----- 1 oracle oinstall 40054784 Feb 14 04:51 1_46_741607100.dbf
-rw-r----- 1 oracle oinstall 40991744 Feb 14 21:11 1_47_741607100.dbf
-rw-r----- 1 oracle oinstall 40881664 Feb 15 03:00 1_48_741607100.dbf

The status now should be

SWITCHOVER_STATUS
--------------------
TO STANDBY

Execute the switch over command. Then shutdown the database immediate and mount it.

ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY WITH SESSION SHUTDOWN;

Check the status again, it should be

SWITCHOVER_STATUS
--------------------
TO PRIMARY

DATABASE_ROLE DB_UNIQUE_NAME NAME
---------------- ------------------------------ ---------
PHYSICAL STANDBY boston CHICAGO

Go to the old standby database chicago now and execute switch over command.

ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;

And open the database. Also, check the role.

DATABASE_ROLE DB_UNIQUE_NAME NAME
---------------- ------------------------------ ---------
PRIMARY chicago CHICAGO

On the new standby database, boston, turn on the recovery process. Then generate a new log file on primary.

/arch/chicago
-rw-r----- 1 oracle oinstall 4865536 Feb 7 05:12 1_5_741607100.dbf
-rw-r----- 1 oracle oinstall 32439808 Feb 7 06:03 1_6_741607100.dbf
-rw-r----- 1 oracle oinstall 48640 Feb 7 06:08 1_7_741607100.dbf
-rw-r----- 1 oracle oinstall 6873600 Feb 7 11:01 1_8_741607100.dbf
-rw-r----- 1 oracle oinstall 2055168 Feb 7 11:42 1_9_741607100.dbf
-rw-r----- 1 oracle oinstall 51200 Feb 7 11:42 1_10_741607100.dbf
-rw-r----- 1 oracle oinstall 40399872 Feb 7 22:03 1_11_741607100.dbf
-rw-r----- 1 oracle oinstall 22781440 Feb 8 04:08 1_12_741607100.dbf
-rw-r----- 1 oracle oinstall 269312 Feb 8 04:47 1_13_741607100.dbf
-rw-r----- 1 oracle oinstall 5327872 Feb 8 07:18 1_14_741607100.dbf
-rw-r----- 1 oracle oinstall 36864 Feb 8 07:19 1_15_741607100.dbf
-rw-r----- 1 oracle oinstall 69120 Feb 8 07:21 1_16_741607100.dbf
-rw-r----- 1 oracle oinstall 224256 Feb 8 07:36 1_17_741607100.dbf
-rw-r----- 1 oracle oinstall 5253120 Feb 8 10:02 1_18_741607100.dbf
-rw-r----- 1 oracle oinstall 309248 Feb 8 10:16 1_19_741607100.dbf
-rw-r----- 1 oracle oinstall 2229248 Feb 8 11:20 1_20_741607100.dbf
-rw-r----- 1 oracle oinstall 9216 Feb 8 11:21 1_21_741607100.dbf
-rw-r----- 1 oracle oinstall 471552 Feb 9 04:55 1_22_741607100.dbf
-rw-r----- 1 oracle oinstall 101376 Feb 9 04:57 1_23_741607100.dbf
-rw-r----- 1 oracle oinstall 8559616 Feb 9 06:15 1_24_741607100.dbf
-rw-r----- 1 oracle oinstall 116224 Feb 9 06:21 1_25_741607100.dbf
-rw-r----- 1 oracle oinstall 14848 Feb 9 06:21 1_26_741607100.dbf
-rw-r----- 1 oracle oinstall 12288 Feb 9 06:21 1_27_741607100.dbf
-rw-r----- 1 oracle oinstall 1334272 Feb 9 07:15 1_33_741607100.dbf
-rw-r----- 1 oracle oinstall 41472 Feb 9 07:15 1_29_741607100.dbf
-rw-r----- 1 oracle oinstall 19968 Feb 9 07:15 1_30_741607100.dbf
-rw-r----- 1 oracle oinstall 1024 Feb 9 07:15 1_28_741607100.dbf
-rw-r----- 1 oracle oinstall 456704 Feb 9 07:15 1_32_741607100.dbf
-rw-r----- 1 oracle oinstall 209920 Feb 9 07:15 1_31_741607100.dbf
-rw-r----- 1 oracle oinstall 50688 Feb 9 07:15 1_34_741607100.dbf
-rw-r----- 1 oracle oinstall 5035520 Feb 9 09:39 1_35_741607100.dbf
-rw-r----- 1 oracle oinstall 45088256 Feb 9 22:07 1_36_741607100.dbf
-rw-r----- 1 oracle oinstall 40347648 Feb 10 13:01 1_37_741607100.dbf
-rw-r----- 1 oracle oinstall 41274880 Feb 10 22:07 1_38_741607100.dbf
-rw-r----- 1 oracle oinstall 40055296 Feb 11 14:48 1_39_741607100.dbf
-rw-r----- 1 oracle oinstall 41124864 Feb 11 22:06 1_40_741607100.dbf
-rw-r----- 1 oracle oinstall 40373248 Feb 12 10:13 1_41_741607100.dbf
-rw-r----- 1 oracle oinstall 40055808 Feb 12 17:31 1_42_741607100.dbf
-rw-r----- 1 oracle oinstall 40054784 Feb 12 23:00 1_43_741607100.dbf
-rw-r----- 1 oracle oinstall 41642496 Feb 13 10:17 1_44_741607100.dbf
-rw-r----- 1 oracle oinstall 43699200 Feb 13 18:43 1_45_741607100.dbf
-rw-r----- 1 oracle oinstall 40054784 Feb 14 04:51 1_46_741607100.dbf
-rw-r----- 1 oracle oinstall 40991744 Feb 14 21:12 1_47_741607100.dbf
-rw-r----- 1 oracle oinstall 40881664 Feb 15 03:00 1_48_741607100.dbf
-rw-r----- 1 oracle oinstall 21595136 Feb 15 12:09 1_49_741607100.dbf
-rw-r----- 1 oracle oinstall 27136 Feb 15 12:10 1_50_741607100.dbf
-rw-r----- 1 oracle oinstall 14336 Feb 15 12:11 1_51_741607100.dbf
-rw-r----- 1 oracle oinstall 1024 Feb 15 12:17 1_52_741607100.dbf
-rw-r----- 1 oracle oinstall 2048 Feb 15 12:18 1_53_741607100.dbf
-rw-r----- 1 oracle oinstall 60928 Feb 15 12:23 1_54_741607100.dbf

Wait a short time, and go to standby database and check the logs.

/arch/boston
-rw-r----- 1 oracle oinstall 309248 Feb 8 10:16 1_19_741607100.dbf
-rw-r----- 1 oracle oinstall 5253120 Feb 8 10:16 1_18_741607100.dbf
-rw-r----- 1 oracle oinstall 2229248 Feb 8 11:20 1_20_741607100.dbf
-rw-r----- 1 oracle oinstall 9216 Feb 8 11:21 1_21_741607100.dbf
-rw-r----- 1 oracle oinstall 224256 Feb 8 11:22 1_17_741607100.dbf
-rw-r----- 1 oracle oinstall 471552 Feb 9 04:57 1_22_741607100.dbf
-rw-r----- 1 oracle oinstall 101376 Feb 9 04:57 1_23_741607100.dbf
-rw-r----- 1 oracle oinstall 8559616 Feb 9 06:15 1_24_741607100.dbf
-rw-r----- 1 oracle oinstall 116224 Feb 9 06:21 1_25_741607100.dbf
-rw-r----- 1 oracle oinstall 14848 Feb 9 06:21 1_26_741607100.dbf
-rw-r----- 1 oracle oinstall 12288 Feb 9 06:21 1_27_741607100.dbf
-rw-r----- 1 oracle oinstall 1024 Feb 9 06:26 1_28_741607100.dbf
-rw-r----- 1 oracle oinstall 41472 Feb 9 06:27 1_29_741607100.dbf
-rw-r----- 1 oracle oinstall 19968 Feb 9 06:27 1_30_741607100.dbf
-rw-r----- 1 oracle oinstall 209920 Feb 9 06:39 1_31_741607100.dbf
-rw-r----- 1 oracle oinstall 456704 Feb 9 06:55 1_32_741607100.dbf
-rw-r----- 1 oracle oinstall 1334272 Feb 9 07:15 1_33_741607100.dbf
-rw-r----- 1 oracle oinstall 50688 Feb 9 07:15 1_34_741607100.dbf
-rw-r----- 1 oracle oinstall 5035520 Feb 9 09:39 1_35_741607100.dbf
-rw-r----- 1 oracle oinstall 45088256 Feb 9 22:07 1_36_741607100.dbf
-rw-r----- 1 oracle oinstall 40347648 Feb 10 13:02 1_37_741607100.dbf
-rw-r----- 1 oracle oinstall 41274880 Feb 10 22:07 1_38_741607100.dbf
-rw-r----- 1 oracle oinstall 40055296 Feb 11 14:49 1_39_741607100.dbf
-rw-r----- 1 oracle oinstall 41124864 Feb 11 22:06 1_40_741607100.dbf
-rw-r----- 1 oracle oinstall 40373248 Feb 12 10:13 1_41_741607100.dbf
-rw-r----- 1 oracle oinstall 40055808 Feb 12 17:31 1_42_741607100.dbf
-rw-r----- 1 oracle oinstall 40054784 Feb 12 22:59 1_43_741607100.dbf
-rw-r----- 1 oracle oinstall 41642496 Feb 13 10:16 1_44_741607100.dbf
-rw-r----- 1 oracle oinstall 43699200 Feb 13 18:42 1_45_741607100.dbf
-rw-r----- 1 oracle oinstall 40054784 Feb 14 04:51 1_46_741607100.dbf
-rw-r----- 1 oracle oinstall 40991744 Feb 14 21:11 1_47_741607100.dbf
-rw-r----- 1 oracle oinstall 40881664 Feb 15 03:00 1_48_741607100.dbf
-rw-r----- 1 oracle oinstall 21595136 Feb 15 12:09 1_49_741607100.dbf
-rw-r----- 1 oracle oinstall 27136 Feb 15 12:10 1_50_741607100.dbf
-rw-r----- 1 oracle oinstall 14336 Feb 15 12:11 1_51_741607100.dbf
-rw-r----- 1 oracle oinstall 1024 Feb 15 12:20 1_52_741607100.dbf
-rw-r----- 1 oracle oinstall 2048 Feb 15 12:20 1_53_741607100.dbf
-rw-r----- 1 oracle oinstall 60928 Feb 15 12:23 1_54_741607100.dbf

SEQUENCE# APPLIED
---------- ---------
17 YES
18 YES
19 YES
20 YES
21 YES
22 YES
23 YES
24 YES
25 YES
26 YES
27 YES

SEQUENCE# APPLIED
---------- ---------
28 YES
28 YES
29 YES
29 YES
30 YES
30 YES
31 YES
31 YES
32 YES
32 YES
33 YES

SEQUENCE# APPLIED
---------- ---------
33 YES
34 YES
34 YES
35 YES
35 YES
36 YES
36 YES
37 YES
37 YES
38 YES
38 YES

SEQUENCE# APPLIED
---------- ---------
39 YES
39 YES
40 YES
40 YES
41 YES
41 YES
42 YES
42 YES
43 YES
43 YES
44 YES

SEQUENCE# APPLIED
---------- ---------
44 YES
45 YES
45 YES
46 YES
46 YES
47 YES
47 YES
48 YES
48 YES
49 YES
49 YES

SEQUENCE# APPLIED
---------- ---------
50 YES
50 NO
51 YES
51 NO
52 NO
53 NO
54 NO

No comments:

Post a Comment