2015年8月25日星期二

Oracle GoldenGate 二、配置和使用 - 堅持╅信念★

本邮件内容由第三方提供,如果您不想继续收到该邮件,可 点此退订
Oracle GoldenGate 二、配置和使用 - �猿蜘樾拍睢�  阅读原文»

配置和使用GoldenGate的步骤

  • 1 在源端和目标端配置数据库支持GoldenGate
  • 2 在源端和目标端创建和配置GoldenGate实例
  • 3 在源端创建和配置主抽取进程(Primary Extract)
  • 4 在源端创建和配置Data Pump进程(Secondly Extract)
  • 5 在目标端创建和配置Replicat进程

1 配置数据库支持GoldenGate

1.1 OGG用户和权限分配

  GoldenGate需要从在线日子或归档日志抽取捕获系统的变更数据信息,这些信息可能来源于业务用户,可能来源于系统用户,为了使GoldenGate能够抽取这些数据应为GoldenGate创建独立的用户和分配必要的权限以满足系统运行需求,这些权限包括读取业务用户表数据的权限、读取系统表的权限、执行某个系统包的权限等,以下脚步创建GoldenGate用户ogg_owner(源用户)、ogg_trg(目标用户)和GoldenGate角色ogg_role:

[oracle@sywu ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Fri Aug 21 14:11:04 2015

Copyright (c) 1982, 2011, Oracle. All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SYS@sydb>create tablespace tbs01
datafile '+oradata'
size 10m
autoextend on
uniform size 2m
/
create user ogg_owner identified by ogg_owner default tablespace tbs01 quota unlimited on tbs01
/
create user ogg_trg identified by ogg_trg default tablespace tbs01 quota unlimited on tbs01
/
create role ogg_role
/

为易管理和维护统一将权限赋予角色ogg_role:

grant
CREATE SESSION,
ALTER SESSION,
ALTER SYSTEM,
RESOURCE,
SELECT ANY DICTIONARY,
FLASHBACK ANY TABLE,
SELECT ANY TABLE,
SELECT ANY TRANSACTION,
insert any table,
update any table,
drop any table,
CREATE TABLE
to ogg_role;

grant SELECT on dba_clusters to ogg_role;
grant SELECT on V_$DATABASE to ogg_role;Android Volley源码分析 - 希尔瓦娜斯女神  阅读原文»

今天来顺手分析一下谷歌的volley http通信框架。首先从github上 下载volley的源码,

然后新建你自己的工程以后 选择import module 然后选择volley。 最后还需要更改1个

配置文件

就是我选中的那句话。记得要加。不然会报错。把volley作为一个module 在你的项目中引用的原因是,因为我们要分析源码,需要测试我们心中所想。所以这么做是最方便的。

就相当于eclipse里面的工程依赖。

有关于volley 如何使用的教程 我就不在这写了,请自行谷歌,我们直接看源码。

1 /*
2 * Copyright (C) 2012 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package com.android.volley.toolbox;
18
19 import android.content.Context;
20 import android.content.pm.PackageInfo;
21 import android.content.pm.PackageManager.NameNotFoundException;
22 import android.net.http.AndroidHttpClient;
23 import android.os.Build;
24 import android.util.Log;
25
26 import com.android.volley.Network;
27 import com.android.volley.RequestQueue;
28
29 import java.io.File;
30
31 public class Volley {
32
33 /**
34 * Default on-disk cache directory.
35 */
36 private static final String DEFAULT_CACHE_DIR = "volley";
37
38 /**
39 * Creates a default instance of the worker pool and calls {@link RequestQueue#start()} on it.
40 *
41 * @param context A {@link Context} to use for creating the cache dir.
42 * @param stack An {@link HttpStack} to use for the network, or null for default.
43 * @return A started {@link RequestQueue} instance.
44 */
45 public static RequestQueue newRequestQueue(Context context, HttpStack stack) {
46 File cacheDir = new File(context.getCacheDir(), DEFAULT_CACHE_DIR);
47 String userAgent = "volley/0";
48 try {
49 String packageName = context.getPackageName();
50 PackageInfo info = context.getPackageManager().getPackageInfo(packageName, 0);
51 userAgent = packageName + "/" + info.versionCode;
52 } catch (NameNotFoundException e) {
53 }
54
55 /**
56 * 注意android 2.3之前一般用httpcilent进行网络交互 2.3包括2.3以后才使用HttpURLConnection
57 * 这里面 实际上hurlstack就是 HttpURLConnection的一个变种
58 */
59 if (stack == null) {
60 if (Build.VERSION.SDK_INT >= 9) {
61
62 stack = new HurlStack();
63 } else {
64 // Prior to Gingerbread, HttpUrlConnection was unreliable.
65 // See: http://android-developers.blogspot.com/2011/09/androids-http-clients.html
66 stack = new HttpClientStack(AndroidHttpClient.newInstance(userAgent));
67 }
68阅读更多内容

没有评论:

发表评论