Tuesday, May 7, 2013

[how to] How to run DB Admin Tool (GUI) in IBM DB2 Express-C?

[how to] How to run DB Admin Tool (GUI) in IBM DB2 Express-C?


How to run DB Admin Tool (GUI) in IBM DB2 Express-C?

Posted: 07 May 2013 09:05 PM PDT

I had installed IBM DB2 Express-C in Windows but I can't find any shortcut to launch the Administration Tools (GUI). When installing, I had selected "Administration Tool" option (I had checked twice to make sure).

This is the only shortcuts available from Start Menu:

IBM DB2 Shortcuts

So how to run the Administration Tools for IBM DB2 Express-C?

T- SQL : Retrieve 5th highest salary in table

Posted: 07 May 2013 07:33 PM PDT

How to get the 5th highest salary from the table. Suppose, I have 100 rows and I want to display details of 5th highest salary of the individual then how to write that query in T-SQL using SQL Server 2008R2.

1 emp1 1000 2 emp2 2000 3 emp3 3000 4 emp4 4000 5 emp5 5000 6 emp6 6000 7 emp7 7000 8 emp8 8000 9 emp9 9000

Regards.

Displaying Hexadecimal Characters in Reporting Services Report

Posted: 07 May 2013 03:13 PM PDT

How do I properly display hexadecimal characters in an SSRS report?

These characters: http://www.htmlhelp.com/reference/html40/entities/special.html

E.g., “ should display as left double quotation mark in the report.

Need help to design model with multiple rights

Posted: 07 May 2013 05:27 PM PDT

For a website, I have multiple elements that need to be moderated by many different users. Until now, I have always used Role-Based Access Control (RBAC) model but I want a more flexible model. I would like to be able to assign some user with some specific rights on particular ressources and after be able to remove/add rights as I want.

For example an element would be a blog with articles. There is the author of the articles who has full rights on his article but I would like to be able to add another user for that article with update right on it. And that for all elements in my website.

Here is what I have:

enter image description here

Elements are 'page', 'article', 'anotherElement'. 'Ownership' is the table where each user has what he can do. 'Right' is the table with specific right (read, write, ...). 'Category' is not important, only to subclass my elements.

Is here a better way to do this? The problem will be the size of table 'ownership' after a certain time.

weak entity with a many to many relationship with its owner

Posted: 07 May 2013 01:26 PM PDT

I have a database that keeps track of the hours worked by a contractor per week. I have one table for contractors that contains "con ID" as primary key. The other table Weekly Hours Tracker contains month day year (representing a particular week) and hours worked. Now from what I understand this table is a weak entity and relies on contractor table for its existence.

The relationship is defined as one contractor can work for many weeks and in one week there are many contractors working. So there is a Many to Many relationship.

so is the Weekly Hours Tracker a weak entity that has a many to many relationship with its owner entity Contractors?

Is following the correct way to represent the above tables?

Bold attributes are keys)

Contractors Table

ConID Name HourlyRate Address

Weekly Hours Tracker

ConID Day Month Year HoursWorked

Auto Disable a SQL Server User

Posted: 07 May 2013 01:27 PM PDT

I have a SQL Authentication User: JOHNDOE

I would like this account to auto-expire or auto-disable after X days or at a certain date/time. Any suggestions or best practices to do this?

How to decode a query on a composite unary-encoded attribute?

Posted: 07 May 2013 01:00 PM PDT

A good early paper on the topic of bitmap indexes is "Bit Transposed Files" by Wong et al, published in 1985.

In all the query-decoding examples, it is left to the reader to understand how each decoded query is derived. One of the examples is too complex for me to figure out.

In section 5.3.3.b, the paper shows how the BTF query processor would decode the query to find all dogs receiving more than 30 dosage units.

In BTF, the query would look like this:

dosage[>30]  

We are told that

Attribute dosage is encoded as a Composite unary with 3 fields of 6 bits. Assume dosage 30 is encoded as 000111,000011,011111."

Thus the paper claims

the query can be translated to

dosage ((b14 & b7 & b4) | (b14 & b8) | b15)  

and says no more about it.

How does that work?

By my understanding, the decoded query dosage (b14 & b7 b4) should alone select the correct values, if we interpret "more than" as "more than or equal to".

My attempt at understanding the solution follows.

Understanding the encoded value

I quote literal values in decimal unless specified otherwise.

We are told that the encoding represents the value 30.

We should remember a unary field that encodes value n+1 sets all the bits that encode n plus the next rightmost bit. A 0 is encoded by setting no bits.

To help me understand the derivation, I created a table that maps each bit of the attribute encoded value (u for unary) to its field value (d for decimal) and to its attribute ordinal position (n for n-th).

The table looks like this:

n 17 16 15 14 13 12    11 10  9  8  7  6     5  4  3  2  1  0    d  6  5  4  3  2  1     6  5  4  3  2  1     6  5  4  3  2  1    u  0  0  0  1  1  1     0  0  0  0  1  1     0  1  1  1  1  1  

We can see from the table that the the values of the fields from left to right are (3, 2, and 5) respectively.

We know that 3 * 2 * 5 = 30, so we might assume that the product of the field values gives the attribute value.

If this is true, then:

  • the order of the fields should be insignificant.
  • 6 * 6 * 6 = 216 values could be encoded.
  • each value might have multiple encodings.

Section 4 (Bit Transposition) states that attribute dosage has 200 distinct values, so all attribute values are encodable.

Understanding the decoded query

The decoded query ORs together three expressions.

The first expression (b14 & b7 & b4) selects attributes whose:

  • first field encodes 3, 4, 5, or 6.
  • second field encodes 2, 3, 4, 5, or 6
  • third field encodes 5 or 6.

The expression selects dosage values greater than 30, but selects dosages of 30 as well. If the aim is to find values strictly greater than 30, then the expression would select values that don't match the BTF query.

The second expression (14 & b8) and the third expression (b15) don't select bits for some fields, so these fields could have any value.

If this is true, then the whole expression would select dogs who received a dose of 0 and many other values less than 30.

By my understanding, the decoded query would select many values that don't match the BTF query.

Do I need to use NVARCHAR rather than VARCHAR to properly store UTF8 characters in Oracle?

Posted: 07 May 2013 03:45 PM PDT

I want my Oracle database to properly store ALL possible UTF8 characters. If NLS_CHARSET is set to AL32UTF8 is that all I need to do? Or do I need to also make sure I use NCHAR and NVARCHAR rather than CHAR and VARCHAR to properly store UTf8 characters?

sleeping SPID blocking other transactions

