Wednesday, July 20, 2016

DDL from a query (Oracle)

All the good db clients like SQL developer, TOAD and so on are good at showing you the DDLs for the tables your are working on, but sometimes these tools are not available at the current environament you have. i.e ATG JDBC Browser:

So you can get the DDL with a Query for any DB object, here is how to do it:

And this is how it looks like the output on JDBC browser which is where I needed to use it:


I found this here

Friday, July 8, 2016

Oracle Query / Kill Sessions


DBAs have great power over the Database, this gist will give us a taste of that.

And This is becuase with the above sql queries you will be able to find out how many sessions are running against your DB, who is using it, to which schema ar connected and more..

And even better if you need to kill a session for some maintaincance is as easy as just Kill  the sessions that won't let you do it.

Note: Be kind to ask whom ever is connected to disconnect before killing sessions.

Source: 
https://docs.oracle.com/cd/B19306_01/server.102/b14237/dynviews_2088.htm#REFRN30223
http://stackoverflow.com/questions/55342/how-can-i-kill-all-sessions-connecting-to-my-oracle-database

Wednesday, July 6, 2016

milliseconds on entry key=atg.repository.search.indexing.ConfigStatePersister.ClaimedLock

While I was doing startup on my localenvironment I found an exception this exception:

milliseconds on entry key=atg.repository.search.indexing.ConfigStatePersister.ClaimedLocknull

I did not find a solution on the internet, but lucky for me oracle have a solution for this on the Oracle Knowlage base.

The root cause seems to be an unexpected stop or kill of the current application leaving the locks alive in Server Lock Manager, since this was on my local environment the solution was easy for me.

just do: 

useLockServer=false

on my ClientLockManager components.

The solution for non development instances is shoutdown the LockManager server, so it release the locks