3DS Will Not Power on even though it is charged — how to fix it (maybe)

My 3DS wouldn’t power on this morning. I hadn’t used it for a week. I guess the battery was as flat as a pancake. After charging the 3DS for an hour it still wouldn’t power on (it was still plugged into the mains and charging as far as I could tell).

Hmm. That’s a bit weird I thought. In a fit of desperation/pique I removed the game card (Mario Kart 7) and I removed the SD Card too. I immediately tried to power on the 3DS and bingo it came on first time. I powered it down again, put the SD card and game card back in and bingo, it powered up again.

Phew.

 

Seamus

The Bears Breeches

 

 

Fix Oracle Database Won’t start due to invalid parameter in spfile.

Hmmm. Your Oracle Database Won’t start due to invalid parameter in spfile.. hmm..

This is a quote from appsdba.comWhen using an SPFILE it is possible to get into the situation where the database won’t start due to an invalid parameter, and since the database won’t start it is not possible to fix the SPFILE.

I got into this situation this morning. Its very very frustrating but relatively straightforward to fix. Here goes.

Step 0: Check for a pfile equivalent of your spfile! If it exists then start the database using startup pfile=/path/to/pfile and issue a create spfile from pfile when the database starts and then restart your database. Bingo. Amend your spfile parameters at your leisure. If you haven’t got a pfile then read on..

Step 1: find your spfile. If you don’t know where this is you’re goose is already cooked. It usually lives in $ORACLE_HOME/dbs and is called spfile<ORACLE_SID>.ora though yours may have a different name. In my case the ORACLE_SID is TEST so my spfile is called spfileTEST.ora. 

Step 2: Back up your spfile (and pfiles too).

Step 3: Open a command prompt, navigate to the directory containing your spfile and type strings spfile_name > $ORACLE_HOME/dbs/temp_pfile.ora (this creates a pfile not an spfile!!). If the spfile file is in $ORACLE_HOME/dbs then rename the spfile to something you’ll remember…  IF the spfile is stored within ASM then login as the ASM owner, start asmcmd and use the cp command to copy the file to a directory your database/instance owner can read and run strings /path/to/spfile/spfile_name > $ORACLE_HOME/dbs/temp_pfile.ora.

Step 4: open temp_pfile.ora with a text editor and check its parameters. Tidy up incomplete entries and amend offending entries where appropriate. (I’d accidentally reduced one of the memory parameters from 24G to 2G preventing the instance from starting up).

Step 5: try starting up the database.. startup pfile=/path/to/file/temp_pfile.ora should do the trick. If the instance starts shut it down immediately (shutdown immediate should do the trick). If the instance doesn’t start then check your parameters and try again!

Step 6: rename temp_pfile.ora to init<ORACLE_SID>.ora. Mine is called initTEST.ora.

Step 7: startup the database again. once its started type create spfile from pfile and press enter.

Step 8: Restart the database. Your database should now start up but this time its using the newly created spfile.

Step 9: Take applause from your colleagues and count your lucky stars.

 

This document was typed rather hastily on a train on my way home. If you spot a mistake please let me know.

 

Enjoy,

Seamus

 

 

How To Change DNS Settings on your Mac

So, why woud you want to know How To Change the DNS Settings on your Mac? If you use wi-fi or even a wired connection chances are DHCP sorts out your DNS settings for you. Well, I’ve been having problems with my Mac and surprise surprise it uses DNS settings supplied by my router which in turn routes me to my ISPs DNS servers for name resolution. After a bit of testing the problem appeared to be my ISP’s Servers that were the problem and so, after rummaging around the world wide web of useful info for advice on what to do, I decided to use Google’s Public DNS Servers instead of my ISPs. Google’s Public Servers are at 8.8.8.8 and 8.8.4.4.

Here’s how I changed my settings:

 

Seamus

 

How to import Enterprise Manager Grid Control Data into Excel and Create Attractive Looking Graphs and Charts

It is really not difficult to import performance data from your Enterprise Manager Grid Control setup and produce some very nice looking graphs from the data stored within.

Here’s one I made earlier.

Custom Oracle Enterprise Manager Graph / Report produced using Excel
A nice 3D graph of Enterprise Manager repository data demonstrating how much nicer Excel’s graphs are than Oracle OEM’s

 