Posted: 07 May 2013 01:39 PM PDT

I'm really having trouble tracking down some blocking we are experiencing.

The root blocking SPID's status is 'sleeping', the cmd is 'AWAITING COMMAND', and the sqltext is 'SET TRANSACTION ISOLATION LEVEL READ COMMITTED'.

When I view the Top Transactions by Blocked Transactions Count report, the Blocking SQL Statement is '--'.

I've performed a trace on the SQL and when the blocking happens tracing the root blocking SPID but it hasn't really led me anywhere. The last trace statement is the same as the sqltext above 'SET TRANSACTION ISOLATION LEVEL READ COMMITTED'.

I've checked all the related SPROCs I can find to make sure they have TRY/CATCH BEGIN TRAN/COMMIT TRAN/ROLLBACK TRAN statements (we use SPROCs for everything so there are no standalone statements being ran). This issue just started happening over the last 24 hours and no one is claiming to have made any changes to the system.

Primary replica set server goes secondary after secondary fails

Posted: 07 May 2013 11:03 AM PDT

I have a 2 servers replica set that, after the secondary fails the primary goes into secondary mode while the secondary is in STARTUP2 (recovering). The problem with this is that I can't use the collection stored in that replica set freely, I'm getting errors trying to use the collection:

pymongo.errors.OperationFailure: database error: ReplicaSetMonitor no master found for set: rs2  

Sometimes if I restart the mongod instances, the server rs2-1 is the primary for a while, but after some time (while the secondary is recovering) I see this in the logs of rs2-1 (the primary):

Tue May  7 17:43:40.677 [rsHealthPoll] replSet member XXX.XXX.XXX.XXX:27017 is now in state DOWN  Tue May  7 17:43:40.677 [rsMgr] can't see a majority of the set, relinquishing primary  Tue May  7 17:43:40.682 [rsMgr] replSet relinquishing primary state  Tue May  7 17:43:40.682 [rsMgr] replSet SECONDARY  Tue May  7 17:43:40.682 [rsMgr] replSet closing client sockets after relinquishing primary  

Is there an easy way to make the primary keep being primary after the secondary fails? Am I doing something wrong?

Thanks in advance!

Does Mongo have disappearing/phantom writes

Posted: 07 May 2013 09:38 AM PDT

I have heard that Mongo has something like phantom writes. For example, if I have a web request with the following db commands in a single unit of work:

a) update comments in article
b) update article attributes
c) update users comment_field

Questions:

  1. Is it possible that only a and c execute, and b fails or never gets to the database?
  2. Is it possible that only a and b execute, and c fails or never gets to the database?

Where can I read some more in regards to this, or is it just a myth?

Oracle 10XE: Stop schemas seeing the all_users table?

Posted: 07 May 2013 10:24 AM PDT

I've got an Oracle 10g XE Database that I want clients to be able to view remotely via SQL*PLUS or SQL Developer. Each schema has a name which includes the name of the client, so anyone looking at the all_users table would be able to see the names of all my other clients! Is there any way to restrict permissions on certain tables? And are there any other tables like this which would be a good idea to restrict access to? I'm not particularly concerned about our clients trying to hack things, I just don't want them to see a list of all our other clients!

Thanks!

Is it okay to use rsync on InnoDB database if the MySQL server is shutdown?

Posted: 07 May 2013 11:22 AM PDT

Is it okay to use rsync on InnoDB database if the MySQL server is shutdown ?

For example :

/etc/init.d/mysql stop  rsync -av /home/mysql/mydb/ root@newserver.com:/home/mysql  

Plugin 'FEDERATED' is disabled

Posted: 07 May 2013 12:09 PM PDT

Im trying to start Mysql using easyPHP : the response is an alert window to a log file. The main error is <-- Plugin 'FEDERATED' is disabled -->.

Through my research on internet i found that the solution is to add the federated option to "my.ini" file. I did this but it is still not working.

Here is an extract from the log file for more information :

 2013-05-03 14:12:57 3776 [Note] Plugin 'FEDERATED' is disabled.      2013-05-03 14:12:57 1b4c InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator.      2013-05-03 14:12:57 3776 [Note] InnoDB: The InnoDB memory heap is disabled      2013-05-03 14:12:57 3776 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions      2013-05-03 14:12:57 3776 [Note] InnoDB: Compressed tables use zlib 1.2.3      2013-05-03 14:12:57 3776 [Note] InnoDB: Not using CPU crc32 instructions      2013-05-03 14:12:57 3776 [Note] InnoDB: Initializing buffer pool, size = 16.0M      2013-05-03 14:12:57 3776 [Note] InnoDB: Completed initialization of buffer pool      2013-05-03 14:12:57 3776 [Note] InnoDB: The first specified data file .\ibdata1 did not exist: a new database to be created!      2013-05-03 14:12:57 3776 [Note] InnoDB: Setting file .\ibdata1 size to 12 MB      2013-05-03 14:12:57 3776 [Note] InnoDB: Database physically writes the file full: wait...      2013-05-03 14:12:57 3776 [Note] InnoDB: Setting log file .\ib_logfile101 size to 5 MB      2013-05-03 14:12:57 3776 [Note] InnoDB: Setting log file .\ib_logfile1 size to 5 MB      2013-05-03 14:12:57 3776 [Note] InnoDB: Renaming log file .\ib_logfile101 to .\ib_logfile0      2013-05-03 14:12:57 3776 [Warning] InnoDB: New log files created, LSN=45781      2013-05-03 14:12:57 3776 [Note] InnoDB: Doublewrite buffer not found: creating new      2013-05-03 14:12:57 3776 [Note] InnoDB: Doublewrite buffer created      2013-05-03 14:12:57 3776 [Note] InnoDB: 128 rollback segment(s) are active.      2013-05-03 14:12:57 3776 [Warning] InnoDB: Creating foreign key constraint system tables.      2013-05-03 14:12:57 3776 [Note] InnoDB: Foreign key constraint system tables created      2013-05-03 14:12:57 3776 [Note] InnoDB: Creating tablespace and datafile system tables.      2013-05-03 14:12:57 3776 [Note] InnoDB: Tablespace and datafile system tables created.      2013-05-03 14:12:57 3776 [Note] InnoDB: Waiting for purge to start      2013-05-03 14:12:57 3776 [Note] InnoDB: 5.6.11 started; log sequence number 0      2013-05-03 14:12:58 3776 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: cadcd135-b3ea-11e2-92bc-e0db55e1304d.      2013-05-03 14:12:58 3776 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306      2013-05-03 14:12:58 3776 [Note]   - '127.0.0.1' resolves to '127.0.0.1';      2013-05-03 14:12:58 3776 [Note] Server socket created on IP: '127.0.0.1'.      2013-05-03 14:12:58 3776 [Warning] InnoDB: Cannot open table mysql/slave_master_info from the internal data dictionary of InnoDB though the .frm file for the table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem.      2013-05-03 14:12:58 3776 [Warning] Info table is not ready to be used. Table 'mysql.slave_master_info' cannot be opened.      2013-05-03 14:12:58 3776 [Warning] InnoDB: Cannot open table mysql/slave_worker_info from the internal data dictionary of InnoDB though the .frm file for the table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem.      2013-05-03 14:12:58 3776 [Warning] InnoDB: Cannot open table mysql/slave_relay_log_info from the internal data dictionary of InnoDB though the .frm file for the table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem.      2013-05-03 14:12:58 3776 [Warning] Info table is not ready to be used. Table 'mysql.slave_relay_log_info' cannot be opened.      2013-05-03 14:12:58 3776 [Note] Event Scheduler: Loaded 0 events      2013-05-03 14:12:58 3776 [Note] C:\PROGRA~1\EASYPH~1.1VC\binaries\mysql\bin\mysqld.exe: ready for connections.      Version: '5.6.11-log'  socket: ''  port: 3306  MySQL Community Server (GPL)      2013-05-03 14:15:59 3776 [Note] C:\PROGRA~1\EASYPH~1.1VC\binaries\mysql\bin\mysqld.exe: Normal shutdown  

