Monday, August 31, 2009

What happens during oracle database hot backup

According to oracle documentation you already heard/aware that during an Oracle tablespace hot backup, a script or program or command puts a tablespace into backup mode, then copies the datafiles to disk or tape, then takes the tablespace out of backup mode. We can check the backup mode from V$BACKUP view. In case of user managed backup, backup process starts after issuing ALTER TABLESPACE tbs_name BEGIN BACKUP; or ALTER DATABASE BEGIN BACKUP; command and backup process ends by ALTER TABLESPACE tbs_name END BACKUP; or ALTER DATABASE END BACKUP; command.

Hot backup is demonstrated inside the topic http://arjudba.blogspot.com/2008/05/user-managed-hot-backup-of-oracle.html.

Although the process is very clear and well understood but there are many misconception around hot backup. The misconception start what is actually done during hot backup, is data file opens writeable during backup process? or changes are stored somewhere in the SGA, the redologs, the rollback/undo segments or some combination thereof, and then written back into the datafile when the tablespace is taken out of backup mode?

Well, around the writeable issue inside datafile there is other misconception like "During hot backup process there is generated huge amount of redo data which in fact slows down the database dramatically if the database is in archivelog mode."

Now let's know what actually happens during hot backup. The hot backup steps are,

1)The corresponding tablespace is checkpointed.

2)The checkpoint SCN marker in the datafile headers cease to increment with checkpoints.

3)Full images of changed DB blocks are written to the redologs.

Whenever you issue,

ALTER TABLESPACE tbs_name BEGIN BACKUP;

command, at that point a checkpoint is performed against the target tablespace and the datafile header is frozen, so no more updates are allowed on it (the datafile header), this is for the database to know which was the last time the tablespace had a consistent image of the data.

But during backup process, the corresponding datafiles in the tablespace allow just normal read/write operations, that is I/O activity is not frozen.

In case of redo log generation, each block will be recorded into the redo log files, the first time it the block is changed. So if a row is modified for the first time inside date block since hot backup started the complete block image is recorded in the redo log files but subsequent transactions on the block will only record the transaction just as normal.

Above three steps are required to guarantee consistency during the file is restored and recovery. By freezing the checkpoint SCN in the file headers, any subsequent recovery on that backup copy of the file will know that it must commence at that SCN. Having an old SCN in the file header tells recovery that the file is an old one, and that it should look for the redolog file containing that SCN, and apply recovery starting there. Note that checkpoints to datafiles in hot backup mode are not suppressed during the backup, only the incrementing of the main checkpoint SCN flag. A "hot backup checkpoint" SCN marker in the file header continues to increment as periodic or incremental checkpoints progress normally.

By initially checkpointing the datafiles that comprise the tablespace and logging full block images to redo, Oracle guarantees that any blocks changed in the datafile while in hot backup mode will also be available in the redologs in case they are ever used for a recovery.

Now many one claims that during hot backup process there is excessive redo log generation than in normal mode. It actually depends on the amount of blocks changes during hot backup process. Because the first time a block is changed logging of full images of changed blocks in these tablespaces are recorded to the redo logs. Normally, Oracle logs an entry in the redologs for every change in the database, but it does not log the whole image of the database block. But during the hot backup process by logging full images of changed DB blocks to the redologs, Oracle eliminates the possibility of the backup containing irresolvable split blocks. To understand this reasoning, you must first understand what a split block is.

Typically, Oracle database blocks are a multiple of O/S blocks. For instance, most windows filesystems have a default block size of 512 bytes and unix filesystems have a default blocksize 2k, while Oracle’s default block size is 8k. This means that the filesystem stores data in 512 byte chunks, while Oracle performs reads and writes in 2k chunks, or multiples thereof. While backing up a datafile, your backup script makes a copy of the datafile from the filesystem, using O/S utilities such as copy, dd, cpio, or OCOPY. As it is making this copy, it is reading in O/S-block sized increments. If the database writer happens to be writing a DB block into the datafile at the same time that your script is reading that block’s constituent O/S blocks, your backup copy of the DB block could contain some O/S blocks from before the database performed the write, and some from after. This would be a split block.

By logging the full block image of the changed block to the redologs, it guarantees that in the event of a recovery, any split blocks that might be in the backup copy of the datafile will be resolved by overlaying them with the full legitimate image of the block from the redologs. Upon completion of a recovery, any blocks that got copied in a split state into the backup will have been resolved through application of full block images from the redologs.

Related Documents

Thursday, August 27, 2009

Does oversize of datatype VARCHAR2 causes performance problem

From the beginning of learning Oracle SQL you have possibly heard that in case of VARCHAR2 datatype it allocates space exactly what it needs. So if you allocates 4000 bytes of VARCHAR2 data type and database needs 10 bytes only then exactly 10 bytes are allocated.

That is, in case of VARCHAR2(4000) and VARCHAR2(16) columns, if we store less then 16 bytes data in these two columns then same amount of space will be allocated, and performance should be the same. But, have you ever tested it? I got a funny example http://hrivera99.blogspot.com/2008/05/why-is-varchar2-oversizing-bad.html here. There it is said performance problem but in reality there is not. In the example it is shown problem in physical reads but I don't agree with the example. In fact in the first example it is cached data and hence physical reads is reduced.

In the following section I simulate same example and see no performance differences. However there may rise, http://arjudba.blogspot.com/2008/09/ora-01450-maximum-key-length-3215.html while creating index in case of bigger VARCHAR2 length.

The most misleading example can be created by omitting
"
ALTER TABLESPACE EXAMPLE OFFLINE;

ALTER TABLESPACE EXAMPLE ONLINE;"

If you omit this step you may get different result as data become cached. And you need to take tablespace offline in order to get most accurate result as offlining a tablespace uncache of corresponding tablespace data.

Step 1)Create varchar2_length_test table with VARCHAR2(4000) and insert data into it.
SQL> create table varchar2_length_test(
2 ID NUMBER,
3 COL2 VARCHAR2(4000),
4 COL3 VARCHAR2(4000),
5 COL4 VARCHAR2(4000),
6 COL5 VARCHAR2(4000),
7 COL6 VARCHAR2(4000),
8 COL7 VARCHAR2(4000),
9 COL8 VARCHAR2(4000),
10 COL9 VARCHAR2(4000),
11 COL10 VARCHAR2(4000),
12 COL11 VARCHAR2(4000),
13 COL12 VARCHAR2(4000),
14 COL13 VARCHAR2(4000)) TABLESPACE EXAMPLE;

Table created.

