Wednesday, September 17, 2014

ORA-02030: can only select from fixed tables/views Error While Granting Access To Oracle V$ Views

This is a pretty common mistake to make when we are learning Oracle database. Basically when we select the data from all these dynamic performance views like V$SESSION or V$TRANSACTION etc., we are using the public synonyms. So if you try to grant select access on these synonyms like below, you will get "ORA-02030: can only select from fixed tables/views" error.

SQL> grant select on v$transaction to test;
 *
ERROR at line 1:
ORA-02030: can only select from fixed tables/views


So you need to grant select permission on the underlying views, not on synonyms. That's pretty straightforward as Oracle has a common naming convention for these v$ views. Just add a underscore "_" after "V" like V_$SESSION or V_$TRANSACTION. So if you just change the above SQL statement like below, you will scceed.

SQL> grant select on v_$transaction to test;
Grant succeeded.

Saturday, September 13, 2014

Does SELECT Statement Start A Transaction In Oracle

Normal SELECT query doesn't start a transaction in Oracle. Oracle will start a transaction implicitly when it acquires a Transaction Lock for the first time. And TX lock is only obtained when you are trying to modify data. So a SELECT query like below which just retrieves data doesn't start a transaction:

select id from test_table where id=1;

But if you are using SELECT ... FOR UPDATE statement, that's a different scenario. SELECT ... FOR UPDATE will lock the selected rows so that you can modify them later and no other session can update the rows in the meantime. So in the below case, Oracle will start a new transaction:

select id from test_table where id=1 for update nowait;

Hope this clear up the things.

Sunday, September 7, 2014

Easiest Way to Run Command Prompt In Full Screen Mode In Windows

If you are using Windows 7 or any later version, then you know that Alt + Enter doesn't work when you try to run DOS in a full screen mode. There's an easy way to fix this.
command prompt layout

Right click on the title bar of the command prompt program. Select "Properties" option.
From the new window, select "Layout" tab and put any large number in width section of "Window Size". Then just save it. If the entered number is bigger than screen width, Windows will automatically resize the value to screen width. Now when you click on "Maximize" button, the DOS console will cover the whole screen.

Saturday, August 30, 2014

Do Not Forget To Turn On Anonymous Comments In New Blogger Blog

Here's the trick. When you create a new Google Blogger blog, by default only registered users can comment there. That means any reader who wants to comment will have to log in to Google or some other OpenID account first. This option can come quite handy if your blog has become popular and you are attracting a lot of spam comments. This can give you better control and your existing readers who comment regularly would still comment most likely to engage into the ongoing conversations. But as a new Blog owner, you would like to start more conversations with your readers. Some readers will skip commenting when they find out that there is extra step and they have to log in to a profile to comment on your blogspot blog. So think and choose wisely. Here's how you can enable anonymous comments option in Google Blogger:
  • Go to Settings > Posts and Comments
  • Select "Anyone" for "Who can comment?" option and save.
Now your reader will have two extra options, commenting anonymously or just with a name/URL pair. By the way, don't forget to turn on comment moderation if you select this option. By default, comment moderation is turned off. You can do it in the same page as mentioned above.

Thursday, August 28, 2014

Where To Download Neave Pacman For Free

Neave Pacman is the best Pacman that I have ever played. And I have tried quite a few different Pac-man games in my computer. The interface of this flash based Pacman game simply works like a charm.

Neave Pacman


But you can't download it from the creator's site due to some copyright issues with Namco. There are two versions of Neave Pacman available online. One file size is around 860 kb and that stores your High Scores. And other one is almost half in size but doesn't have the option to store High Scores. Now here is the download link of Neave Pacman full version where you can store your High Scores. Download and enjoy.

Friday, August 22, 2014

How To Stop Google Analytics From Tracking Your Own Page Views

Few days back I wrote a post on how to stop Blogger from tracking your own pageviews. That works fine. But in addition to that I also track my blog page views through Google Analytics. I was a bit surprised when I found out my Blogger page view count and Google Analytics page view count didn't match. That's when I figured out Analytics was still tracking my own page views, even though Blogger stopped counting them. So Analytics tracking needs to stopped separately for own page views. One way to do it is through IP address filter. But if you don't have a static IP address from your ISP, then it's hard to do as every time you connect to internet you will have a different IP address. So you will have to figure out IP address range, then block tracking for that whole range. But their is an easier way out. You can install Google Analytics Opt-out Add-on in your browser. That will prevent Analytics from tracking page views in your browser. All major browsers including Firefox, Chrome & IE are supported. You just need to install it on the browsers from where you visit your own blog.

Tuesday, August 19, 2014

How To Resolve GoDaddy Problem "There is a problem with the information you provided. Please ensure all fields are completed properly."

This happens because you applied a coupon code that is not applicable for your preferred currency. For an example, currently you can get a $1.99 .com domain from GoDaddy using coupon code "cjcrmn199". Now consider that your preferred currency is set to INR. The coupon will be applied successfully and you will see equivalent amount of 1.99 US dollar in Indian rupee. But when you try to  place your order you won't find any payment option and when you try to submit the form you will get the message:

There is a problem with the information you provided. Please ensure all fields are completed properly.

Solving it is easy if your credit/debit card supports purchase in foreign currency. Just change your preferred currency to USD in this case. Then try again to check out. Now you will be able to place your order successfully.

Saturday, August 16, 2014

Run Apache Server In Windows Without Creating Service

But the first question is why will you want to do that. When you install Apache server in Windows, it will create Windows services automatically. And then whenever you boot your machine, these Apache services will start running by default. You will have to disable them on startup explicitly. And if you don't do that, they will make Windows startup somewhat slower even when you don't want to use Apache sever. These services will also consume RAM unnecessarily. That's a bit annoying especially if you have lots of other applications to work on in your local machine. So other alternative approach is to run Apache server directly as a console application. Just download the Apache binary zipped file and unzip it in your preferred location. Now from command line go to the bin folder inside the unzipped folder. Then type the below command:
httpd.exe
Apache server will keep running until you press Ctrl+C.
So start it only when you need it and save some unnecessary memory consumption. The drawback is that you won't have the option to clean-up gracefully during shutdown. But it should be fine in most cases when you are using it for developing and testing in your local machine.

Thursday, August 14, 2014

Workaround To Solve "Don't track your own pageviews" Issue For Blogger Blogs

You have a Blogger blog .When you click on "Don't track your own pageviews" link, you are getting "There was an error while fetching stats. Please reload page.". Reloading the page doesn't help either. You are getting the same error message. The probable cause is that you are using custom domain for your blogspot blog. There's a workaround. But first let me tell you how this "Don't track your own pageviews" feature works. It will set a blocking cookie in your browser. Google then can ignore any subsequent requests coming from that browser with that cookie. So to solve this issue, it need to be set manually.
Submit the below url from your browser address bar after replacing "yourdomain.com" with your own domain name:

www.yourdomain.com/b/statsBlockingCookie?action=SET&callback=__gwt_jsonp__.P2.onSuccess

And you will get response like below:

// API callback
__gwt_jsonp__.P2.onSuccess({"status":"yes"});


It's fixed. You can check by visiting your blog from the browser. The pageview stats should remain same. You need to do this for every browser from where you access your Blogger blog. And remember, if you clear your cookies from a browser you will need to do it again there.

Quickest Way To Find Apache Configuration File Location

If you work on different environments all the time you will know the pain, especially if the servers are set up on ad hoc basis. The easiest way to find Apache root location is to use httpd command. Just run the below command in terminal:
httpd -V

Now you will get a whole bunch of information about your Apache server installation. You will find something like this:
-D HTTPD_ROOT="/etc/httpd"

This is Apache root location. You will also get your configuration file (httpd.conf) location there. Just look for:
-D SERVER_CONFIG_FILE="conf/httpd.conf"

This location is relative to the HTTPD_ROOT location. So if you are unable to get hold of the guy who set up the system, hope this will help you save some trouble.