MASTER SITE에서 SNAPSHOT을 찾는 방법(ORACLE8)

제품 : ORACLE SERVER
작성날짜 : 2002-05-13
MASTER SITE에서 SNAPSHOT을 찾는방법
==================================
Explanation
오라클 8.0 이전버젼에서는 마스터 사이트는 스냅샷이
fast refresh를 수행하기에 충분한 정보를 가지고 있어야
한다. 마스터 사이트의 관리 ( 예 : 마스터 테이블의
drop 이나 recreate ) 를 위해서는 전체 분산 데이터베이스
환경에서 어떤 스냅샷들이 마스터 테이블을 참조하는지
알아야만 하는 어려움이 있었다.
오라클 8 이전 버전에서는 마스터 사이트는 원격지에 위치한
스냅샷에 대한 정보를 가지고 있지 않았다. 하지만
오라클 8에서는 마스터 사이트서에 스냅샷에 관한 정보를
등록해서 사용한다.
이를 위해 DBA_REGISTERED_SNAPSHOTS 라는 뷰가 새로 생겼다.
이 뷰는 일반적으로 DBA_SNAOSHOT_LOGS 라는 뷰와 join을 해서
사용한다.
SQL> DESCRIBE DBA_REGISTERED_SNAPSHOTS
Name Null? Type
OWNER NOT NULL VARCHAR2(30)
NAME NOT NULL VARCHAR2(30)
SNAPSHOT_SITE NOT NULL VARCHAR2(128)
CAN_USE_LOG VARCHAR2(3)
UPDATABLE VARCHAR2(3)
REFRESH_METHOD VARCHAR2(11)
SNAPSHOT_ID NUMBER(38)
VERSION VARCHAR2(17)
QUERY_TXT LONG
SQL> DESCRIBE DBA_SNAPSHOT_LOGS
Name Null? Type
LOG_OWNER NOT NULL VARCHAR2(30)
MASTER NOT NULL VARCHAR2(30)
LOG_TABLE NOT NULL VARCHAR2(30)
LOG_TRIGGER VARCHAR2(30)
ROWIDS VARCHAR2(3)
PRIMARY_KEY VARCHAR2(3)
FILTER_COLUMNS VARCHAR2(3)
CURRENT_SNAPSHOTS DATE
SNAPSHOT_ID NUMBER(38)
Example: 다음은 scott user의 orders table에 refresh해야할 2개의 스냅샷이 있다.
SQL> SELECT LOG_OWNER, MASTER, LOG_TABLE FROM DBA_SNAPSHOT_LOGS
WHERE MASTER = 'ORDERS';
LOG_OWNER MASTER LOG_TABLE
SCOTT ORDERS MLOG$_ORDERS
SCOTT ORDERS MLOG$_ORDERS
위의 결과 알게된 2개의 snapshot에대한 정보를 다음의 sql로 알 수 있다.
SQL> select owner, name, snapshot_site
from dba_registered_snapshots, dba_snapshot_logs
where dba_registered_snapshots.snapshot_id = dba_snapshot_logs.snapshot_id
and dba_snapshot_logs.master='ORDERS';
OWNER NAME SNAPSHOT_SITE
SCOTT ORDERS V804.WORLD
SCOTT SNAP_ORDERS NEGRIL.WORLD
오라클 7 마스터 사이트에서는 스냅샷을 등록할 수 없다.
오라클 7의 스냅샷은 오라클 8쪽 마스터에 자동적으로 등록되지
못한다.
만약 DBA_SNAOSHOT_LOGS에 MASTER='ORDERS' 에 해당하는
3개의 entry가 있을 경우나, 앞의 query 결과는 2개의 entry라면
오라클 7에서 스냅샷을 사용하던 사이트가 하나 사용되고 있을
것이며, 오라클 8쪽에 등록되지 않은 경우일 것이다.
Reference Ducumment
<Note 68707.1>