Is there a difference in performance between @date and getdate()?

Posted: 07 May 2013 10:17 AM PDT

Usually I use the getdate() function in my where clauses to go back in time. Something like:

 DOC.DATUM >= DATEADD(DD,-1*SSN_SDO.DANA_ZA_POVRAT,GETDATE())   

Will SQL Server 2008R2 perform faster queries if I first declare a date parameter and use that in my queries instead?

declare @dateNow date = getdate()  ...  where       DOC.DATUM >= DATEADD(DD,-1*SSN_SDO.DANA_ZA_POVRAT,@dateNow )   

Lock wait time out exceed restart transaction

Posted: 07 May 2013 10:57 AM PDT

I had got error on the lock wait time out so below I got 3 samples taken. One I took before the increase innodb_lock_wait_timeout to 120. So is there anything else I must tweak based on the logs below.

Before increasing

1280  MySQL thread id 183, query id 465855 192.168.100.11 vscs1  ---TRANSACTION 0 2491326, not started, process no 6622, OS thread id 140388595255040  MySQL thread id 185, query id 479140 192.168.100.11 vscs1  ---TRANSACTION 0 2491044, not started, process no 6622, OS thread id 140388594988800  MySQL thread id 186, query id 463354 192.168.100.11 vscs1  ---TRANSACTION 0 2491324, not started, process no 6622, OS thread id 140388599514880  MySQL thread id 147, query id 479132 192.168.100.11 vscs1  ---TRANSACTION 0 2491100, not started, process no 6622, OS thread id 140388724803328  MySQL thread id 133, query id 477373 192.168.100.11 vscs1  ---TRANSACTION 0 2491278, not started, process no 6622, OS thread id 140388596586240  MySQL thread id 168, query id 476621 192.168.100.11 vscs1  ---TRANSACTION 0 2490727, not started, process no 6622, OS thread id 140388596852480  MySQL thread id 167, query id 463538 192.168.100.11 vscs1  ---TRANSACTION 0 2491140, not started, process no 6622, OS thread id 140388597651200  MySQL thread id 163, query id 463529 192.168.100.11 vscs1  ---TRANSACTION 0 2491312, not started, process no 6622, OS thread id 140388598183680  MySQL thread id 157, query id 479053 192.168.100.11 vscs1  ---TRANSACTION 0 2491294, not started, process no 6622, OS thread id 140388599781120  MySQL thread id 146, query id 478179 192.168.100.11 vscs1  ---TRANSACTION 0 2491225, not started, process no 6622, OS thread id 140388600579840  MySQL thread id 143, query id 465144 192.168.100.11 vscs1  ---TRANSACTION 0 2491305, not started, process no 6622, OS thread id 140388601112320  MySQL thread id 141, query id 478993 192.168.100.11 vscs1  ---TRANSACTION 0 2491290, not started, process no 6622, OS thread id 140388601378560  MySQL thread id 139, query id 477383 192.168.100.11 vscs1  ---TRANSACTION 0 2490874, not started, process no 6622, OS thread id 140388724270848  MySQL thread id 135, query id 463385 192.168.100.11 vscs1  ---TRANSACTION 0 2491277, not started, process no 6622, OS thread id 140388601911040  MySQL thread id 137, query id 479062 192.168.100.11 vscs1  ---TRANSACTION 0 2491135, not started, process no 6622, OS thread id 140388725069568  MySQL thread id 131, query id 463384 192.168.100.11 vscs1  ---TRANSACTION 0 2491310, ACTIVE 29 sec, process no 6622, OS thread id 140388597384960 starting index read  mysql tables in use 1, locked 1  LOCK WAIT 2 lock struct(s), heap size 368, 1 row lock(s)  MySQL thread id 165, query id 479034 192.168.100.11 vscs1 Updating  Update tblID Set lastValue=4372  Where tableName='tblUnAst'  Trx read view will not see trx with id >= 0 2491311, sees < 0 2490366  ------- TRX HAS BEEN WAITING 29 SEC FOR THIS LOCK TO BE GRANTED:  RECORD LOCKS space id 19 page no 3 n bits 72 index `GEN_CLUST_INDEX` of table `scs`.`tblID` trx id 0 2491310 lock_mode X waiting  Record lock, heap no 2  ------------------  ---TRANSACTION 0 2491307, ACTIVE 38 sec, process no 6622, OS thread id 140388597917440 starting index read  mysql tables in use 1, locked 1  LOCK WAIT 2 lock struct(s), heap size 368, 1 row lock(s)  MySQL thread id 162, query id 479004 192.168.100.11 vscs1 Updating  Update tblID Set lastValue=4372  Where tableName='tblUnAst'  Trx read view will not see trx with id >= 0 2491308, sees < 0 2490366  ------- TRX HAS BEEN WAITING 38 SEC FOR THIS LOCK TO BE GRANTED:  RECORD LOCKS space id 19 page no 3 n bits 72 index `GEN_CLUST_INDEX` of table `scs`.`tblID` trx id 0 2491307 lock_mode X waiting  Record lock, heap no 2  ------------------  ---TRANSACTION 0 2491299, ACTIVE 46 sec, process no 6622, OS thread id 140388388042496 starting index read  mysql tables in use 1, locked 1  LOCK WAIT 2 lock struct(s), heap size 368, 1 row lock(s)  MySQL thread id 132, query id 478208 192.168.100.11 vscs1 Updating  Update tblID Set lastValue=4372  Where tableName='tblUnAst'  Trx read view will not see trx with id >= 0 2491300, sees < 0 2490366  ------- TRX HAS BEEN WAITING 46 SEC FOR THIS LOCK TO BE GRANTED:  RECORD LOCKS space id 19 page no 3 n bits 72 index `GEN_CLUST_INDEX` of table `scs`.`tblID` trx id 0 2491299 lock_mode X waiting  Record lock, heap no 2  ------------------  ---TRANSACTION 0 2491281, ACTIVE 64 sec, process no 6622, OS thread id 140388724004608  1 lock struct(s), heap size 368, 0 row lock(s), undo log entries 1  MySQL thread id 136, query id 477325 192.168.100.11 vscs1  Trx read view will not see trx with id >= 0 2491282, sees < 0 2490366  ---TRANSACTION 0 2491256, ACTIVE 108 sec, process no 6622, OS thread id 140388598449920  1 lock struct(s), heap size 368, 0 row lock(s), undo log entries 1  MySQL thread id 158, query id 467973 192.168.100.11 vscs1  Trx read view will not see trx with id >= 0 2491257, sees < 0 2490366  ---TRANSACTION 0 2491199, ACTIVE 153 sec, process no 6622, OS thread id 140388600846080  1 lock struct(s), heap size 368, 0 row lock(s), undo log entries 1  MySQL thread id 142, query id 464318 192.168.100.11 vscs1  Trx read view will not see trx with id >= 0 2491200, sees < 0 2490366  ---TRANSACTION 0 2491086, ACTIVE 265 sec, process no 6622, OS thread id 140388724537088  2 lock struct(s), heap size 368, 0 row lock(s), undo log entries 2  MySQL thread id 134, query id 453252 192.168.100.11 vscs1  Trx read view will not see trx with id >= 0 2491087, sees < 0 2490366  ---TRANSACTION 0 2490842, ACTIVE 587 sec, process no 6622, OS thread id 140388600313600  2 lock struct(s), heap size 368, 0 row lock(s), undo log entries 2  MySQL thread id 144, query id 404624 192.168.100.11 vscs1  Trx read view will not see trx with id >= 0 2490843, sees < 0 2490366  ---TRANSACTION 0 2490708, ACTIVE 716 sec, process no 6622, OS thread id 140388593923840  5 lock struct(s), heap size 1216, 1 row lock(s), undo log entries 5  MySQL thread id 199, query id 370321 192.168.100.11 vscs1  Trx read view will not see trx with id >= 0 2490709, sees < 0 2490366  ---TRANSACTION 0 2490648, ACTIVE 744 sec, process no 6622, OS thread id 140388601644800  2 lock struct(s), heap size 368, 0 row lock(s), undo log entries 2  MySQL thread id 138, query id 369508 192.168.100.11 vscs1  Trx read view will not see trx with id >= 0 2490649, sees < 0 2490366  ---TRANSACTION 0 2490642, ACTIVE 750 sec, process no 6622, OS thread id 140388594190080  1 lock struct(s), heap size 368, 0 row lock(s), undo log entries 1  MySQL thread id 192, query id 367922 192.168.100.11 vscs1  Trx read view will not see trx with id >= 0 2490643, sees < 0 2490366  ---TRANSACTION 0 2490555, ACTIVE 840 sec, process no 6622, OS thread id 140388595787520  4 lock struct(s), heap size 1216, 1 row lock(s), undo log entries 4  MySQL thread id 182, query id 349533 192.168.100.11 vscs1  Trx read view will not see trx with id >= 0 2490556, sees < 0 2490366  ---TRANSACTION 0 2490533, ACTIVE 852 sec, process no 6622, OS thread id 140388596053760  1 lock struct(s), heap size 368, 0 row lock(s), undo log entries 1  MySQL thread id 177, query id 345850 192.168.100.11 vscs1  Trx read view will not see trx with id >= 0 2490534, sees < 0 2490366  ---TRANSACTION 0 2490381, ACTIVE 987 sec, process no 6622, OS thread id 140388600047360  2 lock struct(s), heap size 368, 0 row lock(s), undo log entries 2  MySQL thread id 145, query id 84142 192.168.100.11 vscs1  Trx read view will not see trx with id >= 0 2490382, sees < 0 2490366  ---TRANSACTION 0 2490376, ACTIVE 993 sec, process no 6622, OS thread id 140388598716160  1 lock struct(s), heap size 368, 0 row lock(s), undo log entries 1  MySQL thread id 150, query id 67292 192.168.100.11 vscs1  Trx read view will not see trx with id >= 0 2490377, sees < 0 2490366  ---TRANSACTION 0 2490371, ACTIVE 995 sec, process no 6622, OS thread id 140388598982400  7 lock struct(s), heap size 1216, 7 row lock(s), undo log entries 5  MySQL thread id 149, query id 58852 192.168.100.11 vscs1  Trx read view will not see trx with id >= 0 2490372, sees < 0 2490366  ---TRANSACTION 0 2490366, ACTIVE 998 sec, process no 6622, OS thread id 140388599248640  1 lock struct(s), heap size 368, 0 row lock(s), undo log entries 1  MySQL thread id 148, query id 50401 192.168.100.11 vscs1  Trx read view will not see trx with id >= 0 2490367, sees < 0 2490367  --------  FILE I/O  --------  I/O thread 0 state: waiting for i/o request (insert buffer thread)  I/O thread 1 state: waiting for i/o request (log thread)  I/O thread 2 state: waiting for i/o request (read thread)  I/O thread 3 state: waiting for i/o request (write thread)  Pending normal aio reads: 0, aio writes: 0,   ibuf aio reads: 0, log i/o's: 0, sync i/o's: 0  Pending flushes (fsync) log: 0; buffer pool: 0  23934 OS file reads, 2622 OS file writes, 1521 OS fsyncs  4.00 reads/s, 19894 avg bytes/read, 1.14 writes/s, 1.14 fsyncs/s  -------------------------------------  INSERT BUFFER AND ADAPTIVE HASH INDEX  -------------------------------------  Ibuf: size 1, free list len 0, seg size 2,  641 inserts, 641 merged recs, 513 merges  Hash table size 17393, node heap has 7 buffer(s)  110.27 hash searches/s, 64.42 non-hash searches/s  ---  LOG  ---  Log sequence number 0 1454407131  Log flushed up to   0 1454407131  Last checkpoint at  0 1454403687  0 pending log writes, 0 pending chkp writes  856 log i/o's done, 1.14 log i/o's/second  ----------------------  BUFFER POOL AND MEMORY  ----------------------  Total memory allocated 21296456; in additional pool allocated 1048576  Dictionary memory allocated 390168  Buffer pool size   512  Free buffers       0  Database pages     505  Modified db pages  15  Pending reads 0  Pending writes: LRU 0, flush list 0, single page 0  Pages read 128135, created 12, written 1874  4.86 reads/s, 0.00 creates/s, 0.00 writes/s  Buffer pool hit rate 992 / 1000  --------------  ROW OPERATIONS  --------------  0 queries inside InnoDB, 0 queries in queue  18 read views open inside InnoDB  Main thread process no. 6622, id 140388612400896, state: sleeping  Number of rows inserted 332, updated 353, deleted 0, read 10910686  0.29 inserts/s, 0.43 updates/s, 0.00 deletes/s, 473.93 reads/s  ----------------------------  END OF INNODB MONITOR OUTPUT  ============================    1 row in set (0.00 sec)    ERROR:  No query specified  

