怎么部署SharePlex環(huán)境

這篇文章主要講解了“怎么部署SharePlex環(huán)境”,文中的講解內(nèi)容簡(jiǎn)單清晰,易于學(xué)習(xí)與理解,下面請(qǐng)大家跟著小編的思路慢慢深入,一起來(lái)研究和學(xué)習(xí)“怎么部署SharePlex環(huán)境”吧!

成都創(chuàng)新互聯(lián)專注為客戶提供全方位的互聯(lián)網(wǎng)綜合服務(wù),包含不限于成都網(wǎng)站制作、成都網(wǎng)站設(shè)計(jì)、始興網(wǎng)絡(luò)推廣、重慶小程序開(kāi)發(fā)、始興網(wǎng)絡(luò)營(yíng)銷、始興企業(yè)策劃、始興品牌公關(guān)、搜索引擎seo、人物專訪、企業(yè)宣傳片、企業(yè)代運(yùn)營(yíng)等,從售前售中售后,我們都將竭誠(chéng)為您服務(wù),您的肯定,是我們最大的嘉獎(jiǎng);成都創(chuàng)新互聯(lián)為所有大學(xué)生創(chuàng)業(yè)者提供始興建站搭建服務(wù),24小時(shí)服務(wù)熱線:028-86922220,官方網(wǎng)址:muchs.cn

目標(biāo)在 Linux 系統(tǒng)下安裝 Oracle;利用 SharePlex 實(shí)現(xiàn)數(shù)據(jù)同步;可復(fù)制 DML 和 DDL 操作

一、環(huán)境描述


源端目標(biāo)端
操作系統(tǒng)linux 7.6linux 7.6
IP192.168.66.111192.168.66.112
數(shù)據(jù)庫(kù)版本19.3.0.0.019.3.0.0.0

二、數(shù)據(jù)庫(kù)準(zhǔn)備

  1. 創(chuàng)建shareplex專用表空間

    create tablespace splex_tbs datafile '/oradata/datafile/splex_tbs01.dbf' size 1G;
  2. 數(shù)據(jù)庫(kù)開(kāi)歸檔

  3. 開(kāi)啟補(bǔ)充日志

    alter database add supplemental log data (primary key, unique index) columns;

