中文字幕日韩精品一区二区免费_精品一区二区三区国产精品无卡在_国精品无码专区一区二区三区_国产αv三级中文在线

OGG在RAC上的初始化(下)--OGG初始化

上篇地址http://blog.itpub.net/29047826/viewspace-1284906/

1,源端執(zhí)行RMAN全庫備份
備份路徑為節(jié)點node1的本地磁盤。為了將該備份復(fù)制到災(zāi)備端,此次備份不能保存在ASM上。
run {
allocate channel ch01 device type disk;
allocate channel ch02 device type disk;
backup
format '/backup/full_%d_%s_%T_%p.bak'
  database include current controlfile;
sql 'alter system archive log current';
backup
  archivelog all format '/backup/arch_%d_%s_%T_%p';
release channel ch02;
release channel ch01;
}

2,查看controlfile所在的備份片。災(zāi)備端恢復(fù)的時候也從這個備份片中讀取controlfile。
RMAN> list backup of controlfile;

List of Backup Sets
===================

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
37      Full    17.80M     DISK        00:00:00     2014-09-28 23:53:06
        BP Key: 37   Status: AVAILABLE  Compressed: NO  Tag: TAG20140928T235259
        Piece Name: /backup/full_PROD_36_20140928_1.bak
  Control File Included: Ckp SCN: 1260618      Ckp time: 2014-09-28 23:53:06

3,獲取不活動的(INACTIVE)的已經(jīng)歸檔的日志的最后一個SCN號,如果有多個已歸檔的INACTIVE的組,取最大的FIRST_CHANGE#1260645
該SCN號作為災(zāi)備端recover database until 的SCN,并且在復(fù)制進(jìn)程重新啟動后也要參照這個SCN。
SYS@PROD1 > select inst_id,group#,thread#,sequence#,archived,status,first_change# from gv$log order by status;

   INST_ID     GROUP#    THREAD#  SEQUENCE# ARC STATUS           FIRST_CHANGE#
---------- ---------- ---------- ---------- --- ---------------- -------------
         1          3          2         25 NO  CURRENT                1260660
         2          3          2         25 NO  CURRENT                1260660
         1          1          1         29 NO  CURRENT                1260655
         2          1          1         29 NO  CURRENT                1260655
         1          2          1         28 YES INACTIVE               1260638
         1          4          2         24 YES INACTIVE               1260645
         2          2          1         28 YES INACTIVE               1260638
         2          4          2         24 YES INACTIVE               1260645

4,將源端備份復(fù)制到災(zāi)備端

[oracle@node1 ~]$ scp /backup/* oracle@172.16.228.103:/backup/


5,停止災(zāi)備端的復(fù)制進(jìn)程準(zhǔn)備恢復(fù)數(shù)據(jù)庫

GGSCI (node3) 4> stop rt1

Sending STOP request to REPLICAT RT1 ...
Request processed.

停止復(fù)制進(jìn)程后,可以在源端繼續(xù)執(zhí)行一些DML操作。這些操作會正常的通過抽取進(jìn)程獲取,并有投遞進(jìn)程投遞到災(zāi)備端的remote trail目錄,只是暫時不用復(fù)制進(jìn)程追加而已。

6,關(guān)閉災(zāi)備端數(shù)據(jù)庫
[root@node3 ~]# srvctl stop database -d prod

7,災(zāi)備端從RMAN啟動數(shù)據(jù)庫到nomount狀態(tài)
[root@node3 ~]# su - oracle
[oracle@node3 ~]$ rman target /

RMAN> startup nomount;

Oracle instance started

Total System Global Area     672256000 bytes

Fixed Size                     2256272 bytes
Variable Size                520094320 bytes
Database Buffers             146800640 bytes
Redo Buffers                   3104768 bytes

8,災(zāi)備端從RMAN恢復(fù)控制文件
RMAN> restore controlfile from '/backup/full_PROD_24_20140928_1.bak';

Starting restore at 2014-09-28 20:14:13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=34 instance=PROD1 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=+DATA/prod/controlfile/current.260.859387343
output file name=+ARCH/prod/controlfile/current.256.859387345
Finished restore at 2014-09-28 20:14:14

9,災(zāi)備端控制文件加載復(fù)制過來的備份集信息,核對控制文件信息

RMAN> catalog start with '/backup/';

RMAN> list backup;

10,災(zāi)備端從RMAN恢復(fù)數(shù)據(jù)庫

RMAN> restore database;

11,災(zāi)備端從RMAN恢復(fù)歸檔日志

RMAN> run{
allocate channel c1 type disk;
allocate channel c2 type disk;
restore archivelog all;
release channel c1;
release channel c2;
}

12,災(zāi)備端從RMAN指定SCN恢復(fù)。該SCN是源端數(shù)據(jù)庫執(zhí)行RMAN備份后狀態(tài)為INACTIVE中數(shù)值最大的SCN。

RMAN> recover database until scn1260645

13,災(zāi)備端在mount狀態(tài)下通過控制文件查看文件頭的scn是否一致
SYS@PROD1 > select checkpoint_change# from v$datafile_header;

CHECKPOINT_CHANGE#
------------------
           1260645
           1260645
           1260645
           1260645
           1260645
           1260645
           1260645

7 rows selected.

SYS@PROD1 > select checkpoint_change# from v$datafile;

CHECKPOINT_CHANGE#
------------------
           1260645
           1260645
           1260645
           1260645
           1260645
           1260645
           1260645

14,災(zāi)備端resetlogs方式開啟數(shù)據(jù)庫

alter database open resetlogs;

[root@node3 ~]# srvctl start database -d prod

15,災(zāi)備端重新配置checkpoint
[oracle@node3 goldengate]$ ggsci

GGSCI (node3) 1> DBLOGIN USERID oggadmin,PASSWORD oggadmin

GGSCI (node3) 2> ADD CHECKPOINTTABLE oggadmin.checkpointtable

GGSCI (node3) 14> DELETE REPLICAT rt1

GGSCI (node3) 15> ADD REPLICAT rt1, EXTTRAIL /goldengate/dirdat/rt, checkpointtable oggadmin.checkpointtable

16,災(zāi)備端重新啟動復(fù)制進(jìn)程,從SCN為1260645開始
注意這個單詞不要寫錯aftercsn
GGSCI (node3) 16> start rt1aftercsn1260645

Sending START request to MANAGER ...
REPLICAT RT1 starting

17,災(zāi)備端通過sqlplus查詢恢復(fù)數(shù)據(jù)庫期間生成的DML是否被成功追加
sqlplus / as sysdba
select * from snow.t1

本次初始化演練到此結(jié)束。

分享標(biāo)題:OGG在RAC上的初始化(下)--OGG初始化
轉(zhuǎn)載注明:http://www.rwnh.cn/article42/jjshhc.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站營銷軟件開發(fā)、關(guān)鍵詞優(yōu)化、網(wǎng)站策劃網(wǎng)站收錄、建站公司

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

營銷型網(wǎng)站建設(shè)
建宁县| 义乌市| 色达县| 开封县| 郓城县| 家居| 渝中区| 罗源县| 新田县| 皮山县| 夏津县| 神木县| 宁波市| 昌平区| 乌拉特前旗| 民勤县| 昌宁县| 长治县| 瓦房店市| 德钦县| 定远县| 丹东市| 福州市| 绥德县| 城市| 宁城县| 富阳市| 贵德县| 金阳县| 青河县| 鄢陵县| 汕尾市| 唐山市| 赣州市| 措勤县| 曲沃县| 宜宾县| 平和县| 临泉县| 元阳县| 孝感市|