1st sample after increase

show engine innodb status\G  *************************** 1. row ***************************    Type: InnoDB    Name:  Status:  =====================================  130507  5:13:33 INNODB MONITOR OUTPUT  =====================================  Per second averages calculated from the last 51 seconds  ----------  SEMAPHORES  ----------  OS WAIT ARRAY INFO: reservation count 20519, signal count 20505  Mutex spin waits 0, rounds 4183, OS waits 15  RW-shared spins 45944, OS waits 20490; RW-excl spins 19, OS waits 12  ------------  TRANSACTIONS  ------------  Trx id counter 0 2493509  Purge done for trx's n:o < 0 2493504 undo n:o < 0 0  History list length 37  LIST OF TRANSACTIONS FOR EACH SESSION:  ---TRANSACTION 0 2493455, not started, process no 7268, OS thread id 140471080023808  MySQL thread id 90, query id 114373 192.168.100.11 websvs1  ---TRANSACTION 0 2493402, not started, process no 7268, OS thread id 140471202846464  MySQL thread id 25, query id 105647 192.168.100.11 vscs1  ---TRANSACTION 0 2493389, not started, process no 7268, OS thread id 140471203112704  MySQL thread id 24, query id 105583 192.168.100.11 vscs1  ---TRANSACTION 0 2493100, not started, process no 7268, OS thread id 140471203645184  MySQL thread id 22, query id 92664 192.168.100.11 vscs1  ---TRANSACTION 0 2493277, not started, process no 7268, OS thread id 140471210927872  MySQL thread id 8, query id 103502 192.168.100.11 vscs1  ---TRANSACTION 0 2492963, not started, process no 7268, OS thread id 140471080556288  MySQL thread id 38, query id 91212 192.168.100.11 vscs1  ---TRANSACTION 0 0, not started, process no 7268, OS thread id 140471080290048  MySQL thread id 43, query id 114612 localhost root  show engine innodb status  ---TRANSACTION 0 2493507, not started, process no 7268, OS thread id 140471200716544  MySQL thread id 34, query id 114611 192.168.100.11 vscs1  ---TRANSACTION 0 2493506, not started, process no 7268, OS thread id 140471200982784  MySQL thread id 33, query id 114601 192.168.100.11 vscs1  ---TRANSACTION 0 2492547, not started, process no 7268, OS thread id 140471201781504  MySQL thread id 30, query id 76507 192.168.100.11 vscs1  ---TRANSACTION 0 2493058, not started, process no 7268, OS thread id 140471202047744  MySQL thread id 29, query id 91747 192.168.100.11 vscs1  ---TRANSACTION 0 2493421, not started, process no 7268, OS thread id 140471211992832  MySQL thread id 4, query id 114177 192.168.100.11 vscs1  ---TRANSACTION 0 2493484, not started, process no 7268, OS thread id 140471202313984  MySQL thread id 27, query id 114564 192.168.100.11 vscs1  ---TRANSACTION 0 2493411, not started, process no 7268, OS thread id 140471202580224  MySQL thread id 26, query id 105708 192.168.100.11 vscs1  ---TRANSACTION 0 2493292, not started, process no 7268, OS thread id 140471203378944  MySQL thread id 23, query id 105067 192.168.100.11 vscs1  ---TRANSACTION 0 2493166, not started, process no 7268, OS thread id 140471203911424  MySQL thread id 21, query id 101445 192.168.100.11 vscs1  ---TRANSACTION 0 2492826, not started, process no 7268, OS thread id 140471204177664  MySQL thread id 20, query id 90551 192.168.100.11 vscs1  ---TRANSACTION 0 2492515, not started, process no 7268, OS thread id 140471204443904  MySQL thread id 19, query id 76331 192.168.100.11 vscs1  ---TRANSACTION 0 2492452, not started, process no 7268, OS thread id 140470193747712  MySQL thread id 18, query id 71237 192.168.100.11 vscs1  ---TRANSACTION 0 2492272, not started, process no 7268, OS thread id 140471204710144  MySQL thread id 15, query id 91426 192.168.100.11 vscs1  ---TRANSACTION 0 2492269, not started, process no 7268, OS thread id 140471204976384  MySQL thread id 14, query id 92982 192.168.100.11 vscs1  ---TRANSACTION 0 2492304, not started, process no 7268, OS thread id 140471205508864  MySQL thread id 12, query id 105224 192.168.100.11 vscs1  ---TRANSACTION 0 2492687, not started, process no 7268, OS thread id 140471210129152  MySQL thread id 11, query id 81763 192.168.100.11 vscs1  ---TRANSACTION 0 2492665, not started, process no 7268, OS thread id 140471210395392  MySQL thread id 10, query id 80152 192.168.100.11 vscs1  ---TRANSACTION 0 2492476, not started, process no 7268, OS thread id 140471210661632  MySQL thread id 9, query id 73007 192.168.100.11 vscs1  ---TRANSACTION 0 2493048, not started, process no 7268, OS thread id 140471211194112  MySQL thread id 7, query id 91693 192.168.100.11 vscs1  ---TRANSACTION 0 2492481, not started, process no 7268, OS thread id 140471211460352  MySQL thread id 6, query id 73035 192.168.100.11 vscs1  ---TRANSACTION 0 2492600, not started, process no 7268, OS thread id 140471211726592  MySQL thread id 5, query id 77571 192.168.100.11 vscs1  --------  FILE I/O  --------  I/O thread 0 state: waiting for i/o request (insert buffer thread)  I/O thread 1 state: waiting for i/o request (log thread)  I/O thread 2 state: waiting for i/o request (read thread)  I/O thread 3 state: waiting for i/o request (write thread)  Pending normal aio reads: 0, aio writes: 0,   ibuf aio reads: 0, log i/o's: 0, sync i/o's: 0  Pending flushes (fsync) log: 0; buffer pool: 0  11811 OS file reads, 2692 OS file writes, 1778 OS fsyncs  4.80 reads/s, 117496 avg bytes/read, 3.47 writes/s, 2.14 fsyncs/s  -------------------------------------  INSERT BUFFER AND ADAPTIVE HASH INDEX  -------------------------------------  Ibuf: size 1, free list len 0, seg size 2,  713 inserts, 713 merged recs, 288 merges  Hash table size 17393, node heap has 4 buffer(s)  140.62 hash searches/s, 73.39 non-hash searches/s  ---  LOG  ---  Log sequence number 0 1455084521  Log flushed up to   0 1455084521  Last checkpoint at  0 1455083429  0 pending log writes, 0 pending chkp writes  1301 log i/o's done, 1.57 log i/o's/second  ----------------------  BUFFER POOL AND MEMORY  ----------------------  Total memory allocated 21501264; in additional pool allocated 1048576  Dictionary memory allocated 390168  Buffer pool size   512  Free buffers       0  Database pages     508  Modified db pages  4  Pending reads 0  Pending writes: LRU 0, flush list 0, single page 0  Pages read 55114, created 19, written 1524  34.45 reads/s, 0.00 creates/s, 1.90 writes/s  Buffer pool hit rate 976 / 1000  --------------  ROW OPERATIONS  --------------  0 queries inside InnoDB, 0 queries in queue  1 read views open inside InnoDB  Main thread process no. 7268, id 140471091312384, state: sleeping  Number of rows inserted 350, updated 616, deleted 0, read 4394330  0.22 inserts/s, 0.69 updates/s, 0.00 deletes/s, 6064.16 reads/s  ----------------------------  END OF INNODB MONITOR OUTPUT  ============================  