Similar Messages

  • Can not refresh snapshot changes after importing data of master site

    Hello !
    I have two database computer,one as master site,one as snapshot site.Because the error of the hard disk of master computer,I use the exporting data file to recover my database.after importing ,I found I can't refresh the refreshgroup on snapshot,who can tell me why?
    thinks in advance!
    (exp system/manager full=y inctype=complete file='/home/save/backdata/xhsdcomp.dat')
    (imp system/manager inctype=system full=Y file='/home/save/backdata/xhsdcomp.dat'
    imp system/manager inctype=restore full=Y file='/home/save/backdata/xhsdcomp.dat')
    null

    You haven't listed the errors that you're receiving when attempting to refresh your refresh group, but if your snapshots are attempting to fast refresh, I suspect it's because the creation timestamp of the snapshot log on the master site is newer than the creation timestamp of the snapshot. In this case you will need to do a complete refresh of the snapshot (or drop and recreate the snapshot) before you will be able to fash refresh it again.
    If this is not the case, please post the errors you are receiving when you attempt to refresh the refresh group.
    HTH,
    -- Anita
    Oracle Support Services
    null

  • Multi Master Site replication with Snapshot features

    Dear,
    I am implementing a Multi Master site replication. I want to replicate Table A in MASTER SITE A to Table A in MASTER SITE B.
    However, I don't want all the data from MASTER SITE A to be propagated to MASTER SITE B.I may want data that belongs to a certain criteria only to be replicated over.
    I know I can achieve this in a snapshot site replication. But can this be done in a Multi Master Site replication too ?

    Hai,
    As far under my observation, the tables that is marked for a replication from the MASTER SITE to Child Site is an exact replica of data. Your case could be achieved only thru SNAPSHOT VIEWS/GROUPS
    - [email protected]

  • Snapshot/master site implementation in one single system

    how to setup Snapshot/Master site implementation in one single system. Can I get Sample code. Oracle 8 documentation has some problems.

    I know what u said(that is understood)?
    To get some practice on replication scenerio can i do it in single system by create two databases. one database as master site and the other as snapshot site. Is it possible on a single system.i'm able to create snapshot and master site in two databases but when i am trying to
    DBMS_REPCAT.CREATE_SNAPSHOT_REPOBJECT () i'm getting problem using source given in oracle 8i document.
    Thank u

  • Urgent :need help to setup Master to snapshot(read only) environement

    Hi,
    I need your help urgently. I don't know much about master to Snapshot configuration. I need to do prototype of master to snapshot(read only) as soon as possible. I need replication setup/configuration scripts.
    DB1 is master database (8i) and DB1 is Snapshot site db.
    both dbs are identical except they have different Global_name.
    I want to replicate table from DB1---> DB2 unidirectional.
    Global name for DB1 is DB1.world and for DB2 is DB2.world
    TNS names are DB1 and DB2 respectively and TNSNAMES.ORA file is same on both server.
    Schema owner of Mster site (who owns the tables that I want to replicate) is user 'SYNAPSE'. On DB2 I have also same schema with same tables. Lets say table called 'TEST' that I want to replicate from DB1 to DB2.
    for simplicity I want to have only one account(user) on both site who can do administration and take care of all other task including replication.
    I need scripts to do setup for the replication environment described above.
    In short please provide me script to replicate DB1 to DB2 (Master to snapshot).
    I appreciate your help very much.
    You can reach me at [email protected] as well.
    Thank you.
    Pravin

    Finally I figured out how to setup/configure master to Snapshot environment but I have to say that Oracle documents are very confusing.
    The problems I ran into are:
    User Repadamin can't create MV in schema owner other than repadmin. Work arround I used is let that schemema owner allow to create MV.
    Other proble ran in is Constraint(FK) violation when trying to do using refresh group. To resolve this problem either disable constraints on snapshot site or create constraints usinf deferred option.
    Pravin

  • The master site control file does not contain a component item for SMS_STATUS_MANAGER.

    New to the System Center world. We are using a fresh install of Server 2012 R2 and System Center R2 with everything working until Server 2012 R2 Update 1 was installed. Now we are getting the following:
    Site type: Primary Site or CAS SMS_STATUS_MANAGER
    6/4/2014 1:35:21 PM 10996 (0x2AF4)
    Resolved the "Status Manager" inbox to "C:\Program Files\Microsoft Configuration Manager\inboxes\statmgr.box\statmsgs".
    SMS_STATUS_MANAGER 6/4/2014 1:35:21 PM
    10996 (0x2AF4)
    Opened a change notification handle for directory "C:\Program Files\Microsoft Configuration Manager\inboxes\statmgr.box\statmsgs".
    SMS_STATUS_MANAGER 6/4/2014 1:35:21 PM
    10996 (0x2AF4)
    Resolved the "Site Control Manager (Master Site Control File)" inbox to "C:\Program Files\Microsoft Configuration Manager\inboxes\sitectrl.box".
    SMS_STATUS_MANAGER 6/4/2014 1:35:21 PM
    10996 (0x2AF4)
    Opened a change notification handle for directory "C:\Program Files\Microsoft Configuration Manager\inboxes\sitectrl.box".
    SMS_STATUS_MANAGER 6/4/2014 1:35:21 PM
    10996 (0x2AF4)
    Parsed the master site control file, serial number 1551209029.
    SMS_STATUS_MANAGER 6/4/2014 1:35:21 PM
    10996 (0x2AF4)
    This site is the central site. SMS_STATUS_MANAGER
    6/4/2014 1:35:21 PM 10996 (0x2AF4)
    ERROR: The master site control file does not contain a component item for SMS_STATUS_MANAGER.
    SMS_STATUS_MANAGER 6/4/2014 1:35:21 PM
    10996 (0x2AF4)
    Sleeping for 60 seconds... SMS_STATUS_MANAGER
    6/4/2014 1:35:21 PM 10996 (0x2AF4)
    Any thoughts on how to fix this? Seen a few references to a "site reset" for SCCM 2007 but wanted to make sure there wasn't anything else to try before heading down that road with 2012R2.

    A site reset can also be done in CM12 so it's worth a try.
    Torsten Meringer | http://www.mssccmfaq.de

  • Question on materialized view unregistered on master site

    Hi
    not sure how it is known, on master site, about the existence of an materialized view on another site referring some table of a master site. it seems registering is not necessary.
    on master site orcl1 : I have a table A, and a materialized view log defined on table A.
    on another site orcl2 : have a db link to orcl1 and a fast refreshable materialized view SCOTT.A_MVW (create materialized view A_MVW refresh fast as select * from A@orcl1)
    on orcl1 I perform : exec DBMS_MVIEW.UNREGISTER_MVIEW (mviewowner => 'SCOTT' ,mviewname => 'A_MVW' ,mviewsite => 'ORCL2');
    as a result the materialized view seems to be successfully unregistered (as it doesn't appear anymore in : select * from DBA_REGISTERED_MVIEWS; )
    But, to my surprise, I can still perform fast refreshes on A_MVW, which also remove lines from the materialized view log . so how is site orcl1 still aware about the existence of the materialized view ?
    it seems that, registered or not at master site, a materialized view behaves the same...or it doesn't ? where is it stored , on master site, information about materialized views (especially those fast refreshable) that reffer local tables ?
    Thank you

    The view allows the Administrator at the Master (Source) site to see information about MVs in remote databases that are querying his/her database.
    A database in Singapore may be administered by DBA "Hemant" . This database may have built (with appropriate permissions !!!) an MV that queries table(s) in a database in London managed by "Alex". Alex can query DBA_REGISTERED_MVIEWS in his (London) database to see that a remote MV is referencing tables locally.
    Why would "Alex" UNREGISTER the MV ? There's no real need to. Unless the information needs to be "hidden" from, say, an Outsource DBA who will be taking "Alex"'s place ! (just kidding !)
    Hemant K Chitale

  • Is it possible to create a super-set materialized view from master site?

    In the replication documents, materialized view is a sub-set of master site. But my scenario is when I delete some records in the master site. I don't want these records(which's been replicated to the materialized view table before) be purged in the materialized view. Is it possible for oracle replication ?

    If your goal is to replicate inserts and updates but to ignore deletes, you would probably be better off setting up Streams and simply not subscribing to deletes.
    Justin

  • Replication/ Master Site

    Hi,
    I4m trying to do a Materialized view site configuration and when i am finishing returned the following error ORA-02082 a loopback database link must have a connection qualifier.
    Ok, i know error mean that: This was made to create a database link with the same name as the current database.
    what i need to know ?
    which are the necessary step to build master sites union two database table ?

    Hello,
    thanks for your answer:
    the database names are the same.
    We made already a full database export und imported it into the target database.
    This was not succesfull, because after the import in the target database
    the table dba_registered_snapshot was not filled!
    Now: what to do?
    Kind regards.
    Steffen

  • Error in Master Site Setup for Oracle Replication

    Hi Guys,
    While i was trying to setup the Master Site for Oralce 8.1.7
    replication, a error is poping up like this :
    ORA-06550:LINE 2, CLOUMN 4:
    PLS-00201: IDENTIFIER 'DBMS_REPCAT_ADMIN.GRANT_ADMIN_ANY_SCHEMA'
    MUST BE DECLARED
    ORA-06550: LINE2, CLOUMN 4:
    PL/SQL: STATEMENT IGNORED
    looking forward to your kind help. If you have any idea about
    solving this error then do contact me at my personal email :
    [email protected]
    Thanks in advince.
    Souren

    Niels,
    1st check the storage prerequisites: http://itnewscast.com/chapter-6-oracle-vm-22-san-iscsi-and-nfs-backend-storage-configurations
    2nd clean each servers cluster configs as show in the prerequisites section then create the pool.
    Respectfully,
    Roddy

  • Missing Master Site in Multi Master Environment

    Hello,
    we are using MM-Replication on three Master sites with two replication groups.
    Replication support was installed and configured by the application vendor.
    I do not have experience with Multi Master Replication.
    The data of the RG (Readonlymastergroup) was never replicated to one Master
    (DEFS01). When I queried dba_repgroup on the failing site, I found the
    RG status to be quiesced. There were no pending administrative requests
    on this site or the Master Definition site, but I found that there is no definition
    of the failing site's membership to the RG on the MD site.
    Master Definition Site
    select gname,dblink,Master,masterdef from dba_repsites;
    GNAME DBLINK M M-----
    MASTERGROUP      DEMD01 Y Y
    MASTERGROUP      DEGS01 Y N
    READONLYMASTERGROUP      DEMD01 Y Y
    READONLYMASTERGROUP      DEGS01 Y N
    MASTERGROUP      DEFS01 Y N
    Failing Master Site
    select gname,dblink,Master,masterdef from dba_repsites@defs01;
    GNAME DBLINK M M-----
    MASTERGROUP      DEFS01 Y N
    MASTERGROUP      DEMD01 Y Y
    READONLYMASTERGROUP      DEFS01 Y N
    READONLYMASTERGROUP      DEMD01 Y Y
    MASTERGROUP      DEGS01 Y N
    READONLYMASTERGROUP      DEGS01 Y N
    Can anybody explain how this could happen? AFAIK adding a master to a resource
    group is a distributed transaction that should be rolled back on all sites, if it fails
    on one.
    To correct this situation; I am thinking of removing the RG from DEFS01
    with DBMS_REPCAT.DROP_MASTER_REPGROUP (on DEFS01) and then rejoin DEFS01
    with DBMS_REPCAT.DROP_MASTER_REPGROUP on the Master
    Definition Site.
    Will this work? Anything else I have to think off?
    Regards,
    uwe

    Hi Janos,
    I have tried the Multi language scenario. You need to have following setup in your system, they are:-
    >Install language pack
    >You need to upload content using below CSV fles:-
    multistring.csv
    Material.csv
    Plant CSV
    Product_Plant_Relationship_template.csv
    If you can share your email id I will email you sample CSV file which you can use. Or else pl follow below steps to download CSV file from system:-
    Click Setup
    Click System Administration tab
    Click to Import data
    Click to New button
    select radio button Upload to Server and click next
    Select any dummy excel file from local server while browsing for Upload Import file option and click next.
    Select  Preview import check box adn search MultiString  from the drop down object type and click next
    In the page you will see the template.csv link, click and save the file. This the file you are looking for.
    Create the content and upload the file...hope this will help you!!!
    There is another way of importing master data is multiple langaure. In this scenario master data source would be ECC. You need to run SAP provided standard report to export the details. This XML file you can import into sourcing system. Pl find below blog link for more detail:-
    http://scn.sap.com/community/sourcing/blog/2011/09/29/extracting-erp-master-data-for-sap-sourcing
    Regards,
    Deepak

  • Can I have more then one MVIEW site connected to single master site?

    Hi,
    I need one help from your end.
    Currently I am working on Basic Replication.For that I am using Read only Materialized views.first i tried with one master site & one Materialized view site its working fine,Can I have more then one MVIEW site connected to single master site referring to same database ? if so how to achive this one..

    Actually one of my senior told me that you need to change number of OPEN_LINKS value like that so for that reason I asked this question.
    Still that problem not solved..
    I will explain what are all the things I did ok.
    IN MASTER SITE:
    I am creating read only MVIEW's.
    first i created one user repadmin and have given
    1>execute any procedure
    2>dbms_repcat_admin.grant_admin_any_repgroup
    3>dbms_repcat_admin.grant_admin_any_schema
    4>select any dictionary
    and all other grants to repadmin user
    then I changed global_name = 'zxincmp' on Master site.
    Then I created mview log for each table (for 85 tables) & then I created mview's for that table on Master site itself. later I took a dump of these 85 mview's . then I transfered this dump to one of my mview site.
    IN MVIEW site:
    I created one user zxdbp_55 and all the above rights are given to this user & i created one public dblink
    "zxincmp" using "TO_CMP"(master site).Then I imported that dump which i took from master site.
    then i created one private link zxincmp in one of my mview site.then i used DBMS_REFRESH.MAKE('')
    to refresh all my tables & to set the interval..
    after that i created index on the mviews..
    this will works out fine for single master & single mvirew site.but I tried with the same procedure to prepare one more mview site,everything is fine but main problem is second mview site is not getting refreshed automatically,i need to do refresh manually from enterprise manager.. then it will get refreshed.
    how to overcome this problem? I am using same db name ,dblink,refresh group for both the mview site will it affects anywhere?
    Thanks & Regards,
    Hanumanth.

  • Migrating the replication-master-site-database  to another hardware

    Hello folks, hello oracle
    we have got the followiong configuration:
    --> Database 8.1.7.0
    --> Advanced Replication system
    --> Single master, snapshot configuration
    --> 50 Slave-sides; offline replication once a day
    --> per slave side: 50 RO-Snaps, 4 UP-Snaps
    an the following problem:
    we need to migrate the master database from
    an IBM-AIX-host-computer to an HP-UX-host-computer.
    the question is:
    Wich steps do we have to make?
    Is there a documented way or method to do this?
    Kind regards
    Steffen

    Hello,
    thanks for your answer:
    the database names are the same.
    We made already a full database export und imported it into the target database.
    This was not succesfull, because after the import in the target database
    the table dba_registered_snapshot was not filled!
    Now: what to do?
    Kind regards.
    Steffen

  • SNAPSHOT LOG의 데이타가 지워지지 않는 이유와 강제로 지우는 방법 (V7 ~ V8I)

    제품 : ORACLE SERVER
    작성날짜 : 2002-05-09
    SNAPSHOT LOG의 데이타가 지워지지 않는 이유와 강제로 지우는 방법
    (V7 ~ V8I)
    ====================================================
    PURPOSE
    사용하고 있는 snapshot의 refresh에는 이상이 없는데 master table의
    sanpshot log가 지워지지 않고 계속 늘어만 가는 경우가 있을 수 있다.
    이러한 경우 master site의 snapshot log가 증가하면서 space문제를
    발생시킬 수도 있고, log의 내용을 refresh해가는 속도도 문제가 될 수
    있으므로 여기에서는 그 원인과 조치 사항을 정리한다.
    Explanation
    1. snapshot log의 데이타가 지워지는 원리
    snapshot log의 데이타가 지워지는 순간은 snapshot의 refresh time 때,
    refresh 후, 해당 데이타에 대해서 MLOG$_<table_name>내의 SNAPTIME과
    SYS.SLOG$의 해당 master table에 대한 snapshot들의 SNAPTIME을 비교해 보아
    SYS.SLOG$.SNAPTIME이 MLOG$_<table_name>.SNAPTIME보다 미래이거나 같으면
    그때 해당 데이타를 지우게 되는 것이다.
    즉 다음 조건을 만족하는 때이다.
    SYS.SLOG$.SNAPTIME >= MLOG$_<table_name>.SNAPTIME
    그 이유는 snapshot log의 각 데이타는 master table에 연결된 여러 snapshot 중
    첫 snapshot의 refresh시에만 refresh해당 시간이 SNAPTIME에 설정되고,
    그 이후에 같은 데이타를 다른 snapshot 이 refresh해가도 값이 변경되지
    않는다.
    아무도 refresh하지 않은 경우는 default로 Oracle7의 경우 null이고,
    Oracle8의 경우는 4000년 1월 1일로 설정된다.
    SYS.SLOG$의 경우는 master table에 대해 연결된 모든 fast refresh로
    refresh해가는 snapshot의 정보가 포함되어 있는데 각 snasphot이 refresh해
    갈때마다 해당 snapshot에 대한 SNAPEIME이 변경된다.
    그러므로 모든 snapshot이 snapshot log의 해당 레코드를 refresh해가는 경우
    SYS.SLOG$의 SNAPTIME은 해당 MLOG$_<table_name>의 해당 레코드의 SNAPTIME
    보다 미래이거나 같게 된다.
    만약 SYS.SLOG$의 특정 snapshot의 SNAPTIME이 과거인채로 계속 refresh를
    안해간다면 그래서 이 값이 snapshot log의 SNAPTIME보다 더 과거라면,
    결국 해당 데이타를 refresh해가지 않은 snapshot이 존재하지 않는다는
    것이므로 snapshot log의 데이타는 지워질 수 없는 것이다.
    이러한 현상이 발생하는 경우는 master table에 연결되어 있는 하나의
    snapshot site가 snapshot을 drop하지 않은 상태에서 장기간 데이타베이스
    자체를 down시켜 둔 채 사용하지 않거나 아예 database를 remove시킨 경우이다.
    그외에도 해당 master table에 snapshot을 test하다가 지우지 않고
    그대로 둔 경우 등 이러한 문제는 실제 자주 발생하는 편이다.
    2. snapshot log의 데이타를 강제로 지우는 방법
    이렇게 사용하지 않는 snapshot으로 인해 비정상적으로 snapshot log의 크기가
    커지는 경우, 가장 쉽게는 해당 snapshot을 찾아 drop해주면 문제는 바로
    해결된다.
    (1) snapshot 확인하는 방법
    많은 경우 이러한 방치된 snapshot이 존재하는지 자체를 몰라 snapshot log가
    계속 증가하게 되는데 이때는 다음과 같이 master site에서 snapshot 정보들을
    확인할 수 있다.
    - Oracle7의 경우:
    Oracle7에서는 해당 master table에 걸려있는 모든 fast refresh의 snapshot의
    정보를 확인할 수 있는 view는 SYS.SLOG$뿐이었다. 예를 들어 master table
    이름이 DEPT인 경우 조회 방법은 다음과 같다.
    SQL>connect sys/manager
    SQL>select * from sys.slog$ where master = 'DEPT';
    이 경우 snapshot을 나타내는 column은 SNAPSHOT으로 날짜로 표시된다.
    이 snapshot을 실제 snapshot site에서 확인하려면 예상되는 snapshot
    site에서 다음과 같이 조회하여 확인할 수 있다.
    SQL>select * from sys.snap$ where master = 'DEPT';
    - Oracle8의 경우
    Oracle7에서는 위와 같이 snapshot의 정보를 master site에서 확인하는
    것이 번거로운 문제점이 있어서 Oracle8부터는 snapshot을 나타내기 위한
    snapshot id라는 개념이 추가되었고,
    DBA_REGISTERED_SNAPSHOTS view가 생성되어 이 view를 통해 쉽게 snapshot를
    찾는것이 가능해 졌다.
    SQL>select snapid from sys.slog$ where master = 'DEPT';
    SQL>select * from dba_registered_snapshots
    where snapshot_id=위에서 확인한 번호;
    이렇게 확인하면 해당 snapsot이 어느 site에 존재하는지에 대한 master
    site의 database link이름 등도 확인 가능하다.
    (2) 강제로 snapshot정보를 master site에서 제거하는 방법
    위와 같이 확인하였는데도 snapshot을 snapshot site에서 직접 drop할 수
    없는 환경이라면, master site에서 해당 snapshot에 대한 정보를 아예 지워
    과거의 SNAPTIME을 가지는 snapshot이 SYS.SLOG$에 남지 않게 하면 된다.
    SLOG$는 dictionary table이므로 바로 delete문장을 이용하여 해당 정보를
    지워서는 안되며 다음과 같은 package를 이용한다.
    - Orcle7의 경우:
    SQL>exec DBMS_SNAPSHOT.PURGE_LOG('DEPT',2);
    해당 master table에 걸려 있는 snapshot중 가장 과거의 SNAPTIME을 가지는
    몇개의 snapshot정보를 지울 것인가를 지정하는 방식이다.
    이 예의 경우는 DEPT table에 걸려있는 snapshot중 가장 이전에 refresh해간
    두개의 snapshot의 정보를 master site의 SYS.SLOG$ 에서 제거한다.
    - Oracle8의 경우:
    Oracle7에서도 앞에서 설명한 DBMS_SNAPSHOT.PURGE_LOG는 여전히
    사용가능하다.
    그 외에 Oracle8에서 새로 추가된 snapshot id를 이용한 다음과 같은
    package를 사용가능하다.
    PROCEDURE PURGE_SNAPSHOT_FROM_LOG
    Argument Name Type In/Out Default?
    SNAPSHOT_ID BINARY_INTEGER IN
    SNAPOWNER VARCHAR2 IN
    SNAPNAME VARCHAR2 IN
    SNAPSITE VARCHAR2 IN
    예를 들어 다음과 같이 사용하면 된다.
    SQL>exec DBMS_SNAPSHOT.PURGE_SNAPSHOT_FROM_LOG
    (10, 'SCOTT', 'DEPT_SNAP', 'SNP8I.WORLD');

  • (V8.1 REPLICATION) UPDATABLE SNAPSHOT환경 구축을 위한 초기 작업

    제품 : ORACLE SERVER
    작성날짜 : 2001-07-19
    (V8.1 REPLICATION) UPDATABLE SNAPSHOT환경 구축을 위한 초기 작업
    =============================================================
    1. 개요
    =======
    Symmetric Replication의 한 종류인 updatable snapshot환경의 구축을 위해서는
    replication manager를 사용하도록 한다. 이 문서는 replication manager사용을
    통해 snapshot group및 object 등을 등록하고 관리하기 이전에 master및 snapshot
    site에서 미리 설정되고 수행되어야 하는 작업들을 정리한다.
    이중 일부 작업은 replication manager를 통해서도 구현이 되지만, 정확한
    수행이 요구되어 지는 작업에 대해서는 이 문서에서와 같이 직접 SQL command를
    통해 수행되어지는 것이 권고된다.
    Oracle 8.1.x부터는 snapshot과 materialized view가 동의로 사용되어지나, 이
    문서에는 snapshot으로 표시한다.
    2. Init.ora parameters
    ======================
    아래와 같은 initialisation parameter들이 추가되거나 수정되어져야 한다.
    아래의 설정은 master site와 snapshot site모두 설정이 필요하며, master site가
    하나뿐인 경우는 job_queue부분과 parallel_ parameter의 경우는 설장할 필요가
    없다.
    Parameter 이름 권장되는 초기 값
    COMPATIBLE 8.1.5.0.0 이상
    SHARED_POOL_SIZE 20M ~ 40M 정도가 추가로 요구
    PROCESSES 현재 값에서 12정도 추가
    GLOBAL_NAMES 반드시 TRUE
    OPEN_LINKS 4, 추가되는 master site당 2 증가
    DISTRIBUTED_TRANSACTIONS 최소 5 이상 (기본값은 trsactions/4)
    가되는 master site당 2 증가
    REPLICATION_DEPENDENCY_TRACKING TRUE
    아래의 값은 상황에 맞게 조정하여 사용한다.
    JOB_QUEUE_INTERVAL 10 초
    JOB_QUEUE_PROCESSES 3, 추가되는 master site당 1씩 증가
    PARALLEL_MAX_SERVERS 10
    PARALLEL_MIN_SERVERS 2, max server의 갯수와 동일한것이 권장
    parallel propagation을 사용하지 않고자
    하면 설정하지 않는다.
    SNAPSHOT_ 로 시작하는 parameter나 JOB_QUEUE_KEEP_CONNECTIONS parameter는
    Oracle 8.1에서는 없어졌으므로 지정하지 않도록 한다.
    3. Tablespace 요구 사항
    =======================
    다음은 replication을 사용하기 위해 추가적으로 필요한 tablespace용량이다.
    Tablespace 권장사항
    SYSTEM 최소 40 Mb free space
    ROLLBACK SEGMENTS 최소 30 Mb free space
    TEMPORARY 최소 20 Mb free space
    4. Replication Catalogue 설치
    ==============================
    database생성시에 replication catalog를 설치하지 않았다면, Database
    Configuration Assistant 를 이용하여 Advance Replication Option부분을
    database에 추가하도록 하거나, 아니면 다음과 같이 작업한다.
    cd $ORACLE_HOME/rdbms/admin
    sqlplus internal
    SQL>spool rep.log
    SQL>@catrep
    SQL>spool off
    이 script는 약 1시간 정도 수행되며, spool을 받아 수행에 문제가 있었는지
    이후에 확인하도록 한다.
    [주의] 이 script를 수행하게 되면, replication관련 table과 queue등이 system
    owner로 생성되게 된다.
    그러므로 이후에 replication작업이 일시 중단되어 queue가 커지게 되면,
    system user의 default tablespace에 부담이 되므로 system owner의
    default tablespace를 tools나 그외 replication관리를 위한 별도의
    table로 일시 지정하도록 한다.
    SQL>ALTER USER sysem DEFAULT TABLESPACE REPTBS;
    catrep의 수행이 끝나면 spool로 생긴 rep.log도 확인하여 보고, 아래 문장을
    통해 invalid상태인 object를 확인하고 재 compile을 시도한다.
    SQL> SELECT OWNER, OBJECT_NAME FROM ALL_OBJECTS
    WHERE STATUS = 'INVALID';
    이때 만약 SYS나 SYSTEM package의 body가 invalid로 나타나면 다음과 같이 재
    compile을 시도한다. package body만 invalid인데 aler package문장에서 compile
    body대신 compile이라고만 하면 그 package에 대한 definition이 변경되어,
    이 package와 dependency관계에 있는 다른 object도 invalid상태가 되도록 한다.
    작업이 성공적으로 끝났으면, system user의 default tablespace의 원래대로,
    tool나 system으로 수정한다.
    SQL> alter user system default tablespace system;
    5. Setup NET8
    =============
    Replication환경에 포함된 모든 server는 listener를 구동하도록 하며, snapshot
    site에서는 master site를 가리키는 service alias를 tnsnames.ora file에 등록하
    도록 한다.
    또한, replication manager를 사용하는 client도 tnsnames.ora file에 master와
    snapshot site와 연결가능하도록 service alias를 net8 easy configuration등을
    통하여 등록하도록 한다.
    6. Replication Manager Setup Wizard
    ===================================
    위의 작업이 모두 끝났으면 앞으로의 작업은 replication manager를 통해서도
    수행 가능하다.
    그러나 이 문서에 포함된 내용은 replication환경 설정시 한번만 필요한 작업이며,
    이 부분에 대한 사소한 실수도 이후 사용에 문제를 야기하기 때문에, 여기에 포함된
    작업만큼은 sql command를 통해 직접 작업하기를 권고한다.
    Replication manager가 포함되어 있는 OEM version은 1.4부터이며, Oracle8.1의
    경우는 2.1이 최적화되어 있다. 그러나 그 이전 version도 사용가능하다.
    7. Replication Users
    =====================
    일반적으로, multi-master환경보다는 updatable snapshot환경이 더 보안이 문제시
    된다. multi-master의 경우는 일반적으로 중앙에서 같은 db admin에 의해 관리
    되는것이 일반적이나 snapshot의 경우는 지역적으로 떨어져 별개로 관리되는 경우가
    많아 그 snapshot에서 master site의 database에 손상을 주는 일을 막는것이
    중요하여, user구성은 multi-master환경보다 복잡하다.
    Snapshot Site Master Site
    Replication administrator
    Snapshot replication administrator ---> Proxy snapshot administrator
    Propagator ---> Receiver
    Refresher ---> Proxy refresher
    Snapshot Owner(s) ---> Proxy refresher
    - Replication administrator: master site에서, master group들의 구성과
    관리를 책임진다.
    - Snapshot administrators: snapshot site에서 snapshot replication group을
    구성하고 관리하는 책임을 지며, master site의 Proxy administrator가
    master group의 최소한의 access만 허용하게 된다.
    - Propagators: deferred transaction을 master site에 전달하면, master site의
    Receiver가 전달받은 data를 master table에 적용시킨다.
    - Refreshers: snapshot site에서 master site의 변경된 data를 snapshot
    site로 끌어오는 역할을 하며, master site의 Proxy refresher는 master
    site의 table에 대한 최소한의 acess만을 허용한다.
    이러한 user들의 생성하고 이용하는 방법은 여러가지로 가능하다. 아래에서는,
    그중 가장 일반적으로 사용되는 방법을 기술한다.
    8. Replication user 생성 및 권한 부여
    =====================================
    Oracle 8.1부터 updatable snapshot 환경 구축시 trusted와 untrusted두가지
    방법이 가능하다. untrusted의 경우 snapshot site가 master site와 같은 관리자
    아래에 포함되지 않아 보안을 더 강화해야 하는 model이다.
    하나의 master site에 snapshot group이 여러개이고, 각 snapshot별로, 이
    snapshot group을 공유하는것이 아니고, 별개로 사용하는 경우 서로 다른
    snapshot이 사용하는 group에 대해 보안을 유지하려면 untrusted model을 사용해야
    하나 실제 이러한 환경으로 구성되는 일은 거의 없고, 작업의 번거로움으로 이
    문서에는 trusted model에 대해서는 설명한다.
    8.1 Master Site user와 권한
    (1) Replication Administrator (REPADMIN)
    SQL>CONNECT system/<password>
    SQL>CREATE USER repadmin IDENTIFIED BY <password>
    DEFAULT TABLESPACE <tablespace name>
    TEMPORARY TABLESPACE <tablespace name>;
    SQL>GRANT connect, resource TO repadmin;
    SQL>EXECUTE dbms_repcat_admin.grant_admin_any_schema('repadmin');
    SQL>GRANT comment any table TO repadmin;
    SQL>GRANT lock any table TO repadmin;
    만약 replication group이 어느 특정 schema에만 한정된다면,
    grant_admin_any_schema대신 grant_admin_schema를 사용하여도 된다.
    (2) Proxy snapshot administrator / Receiver / Proxy refresher (SNAPPROXY)
    master site의 proxy snapshot administrator, receiver, proxy refresher는
    하나의 user로 관리하는 것이 일반적이다. 이러한 SNAPPROXY user를 생성하지
    않고 REPADMIN user가 이러한 역할도 수행하도록 설정할 수 있으나, 그렇게
    되면 snapshot site에 너무 많은 권한을 부여하게 되어 바람직하지 않다.
    replication manager를 이용해 이러한 user를 생성하면 master site에 연결된
    snapshot site마다 각각의 snapproxy_n과 같은 형태로 user를 생성하나,
    같은 snapshot group에 대하여 이렇게 각각의 user를 생성하는 것은 의미가
    없으므로 권장되지 않는다.
    SQL>CONNECT system/<password>
    SQL>CREATE USER snapproxy IDENTIFIED BY <password>
    DEFAULT TABLESPACE <tablespace name>
    TEMPORARY TABLESPACE <tablespace name>;
    (3) Proxy snapshot administrator privileges
    SQL>CONNECT system/<password>
    SQL>BEGIN
    dbms_repcat_admin.register_user_repgroup(
    username => 'snapproxy',
    privilege_type => 'proxy_snapadmin',
    list_of_gnames => NULL);
    SQL>END;
    SQL>/
    register_user_repgroup procedure를 통해 권한을 부여한다. 이때, "create
    session" 과 dbmsobjgwrapper / dbms_repcat_untrusted package에 대한
    "execute"권한이 부여된다.
    Replication group에 table을 add하게 되면 그 table에 대한 "select" 권한이
    부여된, master objects에 대한 DML권한은 이 user에게 부여되지 않는다.
    (4) Receiver privileges
    SQL>CONNECT system/<password>
    SQL>BEGIN
    dbms_repcat_admin.register_user_repgroup(
    username => 'snapproxy',
    privilege_type => 'receiver',
    list_of_gnames => NULL);
    SQL>END;
    SQL>/
    이 문장을 통해 "create session" 과 dbms_defer_internal packages,
    dbms_defer package에 대한 "execute"권한이 부여된다. 그러나 이것도
    마찬가지로 master object에 대한 DML권한을 부여하지 않는다.
    또한 receiver는 replication object를 추가한 후 replication support시에
    생성되는 <schema>.<object name>$RP (LOB table에 대해서는 $RL)에 대한
    execute권한을 부여 받아 master site에 변경사항을 적용하게 된다.
    (5) Proxy refresher privileges
    SQL>CONNECT system/<password>
    SQL>GRANT create session TO snapproxy;
    SQL>GRANT select any table TO snapproxy;
    (6) Schema Owner(s) (여기에서는 REPUSER로 명시)
    SQL>CONNECT system/<password>
    SQL>CREATE USER repuser IDENTIFIED BY <password>
    DEFAULT TABLESPACE <tablespace name>
    TEMPORARY TABLESPACE <tablespace name>;
    SQL>GRANT connect, resource TO repuser;
    8.2 Snapshot Site user와 권한
    (1) Snapshot administrator / Propagator / Refresher (SNAPADMIN)
    snapshot administrator, propagator, refresher에 대해서 하나의 user로
    관리하는것이 일반적이다.
    SQL>CONNECT system/<password>
    SQL>CREATE USER snapadmin IDENTIFIED BY <password>;
    DEFAULT TABLESPACE <tablespace name>
    TEMPORARY TABLESPACE <tablespace name>;
    (2) Snapshot administrator 권한
    SQL>CONNECT system/<password>
    SQL>EXECUTE dbms_repcat_admin.grant_admin_any_schema('snapadmin');
    SQL>GRANT comment any table TO snapadmin;
    SQL>GRANT lock any table TO snapadmin;
    (3) Propagator 권한
    SQL>EXECUTE DBMS_DEFER_SYS.REGISTER_PROPAGATOR('snapadmin');
    (4) Refresher 권한
    SQL>GRANT create any snapshot TO snapadmin;
    SQL>GRANT alter any snapshot TO snapadmin;
    refresher와 대응하는 master site의 proxy refrsher에 의해 master site의
    table에 대한 "select any table" 권한을 가지게 된다.
    (5) Schema Owner(s) (여기에서는 REPUSER로 명시)
    replicate되고자 하는 table에 대한 master site의 schema와 동일한 이름의
    shema가 snapshot site에서도 필요하다. 단 password는 같을 필요는 없다.
    만약 다른 schema에 대해서 updatable snapshot을 생성하면, snapshot생성시는
    오류없이 만들어지지만, create_snapshot_repobject 수행시에 아래와 같이
    오류가 발생할 것이다.
    ORA-23306: schema <schema name> does not exist
    ORA-23308: object <schema name>.<object name> does not exist or is invalid
    아래 문장과 같은 schema owner생성시 주의할 점은 이 권한을 role을 통해
    부여하지 말고 직접 주어야 한다는것이다. 즉, 이미 connect, resource등을
    통해 create table과 같은 권한은 부여된 상황임에도 불구하고, 이후에
    procedure나 package등에서 이 권한이 필요한 경우 role을 통해 부여된 것은
    인식이 되지 않고 ORA-1031이 발생하기 때문에 아래와 같이 직접 권한을
    부여하여야 한다.
    SQL>CONNECT system/<password>
    SQL>CREATE USER repuser IDENTIFIED BY <password>
    DEFAULT TABLESPACE <tablespace name>
    TEMPORARY TABLESPACE <tablespace name>;
    SQL>GRANT connect, resource TO repuser;
    SQL>GRANT create table TO repuser;
    SQL>GRANT create snapshot TO repuser;
    이 user가 master site에 대해서 수행할 수 있는 권한에 대해서는 이 user에서
    master site로 생성하는 database link를 어느 user로 connect하느냐에 달려
    있으며 이것은 9.4에서 설명한다.
    (6) End Users
    snapshot schema에 있는 snapshot을 이용하는 user가 별도로 존재할 수
    있으며, 이 경우 특별한 권한이 추가적으로 필요하지는 않고, snapshot
    object에 대한 필요한 권한을 부여하면 된다.
    9. Database Link
    ================
    database link를 생성하기 전에 중요한 것은 replication 환경에 포함된 모든
    database는 고유한 global name을 가지고 있어야 한다. default global name은
    <db_name>과 동일하나 다음과 같이 문장을 통해 global name을 수정가능하다.
    그러므로 db_name이 같더라도 이렇게 global name을 수정하여 replication
    환경을 구성할 수 있다.
    SQL>ALTER DATABASE RENAME GLOBAL_NAME TO <new global name>;
    SQL>SELECT * FROM GLOBAL_NAME;
    updatable snapshot환경에서 database link가 제대로 구성되지 않으면 이후
    작업에 계속 문제가 생기므로 주의하여야 한다. 이 database link는 snapshot
    site에서 master site로만 구성하면 되며, 반대로 master site에서 snapshot
    site로 구성할 필요는 없다.
    (1) Public Database Links
    Net8 connection alias를 이용하여 다음과 같이 public database link를
    만든다. 이후 생성되는 private link는 using절을 포함하지 않게 되며,
    모두 public database link와 동일한 이름의 db link이름을 가져야 한다.
    (global_names=true이기 때문)
    SQL>CONNECT system/<password>
    SQL>CREATE PUBLIC DATABASE LINK <remote databases global name.world>
    USING 'Net8 alias';
    여기에서 표현한 Net8 alias는 snapshot site의 tnsnames.ora file에 정의
    되어 있어야만 한다.
    (2) Snapshot Administrator / Snapshot propagator / refresher
    snapshot administrator와 proxy snapshot administrator 다음과 같이 private
    database link가 필요하다.
    SQL>CONNECT snapadmin/<password>
    SQL>CREATE DATABASE LINK <remote databases global name.world>
    CONNECT TO snapproxy IDENTIFIED BY <password>;
    (3) Schema Owner (여기에서는 REPUSER로 명시한다)
    snapshot을 가지고 있는 모든 schema는 master site에 private database
    link를 생성해야 한다. 이때, "Schema to Schema" 와 "Schema to Proxy
    Refresher" 두가지를 고려할 수 있다.
    만약 link를 schema to schema방식으로 생성하게 되면, snapshot owner는
    쉽게 master site로 연결하여, master table에 DDL이나 DML을 수행가능하다.
    이것은 일반적으로 바람직하지 않으므로 master의 proxy refresher로
    private database link를 만들도록 권고된다. master에서 proxy refresher와
    proxy administrator가 동일한것이 일반적으로 결국 proxy administrtor에게
    연결하면 된다.
    이렇게 되면 snapshot의 schema owner는 proxy refresher user에 의해,
    master table에 대한 "select any table"권한은 가지게 되지만, DDL이나,
    DML은 허용되지 않으므로 더 안정적이다.
    SQL>CONNECT repuser/<password>
    SQL>CREATE DATABASE LINK <remote databases global name.world>
    CONNECT TO snapproxy IDENTIFIED BY <password>;
    (5) End User
    database link가 필요하지 않다.
    9.6 Testing Database Links
    database link생성 작업이 끝나면 다음과 같이 하여, 각 user별로 database
    link 생성이 올바로 되었는지 확인하도록 한다.
    SQL>CONNECT user/<password>
    SQL>SELECT * FROM DUAL@<database link name>
    10. schedule설정
    ================
    1 ~ 9번까지 성공적으로 수행되었다면 이제 replication manager를 이용하여,
    replication/snapshot group과 object를 추가할 수 있다.
    replication manager를 이용시 master site는 repadmin user로 접속하고,
    snapshot site는 snapadmin user로 접속하도록 한다.
    snapshot site의 변경 작업을 master site로 주기적으로 push시키고, 이렇게
    push된 data를 또 다른 주기로 purge시키는 scheduling이 필요하다.
    이것은 replication manager를 이용하려면, 아래 menu를 이용하면 된다.
    - Scheduling --> Scheduled Links
    - Database Information --> Purge Job Tab
    이 작업을 sql문으로 수행하려면 다음과 같은 문장을 snapshot site에서
    수행한다.
    SQL>CONNECT snapadmin/<password>
    SQL>BEGIN
    dbms_defer_sys.schedule_push(
    destination => '<destination databases global name>.WORLD',
    interval => '/*10:Mins*/ sysdate + 10/(60*24)',
    next_date => sysdate,
    stop_on_error => FALSE,
    delay_seconds => 0,
    parallelism => 1);
    SQL>END;
    SQL>/
    SQL>BEGIN
    dbms_defer_sys.schedule_purge(
    next_date => sysdate,
    interval => '/*1:Hr*/ sysdate + 1/24',
    delay_seconds => 0,
    rollback_segment => '');
    SQL>END;
    SQL>/

Maybe you are looking for