Here’s how to do it:

  1. The first step is to install ODAC. You must do this because in my experience, on a Windows XP PC, Microsoft’s ODBC for Oracle driver doesn’t appear to handle Oracle’s sysdate at all well. You can download ODAC (11.2 Release 4 (11.2.0.3.0)  in my case) from Oracle’s rather swish download pages.
  2. The next thing to do is create an entry for your repository database. Make sure you edit the tnsnames.ora that is part of the ODAC installation or this won’t work.
  3. Create an ODBC data source using the tnsnames entry you created in step 2.
  4. Fire up Excel.
  5. From the menu bar select Data / Import External Data / New Database Query
  6. Select the ODBC data source you created in step 3.
  7. Enter your username and password. Username will be sysman, see your admin people if you don’t know the password.
  8. The MS Query query wizard shop pop up. Expand the the first table that appears in the Available Tables and Columns list and add the first row only to Columns in your query (for me the table is AQ$_MGMT_ADMINMSG_BUS_G and the first column is MSGID).
  9. Keep clicking next until you reach Query Wizard – Finish and you’re asked what you want to do next.
  10. Select the middle option – View Data or Edit data in Microsoft Query and click finish.
  11. If all goes well you should a Microsoft Query window containing another a visual representation of the query you just created
  12. Click on the AQ$_MGMT_ADMINMSG_BUS_G table ( or which ever table you used in step 8 ) and press delete. The table should disappear from the screen.
  13. Click the SQL button (at the very top of the window) and paste your query into the the SQL box that opens up then click OK. (You can use the query builder features of Microsoft Query but,  to be honest, that can take a while. What i usually do is take my base query (click here to see it or download it here: sample_oemrep_query.sql) and paste that in). NOTE: this query returns daily summaries up until the day before today – the query won’t return any data for today.
  14. Change your parameters to suit and Save the query if you wish (Irecommend this).
  15. Then click the Return Data button (its at the top of the window to the immediate left of the SQL button). You should find yourself back in Excel territory.
  16.  Choose where you want to put the data and click ok. You should have a spreadsheet full of Enterprise Repository data.
  17. Create charts and graphs and pivot tables and pivot charts to your heart’s content.

Beware! There is a caveat:

Your date must be formatted as YYYY-MON-DD or MS Query will have a fit. Your query, if you’re going to query on dates must contain something like:

MGMT_METRICS_1DAY.ROLLUP_TIMESTAMP>TO_DATE('2012-JAN-01','YYYY-MON-DD')

or for the last 90 days worth of metrics data..

MGMT_METRICS_1DAY.ROLLUP_TIMESTAMP >= SYSDATE - 90

 

Leave a comment if this is any use to you.

Video (and amendments coming soon!).
Seamus.

An easier way to run dscacheutil -flushcache on your Mac (OS X Snow Leopard) to clear your dns cache

Don’t know about you but I am fed up with intermittent “Unable to connect..” messages when I’m browsing the web on my Mac. Its a real pain – my mac is the only device in my house (out of many devices) that seems to have problems connecting to the web.

I’m fed up with having to open a terminal and enter “dscacheutil -flushcache” to get browsing the web going again.

To begin with I got around this by creating a shell script called revive.sh which ran dscacheutil but i got bored having to open a terminal, navigate to the location of my shell script and enter ./revive.sh.

There had to be another way… and there is. I created an Automator App which runs dscacheutil. Now when I get one of those pesky “Unable to connect…” messages I double-click on my app (or an alias for the app) and I’m browsing the web again.

You can download the app here: flushdns.app

Seamus

Mac OS X Automator Adventures – an app that will speak a dictionary definition of a word

Here’s an Automator app that will speak the dictionary definition of a word.

To get going double-click the app and when prompted type in the word for which you would like to hear the definition spoken.

Its basic but i’m jusssst gettin’ to grips with Automator.

 

You can get the app here : speakingdictionary.app

Mac OS X Automator Adventures – an app that speaks one’s IP Address

I know, this is completely useless… unless you have a use for it, that is.

I was home alone and a little bit bored so i decided to play around with Mac OS X’s Automator. Stuck for something do i though it would be nice to have an app that would speak one’s Mac’s IP address out loud. I know, who’d have thought that computers would be used to speak? 🙂 Anyway, I’ve never used Automator before and was surprised how easy it was to use.

 

You can download the app here

 

 

Convert your AWS SSH keys to a format you can use with PuTTY

If you’ve had problems with trying to connect to your EC2 instance with PuTTY its probably because the format of the private key from the keypair you generate in, say, the AWS Management Console is not in a format that PuTTY understands.

 

Check out this article in the Amazon Web Services document repository if you haven’t already done so.. How to get PuTTy working with AWS.

 

