RAC(ASM)到单机OGG配置案例
RAC以及ASM安装全过程整理
RAC以及ASM安装全过程整理RAC以及ASM安装全过程整理更改主机名第一步:#hostname oratest第二步:修改/etc/sysconfig/network中的hostname第三步:修改/etc/hosts文件设置hosts文件可参考:[root@amdocs01 mapper]# cat /etc/hosts# Do not remove the following line, or various programs # that require network functionality will fail.127.0.0.1 localhost.localdomain localhost 172.19.201.188 amdocs02172.19.201.189 amdocs02-vip192.168.10.1 amdocs02-priv设置IPeth0172.19.201.188255.255.0.0172.19.201.6eth1192.168.10.1255.255.255.0172.19.201.6绑定裸设备先在逻辑卷组上分出逻辑卷,全部为裸设备,必须包含:逻辑盘:ocrlv ,votelv 是必须的,因为后面安装ASM要用到data01,data02,data03,data04,data05,softlv,oralv 可选1、裸设备定义:一块没有分区的硬盘,称为原始设备(RAWDEVICE)或者是一个分区,但是没有用EXT3,OCFS等文件系统格式化,称为原始分区(RAWPARTITION)以上两者都是裸设备2、裸设备的绑定有文件系统的分区是采用mount的方式挂载到某一个挂载点的(目录)而裸设备不能mount,只能绑定到/dev/raw/下的某一个设备名比如/dev/raw/raw13、裸设备的绑定方法有两种方法,这里介绍一种,还有一种修改/etc/rc.local文件增加,见后面,我采用的是修改/etc/rc.local文件先介绍第一种方法:修改/etc/sysconfig/rawdevices,添加以下内容,这里sdd1和sdd2是原始分区名或者原始设备(硬盘)名,raw1和raw2是/dev目录下的原始设备名,编号从raw1到raw8191,也就是最多可以绑定255个裸设备/dev/raw/raw1/dev/sdd1/dev/raw/raw2/dev/sdd2然后修改裸设备的属主和访问权限chown oracle:dba /dev/raw/raw1chown oracle:dba /dev/raw/raw2chmod 660 /dev/raw/raw1chmod 660 /dev/raw/raw2最后使得裸设备生效,并且在机器启动的时候就自动加载执行/etc/init.d/rawdevices restart 使裸设备生效执行/sbin/chkconfig rawdevices on保证机器启动的时候裸设备能够加载,这一步很重要裸设备的绑定方法第二种方法,修改/etc/rc.local文件的方法[root@amdocs01 ~]# cat /etc/rc.local#!/bin/sh## This script will be executed *after* all the other init scripts.# You can put your own initialization stuff in here if you don't# want to do the full Sys V style init stuff.touch /var/lock/subsys/localraw /dev/raw/raw1 /dev/mapper/vg00-ocrlvraw /dev/raw/raw2 /dev/mapper/vg00-votelvraw /dev/raw/raw3 /dev/mapper/vg00-data01raw /dev/raw/raw4 /dev/mapper/vg00-data02raw /dev/raw/raw5 /dev/mapper/vg00-data03raw /dev/raw/raw6 /dev/mapper/vg00-data04chmod 775 /dev/raw/raw1chmod 775 /dev/raw/raw2chmod 775 /dev/raw/raw3chmod 775 /dev/raw/raw4chmod 775 /dev/raw/raw5chmod 775 /dev/raw/raw6chown oracle:dba /dev/raw/raw1chown oracle:dba /dev/raw/raw2chown oracle:dba /dev/raw/raw3chown oracle:dba /dev/raw/raw4chown oracle:dba /dev/raw/raw5chown oracle:dba /dev/raw/raw6chown oracle:dba /dev/raw/raw7modprobe hangcheck-timer hangcheck-tick=30 hangcheck_margin=1804、裸设备的读写不能用cp等命令操作,写入内容用dd命令,可以参阅相关资料5、清空裸设备相当于格式化啦bs是快的大小,blocksizecount是快的数量,这两者相乘大于裸设备的容量即可ddif=/dev/zeroof=/dev/raw/raw1bs=8192count=12800ddif=/dev/zeroof=/dev/raw/raw2bs=8192count=12800-------另外,注意:rhel4使用udev来管理设备手动修改/dev/raw/raw1不能永久生效要想使得权限持久生效需要修改文件/etc/udev/permissions.d/50-udev.permissions的第113行raw/*:root:disk:0660改成raw/*:oracle:dba:0660重启机器如果/dev/下没有/raw/目录,可以自己手工建立。
【原创】RAW+ASM配置ORACLE单实例
RAW+ASM配置ORACLE单实例RAW+ASM配置ORACLE单实例 (1)一、安装环境: (1)二、ASM配置 (1)三、安装数据库 (5)因为原来本机上已有一个单机的10g数据库,现在想装一个新德数据库,并将数据文件都放在ASM上,所以这里重点讲ASM配置,和装数据库时注意的事项。
一、安装环境:VMware Server1.0.8 、Redhat5.4 、10201_database_linux32.zip二、ASM配置1、先在虚拟机上添加磁盘我这里添加了五块磁盘大小为1G,实际只用了三块这里在添加磁盘是需注意一点:因为redhat5.4,刚装完,在开启,所以用redhat4截的图,标注的地方要选择添加磁盘顺序,添加完磁盘后要类似于2、给磁盘分区:先查看一下:这是我这边已分好的区,一共有五个磁盘:sdb、sdc、sdd、sde、sdf下面我们进行分区:Root@orah5 dev]# fdisk sdb先输入n,再输入p,输入1,再输入回车,回车,再输入w,sdb分区就ok了,剩下的几个磁盘也是同样的操作,用几块就分几块。
分好后,就类似上图。
3、打oracleasm包:一共打了五个asm包,这些包都可以在Oracle官方网站上下载,下的时候要找对内核参数,用uname –r 命令查看自己机器的内核。
打包命令可以用:rpm –ivh/Uvh oracleasmlib-2.0………..4、配置裸设备在/etc/sysconfig/ 编辑rawdevices文件,添加下面命令:添加完毕,启动rawdevices服务# service rawdevices startRawdevices服务起来后可以到/dev/raw这里看到上一步操作的成果:当然,上面一步操作完毕还不是这种效果,因为权限和用户组还没用更改,要执行完下面的操作才能正在的达到上图的效果。
我们接着继续操作。
更改设备的属主:root@orah5 raw]# chown oracle:oinstall *为了每次系统重启后都能更改设备的属主,我们要在/etc/udev/rules.d/60-raw.rules文件下添加如下内容:ACTION=="add", KERNEL=="sdb1",RUN+="/bin/raw /dev/raw/raw1 %N"ACTION=="add", KERNEL=="sdc1",RUN+="/bin/raw /dev/raw/raw2 %N"ACTION=="add", KERNEL=="sdd1",RUN+="/bin/raw /dev/raw/raw3 %N"ACTION=="add", KERNEL=="sde1",RUN+="/bin/raw /dev/raw/raw4 %N"ACTION=="add",KERNEL=="raw[1-4]", OWNER="oracle", GROUP="oinstall", MODE="660" 添加完毕要重新启动rawdevices服务# service rawdevices restart这样裸设备算配置完毕。
RAC+DG+OGG灾备中OGG实现部分
RAC+DG+OGG灾备中OGG实现部分RAC+DG+OGG灾备中OGG实现部分2013年05⽉12⽇阅读 341,389 次本⽂不牵扯具体操作系统及oracle软件的安装,假定在实施完毕的rac环境及安装好oracle软件的单机平台下,讲解如何实施RAC+DG+OGG 构建灾备系统中OGG实现部分,其他部分见我之前的相关博⽂。
RAC+DG+OGG简要架构如下:以下为主要的实施过程:修改存储服务器中共享盘的设置[root@openfiler rac_ogg]# cat /etc/exports# PLEASE DO NOT MODIFY THIS CONFIGURATION FILE!# This configuration file was autogenerated# by Openfiler. Any manual changes will be overwritten# Generated at: Thu May 2 15:36:07 CST 2013# End of Openfiler configuration/mnt/rac_ogg/rac_ogg 192.168.137.0/24(rw,sync,no_root_squash,no_all_squash,no_subtree_check)在rac所有节点挂载mount -t nfs 192.168.137.141:/mnt/rac_ogg/rac_ogg/rac_ogg /u01/app/ogg/11.1修改所有节点开机⾃动修改项⽬录属组[root@11grac1 11.1]# cat /etc/rc.local#!/bin/sh## This script will be executed *after* all the other init scripts.# You can put your own initialization stuff in here if you don't# want to do the full Sys V style init stuff.touch /var/lock/subsys/localchown -R oracle:oinstall /u01/app/ogg/11.1修改rac2个节点的开机⾃动挂载项[root@11grac2 11.1]# cat /etc/fstabLABEL=/ / ext3 defaults 1 1LABEL=/boot /boot ext3 defaults 1 2tmpfs /dev/shm tmpfs defaults 0 0devpts /dev/pts devpts gid=5,mode=620 0 0sysfs /sys sysfs defaults 0 0proc /proc proc defaults 0 0LABEL=SWAP-sda2 swap swap defaults 0 0#oralce set for ogg192.168.137.141:/mnt/rac_ogg/rac_ogg/rac_ogg /u01/app/ogg/11.1 nfs defaults 0 0在共享的nfs⽬录下解压并创建ogg相关⽬录[oracle@OELx64 app]$ mkdir -p ogg/11.1[oracle@OELx64 11.1]$ tar -xvf /tmp/ggs_Linux_x64_ora11g_64bit_v11_1_1_0_0_078.tar修改ogg⽤户的环境变量(此处的ogg⽤户为oracle)在.bash_profile中添加以下条⽬#ogg setOGG_BASE=/u01/app/ogg; export OGG_BASEOGG_HOME=$OGG_BASE/11.1; export OGG_HOMEPATH=$OGG_HOME:$PATH; export PATHexport LD_LIBRARY_PATH=$ORACLE_HOME/lib:$OGG_HOME:$LD_LIBRARY_PATH[oracle@ora10gr2 11.1]$ pwd/u01/app/ogg/11.1[oracle@ora10gr2 11.1]$ ggsciOracle GoldenGate Command Interpreter for OracleVersion 11.1.1.1.2 OGGCORE_11.1.1.1.2_PLATFORMS_111004.2100Linux, x86, 32bit (optimized), Oracle 10g on Oct 4 2011 23:54:04Copyright (C) 1995, 2011, Oracle and/or its affiliates. All rights reserved.GGSCI (ora10gr2) 1> create subdirsCreating subdirectories under current directory /u01/app/ogg/11.1Parameter files /u01/app/ogg/11.1/dirprm: createdReport files /u01/app/ogg/11.1/dirrpt: createdCheckpoint files /u01/app/ogg/11.1/dirchk: createdProcess status files /u01/app/ogg/11.1/dirpcs: createdSQL script files /u01/app/ogg/11.1/dirsql: createdDatabase definitions files /u01/app/ogg/11.1/dirdef: createdExtract data files /u01/app/ogg/11.1/dirdat: createdTemporary files /u01/app/ogg/11.1/dirtmp: createdVeridata files /u01/app/ogg/11.1/dirver: createdVeridata Lock files /u01/app/ogg/11.1/dirver/lock: createdVeridata Out-Of-Sync files /u01/app/ogg/11.1/dirver/oos: createdVeridata Out-Of-Sync XML files /u01/app/ogg/11.1/dirver/oosxml: createdVeridata Parameter files /u01/app/ogg/11.1/dirver/params: createdVeridata Report files /u01/app/ogg/11.1/dirver/report: createdVeridata Status files /u01/app/ogg/11.1/dirver/status: createdVeridata Trace files /u01/app/ogg/11.1/dirver/trace: createdStdout files /u01/app/ogg/11.1/dirout: created创建数据库⽤户SQL> select file_name from dba_data_files where rownum<10;FILE_NAME--------------------------------------------------------------------------------+DATA/racdb/users01.dbf+DATA/racdb/undotbs01.dbf+DATA/racdb/sysaux01.dbf+DATA/racdb/system01.dbf+DATA/racdb/undotbs02.dbf+DATA/racdb/datafile/yallonking.432.812066619+DATA/racdb/yallonking_2.dbf7 rows selected.SQL> create tablespace ogg datafile '+DATA/racdb/ogg01.dbf' size 50m autoextend on;Tablespace created.SQL> create user ogg identified by ogg default tablespace ogg quota unlimited on ogg temporary tablespace temp; User created.SQL> grant dba to ogg;Grant succeeded.修改2个节点的监听⽂件配置,需要添加ASM服务⽂件位置:/u01/11.2.0/grid/network/admin/listener.ora节点1:SID_LIST_LISTENER =(SID_LIST =(SID_DESC =(GLOBAL_DBNAME = +ASM)(ORACLE_HOME = /u01/11.2.0/grid)(SID_NAME = +ASM1)))节点2:SID_LIST_LISTENER =(SID_LIST =(SID_DESC =(GLOBAL_DBNAME = +ASM)(ORACLE_HOME = /u01/11.2.0/grid)(SID_NAME = +ASM2)))验证如下[oracle@11grac1 ~]$ sqlplus sys/oracle@192.168.137.165:1521/+ASM as sysdbaSQL*Plus: Release 11.2.0.1.0 Production on Mon Apr 22 15:59:53 2013Copyright (c) 1982, 2009, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - ProductionWith the Real Application Clusters and Automatic Storage Management optionsSQL>[oracle@11grac1 ~]$ sqlplus sys/oracle@192.168.137.166:1521/+ASM as sysdbaSQL*Plus: Release 11.2.0.1.0 Production on Mon Apr 22 16:00:51 2013Copyright (c) 1982, 2009, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - ProductionWith the Real Application Clusters and Automatic Storage Management optionsSQL>注意:可能需要早grid下修改sys密码[grid@11grac1 dbs]$ mv orapw+ASM orapw+ASM_bak[grid@11grac1 dbs]$ orapwd file=orapw+ASM password=oracle entries=10;修改2个节点的tnsname.ora[oracle@11grac1 ~]$ tail -f /u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora ASM =(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.137.165)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = +ASM)(SID_NAME = +ASM1)))RAC =(DESCRIPTION=(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 11grac1-vip)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = 11grac2-vip)(PORT = 1521)))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = racdb)))rac_ogg =(DESCRIPTION=(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.137.174)(PORT = 1521)))(CONNECT_DATA =(SERVER = DEDICATED)(SID = rac_ogg)))[oracle@11grac2 ~]$ tail -f /u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora ASM =(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.137.166)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = +ASM)(SID_NAME = +ASM2)))RAC =(DESCRIPTION=(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 11grac1-vip)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = 11grac2-vip)(PORT = 1521)))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = racdb)))在任意节点配置DDLSQL> alter system set recyclebin=off scope=spfile;System altered.SQL> alter database add supplemental log data;Database altered.SQL> alter database add supplemental log data (primary key) columns;Database altered.SQL> alter database add supplemental log data (foreign key) columns;Database altered.SQL> alter database add supplemental log data (unique) columns;Database altered.SQL> alter system archive log current;System altered.SQL> grant execute on utl_file to ogg;Grant succeeded.SQL> @marker_setup.sqlSQL> @ddl_setup.sqlSQL> @role_setup.sqlSQL> grant ggs_ggsuser_role to ogg;SQL> @ddl_enable.sqlSQL> @ddl_pin ogg节点1构建测试数据SQL> create tablespace test datafile '+DATA/racdb/test01.dbf' size 50m autoextend on;Tablespace created.SQL> create user test identified by test default tablespace test quota unlimited on test temporary tablespace temp; User created.SQL> grant resource,connect to test;Grant succeeded.SQL> conn test/testConnected.SQL> create table yallonking (id number,name varchar2(20),my_date date);Table created.SQL> insert into yallonking values(1,'yallonking',sysdate);1 row created.SQL> commit;Commit complete.SQL> alter session set nls_date_format='yyyy/mm/dd hh24:mi:ss';Session altered.SQL> select * from yallonking;ID NAME MY_DATE---------- -------------------- -------------------1 yallonking 2013/05/12 10:43:01登陆源库[oracle@11grac1 ~]$ /u01/app/ogg/11.1/ggsciOracle GoldenGate Command Interpreter for OracleVersion 11.1.1.1.2 OGGCORE_11.1.1.1.2_PLATFORMS_111004.2100Linux, x86, 32bit (optimized), Oracle 11g on Oct 4 2011 23:53:33Copyright (C) 1995, 2011, Oracle and/or its affiliates. All rights reserved.GGSCI (11grac1) 1> DBLOGIN USERID ogg,PASSWORD oggSuccessfully logged into database.主备端配置mgr进程此处注意创建相关⽬录GGSCI (11grac1) 1> view params mgrport 7840autostart er *autorestart er *GGSCI (11grac1) 2> info mgrManager is running (IP port 11grac1.7840).源端配置extract进程GGSCI (11grac1) 1> dblogin userid ogg,password oggSuccessfully logged into database.GGSCI (11grac1) 2> add extract ext_test,tranlog,begin now,threads 2EXTRACT added.GGSCI (11grac1) 4> view params ext_testEXTRACT ext_testSETENV (ORACLE_HOME = "/u01/app/oracle/product/11.2.0/db_1")USERID ogg@rac, PASSWORD oggTRANLOGOPTIONS ASMUSER sys@ASM,ASMPASSWORD oracle THREADOPTIONS MAXCOMMITPROPAGATIONDELAY 20000EXTTRAIL /u01/app/ogg/11.1/dirdat/etDYNAMICRESOLUTIONDDL INCLUDE ALLTABLE test.*;GGSCI (11grac1) 53> add exttrail /u01/app/ogg/11.1/dirdat/et, extract ext_test EXTTRAIL added.GGSCI (11grac1) 2> add extract pu_test,exttrailsource /u01/app/ogg/11.1/dirdat/et,begin now EXTRACT added.GGSCI (11grac1) 3> add rmttrail /u01/app/ogg/11.1/dirdat/rt,extract pu_testRMTTRAIL added.GGSCI (11grac1) 5> view params pu_testEXTRACT pu_testRMTHOST 192.168.137.174, MGRPORT 7840RMTTRAIL /u01/app/ogg/11.1/dirdat/rtPASSTHRUTABLE test.*源端配置pump进程GGSCI (11grac1) 22> view params pu_testextract pu_testdynamicresolutionpassthrurmthost 192.168.137.174,mgrport 7840,compressrmttrail /u01/app/ogg/11.1/dirdat/pttable test.*;GGSCI (11grac1) 23> add extract pu_test ,exttrailsource /u01/app/ogg/11.1/dirdat/et ERROR: EXTRACT PU_TEST already exists.GGSCI (11grac1) 24> delete pu_testDeleted EXTRACT PU_TEST.GGSCI (11grac1) 25> add extract pu_test,exttrailsource /u01/app/ogg/11.1/dirdat/etEXTRACT added.GGSCI (11grac1) 26> add rmttrail /u01/app/ogg/11.1/dirdat/pt,extract pu_testRMTTRAIL added.源端进程状态:GGSCI (11grac1) 30> info allProgram Status Group Lag Time Since ChkptMANAGER RUNNINGEXTRACT RUNNING EXT_TEST 00:00:01 00:00:00EXTRACT ABENDED PU_TEST 00:00:00 00:01:33⽬标端进程状态:GGSCI (x64_ogg) 5> info allProgram Status Group Lag Time Since ChkptMANAGER RUNNING以下为源库到⽬标库的复制过程修改⽬标端的密码⽂件[oracle@11grac1 dbs]$ scp orapwracdb1 192.168.137.172:/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwrac_ogg orapwracdb1 100% 2048 2.0KB/s 00:00修改⽬标端的监听⽂件[oracle@x64_ogg ~]$ cat /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.oraSID_LIST_LISTENER =(SID_LIST =(SID_DESC =(GLOBAL_DBNAME = racdb)(ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)(SID_NAME = rac_ogg)))LISTENER =(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.137.174)(PORT = 1521)))ADR_BASE_LISTENER = /u01/app/oracle构建对端数据库参数⽂件[oracle@x64_ogg ~]$ cat /tmp/pfile_ogg*.__db_cache_size=360710144*.__java_pool_size=4194304*.__large_pool_size=4194304*.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment*.__pga_aggregate_target=213909504*.__sga_target=633339904*.__shared_io_pool_size=0*.__shared_pool_size=255852544*.__streams_pool_size=0*.audit_file_dest='/u01/app/oracle/admin/racdb/adump'*.audit_trail='db'*.compatible='11.2.0.0.0'*.control_files='/u01/app/oracle/oradata/control01.ctl','/u01/app/oracle/oradata/control02.ctl'*.db_block_size=8192*.db_domain=''*.db_file_name_convert='+DATA/racdb/datafile','/u01/app/oracle/oradata','+DATA/racdb/tempfile','/u01/app/oracle/oradata' *.db_name='rac_ogg'*.db_recovery_file_dest='/u01/app/oracle'*.db_recovery_file_dest_size=4039114752*.diagnostic_dest='/u01/app/oracle'*.dispatchers='(PROTOCOL=TCP) (SERVICE=racdbXDB)'*.instance_number=1#*.log_archive_dest_1='/u01/app/oracle/arch'#*.log_file_name_convert='/u01/app/oracle/oradata','+DATA/racdb','+DATA/racdb/tempfile',*.open_cursors=300*.pga_aggregate_target=210763776*.processes=150*.remote_login_passwordfile='exclusive'*.sga_target=632291328*.thread=1*.undo_tablespace='UNDOTBS1'注意:在对端创建必要的⽬录将参数⽂件复制到主节点1相同⽬录[oracle@x64_ogg tmp]$ scp pfile_ogg 192.168.137.165:/tmp/The authenticity of host '192.168.137.165 (192.168.137.165)' can't be established.RSA key fingerprint is 69:c3:cb:7f:5b:dd:59:a9:5c:94:4e:33:fa:5b:0c:70.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added '192.168.137.165' (RSA) to the list of known hosts.oracle@192.168.137.165's password:pfile_ogg 100% 1157 1.1KB/s 00:00使⽤rman初始化ogg⽬标库注意主节点和灾备节点ogg进程状态主节点:GGSCI (11grac2) 50> info allProgram Status Group Lag Time Since ChkptMANAGER RUNNINGEXTRACT RUNNING EXT_TEST 00:00:00 00:00:00EXTRACT RUNNING PU_TEST 00:00:00 00:00:04备节点:(注意不要启动replica进程)GGSCI (x64_ogg) 4> info allProgram Status Group Lag Time Since ChkptMANAGER RUNNINGREPLICAT STOPPED REP1 00:00:00 00:00:01备份主数据库(注意验证备份可⽤性,以及备份期间主节点抓取进程不能掉)查看最新的事物的开始时间,确保备份在该时间之后。
goldengate配置(rac向单实例包含ddl)
goldengate配置(rac向单实例包含ddl)Goldengate配置环境:11204的双节点rac,11204的单实例数据库软件:goldengate 版本:121200_fbo_ggs_Linux_x64_shiphome(中国官网没有)由于之前使用版本ogg112101_fbo_ggs_Linux_x64_ora11g_64bit(中国官网)导致与11204版本不兼容,所以更换最新版。
Rac与单实例不同之处在与rac上的goldengate需要安装在共享存储上,以下为详细步骤:首先在oracle rac上安装goldengate,因为使用的oracle版本比较新,goldengate 版本也比较新,所以很多以前的的配置方法需要一些小的修改,具体为下面红色字体:安装之前,先要在各个节点都创建/opt/app/ogg的安装目录,然后在共享存储上新建一个供各个节点的/opt/app/ogg安装目录使用的分区,此处把该分区格式化为ext3文件系统(ext3文件系统不是支持共享的,所以在安装过程中会有错误):mkfs �Ct ext3/dev/sdf1,然后把各个节点的目录挂载到共享存储的供goldengate使用的分区下:mount /dev/sdf1/opt/app/ogg,之后使用grid用户来进行安装,执行下面的安装: 源端配置步骤:[grid@rac1 ~]$ cd /opt/app/dir/fbo_ggs_Linux_x64_shiphome/ [grid@rac1fbo_ggs_Linux_x64_shiphome]$ ls Disk1[grid@rac1 fbo_ggs_Linux_x64_shiphome]$ cd Disk1/ [grid@rac1Disk1]$ ./runInstaller Starting Oracle Universal Installer...Checking Temp space: must be greater than 120 MB. Actual 8976 MB Passed Checking swap space: must be greater than 150 MB. Actual 29996 MB PassedChecking monitor: must be configured to display at least 256 colors. Actual 16777216 PassedPreparing to launch Oracle Universal Installer from /tmp/OraInstall2021-06-12_11-29-54AM. Please wait ...[grid@rac1 Disk1]$因为使用的数据库版本wei11204,此处选择安装11g的goldengate,点击next此处选择软件的安装路径和是否启动goldengate的mgr,注意:此处的安装目录/opt/app/ogg必须是安装在共享存储上,然后各个节点的/opt/app/ogg都挂在该共享存储分区,点击next因为之前把共享存储分区格式化为了ext3文件系统,但是该系统并是共享文件系统,所以回报这个错误,但是goldengate依旧还是安装在了共享存储上,依旧可以从其他节点启动,只是此处无法识别,虽然可以点击yes,继续安装,把goldengate安装在sdf1分区上。
RAC 安装和配置及ASM最佳实践
8
在Linux上安装Oracle10g RAC
在安装的各个阶段运行 CVU (Cluster Verification Utility) 使用最新的被支持的操作系统版本并且正确设置核心参数 参考OTN上被验证了的多种配置 (只对Linux) - 包含了10g RAC在Linux上的很多配置情况 (包括不 同的Linux版本、不同的硬件配置、不同的存储方式等) - 详细列出了主机型号、CPU类型、内存大小、存储设备 的类型和容量、磁盘阵列(RAID)、网络设备、操作系统 及kernel的版本、oracle软件版本和补丁情况、安装的操 作系统package和oracle package、操作系统参数配置 、测试过的存储方式(如ASM或RAW DEVICE等)、驱动 器模块及配置情况的反馈等 - 详细情况请参考以下网址:
CRS Home (如果已安装CRS软件)
– –
<crs_home>/bin/cluvfy <crs_home>/cv/rpm/cvuqdisk-1.0.1-1.rpm (linux only)
Oracle Home (如果已安装RAC数据库软件)
–
$ORACLE_HOME/bin/cluvfy
© 2005-2006 Oracle Corporation All rights reserved.
在linux上安装oracle10grac在安装的各个阶段运行cvuclusterverificationutility包含了10grac在linux上的很多配置情况包括不同的linux版本不同的硬件配置不同的存储方式等详细列出了主机型号cpu类型内存大小存储设备的类型和容量磁盘阵列raid网络设备操作系统及kernel的版本oracle软件版本和补丁情况安装的操作系统package和oraclepackage操作系统参数配置测试过的存储方式如asm或rawdevice等驱动器模块及配置情况的反馈等详细情况请参考以下网址
RHEL7上安装11gR2单机使用ASM存储搭建PhysicalStandby笔记
RHEL7上安装11gR2单机使用ASM存储搭建PhysicalStandby笔记参考文献1.执行root.sh出现ohasd failed解决方案2.inux 7安装rac 11gR2时运行root.sh报错找不到ohas服务3.Error in invoking target 'agent nmhs' of makefile4.Oracle 11g Data Guard 使用duplicate from active database 创建 standby database一、背景介绍接到需求要安装单机使用ASM存储的数据库,原本以为是轻车熟路的事情,emm,世界上哪有那么多轻松的活给你干,废话少说,进主题吧。
二、关于安装思路一直以来搭建的都是RAC+ASM存储或者单机物理存储,这次说要安装单机+ASM存储,确实有点懵逼,不过还是迷之自信,毕竟是安装过十多套RAC+ASM存储和几十遍单机物理存储的男人。
一上手就按单机物理存储的安装模式直接安装DB软件,看DB创建过程中是不是会有什么选项可以创建并使用asm存储盘,可惜世界上并没有奇迹,在安装好DB软件创建DB的过程中发现要使用asm 存储一定要安装GI程序!于是铲除已安装好的DB程序,按照RAC+ASM存储的方式重新安装,在grid用户下安装GI,安装过程中发现没有分配给grid的那5个1g的存储,于是选择在oracle用户下作死安装GI和DB软件,结果又是一顿铲除重装。
单机+ASM存储的正确安装方式:grid用户安装GI,oracle用户安装DB,所有物理磁盘都拿来做data磁盘组!三、安装GI时的问题安装GI在执行root.sh脚本报错,报如下错误:ohasd failed to start at/u01/app/11.2.0/grid/crs/install/roothas.pl line 377, line 4./u01/app/11.2.0/grid/perl/bin/perl -I/u01/app/11.2.0/grid/perl/lib -I/u01/app/11.2.0/grid/crs/install/u01/app/11.2.0/grid/crs/install/roothas.pl execution failed解决方案如下:1.回退root.sh脚本操作$ORACLE_HOME/crs/install/roothas.pl -deconfig -force -verbose2.清空/var/tmp/.oracle/npohasd文件在执行root.sh脚本时出现Adding daemon to inittab的时候,在另一个窗口使用root立即执行以下命令:dd if=/var/tmp/.oracle/npohasd of=/dev/null bs=1024 count=1顺利安装结束。
Oracle11gR2RAC+ASM+Grid安装
Oracle11gR2RAC+ASM+Grid安装(⼀)环境准备主机操作系统windows10虚拟机平台vmware workstation 12虚拟机操作系统redhat 5.5 x86(32位) :Linux.5.5.for.x86.rhel-server-5.5-i386-dvd.isogrid版本linux_11gR2_grid.zip (32位)oracle版本linux_11gR2_database_1of2 和 linux_11gR2_database_2of2(32位)共享存储ASM(⼆)操作系统安装(2.1)操作系统安装操作系统安装相对⽽⾔较简单,不做详述。
系统的配置信息⼤致如下,后⾯还会根据需要添加和删除设备(2.2)安装VM Tools为了⽅便在主机与虚拟机之间进⾏⽂件拖拽、复制粘贴、使⽤共享⽂件夹等功能,我们需要安装VM Tools,VM Tools的安装包已经集合在了vmware workstation⾥⾯了。
下⾯⼀步⼀步安装VM Tools。
step 1:虚拟机-> 安装Vmware Toolsstep 2: mount查看是否装载 VMware Tools 虚拟 CD-ROM 映像,如果有红⾊部分,说明已经将VM tools安装包mount在了/media⽬录下step 3:转到安装⽬录/tmp,解压VM tools安装包step 4:开始安装VM Tools[root@Redhat tmp]# cd vmware-tools-distrib[root@Redhat vmware-tools-distrib]#./vmware-install.pl遇到选项,直接回车即可。
step 5:安装结束,重启虚拟机[root@rac1 ~]# rebootstep6:测试VM Tools安装是否成功从主机拖到⼀个⽂档到虚拟机,如果拖动成功,说明VM Tools已经安装成功(三)操作系统配置(3.1)⽹络配置(3.1.1)主机名配置①节点1:[root@rac1 ~]# vim /etc/sysconfig/networkNETWORKING=yesNETWORKING_IPV6=noHOSTNAME=rac1②节点2:[root@rac2 ~]# vim /etc/sysconfig/networkNETWORKING=yesNETWORKING_IPV6=noHOSTNAME=rac2(3.1.2)IP配置为了使⽤静态IP配置数据库,我⼜为每台虚拟机新增加了⼀块⽹卡,将其配置成only-host模式,新增⽹卡⽅式如下:step1:添加⽹络点击vmware的“编辑”-> “虚拟⽹络编辑器”-> “更改设置”-> “添加⽹络”,按下图选择,保存step2:在两台虚拟机上添加⽹卡选择虚拟机,“设置”->“添加”->“⽹络适配器”,选择“⾃定义”,这个⾃定义是我们上⼀步定义的⽹络,结果如下:step3:根据⽹络设置,我们规划IP地址如下:接下来就是配置IP地址了,对于节点1(主机名:rac1),我们:①配置eth1--或删除BOOTPROTO--不要修改硬件地址--设置⽹卡为开机启动--增加IP和MASK[root@rac1 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth1#修改下⾯红⾊部分# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]DEVICE=eth1# BOOTPROTO=dhcpHWADDR=00:0C:29:9C:DF:6AONBOOT=yes IPADDR=192.168.19.10NETMASK=255.255.255.0②配置eth2[root@rac1 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth2# 修改红⾊部分# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]DEVICE=eth2# BOOTPROTO=dhcpONBOOT=yesHWADDR=00:0C:29:6G:8C:5F=192.168.15.10NETMASK=255.255.255.0对于节点2(主机名:rac2),我们参照节点1即可:①配置eth1[root@rac2 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth1 # Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] DEVICE=eth1# BOOTPROTO=dhcp ONBOOT=yesHWADDR=00:0c:29:b0:4e:b6IPADDR=192.168.19.11NETMASK=255.255.255.0②配置eth2[root@rac2 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth2 # Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] DEVICE=eth2# BOOTPROTO=dhcpONBOOT=yesHWADDR=00:0c:29:b0:4e:c0IPADDR=192.168.15.11NETMASK=255.255.255.0(3.1.3)hosts⽂件配置在2个节点上配置hosts⽂件,以节点1为例[root@rac1 ~]# vim /etc/hosts# 在⽂件的最后⾯加上#eth1 public192.168.19.10 rac1192.168.19.11 rac2#virtual192.168.19.12 rac1-vip192.168.19.13 rac2-vip192.168.15.10 rac1-priv192.168.15.11 rac2-priv#scan192.168.19.14 rac-scan配置完成后,重启⽹卡[root@rac1 ~]# service network restart重启⽹卡时,遇到了⼀个⼩错误,提⽰:Device eth2 has different MAC address than expected, ignoring.[FAILED]看了其他⼈的⽂章,发现是⽹卡配置⽂件⾥⾯的MAC地址与实际虚拟机的MAC地址不⼀样,解决办法如下:step1:查看本机实际MAC地址(红⾊部分)[root@rac1 ~]# ifconfig eth2eth2 Link encap:Ethernet HWaddr 00:0C:29:9C:DF:7Einet addr:192.168.15.10 Bcast:192.168.15.255 Mask:255.255.255.0inet6 addr: fe80::20c:29ff:fe9c:df7e/64 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:30677 errors:0 dropped:0 overruns:0 frame:0TX packets:26377 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:15839769 (15.1 MiB) TX bytes:10819637 (10.3 MiB)Interrupt:83 Base address:0x2824step2:查看我们配置的MAC地址[root@rac1 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth2# 修改红⾊部分# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]DEVICE=eth2# BOOTPROTO=dhcpONBOOT=yesHWADDR=00:0C:29:6G:8C:5FIPADDR=192.168.15.10NETMASK=255.255.255.0发现我们配置的MAC地址与实际的MAC地址不⼀样,修改⽹卡step2⾥⾯的MAC地址,重启⽹卡。
NBU oracle rac 异机恢复到单机(11G)
oracle 11g rac 恢复到单机环境介绍:10.204.101.45和46是11.2.0.4.0的rac环境,变成单机恢复到测试环境10.204.16.155(双方都是linux系统)101.45-racdb1101.46-racdb2补充:通过查看v$db_transportable_platform可以看到跨平台恢复是否支持:AIX 支持的平台恢复:linux 支持的平台恢复:一、16.155环境准备1、安装数据库软件2、安装nbu:二、恢复1、新建参数文件:到101.45上面把参数文件down下来修改下,修改后内容如下:cd $ORACLE_HOME/dbs/vi initracdb.oraracdb.__db_cache_size=369098752racdb.__java_pool_size=16777216racdb.__large_pool_size=33554432racdb.__oracle_base='/oracle/app/oracle'racdb.__pga_aggregate_target=553648128racdb.__sga_target=1056964608racdb.__shared_io_pool_size=0racdb.__shared_pool_size=620756992racdb.__streams_pool_size=0*.audit_file_dest='/oracle/app/admin/racdb/adump'*.audit_trail='FALSE'#*.cluster_database=true //单机去掉*.compatible='11.2.0.4.0'*.control_files='/oracle/app/oradata/racdb/ctl01.ctl'*.db_block_size=8192*.db_create_file_dest='/oracle/app'*.db_domain=''*.db_name='racdb'*.diagnostic_dest='/oracle/app'*.dispatchers='(PROTOCOL=TCP) (SERVICE=racdbXDB)'racdb.instance_number=1racdb.log_archive_dest_1='LOCATION=/oracle/arch'*.memory_target=1606418432*.open_cursors=300*.processes=500*.remote_login_passwordfile='exclusive'*.sessions=555racdb.thread=1racdb.undo_tablespace='UNDOTBS1'注意事项:1>把racdb2的删除掉,把racdb1替换成racdb2>把涉及到路径的替换成实际环境的,有些目录得手工创建。
ORACLE11gR2 RAC集群+单实例DG安装部署配置
ORACLE 11gR2 RAC集群+单实例DG安装部署配置方案1 参考集群规划1.1硬件环境主库RAC:服务器2台:分别为32核CPU、128G内存双网卡*2 。
共享存储:2T备库单机:服务器1台:为32核CPU、128G内存。
存储:2T1.2软件环境数据库:linux.x64_11gR2集群件:linux.x64_11gR2_grid操作系统:rhel 6.9数据库版本:oracle 11.2.0.4.01.3IP及存储规则每个节点一个public IP每个节点一个public VIP每个节点一个private IP心跳private ip走私有网段,public走公用网段,网段不能相同, Public IP、Virtual IP、SCAN IP必须配置在同一网段。
2RAC主库安装实施2.1 主机环境准备2.1.1 操作系统安装分别在两个节点安装rhel6.9 x86_64位操作系统Root密码:wyq19851215--a2.1.2 服务器内存要求Swap大小:当内存为2.5GB-16GB时,Swap需要大于等于系统内存。
当内存大于16GB时,Swap等于16GB即可。
128内存建议为64或者128.配置方法:1、以下的操作都要在root用户下进行,首先先建立一个分区,采用如下命令创建512M 的swap文件(1024 * 512MB = 524288)。
dd if=/dev/zero of=/swapfile1 bs=1024 count=41943042、接着再把这个分区变成swap分区。
/sbin/mkswap /swapfile13、使用这个swap分区。
使其成为有效状态。
/sbin/swapon /swapfile14、设置系统自激活交换文件。
编辑 /etc/fstab文件,并增加如下第二行代码。
vi /etc/fstab/swapfile1 swap swap defaults 0 0你就会发现你的机器自动启动以后swap空间也增大了。
oracle10g RAC ASM rman备份到单节点文件系统恢复处理步骤
一、RAC 转换单机环境
1、创建pfile
2、relink oracle
cd $ORACLE_HOME/rdbms/lib
make -f ins_rdbms.mk rac_off
make -f ins_rdbms.mk ioracle
) SIZE 500M,
GROUP 6 (
'/oradata/datafs/app/redo601',
'/oradata/datafs/app/redo602'
) SIZE 500M,
GROUP 7 (
'/oradata/datafs/app/redo701',
set newname for datafile '+ATMDG/postdbs/pafetbs101.dbf' to '/oradata/datafs/app/pafetbs101.dbf';
set newname for datafile '+ATMDG/postdbs/pafetbs201.dbf' to '/oradata/datafs/app/pafetbs201.dbf';
run
{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
set newname for datafile '+ATMDG/postdbs/datafile/system.256.842220161' to '/oradata/datafs/app/system.256.842220161';
Oracle双活架构案例实战
持久性的挑战
双活架构瓶颈
新特性的启迪
新特性的启迪
• 远程同步实例Far Sync • PDB级Failover • 可切换的增量刷新克隆数据库
远程同步实例
• 不包含数据库
– 没有数据文件
• 在不增加负载的情况下提供零数据丢失能力 • 级联零数据丢失
– 允许同步传输到远程同步实例 – 从远程同步实例传输到远端备库 – 不会由于远端网络延迟导致主库性能下降
SQL> select 3600*5 from dual; 3600*5 ---------18000
• • • • • • •
提高存储响应,降低单次LOG FILE PARALLEL WRITE等待时间 业务端合并短小事务,降低每秒处理的事务数量 初始化参数COMMIT_WAIT=nowait 增加实例,分担单个实例每秒处理事务数量 数据库级切分,增加新的数据库来分担每秒处理事务数量 数据库版本升级到12.1 存储同步复制改为异步复制
Extended RAC性能案例(二)
Extended RAC性能案例(二)
Extended RAC最佳实践
• 私有网络全冗余配置 • 光纤网络全冗余配置 • 使用密集型光波复用设备(DWDM)架设集群互连所需的高速低延迟网络 通道 • 扩展RAC在每个机房维护一份数据的本地拷贝 • 如果采用ASM方式,设置ASM_PREFRERED_READ_FAILURE_GROUPS参数,使 得读取数据时优先访问本地数据 • 为VOTING DISK设置第三地仲裁盘 • 扩展RAC节点间距离不要超过100公里
OGG双活架构
• 系统采用Ogg DownStream模式 • 日志在本地存两份(数据实例、OGG实例),数据丢失更少; • 将数据库与OGG隔离,最大程度的降低OGG影响; • OGG的抽取和复制服务均加入到CRS集群中,提供故障自动切换的能力; • 抽取服务和复制服务主活在不同的节点,充分利用系统资源; • 日常运维服务不停机
Oracle11GADG搭建RACtoSingle详细教程(RMANDUPLICATE)
Oracle11GADG搭建RACtoSingle详细教程(RMANDUPLICATE)前言经过交流群中朋友的多次要求,这次给大家分享一下RAC to Single 的 ADG 搭建教程!一、环境准备老规矩,测试环境实战演示:主机名ip DB Version db_name db_unique_name主库节点一lucifer01 10.211.55.100 11.2.0.4 orcl主库节点二lucifer02 10.211.55.101 11.2.0.4 orcl备库luciferdg 10.211.55.110 11.2.0.4 orcl以下几点需要注意:•db_unique_name 主备库不能相同•db_name主备库需保持一致•主备库DB版本需保持一致二、搭建过程1、Oracle软件安装使用我写的Oracle 一键安装脚本,快速安装主库 RAC 和备库单机。
cd ../racdbvagrant upvagrant ssh node1su - rootcd /softsh rac_install.sh简单等待一段时间,Oracle RAC 就安装成功了!2、环境配置搭建 ADG 之前,需要先配置一下环境信息,包括主机名解析以及TNS。
1、配置 hosts 文件主库:##节点一#dgcat<<EOF>>/etc/hosts10.211.55.110 luciferdgEOF##节点二#dgcat<<EOF>>/etc/hosts10.211.55.110 luciferdgEOF备库:##dgcat<<EOF>>/etc/hosts10.211.55.100 lucifer0110.211.55.101 lucifer0210.211.55.105 lucifer-scanEOF2、配置 TNS主库+备库,在 root 用户下执行:##tnsnames.orasu - oracle -c "cat <<EOF >> /u01/app/oracle/product/11.2.0/db/network/admin/tnsnames.o ra##FOR DG BEGINORCL =(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = lucifer-scan)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = orcl)))ORCL1 =(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = lucifer01)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = orcl)))ORCL2 =(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = lucifer02)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = orcl)))ORCLDG =(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = luciferdg)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = orcl)))##FOR DG BEGINEOF"3、主库开启归档和强制日志开启归档模式(需要停机):srvctl stop database -d orcl -o immediatesrvctl start instance -d orcl -i orcl1 -o mountalter database archivelog;alter database open;srvctl start instance -d orcl -i oorcl2开启强制日志模式(可在线开启):alter database force logging;4、复制参数文件和密码文件至备库复制参数文件至备库(备库执行),要在 oracle 用户下复制:su - oraclescp oracle@lucifer01:/tmp/initorcldg.ora /tmp备库创建目录:mkdir -p /u01/app/oracle/admin/orcl/adumpsu - oracle -c "mkdir -p /oradata/orcl/datafile"su - oracle -c "mkdir -p /oradata/orcl/onlinelog"su - oracle -c "mkdir -p /oradata/orcl/tempfile"mkdir -p /u01/app/oracle/fast_recovery_area/orclchown -R oracle:oinstall /u01/app/oracle/admin/orcl/adump chown -R oracle:oinstall /u01/app/oracle/fast_recovery_area 备库修改参数文件:*._optimizer_cartesian_enabled=FALSE*.audit_file_dest='/u01/app/oracle/admin/orcl/adump'*.audit_trail='NONE'*.compatible='11.2.0.4.0'*.db_block_size=8192*.control_files='/oradata/orcl/control01.ctl','/u01/app/oracle /fast_recovery_area/orcl/control02.ctl'*.db_create_file_dest='/oradata/orcl'*.db_domain=''*.db_name='orcl'*.db_recovery_file_dest='/u01/app/oracle/fast_recovery_are a'*.db_recovery_file_dest_size=5501878272*.deferred_segment_creation=FALSE*.diagnostic_dest='/u01/app/oracle'*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'*.event='10949 trace name context forever:28401 trace name context forever,level 1:10849 trace name context forever, level 1:19823 trace name context forever, level 90'*.open_cursors=300*.pga_aggregate_target=196083712*.processes=150*.result_cache_max_size=0*.sga_target=784334848*.db_unique_name='orcldg'*.log_archive_config='dg_config=(ORCLDG,ORCL)'*.log_archive_dest_1='location=/archivelogvalid_for=(all_logfiles,all_roles) db_unique_name=ORCLDG' *.log_archive_dest_2='service=orcl async valid_for=(online_logfiles,primary_role) db_unique_name=ORCL' *.log_archive_dest_state_2='ENABLE'*.log_archive_format='%t_%s_%r.arc'*.log_archive_max_processes=4*.remote_login_passwordfile='exclusive'*.fal_server='ORCL'*.fal_client='ORCLDG'*.db_file_name_convert='+DATA','/oradata'*.log_file_name_convert='+DATA','/oradata'*.standby_file_management='AUTO'*.undo_tablespace='UNDOTBS1'复制密码文件至备库(备库执行),要在 oracle 用户下复制:su - oraclescporacle@lucifer01:/u01/app/oracle/product/11.2.0/db/dbs/orap worcl1 /u01/app/oracle/product/11.2.0/db/dbs/orapworcl5、主库添加 stanby log 文件set pagesize100set line222col member for a60select * from v$logfile;select * from v$log;注意:•stanby log 日志大小与 redo log 日志保持一致•stanby log 数量:standby logfile=(1+logfile组数)*thread=(1+3)*1=4 组,需要加 4 组 standby logfile•thread 要与redo log 保持一致,如果是rac,需要增加多个thread 对应的 standby logALTER DATABASE ADD STANDBY LOGFILE thread 1group 5 ('+DATA') SIZE 120M,group 6 ('+DATA') SIZE 120M,group 7 ('+DATA') SIZE 120M;ALTER DATABASE ADD STANDBY LOGFILE thread 2group 8 ('+DATA') SIZE 120M,group 9 ('+DATA') SIZE 120M,group 10 ('+DATA') SIZE 120M;select * from v$standby_log;6、备库开启到 nomount 状态startup nomount pfile='/tmp/initorcldg.ora';3、RMAN DUPLICATErman 恢复备库:rman target sys/oracle@orcl1 AUXILIARY sys/oracle@orcldgrun {allocate channel prmy1 type disk;allocate channel prmy2 type disk;allocate auxiliary channel aux1 type disk;allocate auxiliary channel aux2 type disk;DUPLICATE TARGET DATABASE FOR STANDBY FROM ACTIVE DATABASE DORECOVER NOFILENAMECHECK;}主库设置 ADG 参数:ALTER SYSTEM SET LOG_ARCHIVE_CONFIG='DG_CONFIG=(ORCL,ORCLDG)';ALTER SYSTEM SET LOG_ARCHIVE_DEST_1='LOCATION=+DATAVALID_FOR=(ALL_LOGFILES,ALL_ROLES)DB_UNIQUE_NAME=ORCL';ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='SERVICE=orcldgLGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=ORCLDG';ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=ENABLE;ALTER SYSTEM SET LOG_ARCHIVE_FORMAT='%t_%s_%r.arc' SCOPE=SPFILE;ALTER SYSTEM SET LOG_ARCHIVE_MAX_PROCESSES=4;ALTER SYSTEM SET REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE SCOPE=SPFILE;ALTER SYSTEM SET FAL_SERVER=ORCLDG;ALTER SYSTEM SET FAL_CLIENT=ORCL;ALTER SYSTEM SET DB_FILE_NAME_CONVERT='/oradata','+DATA' SCOPE=SPFILE;ALTER SYSTEM SET LOG_FILE_NAME_CONVERT='/oradata','+DATA' SCOPE=SPFILE;ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=AUTO;4、备库开启日志应用-- 首先开启备库至只读状态alter database open read only;-- 开启主备同步进程ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;-- 检查备库角色select database_role,open_mode from v$database;DATABASE_ROLE OPEN_MODE---------------- --------------------PHYSICAL STANDBY READ ONLY WITH APPLY-- 检查保护模式,最大性能SQL> SELECT protection_mode FROM v$database;PROTECTION_MODE--------------------MAXIMUM PERFORMANCE5、主库开启 LOG_ARCHIVE_DEST_STATE_2确认主备之前没有问题,主库开启同步:ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=ENABLE; 写在最后ADG 的搭建过程比较简单,有很多朋友经常问,单机到单机,RAC 到单机,RAC到RAC的教程。
在ASM上配置GoldenGate
table his_dba.HIS_APPLY_INFO_T;
table his_dba.HIS_ERROR_INFO_T;
table his_dba.HIS_SSMZ_T;
方法2:
OGG11g提供一个新的参数:DBLOGREADER
使用该参数,我们就不需要配置登陆ASM所需要的TNS配置内容,而且在参数文件里面也不需要制定归档路径的位置,它会自动去寻找归档路径。但如果要使用该参数,对数据库的版本有一定的要求,以下是官方文档对该参数的解释:
1)添加OGG捕获进程:
GGSCI>add extract wuhan, tranlog, begin now,threads 2
GGSCI>add exttrail ./dirdat/aa, extractwuhan, megabytes 100
2)添加OGG捕获进程:
EXTRACTWUHAN
setenv (NLS_LANG=AMERICAN_AMERICA.AL32UTF8)
2014-01-20 15:34:12ERROROGG-00868 This version of Oracle does not support the DBLOGREADER option
2014-01-20 15:34:12ERROR OGG-01668 PROCESS ABENDING
使用该参数,只需要在捕获进程参数文件里面添加好就OK了。
11.2.0.2 and later11gR2 versions (but not in Oracle 11gR1versions).This API uses the database server to access the redo and archive logs, instead of connecting directly to the Oracle ASM instance. The database must contain the
Oracle 10g RAC 在IBM AIX上实施ASM
Oracle 10g RAC 在IBM AIX上实施ASM(初稿)Oracle 10g RAC中HACMP不再是必需的Oracle提供自己的群集件CRS(Oracle Cluster Ready Service) 10g RAC必需要用CRS10g RAC实现方式主要为:1. 裸设备+ASM (AutoMated Storage Management)2. GPFS (General Parallel File System)3. 裸设备+HACMP在局域网中实现方式2到多个节点硬件结构AIX5.2/5.3操作系统被oracle认证通过,如果安装了HACMP而没有选择裸设备+HACMP 实现方式,必须要卸载HACMP在实际的产品库环境中,千兆交换机是必须的,被用来处理缓存融合(cache fusion)网络结构的例子:各节点上的公用(public )网卡必须采用一样的名字,例如:en0各节点上的私用(private)网卡必须采用一样的名字,例如:en1AIX VIRTUAL I/O DISKS可用于安装$CRS_HOME 或$ORACLE_HOME,不能用于ocr vote disk datafile存储设备方面IBM DS4000, DS6000 and DS8000 series 被10gRAC支持具体可查/servers/storage/product/products_pseries.html还支持EMC 等产品RAC整体安装步骤:具体建库步骤:硬件需求至少1G物理内存lsattr –El sys0 –a realmem交换分区400M-2G lsps –a临时空间不少于400M df –m /tmp操作系统AIX5204或更晚版本AIX5302或更晚版本oslevel –r操作系统要安装好需要的filesets和APAR确认PTF是否安装,如果没装从这里下载安装: /eserver/support/fixes/ ASM需要的filesets和APAR:需要的Oracle安装介质:解压方法:检查oracle用户限制是否已取消,ulimit -f 文件大小限制ulimit -a 全部限制可以检查或修改/etc/security/limits,以取消对新用户的限制用passwd oracle修改各节点oracle用户口令为一致在各节点配置内核参数和shell限制可以使用smit chuser修改用户最大进程数smit chgsys 把Maximum number of PROCESSES allowed per user改为2048或更大配置网络Public网络的节点名(这里是node1 node2 node3)必须是hostname显示的结果检查更新各节点hosts文件内容是否如下:# Public Network10.3.25.81 node110.3.25.82 node210.3.25.83 node3# Virtual IP address10.3.25.181 node1_vip10.3.25.182 node2_vip10.3.25.183 node3_vip# Interconnect RAC10.10.25.81 node1_rac10.10.25.82 node2_rac10.10.25.83 node3_rac在公用网络接口(这里是en0)上设置默认网关smitty chinet 设置BROADCAST ADDRESS为10.3.25.254检查配置各节点/etc/hosts.equiv 和root、oracle用户主目录下的$HOME/.rhosts如下:node1 rootnode2 rootnode3 rootnode1 oraclenode2 oraclenode3 oracle出于安全考虑,不建议把+放在hosts.equiv 或.rhosts文件中注意节点名是以hostname显示的结果,命令示例:rsh node2 dateecho aa>1.tmprcp 1.tmp node2:/tmprlogin node2在每个节点上配置oracle用户环境,以oracle用户登录后执行vi $HOME/.profile,加入以下内容:#oracle envionmentexport ORACLE_BASE=/u01/app/oracleexport ORACLE_CRS=$ORACLE_BASE/crsexport ORACLE_CRS_HOME=$ORACLE_BASE/crsexport ORACLE_HOME=$ORACLE_BASE/10.2.0exportLD_LIBRARY_PA TH=$ORACLE_CRS/lib:$ORACLE_CRS/lib32:$ORACLE_HOME/lib:/usr/li b:$ORACLE_HOME/lib32export PA TH=$ORACLE_CRS/bin:$ORACLE_HOME/bin:$PA THexport LIBPATH=$ORACLE_HOME/lib:$ORACLE_HOME/ctx/libexport ORA_DB=$ORACLE_HOME/dbsexport CLASSPATH=$ORACLE_HOME/jlibexport ORACLE_SID=asmdb1 或者asmdb2export ORACLE_TERM=vt100export TNS_ADMIN=$ORACLE_HOME/network/adminexport NLS_LANG=AMERICAN_AMERICA.ZHS16GBKexport AIXTHREAD_SCOPE=Sumask 022export TEMP=/tmpexport TMPDIR=/tmpexport PS1=`whoami`@`hostname`:`$PWD`$#set -o vi#export DISPLAY=localhost:0.0其中的S的含义:S for system-wide thread scope以6G为例,参考命令:lsdev –Ccdisk | grep SCSImkvg -f -y'oraclevg' -s'32' hdisk1crfs -v jfs2 -a bf=true -g'oraclevg' -a size='8388608' -m'/u01' -A'yes' -p'rw' -t'no' -a nbpi='8192' -a ag='64'mount /u01chown oracle:dba /u01ASM实现方式:存储划分,需要根据目前应用情况,与硬件工程师具体商定。
Oracle11gr2RAC到单实例的DG搭建(落地备份)
Oracle11gr2RAC到单实例的DG搭建(落地备份)⼀、实施⽅案这⼏天给客户的Oracle 11gr2 RAC搭建到单实例的DG,整理了⼀下步骤,理清⼀下思路,⽂中敏感信息已做模糊处理。
RAC⾄单实例的Dataguard为双节点各⾃传递⾃⼰当前线程的归档⾄备库。
由于节点1存储不⾜,备份在节点2上跑。
整体搭建思路如下:备库⽂件⽬录创建à主库force logging(已是归档模式)à备份节点⼆à复制节点⼆⼝令⽂件à创建备库pfileà创建备库à恢复备库à创建主备standby logfileà配置主备监听及TNSà修改主库(节点⼀、节点⼆)参数à打开备库并实时应⽤1.1 主备环境说明Primary Node1Node2Hostname hostname01hostname02Public10.10.10.14110.10.10.143VIP10.10.10.14210.10.10.144SCAN10.10.10.140Instance_name repprod1repprod2DB_name repprodService_names repprodDB_unique_name repprodStorage_mode ASMStandby NodeHostname hostnamedgIP10.10.10.191Instance_name RepproddgDB_name repprodService_names repproddgDB_unique_name repproddgStorage_mode Local disk1.2 ⽂件系统规划Primary Standby+DATADG/repprod/datafile/oradata/datafile+DATADG/repprod/tempfile/oradata/tempfile+ARCDG/repprod/onlinelog/oradata/onlinelog+DATADG/repprod/onlinelog+ARCDG//oradata/arch1.3 实施操作步骤1.3.1 备库存储和⽂件系统创建#standby库上新建各个数据⽂件的存放位置$mkdir -p /oradata/datafile --数据⽂件$mkdir -p /oradata/tempfile --临时⽂件$mkdir -p /oradata/onlinelog --redo⽇志$mkdir -p /oradata/controlfile --控制⽂件$mkdir -p /oradata/arch --归档⽂件#备库为全新安装oracle 11.2.0.4软件,需要⼿⼯建⽴以下⽬录,保持与主库⽬录⼀致。
oracleRAC中的ASM调整
oracleRAC中调整ASM磁盘
ASM调整方案如下:
1.从原有磁盘组中分离出一块100G的磁盘
1.1查看磁盘状态:
$export ORACLE_SID=+ASM1
$sqlplus / as sysdba
1.2分离最后一块磁盘DA TA_0011,并监控ASM操作
ASM没有操作时表示分离操作结束,结束显示为:没有选定行
1.3验证磁盘是否从磁盘组分离并核对负载
最后一块盘显示的是0010,0011已经消失,最后显示14行被选定,也说明0011已经被删除。
2.创建新的ASM磁盘组DA TA0
2.1启动DBCA
soadb1:/home/oracle$ dbca
选择RAC集群数据库
选侧配置ASM
选中两节点
输入ASM实例SYS用户密码:oracle
选择创建新的磁盘组
单磁盘建立磁盘组
此时ASM开始创建磁盘组
验证新磁盘组DA TA0参数,重点确认已经在两节点上挂载
2.2进入ASM实例验证
在节点2验证
此时可见,新生成了一个2号组,磁盘名称是DA TA0_0000,另外我们可以发现由于不在同一个磁盘组,其负载并不能与DA TA组的磁盘均衡
3.将快速闪回区移至新的磁盘组DA TA0
查看当前快速闪回区信息为:
3.1重新指定db_recovery_file_dest到DATA0组(快速闪回区路径)并验证
3.2修改db_recovery_file_dest_size到60G(快速闪回区大小)并验证。
ORACLE 10G ASM RAC +SINGLE ASM DATAGUARD
ORACLE 10G ASM RAC +SINGLE ASM DATAGUARD 建立一,主库(在一個節點上改變spfile文件,保持兩個節點公用一個spfile文件),並且与从库的oracle 版本必须一样,主库必须设在归档模式二,强制主库为logging状态Alter database force logging;三,在主库与丛库中同时生成密码文件以Oracle用户登陆$rm $ORACLE_HOME/dbs/orapw$ORACLE_SID$orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password=oracle entries=4其中password為sys用戶密碼四,在主库与丛库中设置相应环境变量以Oracle用户登陆主库:在$vi /home/oracle/.bash_profile中设置export ORACLE_SID=DLexport ORACLE_BASE=/opt/oracleexport ORACLE_HOME=/opt/oracle/product/10.2.0/dlexport NLS_LANG=AMERICAN_AMERICA.ZHT16BIG5export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/dataexport PATH=$ORACLE_HOME/bin:$PATH:/sbinexport LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib丛库:在$vi /home/oracle/.bash_profile中设置export ORACLE_SID=DLDGexport ORACLE_BASE=/opt/oracleexport ORACLE_HOME=/opt/oracle/product/10.2.0/dlexport NLS_LANG=AMERICAN_AMERICA.ZHT16BIG5export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/dataexport PATH=$ORACLE_HOME/bin:$PATH:/sbinexport LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib五,在从库中准备相应目录,如日志文件路径,归档路径,参数文件路径,数据文件准备存放路径等以Oracle用户登陆$cd $ORACLE_BASE$mkdir –p admin/dl/adump$mkdir –p admin/dl/bdump$mkdir –p admin/dl/cdump$mkdir –p admin/dl/dpdump$mkdir –p admin/dl/udump与主库建立同样的归档路径$mkdir –p /backup/archive六,主库与从库建立参数文件在主库中生成pfile$sqlplus ‘/as sysdba’Create pfile=’/home/oracle/pfile.ora’ from spfile;主库中pfile将主库的pfile copy到从库中进行修改如下:从库与主库不一样的参数:*.standby_archive_dest='/backup/archive'*.standby_file_management='AUTO'*.fal_client='DLDG'*.fal_server='DL'还用控制文件路径,及各dump文件路径需要修改七,对主库做一次全备份在主库与从库中建立相同的备份路径以Oracle用户登录$mkdir –p /backup/rman$chmod 770 /backup/rman做一次完整的RMAN热备份$rman target/Rman>show all;CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # defaultCONFIGURE BACKUP OPTIMIZATION OFF; # defaultCONFIGURE DEFAULT DEVICE TYPE TO DISK; # defaultCONFIGURE CONTROLFILE AUTOBACKUP ON;CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # defaultCONFIGURE DEVICE TYPE DISK PARALLELISM 4 BACKUP TYPE TO BACKUPSET;CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # defaultCONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/backup/rman/%U';CONFIGURE MAXSETSIZE TO UNLIMITED; # defaultCONFIGURE ENCRYPTION FOR DATABASE OFF; # defaultCONFIGURE ENCRYPTION ALGORITHM 'AES128'; # defaultCONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # defaultCONFIGURE SNAPSHOT CONTROLFILE NAME TO'/opt/app/oracle/product/10.2.0/dl/dbs/snapcf_DL1.f'; # defaultRman> backup database plus archivelog delete input;Rman>sql”alter system archive log current”;通过scp传送相应的备份集到备用服务器$scp /backup/rman/*.bak (dldg)ip: /backup/rman/八,配置网络连接从库监听listener.oraSID_LIST_LISTENER =(SID_LIST =(SID_DESC =(SID_NAME = PLSExtProc)(ORACLE_HOME = /opt/oracle/product/10.2.0/dl)(PROGRAM = extproc)))LISTENER =(DESCRIPTION_LIST =(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = dldg)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))))从库tnsnames.oradl =(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST=dl)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = dl)))DLDG =(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST=dldg)(PORT = 1521)) )(CONNECT_DATA =(SERVICE_NAME = DLDG)))主库监听listener.oraSID_LIST_LISTENER =(SID_LIST =(SID_DESC =(SID_NAME = PLSExtProc)(ORACLE_HOME = /opt/oracle/product/10.2.0/nb)(PROGRAM = extproc)))LISTENER =(DESCRIPTION_LIST =(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = dl)(PORT = 1521))(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))))主库tnsnames.oradl =(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST=dl)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = dl)))DlDG =(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST=dldg)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = DlDG)))九,在主库创建从库的控制文件主库先关闭,然后使用修改的pfile文件使其处于mount状态下Sql>shutdown immediate;Sql>startup mount pfile=’/home/oracle/pfile.ora’;Sql>alter database create standby controlfile as ‘创建的路径和文件名’;如:alter database create standby controlfile as ‘/backup/con01.ctl’;使用scp传送到从库,然后复制该控制文件到参数指定的路径下,并按参数文件的指定个数复制多分十,备用库配置ASM1,安裝asm包a)配置ASMLib以root 用户身份在两个节点上配置ASMLib。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
RAC(ASM)到单机OGG配置案例环境说明:源端DB:操作系统:AIX 7100-02-07-1524数据库:oracle_11.2.0.1.0 RACgoldengate:for_11g_ppc目标端DB:操作系统:windows 7数据库:oracle_11.2.0.1.0goldengate:for_11g_x86注意:本实验是模拟在不同平台同版本上面安装和配置OGG,并实现简单的DML复制,至于复杂的其他方面希望大家能自己多多实验。
作者:姓名:ZhangQYQQ:5056357配置步骤:1、检查源端和目标端正确的IP解析:源端:# cat /etc/hosts# 10.2.0.2 x25sample # x.25 name/address# 2000:1:1:1:209:6bff:feee:2b7f ipv6sample # ipv6 name/address 127.0.0.1 loopback localhost # loopback (lo0) name/address ::1 loopback localhost # IPv6 loopback (lo0)name/address172.16.16.101 zqdb192.169.79.11 zqdb172.16.16.165 oradg192.169.79.12 oradg172.16.16.166 gc1-scan.zqdb172.16.16.168 zqdb-vip172.16.16.169 oradg-vip目标端:C:\Windows\System32\drivers\etc\hosts无特殊配置2、设置LIBPATH,为了安装OGG所用的动态链接库。
如果没有配置这个路径的话,在安装OGG的过程中会报找不到动态链接库的错误,用户可以自己尝试一下。
源端:# su - oraclezqdb:/home/oracle>$vi .profile".profile" 25 lines, 756 charactersPATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:.export PATHif [ -s "$MAIL" ] # This is at Shell startup. In normalthen echo "$MAILMSG" # operation, the Shell checksfi # periodically.OGG_HOME=/oracle/ogg/12.1.2ORACLE_BASE=/oracle/ora11gORACLE_HOME=/oracle/ora11g/product/11gORACLE_SID=ora11g1export ORACLE_BASE ORACLE_HOME ORACLE_SIDORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/dataNLS_LANG=AMERICAN_AMERICA.ZHS16GBKLD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/libexport ORA_NLS33 NLS_LANG LD_LIBRARY_PATHPATH=$PATH:$ORACLE_HOME/bin:$OGG_HOMEexport PATHLIBPATH=$ORACLE_HOME/lib32:$ORACLE_HOME/libexport LIBPATHexport DISPLAY=172.17.2.203:0.0export PS1="`hostname`":'$PWD>$'目标端:无特殊配置3、在源端创建专用的表空间、schema、并授权。
create tablespace goldengate datafile '+DATA/ora11gtd/datafile/goldengate01.dbf' size 100m autoextend on;create user goldengate identified by goldengate default tablespace goldengate temporary tablespace temp;grant connect to goldengate;grant alter any table to goldengate;grant alter session to goldengate;grant create session to goldengate;grant flashback any table to goldengate;grant select any dictionary to goldengate;grant select any table to goldengate;grant resource to goldengate;grant select any transaction to goldengate;4、检查源端数据库是否在归档模式,强烈建议在归档模式。
SQL> archive log list;Database log mode Archive ModeAutomatic archival EnabledArchive destination +DATA/oraarch/Oldest online log sequence 33Next log sequence to archive 34Current log sequence 345、源端:添加附加日志来唯一标识一行记录,要在数据库级别打开最小开关。
为了减少整个数据库添加附加日志,以及减少归档量,goldengate建议复制哪些对象,就添加哪些表的附加日志(我们到时候是拿hr用户下的表来实验)。
检查:SQL> select supplemental_log_data_min from v$database;SUPPLEME--------NO打开:SQL> alter database add supplemental log data;Database altered.再次查看:SQL> select supplemental_log_data_min from v$database;SUPPLEME--------YES切换日志组,使附加日志开关生效。
SQL> alter system switch logfile;System altered.解释:在正常情况下,oracle是用rowid来唯一标示一行记录的,但goldengate这里不够,需要打开附加日志。
6、我们先安装和配置goldengate,安装比较简单,通过xmanager软件连接主机,并设置好DISPLAY变量,见源端hosts文件。
zqdb:/orainstall/ggs_AIX_ppc_shiphome/Disk1>$./runInstaller注意:自己要下载正确的软件。
7、测试安装成功,只需进入命令行,就表明安装是成功的。
zqdb:/home/oracle>$cd $OGG_HOMEzqdb:/oracle/ogg/12.1.2>$ggsciOracle GoldenGate Command Interpreter for OracleVersion 12.1.2.0.0 17185003 OGGCORE_12.1.2.0.0T1_PLATFORMS_140313.1216 AIX 5L, ppc, 64bit (optimized), Oracle 11g on Mar 13 2014 14:48:55Operating system character set identified as ISO-8859-1.Copyright (C) 1995, 2014, Oracle and/or its affiliates. All rights reserved.GGSCI (zqdb) 1>GGSCI (zqdb) 1> info allProgram Status Group Lag at Chkpt Time Since ChkptMANAGER STOPPED注意:表示安装成功。
8、在目标端也安装成功。
windows安装执行对应包的.exe文件,注意选择正确的版本。
D:\oggapp\product\12.1.2\oggcore_1>ggsciOracle GoldenGate Command Interpreter for OracleVersion 12.1.2.0.0 17185003 OGGCORE_12.1.2.0.0_PLATFORMS_130924.1316 Windows x64 (optimized), Oracle 11g on Sep 24 2013 22:02:24Operating system character set identified as GBK.Copyright (C) 1995, 2013, Oracle and/or its affiliates. All rights reserved. GGSCI (zhangqy-PC) 1>GGSCI (zhangqy-PC) 1> info allProgram Status Group Lag at Chkpt Time Since Chkpt MANAGER STOPPED9、配置源端和目标端的管理进程。
源端:GGSCI (zqdb) 2> create subdirs源端:Creating subdirectories under current directory /oracle/ogg/12.1.2Parameter files /oracle/ogg/12.1.2/dirprm: createdReport files /oracle/ogg/12.1.2/dirrpt: created Checkpoint files /oracle/ogg/12.1.2/dirchk: createdProcess status files /oracle/ogg/12.1.2/dirpcs: createdSQL script files /oracle/ogg/12.1.2/dirsql: createdDatabase definitions files /oracle/ogg/12.1.2/dirdef: createdExtract data files /oracle/ogg/12.1.2/dirdat: createdTemporary files /oracle/ogg/12.1.2/dirtmp: created Credential store files /oracle/ogg/12.1.2/dircrd: createdMasterkey wallet files /oracle/ogg/12.1.2/dirwlt: createdDump files /oracle/ogg/12.1.2/dirdmp: created源端修改MGR参数:GGSCI (zqdb) 20> edit params mgrport 7809DYNAMICPORTLIST 7840-7850AUTOSTART EXTRACT *AUTORESTART EXTRACT *PURGEOLDEXTRACTS ./dirdat/*,usecheckpoints, minkeepdays 7 LAGREPORTHOURS 1LAGINFOMINUTES 30LAGCRITICALMINUTES 45GGSCI (zqdb) 20> start mgrManager started.GGSCI (zqdb) 21> info mgrManager is running (IP port zqdb.7809, Process ID 17432670).目标端修改MGR参数:目标端:GGSCI (zhangqy-PC) 2> create subdirsCreating subdirectories under current directory D:\oggapp\product\12.1.2\oggcore _1Parameter files D:\oggapp\product\12.1.2\oggcore_1\dirprm: already existsReport files D:\oggapp\product\12.1.2\oggcore_1\dirrpt: already existsCheckpoint files D:\oggapp\product\12.1.2\oggcore_1\dirchk: already existsProcess status files D:\oggapp\product\12.1.2\oggcore_1\dirpcs: already existsSQL script files D:\oggapp\product\12.1.2\oggcore_1\dirsql: already existsDatabase definitions files D:\oggapp\product\12.1.2\oggcore_1\dirdef: already existsExtract data files D:\oggapp\product\12.1.2\oggcore_1\dirdat: already existsTemporary files D:\oggapp\product\12.1.2\oggcore_1\dirtmp: alread y existsCredential store files D:\oggapp\product\12.1.2\oggcore_1\dircrd: already existsMasterkey wallet files D:\oggapp\product\12.1.2\oggcore_1\dirwlt: already existsDump files D:\oggapp\product\12.1.2\oggcore_1\dirdmp: alread y existsGGSCI (zhangqy-PC) 3> edit params mgrport 7809DYNAMICPORTLIST 7840-7850AUTOSTART EXTRACT *AUTORESTART EXTRACT *PURGEOLDEXTRACTS ./dirdat/*,usecheckpoints, minkeepdays 7 LAGREPORTHOURS 1LAGINFOMINUTES 30LAGCRITICALMINUTES 45启动配置的管理进程GGSCI (zhangqy-PC) 6> start mgrManager started.查看刚刚设置的端口号有没有问题GGSCI (zhangqy-PC) 7> info mgrManager is running (IP port zhangqy-PC.7809, Process ID 4948).参数分析:第一行表示管理进程的端口号。