2nd sample after increase

mysql> show engine innodb status\G  *************************** 1. row ***************************    Type: InnoDB    Name:  Status:  =====================================  130507 12:26:51 INNODB MONITOR OUTPUT  =====================================  Per second averages calculated from the last 11 seconds  ----------  SEMAPHORES  ----------  OS WAIT ARRAY INFO: reservation count 474709, signal count 474267  Mutex spin waits 0, rounds 83167, OS waits 190  RW-shared spins 1055681, OS waits 474391; RW-excl spins 171, OS waits 84  ------------  TRANSACTIONS  ------------  Trx id counter 0 2507435  Purge done for trx's n:o < 0 2507433 undo n:o < 0 0  History list length 24  LIST OF TRANSACTIONS FOR EACH SESSION:  ---TRANSACTION 0 0, not started, process no 7268, OS thread id 140471205242624  MySQL thread id 2342, query id 2258106 localhost root  show engine innodb status  ---TRANSACTION 0 2507431, not started, process no 7268, OS thread id 140471201515264  MySQL thread id 31, query id 2249681 192.168.100.11 vscs1  ---TRANSACTION 0 2507286, not started, process no 7268, OS thread id 140471080822528  MySQL thread id 37, query id 2237933 192.168.100.11 vscs1  ---TRANSACTION 0 2506767, not started, process no 7268, OS thread id 140471201249024  MySQL thread id 32, query id 2068631 192.168.100.11 vscs1  ---TRANSACTION 0 2507181, not started, process no 7268, OS thread id 140471202846464  MySQL thread id 25, query id 2217691 192.168.100.11 vscs1  ---TRANSACTION 0 2507426, not started, process no 7268, OS thread id 140471203112704  MySQL thread id 24, query id 2249653 192.168.100.11 vscs1  ---TRANSACTION 0 2507057, not started, process no 7268, OS thread id 140471203645184  MySQL thread id 22, query id 2241042 192.168.100.11 vscs1  ---TRANSACTION 0 2507239, not started, process no 7268, OS thread id 140471210927872  MySQL thread id 8, query id 2248183 192.168.100.11 vscs1  ---TRANSACTION 0 2507073, not started, process no 7268, OS thread id 140471080556288  MySQL thread id 38, query id 2195237 192.168.100.11 vscs1  ---TRANSACTION 0 2506947, not started, process no 7268, OS thread id 140471200716544  MySQL thread id 34, query id 2110790 192.168.100.11 vscs1  ---TRANSACTION 0 2507401, not started, process no 7268, OS thread id 140471200982784  MySQL thread id 33, query id 2247238 192.168.100.11 vscs1  ---TRANSACTION 0 2507364, not started, process no 7268, OS thread id 140471201781504  MySQL thread id 30, query id 2244145 192.168.100.11 vscs1  ---TRANSACTION 0 2507147, not started, process no 7268, OS thread id 140471202047744  MySQL thread id 29, query id 2237934 192.168.100.11 vscs1  ---TRANSACTION 0 2506850, not started, process no 7268, OS thread id 140471211992832  MySQL thread id 4, query id 2081660 192.168.100.11 vscs1  ---TRANSACTION 0 2507429, not started, process no 7268, OS thread id 140471202313984  MySQL thread id 27, query id 2249669 192.168.100.11 vscs1  ---TRANSACTION 0 2507433, not started, process no 7268, OS thread id 140471202580224  MySQL thread id 26, query id 2258105 192.168.100.11 vscs1  ---TRANSACTION 0 2507376, not started, process no 7268, OS thread id 140471203378944  MySQL thread id 23, query id 2244897 192.168.100.11 vscs1  ---TRANSACTION 0 2507264, not started, process no 7268, OS thread id 140471203911424  MySQL thread id 21, query id 2228700 192.168.100.11 vscs1  ---TRANSACTION 0 2507407, not started, process no 7268, OS thread id 140471204177664  MySQL thread id 20, query id 2247950 192.168.100.11 vscs1  ---TRANSACTION 0 2507418, not started, process no 7268, OS thread id 140471204443904  MySQL thread id 19, query id 2249083 192.168.100.11 vscs1  ---TRANSACTION 0 2506774, not started, process no 7268, OS thread id 140470193747712  MySQL thread id 18, query id 2228732 192.168.100.11 vscs1  ---TRANSACTION 0 2507290, not started, process no 7268, OS thread id 140471204710144  MySQL thread id 15, query id 2237960 192.168.100.11 vscs1  ---TRANSACTION 0 2507224, not started, process no 7268, OS thread id 140471204976384  MySQL thread id 14, query id 2244173 192.168.100.11 vscs1  ---TRANSACTION 0 2506999, not started, process no 7268, OS thread id 140471205508864  MySQL thread id 12, query id 2131568 192.168.100.11 vscs1  ---TRANSACTION 0 2507275, not started, process no 7268, OS thread id 140471210129152  MySQL thread id 11, query id 2237180 192.168.100.11 vscs1  ---TRANSACTION 0 2507414, not started, process no 7268, OS thread id 140471210395392  MySQL thread id 10, query id 2248290 192.168.100.11 vscs1  ---TRANSACTION 0 2506827, not started, process no 7268, OS thread id 140471210661632  MySQL thread id 9, query id 2071734 192.168.100.11 vscs1  ---TRANSACTION 0 2507368, not started, process no 7268, OS thread id 140471211194112  MySQL thread id 7, query id 2244168 192.168.100.11 vscs1  ---TRANSACTION 0 2507279, not started, process no 7268, OS thread id 140471211460352  MySQL thread id 6, query id 2249682 192.168.100.11 vscs1  ---TRANSACTION 0 2507300, not started, process no 7268, OS thread id 140471211726592  MySQL thread id 5, query id 2241023 192.168.100.11 vscs1  --------  FILE I/O  --------  I/O thread 0 state: waiting for i/o request (insert buffer thread)  I/O thread 1 state: waiting for i/o request (log thread)  I/O thread 2 state: waiting for i/o request (read thread)  I/O thread 3 state: waiting for i/o request (write thread)  Pending normal aio reads: 0, aio writes: 0,   ibuf aio reads: 0, log i/o's: 0, sync i/o's: 0  Pending flushes (fsync) log: 0; buffer pool: 0  251091 OS file reads, 45023 OS file writes, 25818 OS fsyncs  3.64 reads/s, 16384 avg bytes/read, 0.36 writes/s, 0.36 fsyncs/s  -------------------------------------  INSERT BUFFER AND ADAPTIVE HASH INDEX  -------------------------------------  Ibuf: size 1, free list len 0, seg size 2,  9852 inserts, 9852 merged recs, 8373 merges  Hash table size 17393, node heap has 4 buffer(s)  5.36 hash searches/s, 23.27 non-hash searches/s  ---  LOG  ---  Log sequence number 0 1460632209  Log flushed up to   0 1460632209  Last checkpoint at  0 1460630034  0 pending log writes, 0 pending chkp writes  15288 log i/o's done, 0.36 log i/o's/second  ----------------------  BUFFER POOL AND MEMORY  ----------------------  Total memory allocated 21342016; in additional pool allocated 1045248  Dictionary memory allocated 390168  Buffer pool size   512  Free buffers       0  Database pages     508  Modified db pages  22  Pending reads 0  Pending writes: LRU 0, flush list 0, single page 0  Pages read 1554136, created 189, written 31373  3.64 reads/s, 0.00 creates/s, 0.00 writes/s  Buffer pool hit rate 977 / 1000  --------------  ROW OPERATIONS  --------------  0 queries inside InnoDB, 0 queries in queue  1 read views open inside InnoDB  Main thread process no. 7268, id 140471091312384, state: sleeping  Number of rows inserted 4574, updated 5967, deleted 0, read 154891781  0.18 inserts/s, 0.18 updates/s, 0.00 deletes/s, 250.16 reads/s  ----------------------------  END OF INNODB MONITOR OUTPUT  ============================    1 row in set (0.00 sec)  

