Goldengate: How to handle soft deletes

How are you all , it has been a  long while since my last blog so thought of sharing some useful information on goldengate, let us try to implement soft deletes in the goldengate.

Concept: 
      In the source table record got deleted , in the replicated target update the record attribute delete_flag from N to Y, if record got reinserted in the source, in the target modify delete_flag from ‘Y’ to ‘N’. If new record got inserted then delete_flag will be N and if source updates a record in the target also record should get updated but there is no change in the delete_flag value i.e. it will be N only.

Implementation details…..for example let us have source target tables as follow

CREATE TABLE source.SOFT_DETELE_IMPLEMENTATION
(
   ROW_ID      VARCHAR2(15 CHAR) ,
   LOGIN       VARCHAR2(50 CHAR)
);
  
CREATE TABLE target.SOFT_DETELE_IMPLEMENTATION
(
   ROW_ID                 VARCHAR2(15 CHAR) ,
   LOGIN                  VARCHAR2(50 CHAR) ,
   DELETE_FLG             CHAR(1 CHAR)     
);


In extract parameter file add the table which you are interested in
example: edit /app/ggate/dirprm/eextract.prm

EXTRACT EEXTRACT

SETENV (NLS_LANG = "AMERICAN_AMERICA.UTF8")
USERID dbuser_name@DB_Instance, PASSWORD password

EXTTRAIL /app/gg/trail/
-- etc

TABLE source.SOFT_DETELE_IMPLEMENTATION, &
      COLS (ROW_ID, LOGIN);


--Modify the Replicat parameter file and add following syntax for corresponding table then perform all necessary task need for extract / replication to work.

edit /app/gg/dirprm/rextract.prm

---------------------------------
-- TARGET Table mapping -- 
---------------------------------
-- following tag will allow multiple maps for single source
ALLOWDUPTARGETMAP
GETINSERTS
GETUPDATES
-- IGNOREDELETES will ignores deleted records
IGNOREDELETES
MAP source.SOFT_DETELE_IMPLEMENTATION,  TARGET target.SOFT_DETELE_IMPLEMENTATION, &
    COLMAP ( ROW_ID = ROW_ID, LOGIN =  LOGIN, DELETE_FLG = "N" ),HANDLECOLLISIONS;
IGNOREINSERTS
IGNOREUPDATES
GETDELETES
-- UPDATEDELETES will convert delete operations into update operations.
UPDATEDELETES
MAP source.SOFT_DETELE_IMPLEMENTATION,  TARGET target.SOFT_DETELE_IMPLEMENTATION, &
    COLMAP ( ROW_ID = ROW_ID, LOGIN =  LOGIN, DELETE_FLG = "Y" ),HANDLECOLLISIONS;

Unit testing:
Inserted a record into source  ( insert into SOFT_DETELE_IMPLEMENTATION values ('400','aaa');)
Target Table Values ---- 400    aaa         N     

Updated a record in the source (update SOFT_DETELE_IMPLEMENTATION set login ='upd'  where row_id ='400';)
Target Table Values ---- 400     upd        N 

deleted a record from source (delete SOFT_DETELE_IMPLEMENTATION where row_id ='400';)
Target Table Values ---- 400     upd        Y   

Inserted same record 2nd time in the source
Target Table Values ----400     aaa         N    

Source record got updated
Target Table Values ----400     upd        N  

Source record got deleted second time

Target Table Values ----400     upd        Y     


OBIEE Suite Bundle Patches - Useful information


Good news for all the OBIEE implementer’s. Going forward Oracle is going to provide bundle patch scheduled every quarterly(you can plan upgrade activities well ahead), each patch consist of critical bugs fixes, security bugs and or small feature enhancements. Bundle patch is “One Integrated, Well Tested” and you don’t have to worry about patch conflicts with ‘one-off’ patches.

Bundle patches have moved to a calendar based numbering scheme. Example: 1.1.1.7.131017 (YYMMDD format 2013 Oct 17)

For additional details take a look at KM document “OBIEE Suite Bundle Patches (Doc ID 1591422.1)”

Have a wonderful weekend
-- Vasu

Chrome (Version 30.0.1599.69 m) browser issue -- Patch available


If you are accessing OBIEE using Chrome browser latest version (Version 30.0.1599.69 m) , you may experience many UI issues. For this issue there exists a patch (Patch 16068402) , currently it is available for 11.1.1.6.10+, if you are below this version then you need upgrade to latest version and apply the patch.

OBIEE11g - URL's and its purpose


Based on your permissions and environment setup you will be able to access following links.

http://Your_Server_Name:7001/console    
to access Administraton Server
http://Your_Server_Name:7001/em
   to Fusion Middleware Control (FMW)
