Oracle streams CREATE TABLE space-level environment Overview: initialization

Source: Internet
Author: User
Tags commit create directory resource unsupported

DBMS_STREAMS_ADM provides three procedures for creating a table space-level replication environment:

Maintain_simple_tts: Replication of a single table space

Maintain_tts: Replication of multiple table spaces

Pre_instantiation_setup and Post_instantiation_setup: Replication of multiple table spaces

Maintain_simple_tts and Maintain_tts Two processes automatically add negative rule set filtering streams unsupported database objects, Pre_instaintiation_setup and Post_instaintiation_ Setup requires you to manually configure the parameters (described in the previous chapter), for objects not supported in the database can be obtained through query dba_streams_unsupported, if unsupported objects are not filtered, the catch throws an exception.

Pre_instantiation_setup and Post_instantiation_setup have just shown the replication environment for creating the entire library, which is similar to the creation of the table space level, so this chapter will think twice about trying to pass the Maintain_ TTS to create a table-space-level replication environment (Maintain_tts can also be used to replicate a single tablespace, Maintain_simple_tts is implemented in a similar way to Maintain_tts, but not functionally, so it is not shown here).

Table space-level replication One thing to note is whether the table space to be replicated is self-contained (self-contained), and the concept of self-contained is carefully described in the "Copying data using features of the Transport Table Space" series, and if you want to know more about your friends, you might as well read it first, Here is also a simple mention, the so-called self-contained table space refers to the table space object its reference or referenced object is in the same table space, for example, if the table's index contains a table space that is different from the table space, the table space is not included in the table space, unless you decide to copy both tablespaces simultaneously.

The example in this chapter follows the environment in the previous chapter (Haha, just as the last step of the previous chapter has cleared the streams), so at least the preparation step can be skipped, setting the environment:

Source database Sid:jssweb, Target library: jssstr

Downstream capture

Copy webdata table space, configured for bidirectional replication

Synchronous DDL Operations

Dbms_streams_adm. Maintain_tts Direct Build Configuration

STREAMS management has been created, and the database chain for source and target-side communication has also been created

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/

First, the preparatory work:

In addition to the preparatory work that has been done in the previous chapter (creating a secondary instance is not needed, the replication target library at the table space level must already exist), you need to do the following.

1. Construct the table space to be replicated and initialize some data

Jssweb> Conn/as SYSDBA

Connected.

jssweb> Create tablespace webdata datafile¨/data/oradata/jssweb/webdata01.dbf¨size 100m;

Tablespace created.

Jssweb> create user member identified by member default Tablespace webdata quota unlimited on webdata;

User created.

Jssweb> Grant Connect,resource to member;

Grant succeeded.

Jssweb> revoke unlimited tablespace from member;

Revoke succeeded.

Jssweb> CREATE TABLE MEMBER.DT_TBL1 as select object_id id,object_name name

2 from All_objects where rownum<=100;

Table created.

Jssweb> commit;

Commit complete.

Note that the schema of the object in the tablespace to be replicated must also exist on the target side, so the target side also needs to create the user of member.

Jssstr> create user member identified by member default tablespace users;

User has created.

Jssstr> Grant Connect,resource to member;

The authorization was successful.

2. Create directory objects on both the source and target side:

First create data pump files in the source side directory:

Jssweb> Conn Strmadmin/strmadmin

Connected.

Jssweb> Create directory myDT _source As¨/data/oradata/jssweb/dmp¨;

Directory created.

Also, the source side needs to create a directory object that points to the path to the table space corresponding data file to be replicated:

Jssweb> Create directory Dfpath As¨/data/oradata/jssweb¨;

Directory created.

Tip: If the table space corresponds to a data file that is under multiple different paths, it is important to create multiple directory, which is maintain_tts to read this part of the information to copy the data file when executing.

Target-side Create Create data file directory:

Jssstr> Conn Strmadmin/strmadmin

is connected.

Jssstr> Create directory myDT _dest As¨/data/oradata/jssstr¨;

The directory has been created.

Note that the/DATA/ORADATA/JSSWEB/DMP and/DATA/ORADATA/JSSSTR directories do exist in their respective operating systems, otherwise the error occurs when the EXPDP/IMPDP is executed.

3. Set the archive path

Because you think twice about preparing for downstream capture, you need to configure the Log_archive_dest_n parameter at the source to send the source end to the capture database (and, of course, we capture the database in fact the target database).

Jssweb> alter system set log_archive_dest_2=¨service=jssstr.jss.cn LGWR async Noregister¨;

System altered.

4. Check to see if the table space is self contained

Although the tablespace is what we just created, think twice about being sure to be a self-contained tablespace, but just post the check steps for reference, and maybe you'll use it in the actual application:

Jssweb> set Serveroutput on

jssweb> exec Sys.dbms_tts.transport_set_check (¨webdata¨,true,true);

Pl/sql procedure successfully completed.

Jssweb> select * from Sys.transport_set_violations;

No rows selected

Return null to indicate that there is no problem.

Author: 51cto Blog Oracle Little Bastard

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.