More Than Four

Areas of Interest, as counted by my cat

Page 5 of 12

Data Warehouses: Dimensions, and slowly changing them

Some very nice articles, for reference:

Oops, Jamie Thomson seems to have vanished from the web. However, his posts are still available via the Wayback Machine:

Git: how to create a merge conflict all on your own

I had some doubts that I was seeing all the changes from all developers, so I did some testing.

(I ran a git log command after each step to see what changes would show up.)

Step 1: Add a new file, and commit locally:

Mon Jul 11 21:05:41 2016 - Colin Nicholls : (Testing) Added a file locally
A misc_scripts/Testing_git_log.txt

Step 2: Pull from remote to refresh locally

Step 3: Push my local changes to the remote (origin).

Step 4: Edit the file, and commit. I misunderstood the use of the [x] Amend Last commit checkbox…

Mon Jul 11 21:10:28 2016 - Colin Nicholls : (Testing) Editing a file locally
A misc_scripts/Testing_git_log.txt

Note that the time-stamp has changed, and the comment text, but it is the same “Add” operation.

Step 5: Edit the file again, and commit. (This time, I did not use the [ ] Amend last commit, and I commented thusly:

Mon Jul 11 21:10:28 2016 - Colin Nicholls : (Testing) Editing a file locally
A misc_scripts/Testing_git_log.txt

Mon Jul 11 21:12:43 2016 - Colin Nicholls : (testing) [ ] Amend last commit (did not check)
M misc_scripts/Testing_git_log.txt

Step 6: Do a push to remote repository:

git.exe push --progress "origin" master:master

To https://github.abacab.com/zyxx/zyxx-db.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.abacab.com/zyxx/zyxx-db.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
git did not exit cleanly (exit code 1) (1981 ms @ 7/11/2016 13:14:39)

OK, I don’t understand why “the tip of my current branch is behind its remote counterpart”, but it is telling me I should do another pull before pushing, so:

Step 7: Pull from the remote to update locally:

git.exe pull --progress --no-rebase -v "origin"

From https://github.abacab.com/zyxx/zyxx-db
= [up to date] master -> origin/master
= [up to date] cmp13_convert -> origin/cmp13_convert
= [up to date] dev_2015_02_A -> origin/dev_2015_02_A
= [up to date] dyson -> origin/dyson
= [up to date] edison -> origin/edison
= [up to date] fermi -> origin/fermi
= [up to date] gauss -> origin/gauss
= [up to date] grendel -> origin/grendel
= [up to date] hubble -> origin/hubble
= [up to date] prod_2015_04 -> origin/prod_2015_04
Auto-merging misc_scripts/Testing_git_log.txt
CONFLICT (add/add): Merge conflict in misc_scripts/Testing_git_log.txt
Automatic merge failed; fix conflicts and then commit the result.
git did not exit cleanly (exit code 1) (2231 ms @ 7/11/2016 13:15:42)

Now I’m in conflict with myself!?

Step 8: At this point, I resolved the conflict by selecting “mine” over “theirs”, and did another local commit. This time I got a special “merge commit” dialog that didn’t show any specific changed files, but clearly wanted to do something.

So what does the log say at this point?

Mon Jul 11 21:05:41 2016 - Colin Nicholls : (Testing) Added a file locally
A misc_scripts/Testing_git_log.txt

Mon Jul 11 21:10:28 2016 - Colin Nicholls : (Testing) Editing a file locally
A misc_scripts/Testing_git_log.txt

Mon Jul 11 21:12:43 2016 - Colin Nicholls : (testing) [ ] Amend last commit (did not check)
M misc_scripts/Testing_git_log.txt

Mon Jul 11 21:22:08 2016 - Colin Nicholls : Merge branch 'master' of https://github.abacab.com/zyxx/zyxx-db

Interesting:

  1. The first edit operation has now returned to the log. It looks as though we have two “Add” operations.
  2. We get a generic “merge branch” message as the most recent log entry.
  3. Also, the time-stamps aren’t “local” time, at least, not my local time (it’s 13:25 PDT currently)

Step 9: Pull; delete test file; commit; push

Mon Jul 11 21:05:41 2016 - Colin Nicholls : (Testing) Added a file locally
A misc_scripts/Testing_git_log.txt

Mon Jul 11 21:10:28 2016 - Colin Nicholls : (Testing) Editing a file locally
A misc_scripts/Testing_git_log.txt

Mon Jul 11 21:12:43 2016 - Colin Nicholls : (testing) [ ] Amend last commit (did not check)
M misc_scripts/Testing_git_log.txt

Mon Jul 11 21:22:08 2016 - Colin Nicholls : Merge branch 'master' of https://github.abacab.com/zyxx/zyxx-db
Mon Jul 11 21:35:21 2016 - Colin Nicholls : (testing) deleted file
D misc_scripts/Testing_git_log.txt

This needs further testing, perhaps, but I’m going to return to billable work at this point.

Git: Obtaining a useful log of recent check-ins

This is mostly for my own reference, so I don’t lose it.

C:> set path=C:\Programs\Git\bin;%PATH%
C:> D:
D:> cd /source_control/ABACAB/github/zyxx_db
D:> git log --name-status -10 > last_ten_updates.txt

So long as the current path is under the right repository directory, the git log command seems to pick up the right information, without being told what repository to interrogate.

The output is useful, but the default formatting isn’t ideal. I’m not so interested in the git-svn-id or commit id. There’s a comprehensive list of options…

Try:

git log --name-status --pretty=format:"%cd - %cn : %s" --date=iso

The results are close to what I’m used to with Subversion:

2016-06-25 21:54:13 -0700 - Colin Nicholls : Synchronizing with latest SVN version
M zyxx/db/trunk/DW/DIRECT_DW.pkb
M zyxx/db/trunk/DW/SAMPLE_DATA.pck
:
M zyxx/db/trunk/environments/PROD/db_build_UAT.config
M zyxx/db/trunk/environments/UAT/db_build.config

2016-06-02 17:41:59 +0000 - cnicholls : Re-run previous report asynch; clear STATUS_TEXT on re-run
M zyxx/db/trunk/RIX/RIX.pck

2016-06-01 23:05:29 +0000 - cnicholls : Added V_Rix_Run_Log
M zyxx/db/trunk/RIX/create_views.sql

2016-06-01 09:12:36 +0000 - fred : Prepare deployment script.
M zyxx/db/trunk/deployment_scripts/49/during_DW.sql

2016-06-01 02:27:39 +0000 - zeng : INH-1139: Offer Issue - DW Should handle the "Link" action for Tag. Fix bug.
M zyxx/db/trunk/DW/ABACAB_RI.pkb

What I don’t yet know is why the most recent change has a time zone of “-0700” and the others “-0000”. It may have something to do with the way the previous entries were imported. Notice the committer name is different in the most recent check-in, which was the first one I did from my working copy, after the initial import.

Update

My current format of choice:

git log --name-status --pretty=format:"%cd - %cn : %s" --reverse --date-order --date=local

However, “local” doesn’t seem to mean “my local time zone”. So, not sure what the best date format is.

Crashing a server process with Error 14508

We have a SQL query that accepts WHERE clause parameters of date range. 1 year, 2 years, all work predictably. When I use a very large date range (i.e. “everything”), the Oracle dedicated server process crashes.

From the trace file:

*** 2016-05-20 22:06:12.735
*** SESSION ID:(630.42649) 2016-05-20 22:06:12.735
*** CLIENT ID:() 2016-05-20 22:06:12.735
*** SERVICE NAME:(SYS$USERS) 2016-05-20 22:06:12.735
*** MODULE NAME:(rix) 2016-05-20 22:06:12.735
*** CLIENT DRIVER:() 2016-05-20 22:06:12.735
*** ACTION NAME:(prepare_series(a)) 2016-05-20 22:06:12.735

Block Checking: DBA = 8236992, Block Type = Unlimited undo segment header
ERROR: Undo Segment Header Corrupted. Error Code = 14508
ktu4shck: starting extent(0xffff8000) of txn slot #0x6b is invalid.

Searching Google brought up a Russian blog page, that seems to be citing exactly the same issue:

*** MODULE NAME:(e:AR:bes:oracle.apps.xla.accounting.extract) 2015-10-01 06:37:00.659 -- станд.модуль OEBS
...

Block Checking: DBA = 14597504, Block Type = Unlimited undo segment header -- проверка UNDO
ERROR: Undo Segment Header Corrupted. Error Code = 14508 -- падает со специфичной для ANALYZE ошибкой (***)
ktu4shck: starting extent(0xffff8000) of txn slot #0x21 is invalid.
valid value (0 - 0x8000)

The gist of the post seems to indicate that they are using Oracle 12.1.0.2 and had set TEMP_UNDO_ENABLED=TRUE (a new feature in 12c).

This is interesting because we set this parameter true also, in our code.

Google Translate failed to come through with a useful translation, but it could be that they set this parameter FALSE in order to resolve the problem.

Previously, our test failed after ~2 hours. So far, having made the change to the parameter, it is still running after 4 hours. So, we’re optimistic.

iMac; Linux; GRUB; OS X: Can’t we all just get along?

I’m not really a fan of OS X. I’m sure the underlying OS is fine – after all, It’s a Unix system. I know this! – but the Finder; the keyboard layout; the relentless updates; but most of all the fuzzy text aggravated me.

After some success with a Bootable USB drive containing a 64-bit Linux Mint ISO, I decided to follow Clem’s excellent instructions here:

http://community.linuxmint.com/tutorial/view/1643

and install Linux Mint 17.1 on my 2013 iMac.

Now, I’m not crazy: I resized the primary OS X partition and divided up the remaining space, just as Clem recommended:

/dev/sda4    30 GB   ext4
/dev/sda5     4 GB   swap
/dev/sda6   500 GB   ext4 

After the Linux install completed, I also followed the “Fixing the boot order” instructions, about installing efibootmgr and making the EFI boot Linux first. Supposedly this was to achieve:

“The boot order should now indicate that it will run Mint first, and if that ever came to fail.. it would then run Mac OS. In other words our MacBook now boots into Grub. From there we can select Mint or press Escape and type “exit” to boot into Mac (we’ll fix the Mac grub entries to make it exit without having to type anything later on in this tutorial).”

I’m not sure what I did wrong… maybe nothing. Maybe we’re just expected to have a complete understanding of EFI and GRUB and bootloader configuration in general, at this point.

Anyway, bottom line: I never saw GRUB, or a menu of boot options, or anything. It just booted straight into Linux. Fortunately the Mac HD volume is visible and accessible under Linux, and I’ve been able to copy my files over as the need arises, from inside Linux Mint. Excellent.

But what if I want to execute a Mac OS X application natively, for some reason? Dammit, I want to dual boot this thing. The normal Option- key (Mac Boot menu) no longer works, and neither does Option-R (to get to the Mac Recovery partition).

After some research, I learned that pressing ‘c’ during the boot process gets us to the GRUB command line. Now I could use the ls -l command to list the partitions:

hd2,gpt1      fat efi
hd2,gpt2 hfsplus 'Mac HD'
hd2,gpt3 hfsplus 'Recovery HD'
hd2,gpt4 ext * 29 GiB
hd2,gpt5 - 5 GiB
hd2,gpt6 ext * 438 GiB

but this still left me with no understand of how to boot into one of them. More research:

http://askubuntu.com/questions/16042/how-to-get-to-the-grub-menu-at-boot-time

OK, so I learn about GRUB 2 and the significance of the /etc/grub.d scripts and the /etc/default/grub file, and commenting out the GRUB_HIDDEN_TIMEOUT=0 setting by prefixing it with ‘#’.

Dedoimedo has a really nice tutorial on GRUB here:

That taught me how any changes to these grub config files should be followed up with:

$ sudo update-grub

After that, when I restart, I get the boot menu! Yay. From the partition list (see above) I’m pretty sure that I should be able to add a menu option for the OS X partition.

More research:

http://askubuntu.com/questions/179689/mac-os-x-wont-boot-from-grub-menu-in-ubuntu-precise-on-apple-mba5-2

It suggests adding the following to the /etc/grub.d/40_custom script:

   menuentry "OS X" {
insmod hfsplus
set root=(hd1,gpt2)
chainloader /System/Library/CoreServices/boot.efi
}

Long story short: that works perfectly. After sudo update-grub and a reboot, we have a menu and an option that will boot into OS X.

Thanks, Internet!

Installing VirtualBox 4.3 on Windows 7-64 – Solved

I was preparing for an Oracle online workshop on Database 12c multi-tenancy, and as part of the prep, you get to download a VM image with the lab environment. Of course, being Oracle, it is a Virtual Box vm.

Now, I like Virtual Box. It works great on my Mac at home, but for some reason I’ve had problems installing 4.x on my work laptop (Lenovo W520, getting on a bit now but still recommended).

The problem is Virtual Box almost completely installs – until it gets a certain point, then the progress bar runs backwards and it says “rolling back install”, followed by:

“Oracle VM VirtualBox 4.3.20 Setup Wizard ended prematurely” because of “an error”. This is followed up by “Installation failed! Fatal error during installation.”.

No other information provided. Running as Adminstrator after a cold reboot didn’t help.

Well… I really wanted to have the Workshop lab environment available, so despite the fact that last time I encountered this problem I didn’t find any useful help on the web, I tried again… and this time, I found something on the forums, a post by user Tronmech:

https://forums.virtualbox.org/viewtopic.php?f=6&t=61785

I’ll repeat the instructions here in case for some reason that post vanishes:

  • Go into the registry at: HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Network
  • Change “MaxNumFilters” from 8 to 20 (decimal)
  • Reboot
  • Install 4.3.x (run installer as administrator, just in case)

This time, the install was successful. Thanks, Tronmech!

After some more research, it seems that Windows 7 has a maximum hard-coded limit of 14 network filter drivers… and for some reason, this setting in the registry reduces it further to 8, by default.

So setting the MaxNumFilters key to 20 probably only lifts the artificial limit and allows 14 possible filters. Applications such as Virtual Machine managers and VPN clients need to add filters to the network stack, and increasing this limit in the registry seems to be the recommended fix.

In one KB article, I read that a Windows Service Pack could not be installed until some filters were removed!

To view currently deployed Network Filter Drivers, right-click on your connection widget in the Network Connections control panel applet, and view properties:

I believe that each of those checkboxed items is a “Network Filter Driver”. I have 9 of them, and I assume that the “VirtualBox Bridged Networking” driver was the 9th one added after I lifted the limit of 8.

Implementing a Proper() case function in PL/SQL

I found that I needed to convert some raw column names (i.e. THIS_IS_MY_COLUMN) into a human-readable “Proper” or “Title” case form, e.g. This Is My Column.

Scouring the web, I didn’t find out I could steal, so here’s my implementation:

   function Proper(
p_string varchar2
) return varchar2
is
l_string varchar2(200);
l_proper varchar2(200);
begin
l_proper := '';
-- change any underscores to spaces:
l_string := replace(lower(p_string), '_',' ' );

for i in 1..length(l_string)
loop
-- obviously the first character is UPPER:
if i =1 then
l_proper := l_proper || upper( substr( l_string, i, 1 ) );
else
-- if the character is preceded by a space, UPPER it:
if substr( l_string, i-1, 1 ) = ' ' then
l_proper := l_proper || upper( substr( l_string, i, 1 ) );
else
l_proper := l_proper || substr( l_string, i, 1 );
end if;
end if;
end loop;
return l_proper;
end;
 
« Older posts Newer posts »

© 2025 More Than Four

Theme by Anders NorenUp ↑