二、SharePlex 安裝(源 & 目標(biāo))

  1. 解壓安裝
    使用oracle用戶解壓,安裝。

    node1-orcl[oracle]/home/oracle>./SharePlex-9.2.1-b39-ONEOFF-rhel-amd64-m64.tpm
    Unpacking ..................................................................
      ..........................................................................
      ..........................................................................
      ..........................................................................
      ..........................................................................
      ..........................................................................
      ..........................................................................
      ..........................................................................
      ..........................................................................
      ..........................................................................
      ..........................................................................
      ..........................................................................
      ..........................................................................
      ................................
    SharePlex installation program:
        SharePlex Version: 9.2.1
        Build platform: rhel-amd64
        Target platform: lin-amd64
    Please enter the product directory location? /home/oracle/splex/soft
    Please enter the variable data directory location? /home/oracle/splex/data
    Please specify the SharePlex Admin group (select a number):
    1. [oinstall]
    2. dgdba
    3. kmdba
    4. backupdba
    5. dba
    6. oper
    ?  5
    Please enter the TCP/IP port number for SharePlex communications? [2100] 
    Preparing to install SharePlex v.9.2.1:
        User:                     oracle
        Admin Group:              dba
        Product Directory:        /home/oracle/splex/soft
        Variable Data Directory:  /home/oracle/splex/data
    Proceed with installation? [yes] 
    Installing ................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      ...............................
    Setting file ownerships ...................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      ............................................
    Setting file permissions ..................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .........................................................................
      .............................................
    Do you have a valid SharePlex v. 9.2.1 license? [yes] 
    Please enter the License key? 序列號(hào)
    Please enter the customer name associated with this license key? CHINA MINISTRY OF RAILWAY
    SharePlex v. 9.2.1 license validation successful:
        Customer Name:      CHINA MINISTRY OF RAILWAY
        License Key:        序列號(hào)
        Product Name:       SharePlex for Oracle - RAC
        License Key Type:   "Perpetual Key"
    NOTE: You can upgrade this license key or add license keys for additional machines
          by executing utility /home/oracle/splex/soft/install/splex_add_key.
    Installation log saved to: /home/oracle/.shareplex/INSTALL-SharePlex-9.2.1-1911290513.log
    SharePlex v.9.2.1 installation successful.
  2. ora_setup配置
    配置shareplex,配置時(shí)如果需要自定義復(fù)制的源與目標(biāo)端的ORACLE_SID,則需要配置tnsnames.ora別名,且/etc/oratab中必須有對(duì)應(yīng)于自定義的tnsnames別名的ORACLE_SID。

    node1-orcl[oracle]/home/oracle/splex/soft/bin>./ora_setup
    Welcome to the Oracle SharePlex setup process for port 2100.
    This process creates tables and user accounts needed to run
    Oracle SharePlex replication.
    Will the SharePlex install be using a BEQUEATH connection? (Entering 'n' implies a SQL*net connection)  [y] : 
    Please note the following:
    ** In response to prompts, a carriage return will choose the default
       given in brackets.  If there is no default, a reply must be entered.
    ** To exit the program while the program is waiting for input, use the
       CTRL-C key sequence.
       This sequences can be entered by holding down the CONTROL key and
       pressing the C key.
    Enter the Oracle SID for which SharePlex should be installed [orcl] : 
    In order to create the SharePlex tables and user account, we must
    connect to the database as a DBA user
    Enter a DBA user for orcl  : system
    Enter password for the DBA account, which will not echo : 
    connecting--This may take a few seconds.
    validating user name and password. . . This may take a few seconds.
    SharePlex objects will need to be created under a special
    account.  You can pick an existing user or create a new one.
    Would you like to create a new SharePlex user ? [y] : 
    Enter username for new user [splex/splex] : 
    Warning:  This user is now being granted unlimited tablespace.
    This privilege will remain in effect until it is explicitly changed.
    Granting select on sys.user$ to splex
    SPLEX_ROLE_BOTH  already exists; continuing setup . . .
    Do you want to enable replication of tables with TDE? [n] : 
    To enable replication of tables with TDE in the future, please rerun ora_setup.
    Setup will now install SharePlex objects.
    These are the existing tablespaces.
    SYSTEM SYSAUX UNDOTBS1 TEMP USERS SPLEX_TBS 
    Enter the default tablespace for use by SharePlex [USERS] : SPLEX_TBS
    Enter the temporary tablespace for use by SharePlex [TEMP] : 
    Enter the index tablespace for use by SharePlex [ ] : SPLEX_TBS
    Creating SharePlex objects [Installation type: Fresh]. . .
    Creating SharePlex Oracle-timezone-region map . . . Done.
    Creating Conflict Resolution Package . . . Done.
    Creating SharePlex Dataequator package . . . 
    Loading Compare Package from "/home/oracle/splex/soft/util/sp_deq_pkg.plb"...Done.
    Note: The SharePlex object that supports replication of SDO_GEOMETRY cannot be installed
          because the Oracle Spatial and Graph feature is not installed.
    Do you want to continue with the setup without support for SDO_GEOMETRY? [n] : y
    Will the current setup for sid: [orcl] be used as source (including cases as source for failover or master-master setups)?  [y] : 
    Setup of SharePlex objects successful . . .
    Changing SharePlex connection database . . .
    Setup of orcl completed successfully
    -- The datasource identifier in the SharePlex configuration is 'o.orcl' --
  3. sp_cop -u 2300 & 啟動(dòng)
    可以使用該參數(shù)指定 shareplex 啟動(dòng)到指定的 IP 上,可以使用 netstat -an | grep <port_number>
    啟動(dòng) -u可以啟動(dòng)shareplex實(shí)例到指定端口,可以復(fù)制多個(gè)庫(kù)。

    node1-orcl[oracle]/home/oracle/splex/soft/bin>./sp_cop &
    [1] 2672
    node1-orcl[oracle]/home/oracle/splex/soft/bin>
    *******************************************************
    * SharePlex for Oracle Startup 
    * Copyright 2018 Quest Software Inc.
    * ALL RIGHTS RESERVED.
    * Protected by U.S. Patents: 7,461,103 and 7,065,538
    * Version: 9.2.1.39-m64-ONEOFF-SPO17172-SPO17624C-SPO17384-SPO17377-oracle
    * VarDir : /home/oracle/splex/data
    * Port   : 2100
    *
    * IMPORTANT SECURITY NOTICE:
    *
    * YOU HAVE NOT YET SELECTED THE NETWORK SECURITY MODEL.
    * PLEASE RUN:
    *
    *     sp_security --setup
    *
    * TO SELECT YOUR NETWORK SECURITY MODEL.
    *******************************************************
  4. 狀態(tài)驗(yàn)證

    node1-orcl[oracle]/home/oracle/splex/soft/bin>./sp_ctrl
    *******************************************************
    * SharePlex Command Utility
    * Copyright 2018 Quest Software Inc.
    * ALL RIGHTS RESERVED.
    * Protected by U.S. Patents: 7,461,103 and 7,065,538
    *******************************************************
    sp_ctrl (node1:2100)> status
    Brief Status for node1
    Process          State                             PID     Running   Since     
    ---------------  ------------------------------  --------  --------------------
    Cop              Running                             2672  29-Nov-19 05:18:20  
    Cmd & Ctrl       Running                             2696  29-Nov-19 05:18:34  
    There are no active configuration files