SQL>
SQL> begin
2 for i in 1 .. 100000
3 LOOP
4 INSERT into varchar2_length_test VALUES(
5 i, i||'Col2',i||'Col3',i||'Col4',i||'Col5',i||'Col6',i||'Col7',i||'Col8',i||'Col9',i||'Col10',i||'Col11',i||'Col12',
6 i||'Col13');
7 END LOOP;
8 END;
9 /

PL/SQL procedure successfully completed.

Step 2)Create varchar2_length_test_short table with VARCHAR2(16) and insert data into it.
SQL> create table varchar2_length_test_short(
2 ID NUMBER,
3 COL2 VARCHAR2(16),
4 COL3 VARCHAR2(16),
5 COL4 VARCHAR2(16),
6 COL5 VARCHAR2(16),
7 COL6 VARCHAR2(16),
8 COL7 VARCHAR2(16),
9 COL8 VARCHAR2(16),
10 COL9 VARCHAR2(16),
11 COL10 VARCHAR2(16),
12 COL11 VARCHAR2(16),
13 COL12 VARCHAR2(16),
14 COL13 VARCHAR2(16)) TABLESPACE EXAMPLE;

Table created.

SQL> begin
2 for i in 1 .. 100000
3 LOOP
4 INSERT into varchar2_length_test_short VALUES(
5 i, i||'Col2',i||'Col3',i||'Col4',i||'Col5',i||'Col6',i||'Col7',i||'Col8',i||'Col9',i||'Col10',i||'Col11',i||'Col12',
6 i||'Col13');
7 END LOOP;
8 END;
9 /

PL/SQL procedure successfully completed.

Step 3)Clear caching in the tablespace.
SQL> ALTER TABLESPACE EXAMPLE OFFLINE;
Tablespace altered.

SQL> ALTER TABLESPACE EXAMPLE ONLINE;
Tablespace altered.


Step 4)Enable tracing and look at statistics
SQL> SET AUTOT TRACE
SQL> select count(*) from varchar2_length_test;

1 row selected.


Execution Plan
----------------------------------------------------------
Plan hash value: 1500664439

-----------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Cost (%CPU)| Time |
-----------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 418 (2)| 00:00:06 |
| 1 | SORT AGGREGATE | | 1 | | |
| 2 | TABLE ACCESS FULL| VARCHAR2_LENGTH_TEST | 88364 | 418 (2)| 00:00:06 |
-----------------------------------------------------------------------------------

Note
-----
- dynamic sampling used for this statement


Statistics
----------------------------------------------------------
29 recursive calls
1 db block gets
1980 consistent gets
1912 physical reads
176 redo size
411 bytes sent via SQL*Net to client
396 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed

SQL> ALTER TABLESPACE EXAMPLE OFFLINE;

Tablespace altered.

SQL>
SQL> ALTER TABLESPACE EXAMPLE ONLINE;

Tablespace altered.

SQL> select count(*) from varchar2_length_test_short;

1 row selected.


Execution Plan
----------------------------------------------------------
Plan hash value: 161270611

-----------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Cost (%CPU)| Time |
-----------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 418 (2)| 00:00:06 |
| 1 | SORT AGGREGATE | | 1 | | |
| 2 | TABLE ACCESS FULL| VARCHAR2_LENGTH_TEST_SHORT | 109K| 418 (2)| 00:00:06 |
-----------------------------------------------------------------------------------------

Note
-----
- dynamic sampling used for this statement


Statistics
----------------------------------------------------------
29 recursive calls
1 db block gets
1993 consistent gets
1912 physical reads
176 redo size
411 bytes sent via SQL*Net to client
396 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed



So we see in both VARCHAR2(4000) and VARCHAR2(16) almost same consistent gets and physical reads. So oversize of varchar2 does not cause performance problem issue but lead to other problems.

Related Documents

ORA-01450: maximum key length (3215) exceeded

Shell script book for the newbie

I have written a book of shell script specially for the newbie who want to learn shell script. The book starts from a very basic idea of shell script programming. Each sections are well demonstrated by examples in order to make clear idea about shell script programming. The book is written in such a way so that you can work with unix and practice shell script even you don't have idea about unix operation systems.

Below is some of the topics that is discussed in the book. All topics are discussed with examples.


- Introduction -What is kernel, shell, shell script.
- Basic Steps to write a shell script
- Variables in shell script
- Output text with echo command
- Arithmetic operation and expression in shell script with expr
- Basic shell programming commands quote, exit and read
- Wildcard characters in linux
- Assignment and comparison variable in shell script
- Command writing, command line arguments in shell script
- Input-Output rediection on linux
- Pipe with example in linux


- If construct in shell script
- Checking condition in shell scipt by test or [expr]
- If else construct in shell script
- For and while loop in shell script
- Case statement in shell script


- What is /dev/null on linux
- Conditional execution && and || in shell script
- Functions in shell script
- Trap command on linux shell script
- The shift command and uses of it in shell script
- getopts command in linux shell script


- Retrieve column from file using cut utility in linux
- Merge lines using paste utility on linux
- Join utility in linux
- Translate or replace characters using tr utility
- Data manipulation using awk utility in linux
- Edit file on linux using sed utility
- Remove duplicate successive line using uniq utility
- Find pattern from a file using grep, egrep or fgrep utility

You can collect this shell script book for $15.

And to collect the book please contact to my email address a_arju@yahoo.co.uk
Related Documents
Oracle DBA scripts ordered by Daily, Weekly, Monthly

Oracle DBA scripts ordered by Daily, Weekly, Monthly

I have written a list of oracle DBA scripts that is essential for the DBAs. I have divided the scripts into three categories as daily, weekly and monthly basis. The scripts included almost every types of tasks that are needed for a DBA.

Scripts included various types of error checking, database health monitoring, automatic backup, recovery process, automatic performance problems findings.

Scripts are written for automatic database start up and shut down, check for backup has been carried out successfully, clear archive logs, automatic checking invalid objects, repair them, database growth checking, oracle database security settings, identify top sqls and provide necessary recommendations, tablespace growth management, various advisor to recommend necessary database changes, parameter suggestion/modifications etc.

The scripts not only included oracle scripts, there is also included shell scripts where it is necessary, so you can schedule your scripts through crontab.

All these scripts you can collect for $50.

And to collect the scripts please contact to my email address a_arju@yahoo.co.uk

Guidelines for choosing the best web hosting service.

In order to make a website operational to Internet users, you at first need to build a web site and then you search for a web hosting service provider in order to host your website. There is over tons of websites that offer web hosting service. So it is your choice to pick the best web hosting service.