select version();

+------------+  | version()  |  +------------+  | 5.1.69-log |  +------------+  1 row in set (0.00 sec)  

show global variables like 'innodb%';

+-----------------------------------------+------------------------+  | Variable_name                           | Value                  |  +-----------------------------------------+------------------------+  | innodb_adaptive_hash_index              | ON                     |  | innodb_additional_mem_pool_size         | 1048576                |  | innodb_autoextend_increment             | 8                      |  | innodb_autoinc_lock_mode                | 1                      |  | innodb_buffer_pool_size                 | 8388608                |  | innodb_checksums                        | ON                     |  | innodb_commit_concurrency               | 0                      |  | innodb_concurrency_tickets              | 500                    |  | innodb_data_file_path                   | ibdata1:10M:autoextend |  | innodb_data_home_dir                    |                        |  | innodb_doublewrite                      | ON                     |  | innodb_fast_shutdown                    | 1                      |  | innodb_file_io_threads                  | 4                      |  | innodb_file_per_table                   | ON                     |  | innodb_flush_log_at_trx_commit          | 1                      |  | innodb_flush_method                     |                        |  | innodb_force_recovery                   | 0                      |  | innodb_lock_wait_timeout                | 120                    |  | innodb_locks_unsafe_for_binlog          | OFF                    |  | innodb_log_buffer_size                  | 1048576                |  | innodb_log_file_size                    | 5242880                |  | innodb_log_files_in_group               | 2                      |  | innodb_log_group_home_dir               | ./                     |  | innodb_max_dirty_pages_pct              | 90                     |  | innodb_max_purge_lag                    | 0                      |  | innodb_mirrored_log_groups              | 1                      |  | innodb_open_files                       | 300                    |  | innodb_rollback_on_timeout              | OFF                    |  | innodb_stats_method                     | nulls_equal            |  | innodb_stats_on_metadata                | ON                     |  | innodb_support_xa                       | ON                     |  | innodb_sync_spin_loops                  | 20                     |  | innodb_table_locks                      | ON                     |  | innodb_thread_concurrency               | 8                      |  | innodb_thread_sleep_delay               | 10000                  |  | innodb_use_legacy_cardinality_algorithm | ON                     |  +-----------------------------------------+------------------------+  36 rows in set (0.00 sec)  