http://Your_Server_Name:9704/analytics
to verify the status of bi_server1.
http://Your_Server_Name:9704/analytics/saw.dll?IBotSummary
to create agents
http://Your_Server_Name:9704/analytics/saw.dll?bipublisherEntry&Action=new&itemType=.xdm
to create a new datamodel for BI Publisher
http://Your_Server_Name:9704/analytics/saw.dll?bieehome
to access home page
http://Your_Server_Name:9704/analytics/saw.dll?Admin
to go to Administration Page
http://Your_Server_Name:9704/analytics/saw.dll?ManageGroups
to Manage catalog groups
http://Your_Server_Name:9704/analytics/saw.dll?Sessions
to Manage sessions or for killing a session
http://Your_Server_Name:9704/analytics/saw.dll?ManageIBotSessions
to Manage Agent sessions
http://Your_Server_Name:9704/analytics/saw.dll?bipublisherEntry&Done=%2fanalytics%2fsaw.dll%3fAdmin&Action=admin
to Manage BI Publisher previleges
http://Your_Server_Name:9704/analytics/olh/l_en/biee0194.htm
to launch help documents
http://Your_Server_Name:9704/analytics/saw.dll?catalog&action=searchpanel&type=all
to perform Catalog search
http://Your_Server_Name:9704/analytics/saw.dll?perfmon
to view Performance related metrics
http://Your_Server_Name:9704/analytics/saw.dll?PrivilegeAdmin
to Manage various permissions with in analytics
http://Your_Server_Name:9704/wsm-pm
to verify the status of Web Services Manager.
http://Your_Server_Name:9704/xmlpserver
to accesss Oracle BI Publisher application.
http://Your_Server_Name:9704/ui
to Oracle Real-Time Decisions application.
http://Your_Server_Name:9704/bioffice/about.jsp
to verify the status of the Oracle BI for Microsoft Office application.
http://Your_Server_Name:9704/bicomposer
to verify the status of the Oracle BI Composer application, if this link throw error implies bi composer is not configured.
http://Your_Server_Name:9704/analytics/saw.dll?wsdl
                                       to access web services.

Error: 'Element 'Views' is not valid for content model: '


If you see following error message when starting presentation services, possible reason for error would be, you may have same tags twice or so.

In my case I have 2 time 'Views' tag in the instance config file. When I'm trying to start presentation services it has thrown following error. Just delete one of 'Views' tag then everything worked fine.


Element 'Views' is not valid for content model: 'All(BIforOfficeURL,SmartViewInstallerURL,BIClientInstallerURL32Bit,BIClientInstallerURL64Bit,SmartSpaceInstallerURL,SESSearchUrl
,CatalogPath,CustomerMessageDBPath,DefaultTimeoutMinutes,DSN,LightWriteback,ReportAggregateEnabled,XPLowFragmentationHeap,EnablePartialReportUpdate,ActionFramework,ActionLinks,S
oapClient,AdvancedReporting,Alerts,AsyncLogon,Authentication,BriefingBook,CustomLinks,BISearch,EnableClientState,ClientStorage,FavoritesSyncUpIdleSeconds,Cache,Catalog,BICompose
r,Views,Analysis,Formatters,CSV,Cursors,Dashboard,Disconnected,DiscovererServers,HTTP,Hypercube,Drilling,JavaHostProxy,Listener,Lists,Localization,Logging,CatalogCrawlerLogging,
CatalogManagerLogging,LogonParam,Marketing,MessageTables,MiniDump,OC4JServer,ODBC,PDF,Prompts,RDS,ReportCache,CatalogObjectSchemaValidation,Scheduler,Scorecard,Security,ServerCo
nnectInfo,SpatialMaps,StatePool,SSLCredentialStore,UsernamePasswordCredentialStore,SubjectAreaMetadata,TestAutomation,ThreadPoolDefaults,TimeZone,UI,URL,XmlCacheDefaults,Catalog
Crawler,UserprefCurrenciesConfigFile,UserCurrencyPreferences,EnableHostsLookupInSessionsScreen,BIEEHomeLists,FijiFeatures,Utilities,QueryManager,ExecutionContext,ClientSideCachi
ng,DeploymentProfile,LoadCredentialStore,Thumbnails,PresentationSuggestionEngine,PerformanceMonitoring,MemoryProfiling,ActivityReporting,OracleHardwareAcceleration,ScaleFactor,M
onitorMutexContentions,Download)'

BI Publisher - 'Could not establish connection.' error



When you trying to create new Data Sources - JDBC source (Navigate to Administrator link --> Manage BI Publisher -->JDBC Connection) -- with Oracle Database you may face 'Could not establish connection.'  With this you will not be able to identify root cause.

Go to EM (Fusion Middleware control) check logs you may able to see some useful information.

If you see following error then change the connection string from jdbc:oracle:thin:@databasehost:post_number:your_sid to jdbc:oracle:thin:@//databasehost:post_number/your_sid

Error message:    Message java.sql.SQLException: Listener refused the connection with the following error:
    Supplemental Detail ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:482)
        at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:678)
        at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:238)

Thank you Chris Tanabe for helping me on this.

Inline image 1
Regards,
Srinivas Malyala