Before go through this topic have a look at What is web hosting service? in order to have an idea about web hosting. Also go through different types of web hosting based on application which is discussed in http://arjudba.blogspot.com/2009/06/different-types-of-web-hosting-services.html

In this topic, I am trying to present the guidelines for the best web hosting which will help you to pick a good web hosting provider.

1)Speed and reliability of the servers and hardware:
Be sure about the hosting server's actual hardware configuration as well as the speed of the hosting provider they offers.
- A good hosting service provider must have a high speed Internet connection (T3 or higher).

- It should opt for unlimited bandwidth for your website.

- Good hosting servers must support redundant servers. So that if one server fails another can operate.

- There must be an host administrator to do backup jobs of your web hosting data.

2)Amount of space needed for hosting and flexibility:
Your website contents must need space in the hosting server where it would be reside and if your site is dynamic(in case of blogs. forums, social marketing site), day by day your volume of space needed must increase. So before hosting your web site be sure the amount of space needed for you. Ask them up to how much they can support.

In the market you can get lower cost of 500MB hosting space in one hosting company than in 50MB space of other hosting company. In case of web hosting, this is much true that "The less money you spend in hosting, the poor service you receive".

Also besides choosing space ask the web hosting provider whether they can accommodate your changes in future. Like, in the near future you may need oracle database support or mysql database support which are not belong to your current package.

3)Customer Services:
This is one of the most criteria to choose a web hosting service. Make sure your web hosting service offers 24x7x365 support. That is you can reach them 24 hours/day, seven days a week and 365 days per year with real people on the phone or by email to help you without cost. Before doing hosting, you can easily test this by simply emailing them and check how much time they are taking to response you as well as measure how much effective their mail is.

Also,
- Look for the big customers they are offering service currently.

- Take the existing customers feedback.

- How many years your hosting company have been in the business.

- Are their hardware new and ask for RAM, processor configuration etc for their servers.

4)The features provided by hosting company:
Check for the features that are provided by the company that you are going to host your web site. Some basic and common features are,

- DNS registration for your web site.

- At least 20MB of space to host your files.

- Unlimited bandwidth - to upload files, to support traffic to your site.

- Free Technical Support.

- POP3 E-Mail Accounts - Based on the service you can get many email POP accounts, but they must offer at least 3 email POP accounts.

- Email Forwarding - So that you can forward email to your yahoo/gmail that you check often.

- Email Auto-responders - Some programs that will respond clients answer automatically. May have intelligence into the program or may be generic answer. Vacation response might be a generic auto response.

- Email Aliases - Allows you to create groups and you can assign several emails into the groups.

- FTP Access (File Transfer Protocol) - This is the protocol used on the Internet for sending files.

- FrontPage Support - If your hosting company support FrontPage extensions then you can edit the site online using the program.

- Own CGI-Bin Access (Common Gateway Interface)

- Server Side Includes (SSI) - can be used to dynamically insert information such as local time, date or file information.

- Password Protection - To access your web site contents there must be a authentication.

- Database support - MySQL, Oracle etc. database as you need them.

- Web Statistics - Though you can use various tools to see your web statistics but ask hosting provider whether they support any.

- Secure Server - You should process online credit card transactions through a secure server so the credit card numbers are encrypted.

- Shopping Cart Software - To enable eCommerce on your site you will need some type of method for processing orders online.

- Online Web Site Manager - There should be panel by which you can make changes to your site, maintain your site, account information and emails.

- Search engine submissions - Many hosting service provider offers for extra services like Search engine submissions.

- Virus Scanning - On windows hosting web hosting servers are responsible to do scanning and ensure your files to keep virus free.

- Reseller/referral program - Common program that exist almost in every web hosting company. If someone register to the web hosting service using your referral links then your referral program can pay 20% of the money that someone spend using your referral.

5)The amount you like to spend for hosting:
I already said, the more you spend the better service you get. There may be a little exception into it. However, for a small web hosting package of 20-50MB of allocated space for a site your cost may range from $5 to $100 per month. Anyway, before pick any package look for technical support they will provide.

If you follow the above basic guidelines, prior to choose a hosting company I hope, you will have a reliable, efficient and satisfying hosting service that will contribute to the success of your business for many years to come.

Related Documents

What is web hosting service?

Monday, August 24, 2009

Format Model Modifiers - FX and FM

The FM and FX modifiers are used in the TO_CHAR function in oracle sql in the format model. These two modifiers control blank padding and exact format checking.

FM:
FM is fill mode. If we simply use TO_CHAR function that is without FM then Oracle uses blank characters to fill format elements to a constant width equal to the largest element for the relevant format model in the current session language. For example if NLS_LANGUAGE is set to AMERICAN then, in case of month the highest length month is SEPTEMBER. So if we don't use FM modifier then every month takes the length of 9 characters. (that is month SEPTEMBER). But if we use FM format model modifiers then the blank characters are suppressed.

Below example will clear you.

SQL> select to_char(SYSDATE,'fmDDTH MONTH YYYY') from dual;

