Second, the initialization of the environment
Before you are ready to create a streams replication environment, there are some preparations that need to be made, as follows:
1. Configure Administrator account
For ease of administration, it is not recommended to use Sys/system users, nor is it recommended to use System tablespace, and recommend that everything be new. The user needs to be created separately on the Source/target side and must have relevant administrative privileges, in this case, strmadmin.
A>. Create a new table space first
jssweb> Create tablespace Stream_tbs datafile¨/data/oradata/jssweb/stream01.dbf¨size 200m;
The table space has been created.
B>. Create Streams Administrator account and grant permissions, create Strmadmin as streams administrator
Jssweb> create user strmadmin identified by strmadmin default Tablespace Stream_tbs quota unlimited on STREAM_TBS;
User has created.
--Granting DBA authority
Jssweb> Grant DBA to Strmadmin;
The authorization was successful.
Of course, in some cases you won't be able to solve the problem by directly granting DBA authority, and if you've heard of explicit authorization and implicit authorization, and strmadmin users need to do something in the process, you'll understand what I mean. So the question arises, how do you give users permissions precisely? Oracle provides a package: Dbms_streams_auth, the user can refer to the official documentation, here is not extended, in general, the DBA role permissions are sufficient.
C>. Loop through all the databases involved in the replication environment, and do the above.
2. Create one or more database chains
Note, why do you say one or more? Because the situation is different, the processing way is also different! However, in any case, the source end to the target must create a database chain, this is beyond doubt, where, if the following conditions, the target to the source side also need to create a database chain:
Bidirectional replication Environment
Data Pump via Network
Target end as downstream capture database
RMAN Duplicate or Convert database
In these 4 cases, the database chain needs to be created because the INSTANTIATION_SCN parameter of the Post_instantiation_setup procedure cannot be null, which is Dbms_apply_adm.set_global_ INSTANTIATION_SCN process is obtained, while SET_GLOBAL_INSTANTIATION_SCN process execution requires a database chain. The database chain must be created after the Rman instantiation, before running the Post_instantiation_setup procedure.
If the capture database is a Third-party database, the following two database chains are also required: Third-party databases to the source database and third party databases to the target database.
The database chains mentioned above are all created under Strmadmin.
3. Create directory objects (if required)
This step is not necessary and you will need to create the appropriate directory objects in the following situations:
While executing the procedure without creating it directly, you select the build creation script and create a directory on the source to store the generated script.
By deciding to initialize data through the pump, you need to create a directory on both the source and target side to store and read the generated DMP files.
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/
What? You don't know what directory is? In short, it is also one of the new features of oracle10g, an alias for the operating system directory in Oracle, which allows you to read and write files in the operating system directory via Oracle. directory objects have read/write two permissions that can be granted to users who need access through the grant command.
4, put the source-side database into the archive mode
Verify that the source database is in Archivelog mode and you can use the following command:
jssweb> archive log list;
Database log mode No Archive mode
Automatic Archival Disabled
Archive Destination/opt/ora10g/product/10.2.0/db_1/dbs/arch
Oldest online log sequence 9
Current Log Sequence 11
If not, you can modify the database to archive mode in the following ways.
Jssweb> Startup Mount
ORACLE instance started.
Total System Global area 524288000 bytes
Fixed Size 2073984 bytes
Variable Size 163580544 bytes
Database buffers 352321536 bytes
Redo buffers 6311936 bytes
Database mounted.
jssweb> ALTER DATABASE Archivelog;
Database altered.
Jssweb> alter system set Log_archive_dest_1=¨location=/data/oradata/jssweb/archive/¨;
System altered.
jssweb> archive log list;
Database Log Mode Archive mode
Automatic Archival Enabled
Archive destination/data/oradata/jssweb/archive/
Oldest online log sequence 9
Next Log sequence to archive 11
Current Log Sequence 11
jssweb> ALTER DATABASE open;
Database altered.
Also note that if replication is bidirectional, the target database must also be in archive mode.
5. Configure log file transfer (dedicated downstream capture)
Local capture can read the log file directly, so you do not need this step, and if it is downstream capture, you need some way to send redologs to the capture database.
In fact, the transmission is the same old, if you have seen the "step-by-Step learning Dataguard" series, then the configuration log transport must have been quite skilled. Here is only to relive it ~ ~
A>. Set Log_archive_dest_n parameters
In addition to the locally archived log_archive_dest_n, set up a remote archive path. Log_archive_dest_n also has several parameters, usually you need to specify service (that is, the remote service connection name configured in TNSNames), others such as Arch/lgwr ASYNC/LGWR SYNC, Valid_for, db_ Unique_name or something.