Powered By Blogger

الثلاثاء، 20 أبريل 2010

N-Way oracle streaming

Created By : Taher YahiaDate : 15-04-2010Databases : DB1 and DB2 Schema : TestTable : ONEColumn :( ID and Name )
------------------------------------------------------------------------------------------------------------ 1- Create admin streams user in both databases and grant streams authorization to streams admin :-
DB1 connect as sys/sys
SQL > create user streamadmin identified by streamadmin;SQL > grant dba,select_catalog_role to streamadmin;SQL > exec dbms_streams_auth.grant_admin_privilege('streamadmin',true);
----------------------------------------DB2conn connect as sys/sys
SQL > create user streamadmin identified by streamadmin;SQL > grant dba,select_catalog_role to streamadmin;SQL > exec dbms_streams_auth.grant_admin_privilege('streamadmin',true);
___________________________________________________________________________________________ 2- Alter tables at schema you will work on at both databases :-
DB1 connect as TEST/TESTSQL > alter table one add supplemental log group supp_log_one (ID,NAME);
---------------------------------------------------------------------DB2 connect as TEST/TESTSQL > alter table one add supplemental log group supp_log_one (ID,NAME);____________________________________________________________________________________________ Note :- To check if table altered correctly or not you can run this script on both database :-SQL > select log_group_name, table_name from dba_log_groups where owner='TEST';_____________________________________________________________________________________________
3- Create Database Link between 2 databases :- Connect As streamadmin
DB1
SQL > CREATE DATABASE LINK DB2 CONNECT TO STREAMADMIN IDENTIFIED BY streamadmin USING 'DB2';
DB2
SQL > CREATE DATABASE LINK DB1 CONNECT TO STREAMADMIN IDENTIFIED BY streamadmin USING 'DB1';

