Mar 08

HOTSOS In Texas!

I am currently in Texas at the HOTSOS Symposium. I look forward to this conference every year. There are some brilliant people here, and it is a great place to learn new things. Kerry Osborn did a great live presentation yesterday, can’t wait to get home and try some of this stuff out. Also saw a great presentation by Tanel Poder.

The food down here is amazing too! We went to the Gas Monkey Bar and Grill last night and the food was amazing. I love traveling for work. I mean it is more fun to travel just for fun, but when I can learn something new, and have someone else pickup the majority of the cost, that is pretty amazing!

Feb 08

DBSNMP By Way Of EMCLI

Currently I am changing passwords in several hundred databases, not that uncommon of a task for any DBA. Unfortunately it is time to rotate the dbsnmp password. Usually I would log into OEM after changing the password and manually update the password in the monitoring configuration for each and every database. This is fine if there are only a few passwords, but a huge pain when you are dealing with hundreds. The documentation oracle provides isn’t completely clear [1592390.1], at least it wasn’t to me at first.

First I would connect to the database as the sys user and change the password for dbsnmp

Then you connect to EM through emcli and update the monitoring credentials. For this post lets assume my Oracle RAC cluster has the name “MyRAC” which contains two nodes “MyRAC1” and “MyRAC2”. We don’t really need to know the individual instance names since the dbsnmp user is shared between both nodes.

Connect to the repository

Now you can change the password via emcli

Where I ran into trouble was the last argument, if you look at the monitoring configuration page for a database, it becomes clear what is being asked for

editdbsmp

The role is the same role you would select on the monitoring setup page, Normal or SYSDBA.

The syntax is slightly different if you are doing a single instance, but basically the same idea

So I am going to modify the change password proceedure to spool out these commands and just run them against OEM when I have completed changing the passwords on the databases.

Nov 17

Where Are My Nodes?

I should mention the current setup is a 4 node RAC database with a dataguard managed standby comprised of a 3 node RAC database cluster. The current database version is 11.2.0.4

While writing a shell script today, I needed to know from connecting to a database in a cluster what all the related nodes were. This isn’t a big deal, I could simply query gv$instance to pull a list of the host names, and the associated instances.

But what about the standby nodes? I can query v$archive_dest_status

Ok, great, that is the name of my standby database cluster, but there are three nodes! I want to see what is going where! I could use dgmgrl,

So that gives us the databases in the standby, but parsing this out would be a pain. I just want to generate a report, and it is much easier to be able to query the database to generate my output. However I couldn’t find a place to do this!

Enter the X$DRC view. I could find very little about this view itself. With any X$ table, the view is rather cryptic, but I was able to get enough information out of it to solve my problem.

Because there isn’t a lot of information on this table I had to make some assumptions, based on the data

You can see the primary instances and their hosts listed above. To pull the standby databases out, I used the following query. I am guessing this could be made a lot cleaner, but I ran out of brain power while trying to optimize it, so here is the current query.

I now have the information I want to include in my report. You could easily modify this to get all the nodes in the primary and the standby, but I would prefer to use gv$instance to get the primary nodes.

1/14/2016 Update

I didn’t notice this until much much later, if data guard is not enabled, The query on X$DRC will fail.

I was using this to get my primary and standby nodes, and union them together, this was returning an empty set to me. I was spooling this information out to a text file to be used with a shell script, so my solution was to just break into two pieces, first spool out any RAC nodes, then check to see if there are any standby destinations enabled, and if so then spool out standby databases. This seems to work fine.

This is why it isn’t safe to use X$ tables, they aren’t documented and you may not get expected behavior out of them. I would have assumed I would just back zero rows, but that would be to assume the X$ table is like a V$ table. Not true, the X$ tables are used for reading portions of the oracle memory, mostly, but can also bull information like control file information into the memory to be read. So if the memory segment the data guard, or possibly the data guard broker filed don’t exist, this table cannot function.

To learn more about X$ tables, I suggest these three sites, they are my go to for X$ information

Tanner Poder: Oracle X$ tables – Part 1 – Where do they get their data from?

Morgan’s Library: Oracle X$ Structures

ORAFAQ: X$ Table naming structures

 

Sep 18

Formatting SQL in Oracle

I was looking for a way to format the output from EXPAND_SQL_TEXT and came across this post. I would really rather have something in the database that I could do this with. I would prefer not to spool anything out, but it works very well.

Just another SQL beautifier

Aug 10

Xlib: No protocol specified

While trying to connect to an AIX box, and start dbca, I got the following error

This is an issue with Xming security. I changed the shortcut on my windows desktop to:

I was immediately able to fire up dbca.

the -ac option disable access control restrictions, so you should never do this over a public network, it could open up a massive hole in your computer and allow anyone to connect.

Jun 11

ORA-00904: “UTL_RAW”.”CAST_FROM_NUMBER”: invalid identifier

I have been migrating single instance databases to RAC databases and had several databases that filled up the diag directory spewing out alerts. There is a bug that can cause some of these, but in my case it was much simpler. Simple configuration mistakes

The first error was due to the existance of a spfile on the file system that was being read in.

the spfile was create in ASM, and $ORACLE_HOME/dbs/initdp0db#.ora was created on both nodes

However on node1, we still had $ORACLE_HOME/dbs/spfiledp0db1.ora

checking the spfile parameter in the database confirmed that this was the file being read in. The alert log wasn’t very helpful just spewing out the following.

The second issue I ran into that also filled up the diag directory was due to bad permissions on one of the nodes on the audit directory. This generated the exact same error as above in the log file.

If you see this error check the following

  • on each node check the value of the spfile in the databse, they should both be pointing to the ASM spfile
  • check the location of the audit directory and make sure it exists and oracle can write to it

These were simple mistakes that caused a huge headache.

Mar 03

HOTSOS 2015

I am currently at the HOTSOS Symposium. This is my favorite conference of the year. The people here are incredibly smart, the presentations are very technical, and it is just a good time. I look forward to this conference all year. I have learned some great new things that I am looking forward to trying out when I get home.

Nov 14

Why Didn’t Oracle Export That?

Ever wonder where Oracle keeps track of objects that won’t be exported?

This table contains a list of objects that will be ignored during an export.

Sep 24

Unzipping all Zip files in a directory

I don’t know why zip can’t handle multiple inputs, but it cant’. Gzip does just fine unzipping everything in a directory, I use this little “script” all the time on the command line to unzip all the files in a directory.

Its a small simple script, but it’s useful.

 

Jul 09

New Blades

I just got two additional block erupted blades today, they have been over clocked from 10GH/s to 13GH/s. By todays mining standards this isn’t much hashing power, but I got them very cheap. I had the backplane for these things, but have been having a hard time getting it to not overload the power supply I was using. I started to look online at what type of power supply you could put directly into the backplane, and it was a HP DL380. Ironicaly I just bought a HP DL380 G5 to be my new web server. In fact in a month or so, this website will be hosted on that server.

Since these are redundant power supplies, I just pulled one from the running server, and slapped it into the backplane, and I just upped my hashing power by ~26GH/s

Older posts «

» Newer posts