Seamus.

When CUPS stops printing ~ lp: Too many active jobs

I got a nasty surprise this morning. I run a batch routine that generates a couple of thousand or so letters from E-Business Suite every night and then prints them – via CUPS –  to a series of networked printers. This has worked since the year dot. It has never let me down…. until that is, this morning when it let me down big style.

The first 500 letters were queued and then subsequently printed. The other 2500 were rejected by CUPS. (I should mention at this point that the letters are printed individually thus each letter generates a print job meaning 3000 or so print jobs should’ve been created and subsequently printed off).

After the first 500 letters went of to CUPS I started to see a message in my application log:

lp: Too many active jobs

I have never seen this message before. Well weird considering the number of print jobs that have gone through the system.

To cut a long story short the solution to my print problem was to change a parameter in cupsd.conf

By default CUPS will queue a maximum of 500 print jobs before rejecting further print requests. To quote directly from the CUPS manual :

The MaxJobs directive controls the maximum number of jobs that are kept in memory. Once the number of jobs reaches the limit, the oldest completed job is automatically purged from the system to make room for the new one. If all of the known jobs are still pending or active then the new job will be rejected.

Setting the maximum to 0 disables this functionality. The default setting is 500.

So I added MaxJobs 0 to my cupsd.conf file, restarted CUPS, did a fairly large scale test (about 1000 jobs sent) and all is well. I’ll update this post at some point as I’ve heard setting MaxJobs 0 can have unpleasant side effects in terms of Memory and CPU consumption.

 

Generate your own custom graphs and reports from Oracle Enterprise Manager Grid Control 11g’s Repository Data

I like Enterprise Manager. Its lets me see what’s going on and what’s gone on and that’s great. BUT, i know that’s in upper case, the graphs/charts it produces aren’t much use. The look okay but they’re far too small and are limited in a number of ways – the main way being that you tend to only get one metric per graph (unless I’m doing something really here  and someone wants to tell me where I’m going wrong). The other day My boss asked me for some reports on database storage (ie how much space our databases take up) and such like and could he have some nice graphs to put into his PowerPoint presentation.. Okay said I grudgingly.  I merely saved one or two of the bitmap graphs Enterprise Manager produces and sent him those. “These are nice graphs but I want some better graphs. Something that would look good in a presentation,” said he. “Gulp,” said I.

After a bit of mooching around the EM repository database I found that it wasn’t that difficult to get the data I wanted.

I logged into the my the repository data as SYSMAN, had a nose around and found that i needed 3 tables to extract the data I needed to produce a graph for statistics gathered on a daily basis: MGMT_TARGETS, MGMT_METRICS and MGMT_METRICS_1DAY. I chose MGMT_METRICS_1DAY because it contained the daily summary/figures for the data I wanted. I figured these tables would give me daily figures for the data I needed. You can figure out how the tables are joined by looking at the query which should make an appearance quite soon…

I decided that I needed information only or Oracle Databases,  the total size of all datafiles used by my database[s] over a specific time span. I needed to set the following parameters:

  • MGMT_TARGETS.TARGET_NAME = ‘DLIVE’ – this is the name of my Oracle Instance as it is displayed in Enterprise Manager.
  • MGMT_METRICS.TARGET_TYPE = ‘oracle_database’ – this ensures only data for Oracle Databases is returned
  • MGMT_METRICS_1DAY.ROLLUP_TIMESTAMP > TO_DATE(‘2011-JAN-01’, ‘YYYY-MON-DD’) – I wanted my data from the 1st January 2011
  • MGMT_METRICS.METRIC_COLUMN = ‘ALLOCATED_GB’ – we’re only interested in storage allocated to the oracle database
  • MGMT_METRICS.METRIC_NAME = ‘DATABASE_SIZE’ – as i understood things we’re only interested in the size of the database (though the query works without this parameter!)

 

This SQL provided can provide the basis for all reports which make use of Enterprise Manager’s daily roll-up (ie summary) of a particular metric.

SELECT DISTINCT
                      MGMT_METRICS.TARGET_TYPE, MGMT_METRICS.TYPE_META_VER, MGMT_METRICS.METRIC_NAME, MGMT_METRICS.METRIC_COLUMN,
                      MGMT_METRICS.SHORT_NAME, MGMT_METRICS_1DAY.TARGET_GUID, MGMT_METRICS_1DAY.METRIC_GUID,
                      MGMT_METRICS_1DAY.KEY_VALUE, MGMT_METRICS_1DAY.ROLLUP_TIMESTAMP, MGMT_METRICS_1DAY.SAMPLE_COUNT,
                      MGMT_METRICS_1DAY.VALUE_AVERAGE, MGMT_METRICS_1DAY.VALUE_MINIMUM, MGMT_METRICS_1DAY.VALUE_MAXIMUM,
                      MGMT_TARGETS.TARGET_NAME