_______________________________________________________________________________________________4- Create Stream Queues under the streamadmin user to apply and capture the database changes to be replicated DB1 AND DB2
SQL > exec dbms_streams_adm.set_up_queue(queue_table => 'apply_q', queue_name => 'apply_q', queue_user => 'streamadmin');SQL > exec dbms_streams_adm.set_up_queue(queue_table => 'capture_q',queue_name => 'capture_q',queue_user => 'streamadmin');
_____________________________________________________________________________________________5- Setup data capture on both the databases
DB1
SQL > BEGINDBMS_STREAMS_ADM.ADD_SCHEMA_RULES (SCHEMA_NAME => 'TEST',STREAMS_TYPE => 'CAPTURE',STREAMS_NAME => 'CAPTURE_STREAM',QUEUE_NAME => 'CAPTURE_Q',INCLUDE_DML => TRUE,INCLUDE_DDL => TRUE,INCLUSION_RULE => TRUE);END;
DB2
SQL > BEGINDBMS_STREAMS_ADM.ADD_SCHEMA_RULES (SCHEMA_NAME => 'TEST',STREAMS_TYPE => 'CAPTURE',STREAMS_NAME => 'CAPTURE_STREAM',QUEUE_NAME => 'CAPTURE_Q',INCLUDE_DML => TRUE,INCLUDE_DDL => TRUE,INCLUSION_RULE => TRUE);END;-----------------------------------------------------------------------------------------------------------------------------------------------------6- Setup data apply on both the databases:
DB1
SQL > BEGINDBMS_STREAMS_ADM.ADD_SCHEMA_RULES (SCHEMA_NAME => 'TEST',STREAMS_TYPE => 'APPLY',STREAMS_NAME => 'APPLY_STREAM',QUEUE_NAME => 'APPLY_Q',INCLUDE_DML => TRUE,INCLUDE_DDL => TRUE,SOURCE_DATABASE => 'DB2');END;
DB2
SQL > BEGINDBMS_STREAMS_ADM.ADD_SCHEMA_RULES (SCHEMA_NAME => 'TEST',STREAMS_TYPE => 'APPLY',STREAMS_NAME => 'APPLY_STREAM',QUEUE_NAME => 'APPLY_Q',INCLUDE_DML => TRUE,INCLUDE_DDL => TRUE,SOURCE_DATABASE => 'DB1');END;
_______________________________________________________________________________
7- Setup propogation process on both the databases: Note :- Its basically setting up related between the capture process on one database and apply process on the other database. Thes need to run as streamadmin user.
DB1
SQL > BEGINDBMS_STREAMS_ADM.ADD_SCHEMA_PROPAGATION_RULES (SCHEMA_NAME => 'TEST',STREAMS_NAME => 'TEST1_TO_TEST',SOURCE_QUEUE_NAME => 'CAPTURE_Q',DESTINATION_QUEUE_NAME => 'APPLY_Q@DB2',INCLUDE_DML => TRUE,INCLUDE_DDL => TRUE,SOURCE_DATABASE => 'DB1');END;
DB2
SQL > BEGINDBMS_STREAMS_ADM.ADD_SCHEMA_PROPAGATION_RULES (SCHEMA_NAME => 'TEST',STREAMS_NAME => 'TEST_TO_TEST1',SOURCE_QUEUE_NAME => 'CAPTURE_Q',DESTINATION_QUEUE_NAME => 'APPLY_Q@DB1',INCLUDE_DML => TRUE,INCLUDE_DDL => TRUE,SOURCE_DATABASE => 'DB2');END;
____________________________________________________________________________________8- Setup schema instantiation SCN on Both DataBase :
DB1SQL > DECLAREISCN NUMBER;BEGINISCN := DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER();DBMS_APPLY_ADM.SET_SCHEMA_INSTANTIATION_SCN@DB2 (SOURCE_SCHEMA_NAME => 'TEST',SOURCE_DATABASE_NAME => 'DB1',INSTANTIATION_SCN => ISCN,RECURSIVE => TRUE);END;
DB2
SQL > .DECLAREISCN NUMBER;BEGINISCN := DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER();DBMS_APPLY_ADM.SET_SCHEMA_INSTANTIATION_SCN@DB1 (SOURCE_SCHEMA_NAME => 'TEST',SOURCE_DATABASE_NAME => 'DB2',INSTANTIATION_SCN => ISCN,RECURSIVE => TRUE); END;
__________________________________________________________________________________9- Start capture and apply process:
DB1 and DB2
SQL > EXEC DBMS_APPLY_ADM.SET_PARAMETER (APPLY_NAME => 'APPLY_STREAM', PARAMETER => 'DISABLE_ON_ERROR', VALUE => 'N');SQL > EXEC DBMS_APPLY_ADM.START_APPLY (APPLY_NAME => 'APPLY_STREAM');SQL > EXEC DBMS_CAPTURE_ADM.START_CAPTURE (CAPTURE_NAME => 'CAPTURE_STREAM');
____________________________________________________________________________________
10- To make sure that there are any errors
SQL > SELECT APPLY_NAME, SOURCE_DATABASE, LOCAL_TRANSACTION_ID, ERROR_NUMBER,ERROR_MESSAGE,MESSAGE_COUNTFROM DBA_APPLY_ERROR;

الخميس، 15 أبريل 2010

Installation of forms and reports 11g with weblogic 11g



Al Salamo alikom




I will explain how to install oracle forms 11g with weblogic 11g






1. Download oracle middleware fasuion 11g and weblogic 11g from oracle site



2. Install weblogic 11g into your machine, no tricks just press next



3. Begin to install forms and reports 11g



3.1 Unzip downloaded file in a folder like forms11g you will find that it contains four folder disk1...disk4



3.2 Enter disk1 folder and press setup.exe the next page get opened then press next












3.3 Next page appeared with two chices use the first then press next another page apeared to check system requirment if it get you pass press next












3.4 Next page appeared with three choice I try second and third and they are not working and give errors, so choose first one and enter mandatory feilds and be note that password must have at leaset one number then press next




3.5 Next page appeared contains feild to enetr an email to send errors to it and oracle support password to contact with oracle support automatically if any there is any error, so insert those feilds if exist or don't enter any thing and uncheck checks box there is a warring message press yea then press next

3.6 Next page to enter weblogic folders on your machine (You installed before), so the installer detect it automaticaly and give you suggested instance name you can change it if you want then press next

3.7 Next page to select installed component if you want only forms and reports so uncheck oracle discoverer, oracle portal and clustered checkboxs and check developer tools as shown in next pic then press next



3.8 next page to set ports used by forms and reports or make it auto configuration, you will choose auto configuration then press next
3.9 Next page to define used proxy if you use, you choose don't use proxy setting then press next
3.10 Next page to Oracle insternet directory if you use it, uncheck checkedbox to not use OID
3.11 Next page display your choices to confime it before begin to install you can save it then press install, it will start installation process and it will take alot of time