三、同步配置

  1. 創(chuàng)建配置文件(源數(shù)據(jù)庫(kù))

    1. sp_ctrl控制臺(tái)
      SharePlex日常操作都在sp_ctrl控制臺(tái)中進(jìn)行,啟動(dòng)命令為:/<prodir>/bin/sp_ctrl,一般啟動(dòng)之后首先進(jìn)入控制臺(tái)執(zhí)行sp_ctrl > stop post,停止。

      sp_ctrl (node2:2100)> stop post
    2. config 配置文件
      Config配置文件為復(fù)制鏈路需要復(fù)制對(duì)象以及鏈路映射文件。

      1. 列出config文件

        sp_ctrl (node1:2100)> list config   # 列出config文件
        File   Name                                         State       Datasource     
        --------------------------------------------------  ----------  ---------------
        ORA_config                                          Inactive    o.SOURCE_SID   
        Last Modified At: 26-Nov-19 09:13    Size: 151
      2. 復(fù)制修改配置文件

        sp_ctrl (node1:2100)> copy config ORA_config to test_config # 復(fù)制config文件
        sp_ctrl (node1:2100)> edit config test_config # 修改config文件
        datasource:o.orcl
        #source tables      target tables           routing map
        #splex.demo_src      splex.demo_dest            target_system:進(jìn)程名@o.target_sid
        expand hr.%                hr.%                    192.168.66.112:splex_hr@o.orcl
        • splex.demo_src --源庫(kù)的用戶名.表名,可以使用%通配符,全匹配半匹配等。priv%not(table_name)排除表。

        • splex.demo_dest --目標(biāo)庫(kù)的用戶名.表名

        • target_system@o.target_sid --目標(biāo)庫(kù)的IP或hosts文件中映射名@為目標(biāo)端的sid或別名。

        • hr.test hr.test 192.168.204.151:scott_tab@o.honor1 --IP或主機(jī)名后加冒號(hào),可以為該表復(fù)制單獨(dú)起一個(gè)隊(duì)列。

        • mary.cust2!key(c1,c2) mary.cust2 proda@o.sid --自定義pk

      3. config 生效

        sp_ctrl (node1:2100)> activate config test_config
      4. 驗(yàn)證Capture、Read和Export進(jìn)程是否被創(chuàng)建

        sp_ctrl (node1:2100)> show 
        Process    Source                               Target                 State                   PID
        ---------- ------------------------------------ ---------------------- -------------------- ------
        Capture    o.orcl                                                      Running               60407
        Read       o.orcl                                                      Running               60423
        Export     node1                                node2                  Running               60438
        sp_ctrl (node1:2100)> show capture detail
        Host: node1     System time: 28-Nov-19 10:17:58
                                   Operations
        Source     Status            Captured Since
        ---------- --------------- ---------- ------------------
        o.orcl     Running                  0 28-Nov-19 09:34:52
           Oracle current redo log          : 25
           Capture current redo log         : 25
           Capture log offset               : 10206852
           Last change processed:           
                Operation on SHAREPLEX internal table at 11/28/19 10:17:55
           Capture state                    : Processing
           Activation id                    : 2
           Error count                      : 0
           Operations captured              : 0
           Transactions captured            : 0
           Concurrent sessions              : 0
           HWM concurrent sessions          : 2
           Checkpoints performed            : 23
           Total operations processed       : 3948
           Total transactions completed     : 3948
           Total Kbytes read                : 0
           Redo records in progress         : 0
           Redo records processed           : 18556
           Redo records ignored             : 14608
           Redo records - last HRID         : N/A
        sp_ctrl (node1:2100)> show export
        Host   : node1
        Queue  : node1
                                   Kbytes
        Target     Status          Exported     Since              Total       Backlog
        ---------- --------------- ------------ ------------------ ---------- ----------
        node2      Running                   12 28-Nov-19 09:34:56          0          0
        sp_ctrl (node1:2100)>
    3. 同步數(shù)據(jù)

    4. 開(kāi)啟同步(目標(biāo)端)

      1. 設(shè)置恢復(fù)的起點(diǎn)(源端需要有數(shù)據(jù)流入)

        sp_ctrl (node2:2100)> reconcile queue splex_hr for o.orcl-o.orcl scn 1573836
      2. 開(kāi)啟同步

        sp_ctrl (node2:2100)> start post

感謝各位的閱讀,以上就是“怎么部署SharePlex環(huán)境”的內(nèi)容了,經(jīng)過(guò)本文的學(xué)習(xí)后,相信大家對(duì)怎么部署SharePlex環(huán)境這一問(wèn)題有了更深刻的體會(huì),具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是創(chuàng)新互聯(lián),小編將為大家推送更多相關(guān)知識(shí)點(diǎn)的文章,歡迎關(guān)注!

當(dāng)前名稱:怎么部署SharePlex環(huán)境
URL鏈接:http://muchs.cn/article30/ihccpo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供云服務(wù)器、網(wǎng)站設(shè)計(jì)、定制網(wǎng)站、外貿(mào)網(wǎng)站建設(shè)做網(wǎng)站、搜索引擎優(yōu)化

廣告

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

成都做網(wǎng)站