Can I recover CDC tables from transaction logs?

Posted: 07 May 2013 06:02 PM PDT

Is there anyway to restore CDC tables from transaction logs? My basic understanding is that CDC reads these logs, and entries that are specially marked, are grabbed by CDC. Once this has happened though, this data is no longer flagged for harvesting by CDC.

I need this to happen because a DB was restored without any KEEP_CDC options.

MS SMS, 2008 R2, sql server 10.5.16

How to design this database to avoid cyclic dependency?

Posted: 07 May 2013 12:46 PM PDT

There are two tables:

  1. User
  2. Address

User contains a reference to Address.

Address contains the columns CreatedBy and ModifiedBy, which is reference to User.

How do I design this database to avoid a cyclic dependency?

Selective Xml Indexing

Posted: 07 May 2013 10:00 AM PDT

I have recently been researching Selective Xml Indexing and have been trying to figure out how to index a .query method

If I have the below query

WITH XMLNAMESPACES (Default 'http://www.w3.org/2001/XMLSchema' )  SELECT         ,a.value('@Number' , 'INT') As Number      ,c.query('.') as FormattedXml        From        dbo.XmlTable As X        Cross Apply x.XmlColumn.nodes('Root') aa(a)       Cross Apply a.nodes('Block') bb(b)  

