SQLPLUS – Windows – Administator only….

Came across this little chsnut on win2k recently – how to make SQLPLUS work on Citrix – with non admin users – handy alright! – This works a charm. 

Applies to:
Oracle Server – Enterprise Edition – Version: 10.1.0.2.0 to 10.2.0.1.0 Oracle Server – Standard Edition – Version: 10.1.0.2.0 to 10.2.0.1.0 Microsoft Windows 2000 Microsoft Windows XP Microsoft Windows Server 2003 Symptoms

When logged on to the Windows server as a non-Administrator OS account using Microsoft Terminal Services client (mstsc.exe), starting SQL*Plus fails with

SP2-1503: Unable to initialize Oracle call interface
SP2-0152: ORACLE may not be functioning properly

Starting SQL*Plus works when logged on to the Windows server using an Administrator OS account.

Starting SQL*Plus works when logged on locally to the Windows server console using the non-Administrator OS account.
Cause

The issue is related to a Windows Security configuration. The problem is caused by a security policy called “Create Global Objects”. The user account that is used to run the program does not have the “Create global objects” user right. This security policy was introduced with Windows 2000 SP4, and determines if applications started during a Terminal Services session can create or access globally accessible memory. By default, members of the Administrators group, the System account, and Services that are started by the Service Control Manager are assigned the “Create global objects” user right.
Solution
Assign the “Create global objects” user right to the non-Administrator account.

1. Click Start, point to Programs, point to Administrative Tools, and then click Local Security Policy.
2. Expand Local Policies, and then click User Rights Assignment.
3. In the right pane, double-click Create global objects.
4. In the Local Security Policy Setting dialog box, click Add.
5. In the Select Users or Group dialog box, click the user account that you want to add, click Add, and then click OK.
6. Click OK.

Sorted!

He Won…..

My son Caolan won a science prize last week.  He did a project on Asthma – and he built a bio-mechanical lung to show how the lungs worked.  Excellent stuff. Well done Caolan.

This is a pic of the display….

A picture of the Display 

Check out the Meccano… I knew it was worth keeping!

Bio Lung - Meccano Style….

The newsletter this week

Beech Hall Griffin Newsletter

Right Click for Command Prompt

Right – always wanted to remember how to do this…

  1. Navigate in your Registry to

    and create a key called “Command Prompt” without the quotes.

  2. Set the default string to whatever text you want to appear in the right-click menu.

  3. Create a new key within your newly created command prompt named “command,” and set the default string to

    You may need to add %SystemRoot%/ before the Cmd.exe if the executable can’t be found.

  4. The changes should take place immediately. Right click a folder and your new menu item should appear.  

Works a treat.

Safe Threading in C#

Simple explanation. Its a bit like recursion….

Identify the class thats being called from another thread – lets assume its got a few Windows Form calls in it.  

I’ll use the example here.  I have a multithreaded application and one of the worker threads needs to update a text box – on the main app screen.

The class is within the main GUI form  – mainform.cs and ist defined as:

private void MessageHandler_Message(int nId, string sMessage)

The idea behnid this is to marshall into the original thread that contains the GUI code. You need to declare a callback function – like this within the main class.

delegate void MessageHandler_MessageCallback(int id, string sMessage);

OK, so its got the same arguments.

Now in the class thats being called – 

MessageHandler_Message(int nId, string sMessage) it needs re-writing to be thread aware.

private void MessageHandler_Message(int nId, string sMessage){

// Check to see if we are in the correct thread

if (this.InvokeRequired){ // We need to create the callback function in the corrrect thread

MessageHandler_MessageCallback m = new MessageHandler_MessageCallback(MessageHandler_Message);

// Callback function is in the right thread – .Invoke fires it there.this.Invoke(m, new object[] { nId, sMessage }); }else{// If we get here we must be in the right thread

m_listBoxMessages.BeginUpdate();

int nItem = m_listBoxMessages.Items.Add(string.Format(“({0}) <{1}> {2}”, nId, System.DateTime.Now, sMessage));if (m_listBoxMessages.Items.Count > 5000){m_listBoxMessages.Items.RemoveAt(0);
}

if (m_listBoxMessages.SelectedIndex < 0){ {m_listBoxMessages.TopIndex = nItem;}

else if (m_listBoxMessages.SelectedIndex == nItem – 1){m_listBoxMessages.SelectedIndex = nItem;
}

m_listBoxMessages.EndUpdate();

}

}