Based on the last above links in my edit to my question I found my answer. I cannot tweak the system account since our logons to our system are from an LDAP and I cannot control the groups and what not.
So I did the following:
- Opened the DB2 GUI (was easiest to do this way).
- Connected to the desired database as db2admin.
- Added my logon to the database as a user.
- GRANT all authorities to that id (my id).
- Disconnect.
- Connect to the desired database as my id.
- GRANT all authorities to db2admin.
- Disconnect.
Voila! The db2admin logon now as all authorities.
EDIT: I'm going to leave the above as it helped me learn how to do some interesting stuff in DB2. However, I have learned that the
DBADM/SECADM with DATAACCESS and ACCESSCTRL authorities granted the
instance owner (in my case the db2admin id) have all the authority
needed to interact with the database. I could have actually just
commented out those grant lines above in the script. Those were left
over from a script which ran against an older version of DB2. I have
also found if I need to have the instance owner DBADM after doing a
restore to database A from database B, it is easiest just to set the
registry variable DB2_RESTORE_GRANT_ADMIN_AUTHORITY to YES (available
in Fix Pack 2 and above). Then I don't have to try to grant instance
owner DBADM. It automatically is granted that to any database restored
into the instance. If you are not at Fix Pack 5, you have to bounce
the instance for this to take affect.
Ok...I think I have a better idea of what you need based on the comments above.
First off, if all you need it DB2, I'd go download DB2 10.1 Express-C (the link will take you to whatever is the latest at the time. At the time of this post it is 10.1 Fix Pack 2) to get you started. It is the same binaries as Enterprise Server Edition. All you need to do is purchase a license from IBM and apply it using db2licm -a <license file name>
in order to turn your Express-C into Enterprise Server Edition. Now, that aside, since you are installing this on Windows, make sure you download the appropriate bit version (ie, 32 bit vs 64 bit).
Also, and this from my experience on Windows, make sure you install the 64 bit DB2 into Program Files (no matter which drive you install it to) and if you install the 32 bit DB2, install it into Program Files (x86) (on a 64 bit OS). If you don't do this, Windows won't find the DB2 drivers for any ODBC connections you wish to set up. And even with that, I've had hit and miss luck with 32 bit DB2 on 64 bit Windows.... Best to just use 32 bit DB2 on 32 bit Windows and 64 bit DB2 on 64 bit Windows.
Ok...whew! Now that aside, once you install DB2, it will automatically create an instance named DB2 and most likely create a database called SAMPLE (which you can always remove).
I've found it best (and this is just me) to use a system or local account for the admin ID for DB2. Either way, make sure you let DB2 create the DB2ADMNS and DB2USERS groups. Anyone you want to be able to maintain DB2 will need to be in the DB2ADMNS group and obviously if you just want to access DB2 in the DB2USERS group.
DB2 automatically comes with the DB2 Control Center,which is clunky as all get out. But don't let that turn you off. That is just a GUI, the actual database itself is amazingly fast and powerful. Besides as of version 9.5 or 9.7, IBM has deprecated the Control Center. They still have packaged it with DB2, but they really recommend that you download IBM Data Studio, which is a free, Eclipse-based product that you can use to interact with DB2. I recently downloaded it and tried it. I love it waaaaay better than Control Center. We (the DBAs at our company) are going to work on a project to roll out Data Studio to replace end user and developer access to DB2 to move away from Control Center.
When you download Data Studio, pick the "full product image" under the "Optional Downloads" section. It should be the one about 1.5GB rather than the one above that is only 112MB.
Anyway, hope this gets you started. Let me know if you have other questions.
Best Answer
Depending on its precision, a TIMESTAMP value may have fractional seconds. For literals, the precision is defined by the presence of a fractional part after seconds, as well as the number of digits in the fractional part. For columns, the precision is defined as an optional parameter after the name of the type in the column definition. For instance:
defines the column as a timestamp with nanosecond precision (9 digits after the decimal point). (As you have SQL Server background, you can compare this to the SQL Server
datetime2
type, which also has optional precision.)For reference, see IBM Knowledge Center - Datetime values.
It looks likely that the column in question is defined differently between the development environment and production, the development definition being
TIMESTAMP(0)
(no fractional seconds) and the production definitionTIMESTAMP(6)
(or simplyTIMESTAMP
, which means the same).That explains why your developer never has to specify fractions of a second in the development environment – because the column's values cannot possibly have fractional seconds. At the same time, she may have to specify timestamps with a fractional part in the production environment because the column type there allows fractions of a second in the values and some timestamps apparently do have fractional parts.