International Scores: Get the latest scores of all the international cricket matches from Cricinfo. Add the Cricinfo International Scores widget now!
Monday, February 20, 2012
Saturday, February 18, 2012
How to find MSSQL transaction log size
What is MSSQL transaction log :
Transaction log is basically used to write the transactions before committing them to database. Never know the usage till now, even though used this term lot of times.
Why we need to know about the transaction log size.
Because this log file will grow and most of us are not aware of how much is being used and how much is left. So if the transaction log is full, the application using the database will not be able to write or read from it.
How to find the size.
Simple. Connect to MSSQL studio and execute 'dbcc sqlperf(logspace)' .
Columns to look at is Log Size (MB) and Log Space Used(%)
1. Log Size (MB) - Current total log size for that table in MB.
2 . Log Space Used(%) - This will tell the used percentage with respect to the allocated/max size.
If some thing is greater than 90%, then probably you have to think of shrinking the log file or extending the MAX/allocated size.
Any other way to find this.
Connect to MSSQL studio, select the databases -->> right click --> Properties -->Files .
-Krishna.
Transaction log is basically used to write the transactions before committing them to database. Never know the usage till now, even though used this term lot of times.
Why we need to know about the transaction log size.
Because this log file will grow and most of us are not aware of how much is being used and how much is left. So if the transaction log is full, the application using the database will not be able to write or read from it.
How to find the size.
Simple. Connect to MSSQL studio and execute 'dbcc sqlperf(logspace)' .
Columns to look at is Log Size (MB) and Log Space Used(%)
1. Log Size (MB) - Current total log size for that table in MB.
2 . Log Space Used(%) - This will tell the used percentage with respect to the allocated/max size.
If some thing is greater than 90%, then probably you have to think of shrinking the log file or extending the MAX/allocated size.
Any other way to find this.
Connect to MSSQL studio, select the databases -->> right click --> Properties -->Files .
-Krishna.
Thursday, December 29, 2011
Removing mutlitple spaces in a file with single space in Linux
Folks, it is time for some Linux commands.
Ok. Here is the one that I have used, to remove lot of spaces between words with a single space in a file.
For example the "MoreSpaces.txt file is having the following text.
So, once you execute the above command the output file "OneSpace.txt" will be created and it's contents will be like as given below.
Sweet isn't it ???
Ok. Here is the one that I have used, to remove lot of spaces between words with a single space in a file.
cat MoreSpaces.txt | tr -s ' ' ' ' > OneSpace.txt
For example the "MoreSpaces.txt file is having the following text.
"Hello This is having more spaces between words..."
So, once you execute the above command the output file "OneSpace.txt" will be created and it's contents will be like as given below.
"Hello This is having more spaces between words..."
Sweet isn't it ???
Saturday, December 24, 2011
Passing more than 10 arugumets to Windows Batch script
Last week came across an interesting scenario while working a batch script with my friend.
That is, we need to pass more than 10 arguments to a batch script. There will be no problem to pass 9 arguments. I will just try to explain the normal way we use to get up to 9 arguments and way to get more than 10 arguments.
Up to 9 arguments
Consider a script test.bat being called with arguments, a b c as given below.
That is, we need to pass more than 10 arguments to a batch script. There will be no problem to pass 9 arguments. I will just try to explain the normal way we use to get up to 9 arguments and way to get more than 10 arguments.
Up to 9 arguments
Consider a script test.bat being called with arguments, a b c as given below.
Inside test.bat we will getting the arguments as given below.
c:\> test.bat a b c
@echo offset arg_1=%1
set arg_2=%2
set arg_3=%3For more than 10 arguments
We can not use %10 to get the 10th argument. Well, here is the solution we have found.
---------------------------------------------------------------------------------------
@echo ON
setlocal EnableDelayedExpansion
set arg_1=
set arg_2=
set arg_3=
set arg_4=
set arg_5=
set arg_6=
set arg_7=
set arg_8=
set arg_9=
set arg_10=
//Tricky part
---------------------------------------------------------------------------------------
@echo ON
setlocal EnableDelayedExpansion
set arg_1=
set arg_2=
set arg_3=
set arg_4=
set arg_5=
set arg_6=
set arg_7=
set arg_8=
set arg_9=
set arg_10=
//Tricky part
set /a m=0
FOR %%i IN (%*) DO (
set /a m+=1
set arg_!m!=%%i
)
---------------------------------------------------------------------------------------
FOR %%i IN (%*) DO (
set /a m+=1
set arg_!m!=%%i
)
---------------------------------------------------------------------------------------
-Krishna
Friday, December 23, 2011
Apple wax peeler
I love eating apples, but I am very much worried about the wax on the apple skin. Even if we try to wash it, the wax will not go off very easily and the apple will be looking as shiny as ever after that.
I normally use knife to take it off, but I lose considerable amount of apple as well with the skin. At the end I will be eating only 70% apple alone. Considering the cost of the apple(Rs 25 /apple) this loss bothered me as well.
Accidentally seen a wax peeler tool when I was in a shop near my house. The cost is just Rs 25.
Interestingly I found it very useful as it is taking skin of the apple alone and leaving much for me to eat. Hmm Yummy !!!!! ..
So if you go to shop next time, get one and enjoy. Will post some images if possible.
-Krishna.
I normally use knife to take it off, but I lose considerable amount of apple as well with the skin. At the end I will be eating only 70% apple alone. Considering the cost of the apple(Rs 25 /apple) this loss bothered me as well.
Accidentally seen a wax peeler tool when I was in a shop near my house. The cost is just Rs 25.
Interestingly I found it very useful as it is taking skin of the apple alone and leaving much for me to eat. Hmm Yummy !!!!! ..
So if you go to shop next time, get one and enjoy. Will post some images if possible.
-Krishna.
Wednesday, December 7, 2011
show create table tablename - useful SQL query
Hello,
This is a very useful query in I used in MySQL to find out the "create statement" that was used to create a table.
It helped me to copy and paste the table.
Syntax and sample output,
mysql> show create table User\G;
*************************** 1. row ***************************
Table: User
Create Table: CREATE TABLE User (
ID INT(11) default NULL auto_increment,
NAME char(60) default NOT NULL,
EMAIL char(100) default NULL,
PRIMARY KEY (ID)
) ENGINE=MyISAM
Unlike the query "desc tablename", which will give you the table definition,
we can get the table definition and the create statement from the
"show create table tablename" query.
Guys, post your cases where you find this query useful.
-Krishna.Friday, August 19, 2011
java.net.SocketException: No buffer space available (maximum connections reached?): JVM_Bind
Came across the exception in subject when starting a java application via wrapper. The java app never started. Found the below article as a solution in lot of forums.
http://support.microsoft.com/kb/196271
This article suggests to set the MaxUserPort in Windows registry to 65534. This setting may solve the problem, however I have couple of questions here.
http://support.microsoft.com/kb/196271
This article suggests to set the MaxUserPort in Windows registry to 65534. This setting may solve the problem, however I have couple of questions here.
- The exception is occurring because of no TCP ports available at that point of time, so if you do a Server reboot, all the TCP port will be cleared up and java app can be started.
- Is there any way to check (Windows Event log/ application log ) in Windows level when the java app trying to open the TCP socket it is failing. So that I can justify that the cause.
Subscribe to:
Posts (Atom)