1、1ogg 操 作 手 册版本:V1.02目录1. 源端库准备工作 .31.1 创建 ogg 管理用户并授权 .51.2 安装 telnet 工具 .51.3 磁盘使用情况 .62. 源端 ogg 准备工作 .62.1 设置 ogg 环境变量 .62.2 上传 ogg 软件到相关目录 .62.3 登陆 .82.4 创建 def 文件 .82.5 创建 Manager 进程 .82.6 创建 Extract 进程 .92.7 创建 Pump 进程 .92.8 开启源端进程 .102.9 查看进程状态 .103. 目标端 ogg 准备工作 .113.1 磁盘使用情况 .113.2 创建用户并授权 .
2、113.2 设置 ogg 环境变量 .113.3 上传 ogg 软件到相关目录 .123.4 登陆 .133.5 添加检查点系统表 .133.6 创建 Manager 进程 .133.7 创建 Replicat 进程 .143.8 开启目标端进程 .153.9 查看目标端进程的状态 .1531. 源端库准备工作oraclerac1 $ps -ef|grep ogg|grep -v grep/查看业务系统是否安装过 oggoraclerac1 $sqlplus / as sysdbaSQLshow parameter processes; /查询 oracle 最大连接数SQLselect co
3、unt(*) from v$process; /查询当前连接数SQL archive log list/查看是否开启归档Database log mode Archive ModeAutomatic archival Enabled 开启状态Archive destination +ARCHDGOldest online log sequence 342Next log sequence to archive 343Current log sequence 343*开启归档的步骤*SQLshutdown immediate; /必须是 immediate 一至性关闭数据库4SQLstartup
4、 mount;/开启数据库到 mount 状态SQL alter system set log_archive_dest_1=location=+archdg;/指定归档日志存放的路径SQLalter database archivelog;/开启归档SQLalter database open;/打开数据库 SQL alter system switch logfile;/切换归档SQL alter system archive log current;/切换归档SQLSELECT FORCE_LOGGING FROM V$DATABASE;/查看是否开启强制日志SQLalter datab
5、ase force logging;/开启强制日志的命令SQLselect supplemental_log_data_min from v$database;/查看是否开启附加日志SQLalter database add supplemental log data ;/开启附加日至命令5SQLalter system switch logfile;/切换归档1.1 创建 ogg 管理用户并授权SQLcreate user cas_sgcis identified by Sap12345;SQLgrant connect to cas_sgcis;SQLgrant SELECT ANY DI
6、CTIONARY to cas_sgcis;SQLgrant select any table to cas_sgcis;1.2 安装 telnet 工具oraclerac1 $rpm -ivh telnet-0.17-47.el6_3.1.x86_64.rpmoraclerac1 $rpm -ivh telnet-server-0.17-47.el6_3.1.x86_64.rpm/源端和目标端都要安装 telnet编辑设置 /etc/xinetd.d/telnet ,将 disable= yes 设置成disable= noecho pts/0 /etc/securettyecho pts/
7、1 /etc/securettyservice xinetd restart/设置 root 远程登录61.3 磁盘使用情况oraclerac1 $ df -hFilesystem Size Used Avail Use% Mounted on/dev/sda3 145G 19G 119G 14% /tmpfs 1.5G 980M 457M 69% /dev/shm/dev/sda1 291M 39M 238M 14% /boot2. 源端 ogg 准备工作oraclerac1 $mkdir /ogg/创建 ogg 目录oraclerac1 $chown oracle:oinstall -R
8、/oggoraclerac1 $chmod 775 -R /ogg2.1 设置 ogg 环境变量oraclerac1 $vi .bash_profileexport OGG_HOME=/oggoraclerac1 $. .bash_profile2.2 上传 ogg 软件到相关目录oraclerac1 ogg$ unzip ogg112101_fbo_ggs_Linux_x64_ora11g_64bit.zip7oraclerac1 ogg$ tar -xvf fbo_ggs_Linux_x64_ora11g_64bit.tar/解压 ogg 软件oraclerac1 ogg$ cp $ORA
9、CLE_HOME/lib/libnnz11.so /ogg oraclerac1 ogg$ cp $ORACLE_HOME/lib/libclntsh.so.11.1 /ogg/拷贝 ogg 所需要的共享文件oraclerac1 ogg$ ./ggsciGGSCI (rac1) 1 create subdirs/初始化 ogg 目录Creating subdirectories under current directory /oggParameter files /ogg/dirprm: already existsReport files /ogg/dirrpt: createdCheck
10、point files /ogg/dirchk: createdProcess status files /ogg/dirpcs: createdSQL script files /ogg/dirsql: createdDatabase definitions files /ogg/dirdef: createdExtract data files /ogg/dirdat: createdTemporary files /ogg/dirtmp: createdStdout files /ogg/dirout: created82.3 登陆GGSCI (rac1) 1dblogin userid
11、 cas_sgcis,password Sap123452.4 创建 def 文件GGSCI (rac1) 1edit params fdpm_defdefsfile /ogg/dirdef/fdpmaster_ah.defuserid CAS_SGCIS,password Sap12345table fdpmaster_ah.G_LINE;oraclerac1 ogg$ ./defgen paramfile ./dirprm/fdpm_def.prm/生成 def 定义文件oraclerac1 ogg$ scp /ogg/dirdef/fdpmaster_ah.def root192.168
12、.1.205:/ogg/dirdef/把定义文件传到目标端2.5 创建 Manager 进程GGSCIedit params mgrPORT 8333 DYNAMICPORTLIST 8334-8999-AUTOSTART ER *AUTORESTART EXTRACT *,RETRIES 5,WAITMINUTES 3PURGEOLDEXTRACTS ./dirdat/*,usecheckpoints, minkeepdays 3LAGREPORTHOURS 19LAGINFOMINUTES 30LAGCRITICALMINUTES 452.6 创建 Extract 进程GGSCI (rac
13、1) 2 edit params extractextract extractGETTRUNCATESGETUPDATEBEFORESFETCHOPTIONS FETCHPKUPDATECOLSdynamicresolutionuserid CAS_SGCIS,password Sap12345 TRANLOGOPTIONS ASMUSER sysasm, ASMPASSWORD oracleexttrail /ogg/dirdat/a5table fdpmaster_ah.G_LINE;GGSCI (rac1) 2 add extract Extract,tranlog,threads 2,
14、begin nowGGSCI (rac1) 2 add exttrail /ogg/dirdat/a5,extract Extract2.7 创建 Pump 进程GGSCI (rac1) 2 edit params pumpextract pumppassthru10dynamicresolutionuserid CAS_SGCIS,password Sap12345rmthost 192.168.1.205,mgrport 8333rmttrail /ogg/dirdat/a5table fdpmaster_ah.G_LINE;GGSCI (rac1) 2 add extract Pump,
15、exttrailsource /ogg/dirdat/a5GGSCI (rac1) 2 add rmttrail /ogg/dirdat/a5,extract Pump2.8 开启源端进程GGSCI (rac1) 3start mgrGGSCI (rac1) 3start ExtractGGSCI (rac1) 3start Pump2.9 查看进程状态GGSCI (rac1) 4 info allProgram Status Group Lag at Chkpt Time Since ChkptMANAGER RUNNING EXTRACT RUNNING Extract 00:00:00 00:00:07 EXTRACT RUNNING Pump 00:00:00 00:00:01