TO_CHAR(SYSDATE,'FM
-------------------
24TH AUGUST 2009

SQL> select to_char(SYSDATE,'DDTH MONTH YYYY') from dual;

TO_CHAR(SYSDATE,'DD
-------------------
24TH AUGUST 2009

SQL> show parameter nls_language

NAME TYPE VALUE
------------------------------------ ----------- ---------------
nls_language string AMERICAN

SQL> select to_char(SYSDATE,'Day')||' Time' from dual;

TO_CHAR(SYSDAT
--------------
Monday Time
SQL> select to_char(SYSDATE,'fmDay')||' Time' from dual;

TO_CHAR(SYSDAT
--------------
Monday Time


FX:
FX is format exact.
FX modifier specifies exact matching for the character argument and datetime format model of a TO_DATE function.

Let's have a look at FX format model specification.
- Punctuation and quoted text in the character argument must exactly match the corresponding parts of the format model.

- The character argument cannot have extra blanks. Without FX, Oracle ignores
extra blanks.

- Numeric data in the character argument must have the same number of digits as
the corresponding element in the format model. Without FX, numbers in the
character argument can omit leading zeroes.

When FX is enabled, you can disable this check for leading zeroes by using the FM
modifier as well.

If any portion of the character argument violates any of these conditions, then Oracle returns an error message.

Peter Davies' Internet Marketing Blog, a student of Alex Jeffreys

This review is a summary of what Interactive Blogger, an internet marketing blog owned by Peter Davies. Peter has started and an Internet Marketing Business and is being mentored by a rising star in the Online world, Alex Jeffreys who has a great record of coaching newbies in internet marketing or those who have been struggling and don’t know where to go next. Alex in turn has been mentored by Rich Schefren whom Peter has also had the benefit of.

Alex communicates to his student the ethos of providing large amounts of value up front, so that anyone who has an online business or is thinking of creating an online business can receive great tangible benefits.

He sees internet marketing as a few simple steps;
  • First you build a blog with which you create great content to market with your readership, never try to direct sell to them

  • Use the blog to drive traffic to your site, add valuable information to other blogs, market yourself using several techniques, articles, video marketing, forums

  • Use to your traffic to build a list but don’t always try to sell to that list, give them large amounts of useful content first the sales will come later.


  • Peters’ approach has embraced Alex’s ethos, indeed he has decided as his first real venture to create a free product explaining through the eyes of someone who has recently gone through the process himself he has started a new online business from scratch. This is not a product that will get you rich overnight, he states quite clearly that there is no such thing, this covers the basics of planning, building the blog then blogging, generating traffic and building a subscriber list.

    This is a reflection of a genuine approach to getting started, watching him learn new things then apply them and watching him develop into an authority in his chosen field without the hype. Best of all its free! http://interactive-blogger.com

    Related Documents
    http://arjudba.blogspot.com/2008/08/list-of-available-advertising-network.html
    http://arjudba.blogspot.com/2009/06/how-to-get-targeted-backlinks-to-your.html
    http://arjudba.blogspot.com/2009/08/how-to-increase-your-technorati.html

    Tuesday, August 18, 2009

    List of freelancing job sites

    After the fallen of the global economy, many companies has been closed and much employees have been laid off. Some of these employees search for immediate work for living and go through various sites on internet to get work. Also most small and medium sized businesses search for freelancing sites in order to complete their works to lower cost. If a company keep a permanent employee, company has to pay like $5000~$6000 to an employee per month but through freelancing site company can hire a freelancer on demand work or per hour work basis which greatly will minimize the total cost of the company.

    In other hand, many freelancers like to do freelancing instead of regular jobs because they love to work from home. You don't have to face traffic zam, don't need to wait for bus, don't want to do some boring office works from 9 to 5pm and most importantly as a freelancer you have total freedom to choose what type of works you actually like to do.

    There are tons of sites in the Internet offering a repository of freelancing jobs. You can get service as well as provide service through those sites. Buyers post projects through the sites, coder bid on the projects, buyer select a coder based upon rating, experience and bid, after coder is select, coder will be responsible to complete the project. Upon work is accepted by the buyer coder can be paid. All the freelancing sites follow these rules. There is an escrow system before coder started to work so that there exists no scam.

    Besides some legitimate sites, there are tons of scam sites as well. So before doing freelancing tasks you need to aware of the good freelancing sites. In general, the sites where it asks money before doing registration normally they are scam sites. After analysis to various sites I am listing the best freelancing sites here.

    1)Elance.com (USA, founded in 1998):
    Elance.com is the largest online freelance site. If you want to do large professional job then elance.com is the best choice. Unlike other freelancing sites, elance.com charges freelance providers while posting the job in the list. So, it is very trusted one and posts are not fake. While in some freelancing sites there is much fake posting and bidders bid on those project but lastly provider cancel the project. So no waste of time from freelancers.

    2)GetAFreelancer.com (Sweden, started in February 2004):
    GetAFreelaner.com gets huge traffic compared to others because of it's posting flexibility. You can find freelance coders, writers, programmers, designers, marketers and more. But still the site needs to make much improvement as I see several bugs there. Besides they have several limitations and bad features like pop up windows while bidding or editing post. The great limitation is their support system is really worst.

    3)ScriptLance (Canada, started in 2001):
    Provides a service that helps businesses find freelance programmers and designers for their projects. This site has the lowest fees. It has no recurring fees, no project posting fees. Webmaster/Programmer will have to pay per project fee at the point of project acceptance (when webmaster had selected a programmer for the project and programmer accepted the project). It is your best choice if you want really cheap coding.

    4)Rent-a-coder (USA, started in 2001):
    Rent-a-coder may also be your choice but it has several limitations. As posting project is totally free so freelancers sometimes waste much time while bidding a project that is going to cancel. When you get a project done through Rentacoder you put the entire project fees into an escrow account. You don't release the fees until the project is complete. From my experience I see Rent-a-coder is biased to seller. So upon completion of your work you may not get your money. But it is really good for buyers(software providers). Another limitation of them is they are not good who have really slow internet and sites become down often. So you may not submit your tasks within the site in time and any off -site communication means they will not pay you.

    5)Guru.com (USA, started August 2000):
    According to Guru.com, it is one of the leader in freelancing industry with more than 1 million registered members and 100,000 active freelancer profiles. By using SafePay Escrow, Employers are guaranteed 100% satisfaction with their project results. They have some innovative features, such as an online Video Profile, give Freelancers a cutting edge platform to highlight their skills and experience to attract new business and retain repeat customers.

    6)GetACoder.com: (USA, UK, Hong Kong, Portugal):
    It was one of the good site in the freelancing sites. Now they rather go much for advertisement instead of freelancing. Still you can use them. According to them. When you use GetACoder you are stretching your budget and saving as much as 60% over traditional outsourcing. GetACoder is changing business, now it's no longer about what you own or build but which resources and talent you can access. With GetACoder you reduce expenses, increase efficiencies, aggressively grow your business, and create a sustainable competitive advantage.

    Other Sites in terms of less popular
    1) ifreelance
    "Post your project today to receive bids from 100's of professional service providers. When bidders compete for your project, you save time and money. It's quick and easy and best of all, it's free."

    2) Freelance-Work
    "Freelance Work was created to connect freelance and contract professionals with qualified employers. Through our project and job seeker databases, freelancers can find their next great projects and list their qualifications so employers can immediately find them."

    3) Scriptlance
    "Connecting businesses with programmers."

    4) ProjectSpring
    "Connecting Programmers with Custom Software Buyers & WebMasters."

    5) Freelance Job Search
    "New Jobs Updated 8 times an hour from every major freelance job site on the interwebs."

    6) Contracted Work
    "Find Professionals Fast, Easy & Free."

    7) Freelance Auction
    "Freelance Auction Marketplace to buy/sell freelance website services Web Design, Graphic Design, CGI, PHP, Perl, Java, XML, ASP, SQL, MYSQL Programming Script Installation, Custom Website Design, Templates, Software Development, CGI/PHP Scripts Post a quote request from freelancers or join as a freelancer, developer, contractor to bid on work"

    8) Power Lance
    "Our goal is to connect professional freelancers to webmasters providing both freelancers and webmasters the opportunity to expand their business and reduce their costs. Feel free to post a project for bidding or bid on current open projects."

    9) Freelancers
    "Freelancers.net has been helping freelancers find work and clients find freelancers since 1999. Freelancers.net is UK focused and lists many jobs and projects open to UK freelancers, however clients from across the globe use Freelancers.net regularly to source freelancers outside of the UK."

    10) Project4hire
    "Find Freelance Web Designers for Custom Web Design, Graphic Designers, Programmers, Coders, Writers and more
    Project4Hire.com is the place to find Freelance Programmers, Web Designers, Graphic Artists, IT Professionals, Translators, Writers, Consultants & other Freelance Professionals."

    11) Macfreelancer
    "Project outsourcing. Simplified."

    12) Onforce
    "OnForce is the trusted nationwide network of over 13,000 highly-skilled service professionals, available when and where you need them."

    13) Freelanza
    "Freelanza.co.za is an online outsource portal for professionals. Clients may outsource work to the available service providers by means of posting jobs on the notice board. Jobs will be awarded by the clients, to providers as they see fit. "

    14) Agentsolo
    "experts for your projects"

    15) Peopleperhour
    "Outsource Your Work To Rated Freelancers
    Save cost by using freelancers and home workers
    Stay flexible by hiring remotely on-demand
    Find trusted professionals and pay only for results"

    16) BIZReef
    Freelance Marketplace with a fee per job to contact the buyer.

    17) Freelancer Store.com
    "Freelance Programmer – Freelance Projects – Freelance Websites. This site is Totally FREE! We don’t charge to post projects or charge after accepting a freelancer; which other websites do. We don’t take any commission from freelancers; which other freelance websites do. No sign-up fees, No monthly fees, No commission fees. It’s totally FREE!"

    18) Freelancer Listing
    "Looking for Freelance work? Find the latest freelance job postings and bid on them absolutely FREE!"

    19) eTEQ.com
    "Offering everything that project owners and freelancers could possibly need, eTEQ.com contains auctions, job postings, and freelance ads all for free. Project owners can post their projects for free and have the site’s competent freelancers bid on it while freelancers, on the one hand, can also sign up for free and begin browsing for various projects up for bidding posted in the site."

    20) ITMatch Online
    "Are you a BUYER looking for outsourcing IT or BPO projects? Are you a PROVIDER looking for outsourcing IT or BPO projects? ITMatchOnline is the easiest way to find the right partner." Free registration.

    21) DesignQuote.net
    "The best site on the Net for professional designers."

    22) Moday Works
    "International Service Providers at your Fingertips!"

    23) P2W2
    "P2W2 identifies the right partners, negotiates terms, establishes the outsourcing relationship and manages projects for small business. "

    24) Project Worm
    "Builds bridges between Project Owners and Project Professionals."

    25) RfpDB
    "Welcome to the Request for Proposals Database (RFPdb), your source for RFPs and new project leads. This site is free to join and there is NO fee. The site works on a credit system."

    26) BidItOut.com
    "Work on what you want, when you want and where you want to! The lifestyle of a freelancer is taking off and gives unparalleled job flexibility. By working as a freelancer online, you can greatly increase your client base and job throughput. Have the surety of being paid on-time with our trusted escrow system for payments. For the first time you can even work at home and tap into a global pool of suppliers across a huge range of industries!"

    27) Savvylance
    "Bid on web, graphics and development jobs."

    28) Jobloha
    "It’s a new way for you to find and get work done online. Jobloha is mainly being used by freelancers (Coders, Designers, Writers,…) but offers a great variety of remote work and local job offers. Whether you are looking for the right person to do a specific job for you or you are a freelancer looking for work, Jobloha is right for you."

    29) Jobshuk
    "Outsourcing your project to Israel makes smart business sense – ensuring a balance of high quality, reliability & cost savings. JobShuk connects English-speaking freelancers, small businesses, and service providers based in Israel with the world."

    30) LancerGlobal
    "Find qualified freelancers willing to do the job within your budget! Post your project for free and receive bids instantly."

    31) Freelance Projects
    "All freelance projects at one location."

    32) FreakLance
    "Web and graphic design marketplace."

    33) The Superlancers
    "Fast, simple freelance marketplace."

    34) United States Freelancers
    "Freelance Website to connect International, Offshore, Outsourcing Freelancers and Freelance buyers. UnitedStatesFreelancers! We are pleased to announce that we have made concessions to allow for international, offshore, outsourcing freelance work. As the United States is a huge melting pot, so should our site be… United States Freelancers is open to all international buyers and all international freelancers."

    35) DesignBay
    "Get opportunities to be creative using the DesignBay marketplace."


    List of Non-English Sites

    1) Freelancermap
    Location: Germany

    2) Freelance INDIA.com
    "FreelanceIndia a common platform for freelancer. We help you in finding Project Work, Part-time Jobs, Assignments relevant to your field.
    Location: India

    3) Bumeran.com
    Location: South America

    4) Laborum.com
    Location: Latin America

    5) Trabajo Freelance
    Location: South America

    6) XPlace
    "Express outsourcing.
    Location: Israel

    7) Joobs
    Location: Romania

    8) Pinoy Jobs
    Location: Philippines

    9) Motamot
    Location: France

    10) Okeli
    Location: Sweden

    11) Projekurdu
    Location: Turkey

    12) Circa Lavoro.it
    Location: Italy



    Related Documents
    http://arjudba.blogspot.com/2008/06/how-to-make-money-online-please-read-it.html
    http://arjudba.blogspot.com/2009/07/how-to-setup-google-webmaster-tool-for.html

    Monday, August 17, 2009

    Number format models in oracle

    About Number format models
    About format models in oracle it is specified inside post, http://arjudba.blogspot.com/2009/08/format-models-in-oracle.html
    Number format models is the format by which you can recognize oracle about the input data of number type.

    Number format models are used in the following functions.

    1)TO_CHAR function : TO_CHAR function is used to translate a value of NUMBER, BINARY_FLOAT, or BINARY_DOUBLE datatype to VARCHAR2 datatype.

    2)TO_NUMBER function : TO_NUMBER function is used to translate a value of CHAR or VARCHAR2 datatype to NUMBER datatype.

    3)TO_BINARY_FLOAT and TO_BINARY_DOUBLE function : TO_BINARY_FLOAT and TO_BINARY_DOUBLE functions are used to translate CHAR and VARCHAR2 expressions to BINARY_FLOAT or BINARY_DOUBLE values.

    Consider of using Number format Models
  • All number format models causes number to be rounded to a specified number of
    significant digits

  • If there is more number of digits (to the left of the decimal place) in the value than the number specified in the format models, then the value is replaced by pound sign(#).
    Below is an example.

    SQL> select to_char(343543.98,'$999.99') from dual;

    TO_CHAR(
    --------
    ########

    Here number 343543.98 has total 6 digits on the left of the decimal but in the formal model it is used only 3 digits. So instead of returning real digit # sign is returned.

    If we used correct or more number of 9's than required then it would display right characters.

    SQL> select to_char(343543.98,'$9999999.99') from dual;

    TO_CHAR(3435
    ------------
    $343543.98


  • If NUMBER value is extremely large and cannot be represented in the specified format model, then for positive number the value is replaced by the infinity sign (~) and for negative number the vaue is replaced by the negative infinity(-~) sign.

  • If a BINARY_FLOAT or BINARY_DOUBLE value is converted to CHAR or NCHAR,
    and the input is either infinity or NaN (not a number), then Oracle always returns
    the pound signs to replace the value.


  • Number Format Elements
    Number format model is composed of one or more number format elements. List of number format elements are shown below with examples.

    1)Comma(,): Return a comma in the specified position. Comma can't place at the beginning position or at the right to the decimal point.
    Example:

    SQL> select to_char(98687,'9,999,9') from dual;

    TO_CHAR(
    --------
    9,868,7

    2)Period(.): Return a decimal point in the specified position. Can have at best only one decimal point.
    Example:

    SQL> select to_char(98687,'99999.99') from dual;

    TO_CHAR(9
    ---------
    98687.00

    If the number of digits to the left of the decimal point in the format model is less than the number of digits to the left of the decimal point exist in the real number then # is returned.

    SQL> select to_char(98687,'9999.999') from dual;

    TO_CHAR(9
    ---------
    #########

    If there is multiple period(.) then following error returned.
    SQL> select to_char(98687,'99999.9.9') from dual;
    select to_char(98687,'99999.9.9') from dual
    *
    ERROR at line 1:
    ORA-01481: invalid number format model

    3)Dollar sign($):
    If used within format models then character with leading dollar sign is returned. Can be used any position within format models but not in multiple position.
    Example:

    SQL> select to_char(93,'9$9') from dual;

    TO_C
    ----
    $93

    SQL> select to_char(93,'99$') from dual;

    TO_C
    ----
    $93

    Using $ into multiple position fails with ORA-01481.
    SQL> select to_char(93,'$$99') from dual;
    select to_char(93,'$$99') from dual
    *
    ERROR at line 1:
    ORA-01481: invalid number format model

    4)Zero(0):
    Usage of zero(s)(0) inside format models return leading zeros(0) if inside format model they are used to the left of the decimal point. Multiple usage will return multiple leading zeros. If inside format model zero(s) are used to the right in the decimal point then digits to the right of the real number is filled first and then zero is placed based on the deducting from number of zero(s) inside from model minus number of digits to the right of the real number.

    Examples will clear you more.

    SQL> select to_char(93,'099') from dual;

    TO_C
    ----
    093

    SQL> select to_char(93,'99.0') from dual;

    TO_CH
    -----
    93.0

    SQL> select to_char(93,'099000') from dual;

    TO_CHAR
    -------
    000093

    SQL> select to_char(93.98,'099.000') from dual;

    TO_CHAR(
    --------
    093.980

    SQL> select to_char(93,'099.000') from dual;

    TO_CHAR(
    --------
    093.000


    5)9:
    In the above example you find in all number format model 9 is used. 9 returns value with the specified number of digits with a leading space if positive or with a leading minus if negative. For leading 0 in the number, 9 in the format model prints blank.
    Note that leading 0 becomes NULL unless the number is zero.

    SQL> select to_char(09,'9') from dual;

    TO
    --
    9

    SQL> select to_char(09,'99') from dual;

    TO_
    ---
    9

    SQL> select to_char(0,'99') from dual;

    TO_
    ---
    0


    6)B:
    B inside format model returns blanks for the integer part of a fixed-point number when the integer part is zero.
    Following is an example.

    SQL> select to_char(0,'99') from dual;

    TO_
    ---
    0

    SQL> select to_char(0,'B99') from dual;

    TO_
    ---


    7)C:
    C returns the ISO currency symbol in the specified position. The value is determined from the NLS_ISO_CURRENCY parameter.

    SQL> select to_char(9,'C99') from dual;

    TO_CHAR(9,
    ----------
    USD9

    SQL> select to_char(9,'9C9') from dual;

    TO_CHAR(9,
    ----------
    9USD0

    SQL> select to_char(9,'99C') from dual;

    TO_CHAR(9,
    ----------
    9USD

    8)D:
    Returns a numeric character in the specified position. The character is specified by the parameter NLS_NUMERIC_CHARACTERS. The default is a period (.).
    Example:

    SQL> select to_char(99,'999D99') from dual;

    TO_CHAR
    -------
    99.00

    9)EEEE:
    EEEE returns a value using in scientific notation.
    Example:

    SQL> select to_char(9939,'9EEEE') from dual;

    TO_CHAR
    -------
    1E+04

    SQL> select to_char(9939,'9.EEEE') from dual;

    TO_CHAR(
    --------
    1.E+04

    SQL> select to_char(9939,'9.9EEEE') from dual;

    TO_CHAR(9
    ---------
    9.9E+03

    SQL> select to_char(9939,'9.9999EEEE') from dual;

    TO_CHAR(9939
    ------------
    9.9390E+03

    10)G:
    G returns the group separator in the specified position. The current value is specified by the NLS_NUMERIC_CHARACTER parameter. You can specify multiple group
    separators in a number format model.
    Example:

    SQL> select property_value from database_properties where upper(property_name)='NLS_NUMERIC_CHARACTERS';

    PROPERTY_V
    ----------
    .,

    SQL> select to_char(9939,'99G99') from dual;

    TO_CHA
    ------
    99,39

    SQL> select to_char(9939,'99G9G9') from dual;

    TO_CHAR
    -------
    99,3,9

    Note that a group separator cannot appear to the right of a decimal character or
    period in a number format model.

    11)L:

    L returns the local currency symbol in the specified position. The current value is specified by the parameter NLS_CURRENCY.
    Example:
    SQL> select to_char(9939,'L9999') from dual;

    TO_CHAR(9939,'L
    ---------------
    $9939

    SQL> select to_char(9939,'9999L') from dual;

    TO_CHAR(9939,'9
    ---------------
    9939$

    12)MI:
    For negative value MI returns a trailing minus sign (-).
    For positive value MI returns a trailing blank.
    Note that MI format element can appear only in the last position of a number format model.
    Example:

    SQL> select to_char(34,'9999MI') from dual;

    TO_CH
    -----
    34

    SQL> select to_char(-34,'9999MI') from dual;

    TO_CH
    -----
    34-

    13)PR:
    For negative value PR returns value in <angle brackets>.
    For positive value PR returns a a leading and trailing blank.
    Note that PR format element can appear only in the last position of a number format model.
    Example:

    SQL> select to_char(-34,'9999PR') from dual;

    TO_CHA
    ------
    <34>

    SQL> select to_char(34,'9999PR') from dual;

    TO_CHA
    ------
    34

    14)RN/rn:
    RN returns a value as Roman numerals in uppercase.
    rn returns a value as Roman numerals in lowercase.
    Note that value would be in the integer range between 1 and 3999. If it is outside range it can't display in Roman numerals.
    Example:

    SQL> select to_char(34,'RN') from dual;

    TO_CHAR(34,'RN'
    ---------------
    XXXIV

    SQL> select to_char(44434,'RN') from dual;

    TO_CHAR(44434,'
    ---------------
    ###############

    SQL> select to_char(434,'rn') from dual;

    TO_CHAR(434,'RN
    ---------------
    cdxxxiv

    15)S:
    If we use S as leading position in the format model like S999 then it
    returns negative value with a leading minus sign (-).
    returns positive value with a leading plus sign (+).

    And if we use S as trailing position in the format model like 999S then it
    returns negative value with a trailing minus sign (-).
    returns positive value with a trailing plus sign (+).
    Note that the S format element can appear only in the first or last position of a
    number format model.
    Example:

    SQL> select to_char(-434,'999S') from dual;

    TO_C
    ----
    434-

    SQL> select to_char(434,'S999') from dual;

    TO_C
    ----
    +434

    16)TM:
    TM The text minimum number format model returns (in decimal output) the smallest
    number of characters possible.

    The default is TM9, which means it will return the number in fixed notation unless the output exceeds 64 characters.

    If the output exceeds 64 characters, then Oracle Database automatically returns the number in scientific notation.
    Note that, you must use TM leading position in the format model and you can follow this element only with one 9 or one E (or e).
    Example:

    SQL> select to_char(343000,'TME') from dual;

    TO_CHAR(343000,'TME')
    -------------------------------------------------
    3.43E+05

    17)U:
    U returns the Euro (or other) dual currency symbol in the specified position. The return value is based on the NLS_DUAL_CURRENCY parameter.
    Example:

    SQL> select to_char(786,'U999') from dual;

    TO_CHAR(786,'U
    --------------
    $786

    18)V:
    V returns a value multiplied by power(10,n) (and if necessary, round it up), where n is the number of 9’s after the V.
    Example:

    SQL> select to_char(786,'999V9') from dual;

    TO_CH
    -----
    7860

    SQL> select to_char(786,'999V99') from dual;

    TO_CHA
    ------
    78600

    19)X:
    X returns the hexadecimal value of the specified number of digits. If the specified
    number is not an integer, then Oracle Database rounds it to an integer.

    Note that, while using X format models,
    - You can't use X format models on negative number.
    - The format model X only can precede with 0 or FM.
    - If you dont specify 0 or FM with X, then the return value always has one leading blank.
    Example:

    SQL> select to_char(17,'XXXXX') from dual;

    TO_CHA
    ------
    11

    SQL> select to_char(17,'0XXXXX') from dual;

    TO_CHAR
    -------
    000011

    SQL> select to_char(17,'FMXXXXX') from dual;

    TO_CHA
    ------
    11
    Related Documents

    Sunday, August 16, 2009

    Format Models in Oracle

    A format model in oracle describes the format of datetime or numeric data that to be inserted into database field. It is a character literal that does not change any internal representation of a value. It just represents how oracle will interprets the string(date or number) while inserting data into oracle database.

    Format model just represents how to be inserted into oracle database.

    With an example, I will make this understand.

    Let's create a table named test_format.
    SQL> create table test_format(col1 date);

    Table created.


    Now we try to insert date field into the table.
    SQL> insert into test_format values('11-09-09');
    insert into test_format values('11-09-09')
    *
    ERROR at line 1:
    ORA-01843: not a valid month


    And it fails because '11-09-09' is not recognized as a valid date in oracle. Oracle could not understand this format input. So we need to specify format and make it recognize to oracle about our input format model.

    Now try following sql.
    SQL> insert into test_format values (to_date('11-09-09','DD-MM-YY'));

    1 row created.

    And successfully row is inserted because here we recognize oracle about our input data using 'DD-MM-YY' format. This 'DD-MM-YY' is called the format model.

    If we query the table, we see.
    SQL> select * from test_format;

    COL1
    ---------
    11-SEP-09


    Which is not same as the format in which we inserted data. So we can say format models are just recognise the input data format, but it does not affect any internal represntation of stored data into database.

    Let's now see another example of how we can insert data into database.
    SQL> insert into test_format values('12-SEP-09');

    1 row created.


    Here, we see we did not use any format model but oracle recognize the data and successfully inserted into oracle database. It is because if you don't specify any format model of date then oracle implicitly using the initialization parameter NLS_TERRITORY and use the format model specified using NLS_TERRITORY parameter. Most specifically you can see it from NLS_DATE_FORMAT parameter.


    SQL> col property_value for a10
    SQL> select property_name, property_value from database_properties where property_name='NLS_DATE_FORMAT';

    PROPERTY_NAME PROPERTY_V
    ------------------------------ ----------
    NLS_DATE_FORMAT DD-MON-RR


    So you see here by default it can recongnize date format data specified in format DD-MON-RR and so it can recognize '12-SEP-09' but not 'SEP-12-09'.

    So we must need to use format model while inserting data into the database in order to recognize the format of our input whenever necessary.

    Related Documents

    Saturday, August 15, 2009

    Floating element using CSS Float

    Using CSS you can float an element either left or right using property float. Suppose you have a box and now using float property you can place the box either left or right. By using a simple example we see the effect of float.
    The code is,

    <p style="font-size:1.5em"><u> An example to demonstrate float:right</u></p>
    <div style="border-width:5px; color:rgb(200,0,0);border-color:rgb(100,0,0); border-style:ridge; width:20em; height:8em; float:right">
    This is a simple text; just for an example to demonstrate the float attribute. In this example we are seeing the effect of float:right effect.
    </div>

    And the output is,

    An example to demonstrate float:right



    This is a simple text; just for an example to demonstrate the float attribute. In this example we are seeing the effect of float:right effect.


    And now we see the effect of float:left.
    Code is,

    <p style="font-size:1.5em"><u> An example to demonstrate float:left</u></p>
    <div style="border-width:5px; color:rgb(200,0,0);border-color:rgb(100,0,0);
    border-style:ridge; width:20em; height:8em; float:left">
    This is a simple text; just for an example to demonstrate the float attribute. In this example we are seeing the effect of float:left effect.
    </div>


    And output is,

    An example to demonstrate float:left



    This is a simple text; just for an example to demonstrate the float attribute. In this example we are seeing the effect of float:left effect.


    Combining together,

    <p style="font-size:1.5em"><u> An example to demonstrate float:left</u></p>
    <div style="border-width:5px;
    color:rgb(200,0,0);
    border-color:rgb(100,0,0);
    border-style:ridge;
    width:20em;
    height:8em;
    float:left">
    This is a simple text; just for an example to demonstrate the float attribute. In this example we are seeing the effect of float:left effect.
    </div>
    <p style="font-size:1.5em"><u> An example to demonstrate float:right</u></p>
    <div style="border-width:5px;
    color:rgb(200,0,0);
    border-color:rgb(100,0,0);
    border-style:ridge;
    width:20em;
    height:8em;
    float:right">
    This is a simple text; just for an example to demonstrate the float attribute. In this example we are seeing the effect of float:right effect.
    </div>

    output,

    An example to demonstrate float:left



    This is a simple text; just for an example to demonstrate the float attribute. In this example we are seeing the effect of float:left effect.

    An example to demonstrate float:right



    This is a simple text; just for an example to demonstrate the float attribute. In this example we are seeing the effect of float:right effect.

    We can also divide a webpage into several columns. Like we can divide a page into 4 columns. The CSS then look like,

    <div style="border-width:5px;
    color:rgb(200,0,0);
    border-color:rgb(100,0,0);
    border-style:ridge;
    width:22%;
    height:3em;
    float:left " >
    This is a simple text.
    </div>
    <div style="border-width:5px;
    color:rgb(200,0,0);
    border-color:rgb(100,0,0);
    border-style:ridge;
    width:22%;
    height:3em;
    float:left">
    This is a simple text.
    </div>
    <div style="border-width:5px;
    color:rgb(200,0,0);
    border-color:rgb(100,0,0);
    border-style:ridge;
    width:22%;
    height:3em;
    float:left">
    This is a simple text.
    </div>
    <div style="border-width:5px;
    color:rgb(200,0,0);
    border-color:rgb(100,0,0);
    border-style:ridge;
    width:22%;
    height:3em;
    float:left">
    This is a simple text.
    </div>


    This is a simple text.

    This is a simple text.

    This is a simple text.

    This is a simple text.


    In the example of left and right example we see the right elements are moved up to fill the available space which is freed from the left box. This is default behaviour. In CSS float, by default, the subsequent elements are moved up to fill the available space which will be freed when a box is floated to a side. We can change this behaviour by using property clear.

    The property clear can have the values left, right, both or none. The principle is, if clear is set to both for a box, the top margin border of this box will always be under the lower margin border for possible floating boxes coming from above.

    Below is the example,

    <p style="font-size:1.5em"><u> An example to demonstrate float:left</u></p>
    <div style="border-width:5px;
    color:rgb(200,0,0);
    border-color:rgb(100,0,0);
    border-style:ridge;
    width:33%;
    height:8em;
    float:left " >
    This is a simple text; just for an example to demonstrate the float attribute. In this example we are seeing the effect of float:left effect.
    </div>
    <p style="font-size:1.5em; clear:both; "><u> An example to demonstrate float:right</u></p>
    <div style="border-width:5px;
    color:rgb(200,0,0);
    border-color:rgb(100,0,0);
    border-style:ridge;
    width:33%;
    height:8em;
    float:right">
    This is a simple text; just for an example to demonstrate the float attribute. In this example we are seeing the effect of float:right effect.
    </div>

    output is,

    An example to demonstrate float:left



    This is a simple text; just for an example to demonstrate the float attribute. In this example we are seeing the effect of float:left effect.

    An example to demonstrate float:right



    This is a simple text; just for an example to demonstrate the float attribute. In this example we are seeing the effect of float:right effect.







    Wednesday, August 12, 2009

    Position an element in CSS

    With the position property in CSS you can place an element exactly wherever you want inside an HTML page. With using of float you can have almost every combination of positioning an element.

    The positioning an element is based on the coordinates of the system. Suppose if we want to position word "ARJU" 200px from the top of the document and 300px from the left of the document with an addition attribute of red color and twice font size, then our CSS code will be,

    <div style="
    position:absolute;
    top:200px;
    left:300px;
    color:red ;font-size:2em" >Arju</div>

    the output is,
    Arju

    Note that where Arju word now positioned? In fact we have the control to put it anywhere as we want. Is not it interesting? :) Positioning an element with position parameter is really a good technique.

    The position can have a value of absolute or relative. The difference between absolute and relative is, how the position value is calculated.

    An element which is positioned absolute does not obtain any space in the document. This means that it does not leave an empty space after being positioned.

    The position for an element which is relatively positioned is calculated from the original position in the document. That means that you move the element to the right, to the left, up or down. This way, the element still obtains a space in the document after it is positioned.

    Following example should clear your idea,

    <div style="position:absolute; top:500px; left:300px; color:red ;font-size:2em" >Arju</div>
    <span style=" ">T1</span>
    <div style="position:relative; top:500px; left:300px; color:red ;font-size:2em" >Arju2</div>
    <span style=" ">T2</span>
    <div style="position:absolute; top:500px; left:305px; color:red ;font-size:2em" >Arju</div>
    <span style=" ">T3</span>

    If you run above CSS code, you will see after "position: relative" whenever you like to display T2 it is not in the same line as in T1. But after "position:absolute" it is displayed on the same line as T2. Also we displayed both "position: relative" and "position: absolute" in the top and left value. But relative one is slightly to the right, to the left, up or down.

    Arju
    T1
    Arju2
    T2
    Arju
    T3

    Here is more example about positioning of different boxes with top, left, right, bottom property.

    #box1 {
    position:absolute;
    top: 550px;
    left: 550px;
    }

    #box2 {
    position:absolute;
    top: 350px;
    right: 350px;
    }

    #box3 {
    position:relative;
    bottom: 250px;
    right: 350px;
    }

    #box4 {
    position:relative;
    bottom: 350px;
    left: 650px;
    }

    Related Documents