I can write a selective Index as below if I am following it right:

CREATE SELECTIVE XML INDEX xsi_XmlTable  ON dbo.XmlTable( XmlColumn )  WITH XMLNAMESPACES ( Default 'http://www.w3.org/2001/XMLSchema' )  FOR  (        root = '/Root' AS XQUERY 'node()'      , rootNumber = '/Root/@Number' AS SQL INT SINGLETON    )  GO  

Can I include the c.query in the index? Thanks

Normalizing a database without access to source data?

Posted: 07 May 2013 09:31 AM PDT

I've started a new role which deals with large amount of related data. Our source of all this data is various Excel dumps pulled from databases we do not have access to. The previous person filling this role used a dozen or so Excel files to gather these data files, manipulate them, and create reports.

I have started moving the dumps to an Access database. I have noticed a lot of the Excel data is related and should probably be normalized. What I have currently been doing is creating a table for every data dump, and importing them to Access, and using a number of queries to replicate the dozens of data manipulations and reporting.

Are there still benefits to normalizing data where my only source are Excel dumps out of a warehouse?

How would I normalize data, when I do not have the ability to change the format of how the dumps are sent to me?

Additionally, my plan (budget-depending) is to move from Access to a MS SQL Database.

While restoring copy of SQL Server 2008 backup file in SQL Server 2008 R2 degraded performance

Posted: 07 May 2013 04:05 PM PDT

I am trying to upgrade our SQL Server version from SQL Server 2008 to SQL Server 2008 R2. But when I restored a SQL Server 2008 backup file in SQL Server 2008 R2, it's significantly degraded the performance of stored procedures. I took a full back up from old SQL Server 2008 and restored it in new SQL Server 2008 R2. I checked the execution plan of several stored procedures to make sure no indexes are missing, but everything is same.

Can anyone please give me an advice about it if I need to do any further steps to get better performance on it?

Thanks, Dony

Adding User access to DB2

Posted: 07 May 2013 10:59 AM PDT

I have installed DB2 10.1 in a Red hat box. During the installation I was asked to create several users (db2inst1, db2fenc1 etc). I have been using db2inst1 to perform all operations with DB2 and it works perfectly fine. The sqllib files are located in

/home/db2inst1/sqllib

The installation files are located in

/opt/ibm/db2/V10.1/

All users have access to both these folders. I now want to perform the DB2 operations with another user, namely "john". Given that db2 uses the underlying user/password of the host machine, I added the groups dasadm1 and ds2iadm1 to the "john" user (which are the ones listed in db2inst1).

uid=500(john) gid=500(john) groups=500(john),101(dasadm1),102(db2iadm1)

I can properly enter the db2 cmd with the user "john"

[john@rhel6 java]$ /home/db2inst1/sqllib/bin/db2

but when I run my java app as user "john" I get the following error:

SQLException: com.ibm.db2.jcc.am.SqlException: [jcc][10389][12245][4.13.127] Failure in loading native library db2jcct2, java.lang.UnsatisfiedLinkError: db2jcct2 (Not found in java.library.path): ERRORCODE=-4472, SQLSTATE=null

this error does not appear if I run the same java app as user db2inst1. The library paths are the exactly the same for both users. Any idea what is going wrong?

Deriving formulas for input/output

Posted: 07 May 2013 08:05 PM PDT

I'm currently enrolled in a DBS class and am having problem with an assignment. I've searched around and have been unable to understand what it is I'm meant to be doing with this derivation formula.

A plant file with TREE-GENUS as the key field includes records with the following TREE-GENUS values: Tsuga, Ficus , Arbutus, Quercus, Melaleuca, Tristaniopsis, Cornus, Sequoiadendron, Lithocarpus, Liriodendron, Pittosporum.
Suppose that records with these search field values are inserted into a random (heap) file with a maximum of 3 records per block. Derive a formula for the expected number of disk I/O to scan these records and to search for a particular record

I've been using some software that was given with the assignment and it also asks what are the maximum number of blocks that are allowed and that is not given by the above brief. I'm not really sure how to derive a formula for this. I've assumed that because there are 3 records per block there are 4 blocks required and that a random heap file uses 1 disk i/o per write/read.

If this is a larger topic than is worth explaining a link to a reliable few pages is also helpful.

How to change data structure in mysql using mysqldump without deleting files

Posted: 07 May 2013 02:15 PM PDT

Essentially what I'm trying to do is sync a production server with a sandbox server, but only the table structures and stored procedures. The procedures aren't any problem since they can be overriden, but the problem is the tables. I want to sync and alter their structures on the production server using mysqldump (or any other way that you can propose) without altering any existing data.

If it helps, I only want to add more columns, not remove any existing ones. Also, I am using mysqlyog.

Is there any way to do this?

Data Change Audit Plan

Posted: 07 May 2013 12:24 PM PDT

My company is changing from a distributed Access Database model to using a centralized SQL Database. The datatables were designed such that all of the tables have a modified date. In discussion it was suggested that since we will be creating a trigger on each table to handle the modified date perhaps we should have the trigger also log some information to an audit table.

Is this the best way to setup auditing so that we can track who is changing information or is there a better way? Links to articles on the subject are welcome.

For the audit I'm looking at capturing the table name, column name, date modified, row id and the username of the person making the change. Is there any information I'm not thinking of that I should be capturing that might help me avoid future pit falls?

Oracle: Quick way to list all database links

Posted: 07 May 2013 03:29 PM PDT

The title says it all, is there a way to quickly list all the current database links in oracle?

Something along the same lines as this, which lists the current user's tables:

select * from user_tables;

Thanks, GC.

Is it possible to use SQLite as a client-server database?

Posted: 07 May 2013 10:48 AM PDT

Are there any techniques or tools to work with SQLite on a medium size/traffic/concurrency DB environment?

No comments:

Post a Comment

Search This Blog