FROM                  MGMT_METRICS, MGMT_METRICS_1DAY, MGMT_TARGETS, MGMT_TARGET_TYPES
WHERE                MGMT_METRICS.METRIC_GUID = MGMT_METRICS_1DAY.METRIC_GUID AND
                      MGMT_METRICS.TARGET_TYPE = MGMT_TARGETS.TARGET_TYPE AND
                      MGMT_METRICS_1DAY.TARGET_GUID = MGMT_TARGETS.TARGET_GUID AND
                      MGMT_METRICS.TYPE_META_VER = MGMT_TARGETS.TYPE_META_VER AND
                      MGMT_METRICS.TARGET_TYPE = MGMT_TARGET_TYPES.TARGET_TYPE

Here’s the SQL with my parameters added:

SELECT DISTINCT
                      MGMT_METRICS.TARGET_TYPE, MGMT_METRICS.TYPE_META_VER, MGMT_METRICS.METRIC_NAME, MGMT_METRICS.METRIC_COLUMN,
                      MGMT_METRICS.SHORT_NAME, MGMT_METRICS_1DAY.TARGET_GUID, MGMT_METRICS_1DAY.METRIC_GUID,
                      MGMT_METRICS_1DAY.KEY_VALUE, MGMT_METRICS_1DAY.ROLLUP_TIMESTAMP, MGMT_METRICS_1DAY.SAMPLE_COUNT,
                      MGMT_METRICS_1DAY.VALUE_AVERAGE, MGMT_METRICS_1DAY.VALUE_MINIMUM, MGMT_METRICS_1DAY.VALUE_MAXIMUM,
                      MGMT_TARGETS.TARGET_NAME
FROM                  MGMT_METRICS, MGMT_METRICS_1DAY, MGMT_TARGETS, MGMT_TARGET_TYPES
WHERE                 MGMT_METRICS.METRIC_GUID = MGMT_METRICS_1DAY.METRIC_GUID AND
                      MGMT_METRICS.TARGET_TYPE = MGMT_TARGETS.TARGET_TYPE AND
                      MGMT_METRICS_1DAY.TARGET_GUID = MGMT_TARGETS.TARGET_GUID AND
                      MGMT_METRICS.TYPE_META_VER = MGMT_TARGETS.TYPE_META_VER AND
                      MGMT_METRICS.TARGET_TYPE = MGMT_TARGET_TYPES.TARGET_TYPE AND (MGMT_METRICS.TARGET_TYPE = 'oracle_database') AND
                      (MGMT_METRICS_1DAY.ROLLUP_TIMESTAMP > TO_DATE('2011-JAN-01', 'YYYY-MON-DD')) AND
                      (MGMT_METRICS.METRIC_COLUMN = 'ALLOCATED_GB') AND (MGMT_METRICS.METRIC_NAME = 'DATABASE_SIZE')
ORDER BY              MGMT_METRICS_1DAY.ROLLUP_TIMESTAMP, MGMT_METRICS_1DAY.SAMPLE_COUNT

The next thing i did was to import this data into Excel, created a pivot table with chart and filtered the data to suit my needs – my boss was after information on only once of our instances but I thought as I was doing this and it was a useful exercise I’d bring back data for all of my databases and knock out a graph fit for a King. You can see the graph here. NB: I filtered the data so that only DLIVE – the database my boss was interested in is displayed. I should warn you: don’t get too excited.. though I did add a trend line for extra added excitement so beware… 🙂

You can read how to import the data into Excel and produce some fetching graphs and charts here.

Example Enterprise Manager Report in Excel
Enterprise Manager Data Imported into Excel and Presented as a Custom Graph

 

 

Now, I thought that was a useful exercise because there’s a whole load of data (and information) held in the walls of Enterprise Manager but displaying that data how you want the data to be displayed is a different matter all together. I find the graphs in Enterprise Manager to be too small and of very little use when writing my monthly summaries for my Boss. Anyway, he knows how to create his own graphs now so a little bit of work has succeeded in getting him off my back. This was my first custom graph and there are loads more to come. I’ll post details if anyone is interested. or even document the full process and post that if there’s a demand for it.

 

Seamus