Monthly Archives: October 2015

OGG: One useful GGSCI command is `FC`

Beside a useful GGSCI `!` command that enables you to reexecute last previous commands there’s `FC` command. With it you can edit last executed command or any previous command (by it’s number or by it’s beginning).
To invoke by number type fc and a number of previous command (each command executed in GGSCI has it’s number in history)

GGSCI> fc 24

To invoke by starting chars of previous command

GGSCI> fc inf

After hitting `FC` you enter an interactive mode where you have several options (refer to Oracle documentation). In overall `fc` resembles sqlplus’ `ed` command.

OGG: Reliable initial load using nothing but GoldenGate

Performing standard initial load that involves transfering of data from extract to remote replicat by TCP is slow and can cause serious performance decrease or even deadlocks on some source systems. For MSSQL especially extract will block a table while waiting for replicat to apply inserts on target system. To break this pityful dependency use the following method: unload all data from source DB to external files, move these files to the target system, then to load it on target system.
First create an ordinal extract ex1 that will cover our back and capture all changes to source tables that will occur during our inital load process (extracting and loading). Start it.
Create an extract that will unload all data to external files.

GGSCI> create extract ex2 sourceistable

with the `extfile` directive in `ex2.prm` file

sourceistable
extract ex2
sourcedb GGODBC, userid ggate, password !@cGate34
discardfile C:\GoldenGate\gg11_2_1_0_18\dirrpt\ex2.dsc, purge
extfile C:\GoldenGate\gg11_2_1_0_18\dirdat\II, maxfiles 100, megabytes 1024
table dbo.Header;

Start extract ex2, wait it to finish unloading data.
Resulting external files will have the same format as ordinal trail files.
Move files to the target system with the help of some magic, for ex. WinScp.
On target system create a replicat with exttrail option

GGSCI> create replicat r2 exttrail /opt/oracle/ggate/dirdat/II

This will make replicat treat our files like ordinal trails. Start it and wait some time until it loads all data, so it does not increase Log Read Checkpoint (quiery it by issuing `info r2` command).
Stop the replicat.
Create an ordinal replicat operating with handlecollision option. Run it. Wait until it reaches the current time.
That’s it, we’ve just performed a reliable initial load of target system using external files.

SQLDeveloper: Use files panel instead of missing vertical tabs

Vertical tabs are absolute good for big monitors. I think it’s a killer feature for any conmporary IDE, still only few implement it. Unfortunately there’s no option in Oracle SQLDeveloper to switch to vertical tabs. But there’s a feature request for vertical tabs. So please vote for it!
It’s pity, but let’s face the truth waiting for it may take long, mainly because SQLDeveloper IDE is a fork of JDeveloper. But here’s a relief for those who don’t want to wait. By now you can use Files panel (View->Files) instead of vertical tabs. If you want new tab/file to appear in you folder of choise, just save a new Worksheet with some name and it will instantly appear in Files browser, so you can open it by double click.

sqldevfiles