• About
  • Everyday Linux Commands

<roughCode/>

~ …so I can find it

Monthly Archives: January 2013

Identify full table scans in Oracle

23 Wednesday Jan 2013

Posted by Scott in Uncategorized

≈ Comments Off on Identify full table scans in Oracle

Tags

Oracle

I used to have a good query that I was happy with to do this, but I apparently lost it. Here’s some queries I’ve cobbled together today to identify full table scans and check their SQL…and determine that a maybe some new indexes might be in order based on real world queries…

select * from v$sql_plan where operation = ‘TABLE ACCESS’ and options = ‘FULL’
AND timestamp > sysdate – .01
order by TIME

and use the hash value to get the SQL:

select * from v$sql
where HASH_VALUE = {hash value of a result}

Advertisement

A cool row selection

22 Tuesday Jan 2013

Posted by Scott in C#, Code Samples

≈ Comments Off on A cool row selection

Tags

C#

A co-worker had something like this in a project, and I thought it was pretty neat.  A lot cleaner than what I’ve been doing recently:

DataSet ds = GetDataFromSomeWhere();
IEnumerable<DataRow> rows = null;
rows = from row in ds.Tables[0].AsEnumerable()
       where (row.Field<String>("ColumnA").ToUpper() == myValue
       || row.Field<String>("ColumnA").ToUpper() == "SomeOtherValue")
       && row.Field<String>("ColumnB").ToUpper() == aBoolean.ToString().ToUpper()
       && row.Field<String>("ColumnC").ToUpper() == "SomeDifferentValue"
       select row;
foreach (DataRow row in rows)
{
    // stuff
}

C# ASP.Net find index of item in DropDownList by text

18 Friday Jan 2013

Posted by Scott in C#, Code Samples

≈ Comments Off on C# ASP.Net find index of item in DropDownList by text

Tags

asp.net, C#

Another little trick from today — I have the text value of the item, but I need to find the index so I can set it to Selected…

dDList.SelectedIndex = dDList.Items.IndexOf(dDList.Items.FindByText(stringValue));

ASP.net update control in parent page from acsx user control

18 Friday Jan 2013

Posted by Scott in C#, Code Samples

≈ Comments Off on ASP.net update control in parent page from acsx user control

Tags

asp.net, C#

Needed to update a treeview control (oh noes!) on the page from an ascx user control. It was easier than I expected…

// path value for the tree node to update:
string path = string.Format("0/{0}/{1}/{2}", this.Group, this.Trend, this.NID);
// find the treeview control in the page controls collection:
TreeView tvc = Page.FindControl("tvEvents") as TreeView;
//magic!
tvc.FindNode(path).ImageUrl = im;

Find Active Directory user by SMTP Email Address

11 Friday Jan 2013

Posted by Scott in C#, Code Samples

≈ Comments Off on Find Active Directory user by SMTP Email Address

Tags

active directory, C#

We’re always having to look up users in AD by some value or another.  The newest twist was to take an SMTP e-mail address and find the sAMAccountName (LAN login) for that user.  We couldn’t just use the mail value because a lot of users may have more than one SMTP e-mail address…for nick-names and the like.  So, it’s DirectorySearcher to the rescue!  Code after the break uses an OR in the DirectorySearcher’s Filter property to look at PRIMARY SMTP addresses — proxyaddresses=SMTP:{0} OR OTHER SMTP addresses — proxyaddresses=smtp:{0} to find a match.  Notice the case difference there?

Continue reading →

Task Scheduler error “Action failed to start”

02 Wednesday Jan 2013

Posted by Scott in Uncategorized

≈ Comments Off on Task Scheduler error “Action failed to start”

Tags

windows

Interesting point in the Windows Server 2008 Task Scheduler that tripped me up (thanks to http://www.arcomit.co.uk/support/kb.aspx?kbid=000058 for pointing out the problem to me). Don’t include quotes in the Start In: value for your task, even if the path contains spaces. If there are spaces, the Program/Script: value must be surrounded by quotes, but the Start In: value has to be free of quotes…weird.

Recent Posts

  • Bulk commands to install PHP and MySQL on CentOS 7
  • Four year gap? No, had just been self-hosting for a while
  • winhttpcertcfg.exe Example
  • Configure Tomcat 7 to use HTTPS
  • SCP on Mac (and a tool for Windows)

Archives

  • November 2018
  • October 2018
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • January 2013
  • December 2012
  • November 2012
  • October 2012
  • September 2012
  • August 2012
  • July 2012

Categories

  • Apache Tomcat
  • Apache Web Server
  • Application Servers
  • C#
  • CMS
  • Code Samples
  • Databases
  • Development Tools
  • Drupal
  • IIS
  • Java
  • Linux / UNIX
  • MS SQL Server
  • Networking
  • Operating Systems
  • Oracle
  • Uncategorized
  • Video Games
  • Windows
  • WordPress

Meta

  • Register
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.com

Create a free website or blog at WordPress.com.

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Follow Following
    • <roughCode/>
    • Already have a WordPress.com account? Log in now.
    • <roughCode/>
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar