Oracle 11g…

The day when Oracle 11g was made available for download on OTN, there was sort of, flood of posts in the Oracle blogsphere. Here is a quick recap of few of the posts (Whatsoever I could find through OraNA and my Netvibes) Eddie Awad about 11g, I think he was the first one to post Then Doug Burns here Howard on installing 11g Another interesting article from Howard Tim Hall about 11g Tim Hall on installing 11g ...

August 13, 2007 at 10:25 PM · 1 min · 159 words · Amardeep Sidhu

Why Linux cries about "1024 cylinders thing" at the time of installation…

I have been installing Linux for last 6 years and for more than half the number of times, came across a message something like “This partitions is beyond the 1024 cylinder boundary and may not be bootable”. But never cared for it much and understood what exactly it meant to say ? Yesterday I was reading System Admin guide to Linux by Lars Wirzenius (Thanks Howard for the link :) From there I came to know what exactly that message meant. Quoting from the guide itself: ...

August 9, 2007 at 9:29 PM · 3 min · 437 words · Amardeep Sidhu

Plugged-in back to www…

Last to last week, we shifted to a new house. As there was no internet connection, so we were without any internet access for last 2 weeks. Today we got the new internet connection. Its a DSL one. And the guy who came to do the installation threw a little bit of technical jargon like rebooting the router and so on. It feels so good to be back in the world of www :) ...

August 8, 2007 at 11:32 PM · 1 min · 75 words · Amardeep Sidhu

Moving datafiles,control files and log files – Part 1

Many times you need to move datafiles from one location to another. The simplest approach for this is to take the tablespace offline, copy the datafiles to new location, rename the files with alter database rename file (Except that you dont have to move the SYSTEM and UNDO tablespace, as you can’t take SYSTEM tablespace offline) [sourcecode language=‘css’] SYS@orcl AS SYSDBA> alter tablespace system offline; alter tablespace system offline * ERROR at line 1: ORA-01541: system tablespace cannot be brought offline; shut down if necessary ...

July 21, 2007 at 1:44 PM · 2 min · 292 words · Amardeep Sidhu

Batch file for ftp’ing files…

Today I came across a requirement where users needed to ftp files time and again. So ftp’ing again and again is not a very good option. I wrote a small batch file for the same. Just sharing the same over here. I created a folder ftp in C drive and a file get_file.bat Contents of get_file.bat are: [sourcecode language=‘css’] set /p file_name=Enter the name of the file you want to ftp: echo oracle>c:\ftp\param.cfg echo oracle123»c:\ftp\param.cfg echo cd /home/oracle»c:\ftp\param.cfg echo lcd c:\ftp»c:\ftp\param.cfg bin get %file_name% ftp -s:param.cfg 127.0.0.1 ...

July 16, 2007 at 9:54 PM · 1 min · 143 words · Amardeep Sidhu

Import ORA-01435: user does not exist…

One may encounter this error while importing from a dmp file from older versions of Oracle. Genereally this error is caused by some statement like alter session set current_schema=scott; And the simple reason is that the user scott doesn’t exist. Yesterday I came across this error. And the reason was that user was not created. As in case of import we generally create tablespaces first (by creating the DDL using option show=Y) but creation of users is done by import itself. In older versions of Oracle, the temp tablespaces were no different from other tablespaces. But in newer versions temp tablespaces are different. So in dmp files from thoese older versions create user statements are written like create user t1 identified by t1 default tablespace temp temporary tablespace temp. This thing worked fine in older versions but in newer versions we cannot specify the TEMP tablespace as the default tablespace for a user. So the statement create user t2 identified by t2 default tablespace temp temporary tablespace temp throws ORA-12910: cannot specify temporary tablespace as default tablespace. In such cases the users (for which default statement is specified as TEMP) have to be created manually by specifying the appropriate tablespace as default tablespace and then the import should be run with ignore=Y. ...

July 14, 2007 at 9:29 AM · 2 min · 224 words · Amardeep Sidhu

Hats off…

Since I switched to this new job, my profile has changed. Here I work as a DBA. So my interaction with Oracle & anything related to Oracle has also increased. Started exploring Oracle related forums and websites specially OTN forums (http://forums.oracle.com) This is the only page thats almost always open on my Desktop in office & Laptop at home and I refresh more than my office Lotus Notes. Today I was reading APCs blog , that Jonathan Lewis has also started posting on OTN forums and being so busy man, from where he finds the time ? I too think the same. There are so many people having many years of experience in industry, answering the questions on OTN, uesnet groups and various other forums and everything is for free. They are not paid anything for the same thing. Its like taking time out of your time, understand somebody’s problem, create same scenario your PC, try out and then post the answer ! I am, sort of new to the forums and sometimes for whole of week, I am unable to post any answers, even knowing something about the issue someone has posted. Just the “time” thing. These days I am very close to OTN forums, visit for whole of the day and also post answers to the questions I know something about. There are many people who are regular visitors and are answering questions on the daily basis. Hats off ! to all these “big bosses” of the technology ! ...

July 4, 2007 at 10:31 PM · 2 min · 252 words · Amardeep Sidhu

Shell script to spool a no of tables into .xls files…

On OTN someone asked a question that how to spool data from a table into a xls file. Spooling a single table I discussed in one of the previous posts. We can use the same approach to spool data from more than 1 table also. Well here I will do it through a shell script and assume that you have a text file having list of tables to be spooled (Even if you don’t have one, it can be easily made by spooling the names of tables into a simple text file) Here is the shell script that you can use to spool data to various xls files, table wise. ...

June 26, 2007 at 10:38 PM · 1 min · 209 words · Amardeep Sidhu

Is multiplication faster than division ?

An interesing post by Laurent. Check out http://laurentschneider.com/wordpress/2007/06/to-divide-or-to-multiply.html My findings on 10gR2 on Windoze XP SQL> var z number SQL> var y number SQL> exec :z := power(2,102)*2e-31;PL/SQL procedure successfully completed.SQL> exec :y := 1e125;PL/SQL procedure successfully completed.SQL> set timi on SQL> exec while (:y>1e-125) loop :y:=:y/:z; end loopPL/SQL procedure successfully completed.Elapsed: 00:00:00.10 SQL> set timi off SQL> print yY ---------- 9.988E-126SQL> exec :z := power(2,-104)*2e31;PL/SQL procedure successfully completed.SQL> exec :y := 1e125;PL/SQL procedure successfully completed.SQL> set timi on SQL> exec while (:y>1e-125) loop :y:=:y*:z; end loopPL/SQL procedure successfully completed.Elapsed: 00:00:00.04 SQL> set timi off SQL> print yY ---------- 9.988E-126SQL> Sidhu ...

June 18, 2007 at 11:02 PM · 1 min · 101 words · Amardeep Sidhu

Spool to a .xls (excel) file…

A small tip, I read on OTN about spooling to a .xls (excel) file: It goes like this [sourcecode language=‘css’]set feed off markup html on spool onspool c:\salgrade.xls select * from salgrade; spool offset markup html off spool off[/sourcecode] And the xls it makes shows up like: Sidhu Comments Comment by hemant on 2007-06-26 16:44:00 +0530 hi i am working for a bank and we are using 10g. i am very raw at the oracle and have just started teaching myself through a book i have. we have many reports devised by our vendor still we need some that r not available. so we wanted the data to be exported in xl wherein i could manipulate to data to our need. abt this spooling thing. i have copied down ur script and want to test it… but how do i access the shell prompt(do not know unix either) thanks for the help extend it bit further for me please hemu ...

June 16, 2007 at 12:14 AM · 4 min · 766 words · Amardeep Sidhu