Monday, July 13, 2009

CSS Tutorial- Starting with CSS, how to use and integrate it.

CSS stands for Cascading Style Sheets. CSS is the very simple mechanism for adding style (this is fonts, colors, spacing) to Web pages. This post is about how to use css into an html documents and how these two can be work together. Step by step it is discussed of using css into html documents.

Step 1: Create a Html file.
Simply you can use notepad on windows or vi on unix to write a simple html file. You can use third party open source program like notepad++. But never use wordprocessor, such as Microsoft Word or OpenOffice. Because their outcome comes in different format and browser can't read it.

Note that in html comment starts with <!-- and ends with -->
My content of index.html is below.

<html>
<head>
<title>My first styled page</title>
</head>

<body>

<!-- Site navigation menu -->
<ul class="navigation_bar">
<li><a href="index.html">Home page</a>
<li><a href="products.html">Our Products</a>
<li><a href="contact_us.html">Contact us</a>
<li><a href="about_us.html">About us</a>
</ul>

<!-- Main content -->
<h1>This topic is one is for learning css</h1>

<p>Welcome to http://arjudba.blogspot.com

<p>It is just an example.
You can enhance it as you go on.
The style does not look so good.

<p>More learning materials
are coming soon.

<!-- Just publishing today's date with signature -->
<address>14th July, 2009.<br>
by Mohammad Abdul Momin Arju.</address>

</body>
</html>

In the example the tag <ul> introduces an "Unordered List", which means a list in which the items are not numbered. The <li> is the start of a "List Item." Note that <ul>, <p> does not need closing tags.

Step 2: Add some colours:
If you run codes of step1 you will see black text within white background. So with css we want to add some colours to background as well as to text. For css style we should make another file named style.css so that we can use that style for another html file. But in this post to make it easier, I am placing css styles in the same html file index.html. To do it we need to add a <style> element to the HTML file.

Let's see my style looks like,

<html>
<head>
<title>My first styled page</title>
<style type="text/css">
body {
color: green;
background-color: #ededed
}
</style>
</head>

<body>
etc...

Note that in case of adding css element there is followed by rules and each rule contains three part..

selector{
property:value;
}

1. The selector (in the example: "body"), which tells the browser which section of the web page will be affected by css style.

2. The property (in the example, 'color' and 'background-color' are both properties), which tells the browser what aspect of the layout is being set.

3. And the third one is value (in the example 'green' and '#ededed'), which gives the value for the style property.

Step 3: Add fonts
For good design and good look and feel you can add different fonts to different section of the page. For body Georgia font is used, if it is not available, Times New Roman or Times will be there, and if all else fails, the browser may use any other font with serifs.

For heading section Helvetica will be used. If not available Arial will be there, if both unavailable any fonts with sans-serif.

<html>
<head>
<title>My first styled page</title>
<style type="text/css">
body {
font-family: Georgia, "Times New Roman",
Times, serif;
color: purple;
background-color: #d8da3d }
h1 {
font-family: Helvetica, Arial, sans-serif }

</style>
</head>

Step 4: Add a navigation bar
We already have navigation menu at top of the page. But we want to move menu bar on left. This is done by css position property with a value of absolute. Also we need to position of body to the right so that menu and body does not overlap. We can move the body to the right by using padding-left property. So our css code now stands,

<html>
<head>
<title>My first styled page</title>
<style type="text/css">
body {
padding-left:14em;
font-family: Georgia, "Times New Roman",
Times, serif;
color: purple;
background-color: #d8da3d }
h1 {
font-family: Helvetica, Arial, sans-serif }
ul.navigation_bar{
position: absolute;
top: 2em;
left: 1em;
width: 9em }

</style>
</head>
<body>

Here measure 2em means 2 times the size of the current font. E.g., if the menu is displayed with a font of 14 points, then '2em' is 24 points. The 'em' is a very useful unit in CSS, since it can adapt automatically to the font that the reader happens to use.

Step 5: Style the links
Still now navigation menu looks like list. Using list-style-type property we will remove bullet. And we will make background as green of all menu items so that it looks like menu. To make each menu separate margin property would have a value. Also we will change the colours of the links. If user has not visited yet then make it blue and if user has visited link then we will make it purple.

Now it looks,

<html>
<head>
<title>My first styled page</title>
<style type="text/css">
body {
padding-left:14em;
font-family: Georgia, "Times New Roman",
Times, serif;
color: purple;
background-color: #d8da3d }
h1 {
font-family: Helvetica, Arial, sans-serif }
ul.navigation_bar{
list-style-type: none;
position: absolute;
top: 2em;
left: 1em;
width: 9em }
li{
background:green;
border:0;
padding:.5em;
margin:.3em;
}
a {
text-decoration: none }
a:link {
color: blue }
a:visited {
color: purple }

</style>
</head>

Step 6: Add a horizontal line
To make separate address from main page I am adding a horizontal line after body.
So just adding this line within style sheet.

address {
margin-top: 1em;
padding-top: 1em;
border-top: thin dotted }

Step 7: Put the style sheet in a separate file.
Now we are separating the syle sheet in another file so that we can use this style in many other web pages. Let's name this as style.css which looks like,

body {
padding-left:14em;
font-family: Georgia, "Times New Roman",
Times, serif;
color: purple;
background-color: #d8da3d }
h1 {
font-family: Helvetica, Arial, sans-serif }
ul.navigation_bar{
list-style-type: none;
position: absolute;
top: 2em;
left: 1em;
width: 9em }
li{
background:green;
border:0;
padding:.5em;
margin:.3em;
}
a {
text-decoration: none }
a:link {
color: blue }
a:visited {
color: purple }
address {
margin-top: 1em;
padding-top: 1em;
border-top: thin dotted }

Now from html file index.html reference it as,
<link rel="stylesheet" href="mystyle.css">
Our index.html looks like,

<html>
<head>
<title>My first styled page</title>
<link rel="stylesheet" href="style.css">

</style>
</head>


<body>

<!-- Site navigation menu -->
<ul class="navigation_bar">
<li><a href="index.html">Home page</a>
<li><a href="products.html">Our Products</a>
<li><a href="contact_us.html">Contact us</a>
<li><a href="about_us.html">About us</a>
</ul>

<!-- Main content -->
<h1>This topic is one is for learning css</h1>

<p>Welcome to http://arjudba.blogspot.com

<p>It is just an example.
You can enhance it as you go on.
The style does not look so good.

<p>More learning materials
are coming soon.

<!-- Just publishing today's date with signature -->
<address>14th July, 2009.<br>
by Mohammad Abdul Momin Arju.</address>

</body>
</html>

The output will be,







Sunday, July 12, 2009

SQL Decode

Syntax of SQL function Decode
The syntax of sql decode function is,

DECODE (expression,search,result[,default])
where search, result can be repeated many times as needed.
And default is optional.

How Decode Works
DECODE compares expression to each search value one by one. If expression is equal to a search, then corresponding result is returned. If expression does not match with search then Oracle returns default. As default is optional so it can be omitted and if omitted, then Oracle returns null.

Always remember that in a DECODE function, Oracle considers two nulls to be equivalent. So, if expression is null, then Oracle returns the result of the first search that is also null.

The maximum number of components in the DECODE function, including expression, searches, results, and default, is 255.

Data Conversion
- Oracle automatically converts expression and each search value to the datatype of the first search value before comparing. So the datatype of the first search value is a key role in decode.

- Oracle automatically converts the return value to the same datatype as the first result. So the first result plays a key role here.

- If the first result has the datatype CHAR or if the first result is null, then Oracle converts the return value to the datatype VARCHAR2. Again for the result it depends on the first datatype.

An example that demonstrate DECODE:
With an example below I will demonstrate DECODE, about how it works.
1)Create a table named country_list and insert data into it.

SQL> create table country_list(country_name varchar2(100));

Table created.

SQL> insert into country_list values('UK');

1 row created.

SQL> insert into country_list values('USA');

1 row created.

SQL> insert into country_list values('BAN');

1 row created.

SQL> insert into country_list values('PAK');

1 row created.

SQL> insert into country_list values('IND');

1 row created.

SQL> commit;

Commit complete.

SQL> select * from country_list;

COUNTRY_NAME
----------------------------------
UK
USA
BAN
PAK
IND

2)Now use DECODE function.
If the column value is UK then it will show United Kingdom.
If value is USA then it will show United States of America.
If value is BAN then it will show Bangladesh.
If value is PAK then it will show Pakistan.
If neither one matches then it will show default value OTHERS.

SQL> col country_name for a10
SQL> select country_name,
2 decode(country_name,'UK','United Kingdom',
3 'USA','United States of America',
4 'BAN','Bangladesh',
5 'PAK','PAKISTAN',
6 'OTHERS') from country_list;

COUNTRY_NA DECODE(COUNTRY_NAME,'UK'
---------- ------------------------
UK United Kingdom
USA United States of America
BAN Bangladesh
PAK PAKISTAN
IND OTHERS


You can also implement greater than or less than inside sql decode function. In case of number you can achieve that using SIGN function and in case of character you can achieve that using GREATEST function. Below is an example of using greatest function which will display whether name started less than M character or not.

SQL> select country_name, decode(
2 greatest(substr(country_name,1,1),'M'),'M'
3 ,'Name is between A to M','Name is between N to Z') from country_list;

COUNTRY_NA DECODE(GREATEST(SUBSTR
---------- ----------------------
UK Name is between N to Z
USA Name is between N to Z
BAN Name is between A to M
PAK Name is between N to Z
IND Name is between A to M

Related Documents

Saturday, July 11, 2009

ORA-39165: Schema SYS was not found ORA-39166, ORA-31655

Problem Description
This is a variant of error described in ORA-39166: Object was not found, SYS tables can't be exported. The ORA-39166 throws if you want to take data pump export of SYS objects using SYS user. And ORA-39165 throws if you want to take data pump export of SYS objects as a non-SYS user.

With a simple example problem is demonstrated here.

SQL> conn / as sysdba
Connected.
SQL> create table database_10g(col1 number);

Table created.

SQL> insert into database_10g values(23);

1 row created.

SQL> commit;

Commit complete.

SQL> host E:\oracle\product\10.2.0\db_2\BIN\expdp userid=arju/a tables=sys.database_10g dumpfile=sys_table_test.dmp

Export: Release 10.2.0.1.0 - Production on Saturday, 11 July, 2009 18:30:26

Copyright (c) 2003, 2005, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Starting "ARJU"."SYS_EXPORT_TABLE_01": userid=arju/******** tables=sys.database_10g dumpfile=sys_table_test.dmp
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 0 KB
ORA-39165: Schema SYS was not found.
ORA-39166: Object DATABASE_10G was not found.
ORA-31655: no data or metadata objects selected for job
Job "ARJU"."SYS_EXPORT_TABLE_01" completed with 3 error(s) at 18:30:36

It says both schema SYS and object table does not exist. But actually both are existed. Here is the proof.
SQL> conn arju/a
Connected.
SQL> desc sys.database_10g
Name Null? Type
----------------------------------------- -------- ----------------------------
COL1 NUMBER

SQL> select * from sys.database_10g ;

COL1
----------
23

SQL> select table_name, owner from dba_tables where table_name='DATABASE_10G';

TABLE_NAME OWNER
------------------------------ ------------------------------
DATABASE_10G SYS

Cause of the Problem
There is a restriction imposed in data pump export that SYS tables, objects are not exported even with full export option. Whenever we export by schemas=sys then role grants are exported but no data. Data pump does not allow to export system schemas like SYS, ORDSYS, EXFSYS, MDSYS, DMSYS, CTXSYS, ORDPLUGINS, LBACSYS, XDB, SI_INFORMTN_SCHEMA, DIP, DBSNMP and WMSYS in any mode.

Solution of the Problem
1)Use original export instead of data pump export to export SYS objects/schemas.

2)First using create table as select transfer SYS objects into non-restrictive schema and using data pump export data/tables from non-restrictive schema.

So the conclusion is the SYS schema, SYS tables cannot be used as a source schema for data pump export jobs.

Related Documents

In 11g data pump export schemas=sys do export only role grants

In the post http://arjudba.blogspot.com/2009/07/ora-39165-schema-sys-was-not-found-ora.html and http://arjudba.blogspot.com/2009/07/ora-39166-object-was-not-found-sys.html it is shown that the SYS schema objects or tables cannot be used as a source schema for data pump export jobs.

In this post it is shown if we specify schemas=sys option while data pump export then what it actually does. Of course no tables, indexes, constraint, procedures, packages, triggers are exported. Only role grant are exported.

SQL> host expdp userid=\"/ as sysdba\" dumpfile=sys_test_dump.dmp schemas=sys

Export: Release 11.1.0.6.0 - Production on Saturday, 11 July, 2009 18:17:04

Copyright (c) 2003, 2007, Oracle. All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SYS"."SYS_EXPORT_SCHEMA_01": userid="/******** AS SYSDBA" dumpfile=sys_test_dump.dmp schemas=sys
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 0 KB
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Master table "SYS"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYS.SYS_EXPORT_SCHEMA_01 is:
D:\APP\ARJU\ADMIN\ARJU\DPDUMP\SYS_TEST_DUMP.DMP
Job "SYS"."SYS_EXPORT_SCHEMA_01" successfully completed at 18:17:23

Let's see the contents inside dumpfile.
SQL> host impdp userid=\"/ as sysdba\" dumpfile=sys_test_dump.dmp sqlfile=inside_dump.txt

Import: Release 11.1.0.6.0 - Production on Saturday, 11 July, 2009 18:18:29

Copyright (c) 2003, 2007, Oracle. All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "SYS"."SYS_SQL_FILE_FULL_01" successfully loaded/unloaded
Starting "SYS"."SYS_SQL_FILE_FULL_01": userid="/******** AS SYSDBA" dumpfile=sys_test_dump.dmp sqlfile=inside_dump.txt
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Job "SYS"."SYS_SQL_FILE_FULL_01" successfully completed at 18:18:33

The contents inside_dump.txt is as follows.
-- CONNECT SYS
ALTER SESSION SET EDITION = "ORA$BASE";
-- new object type path: SCHEMA_EXPORT/ROLE_GRANT
-- CONNECT SYSTEM
ALTER SESSION SET EDITION = "ORA$BASE";
GRANT "CONNECT" TO "SYS" WITH ADMIN OPTION;

GRANT "DBA" TO "SYS" WITH ADMIN OPTION;

GRANT "SELECT_CATALOG_ROLE" TO "SYS" WITH ADMIN OPTION;

GRANT "EXECUTE_CATALOG_ROLE" TO "SYS" WITH ADMIN OPTION;

GRANT "DELETE_CATALOG_ROLE" TO "SYS" WITH ADMIN OPTION;

GRANT "EXP_FULL_DATABASE" TO "SYS" WITH ADMIN OPTION;

GRANT "IMP_FULL_DATABASE" TO "SYS" WITH ADMIN OPTION;

GRANT "LOGSTDBY_ADMINISTRATOR" TO "SYS" WITH ADMIN OPTION;

GRANT "AQ_ADMINISTRATOR_ROLE" TO "SYS" WITH ADMIN OPTION;

GRANT "AQ_USER_ROLE" TO "SYS" WITH ADMIN OPTION;

GRANT "DATAPUMP_EXP_FULL_DATABASE" TO "SYS" WITH ADMIN OPTION;

GRANT "DATAPUMP_IMP_FULL_DATABASE" TO "SYS" WITH ADMIN OPTION;

GRANT "GATHER_SYSTEM_STATISTICS" TO "SYS" WITH ADMIN OPTION;

GRANT "RECOVERY_CATALOG_OWNER" TO "SYS" WITH ADMIN OPTION;

GRANT "SCHEDULER_ADMIN" TO "SYS" WITH ADMIN OPTION;

GRANT "HS_ADMIN_ROLE" TO "SYS" WITH ADMIN OPTION;

GRANT "OEM_ADVISOR" TO "SYS" WITH ADMIN OPTION;

GRANT "OEM_MONITOR" TO "SYS" WITH ADMIN OPTION;

GRANT "JAVAUSERPRIV" TO "SYS" WITH ADMIN OPTION;

GRANT "JAVAIDPRIV" TO "SYS" WITH ADMIN OPTION;

GRANT "JAVASYSPRIV" TO "SYS" WITH ADMIN OPTION;

GRANT "JAVADEBUGPRIV" TO "SYS" WITH ADMIN OPTION;

GRANT "EJBCLIENT" TO "SYS" WITH ADMIN OPTION;

GRANT "JMXSERVER" TO "SYS" WITH ADMIN OPTION;

GRANT "JAVA_ADMIN" TO "SYS" WITH ADMIN OPTION;

GRANT "JAVA_DEPLOY" TO "SYS" WITH ADMIN OPTION;

GRANT "CTXAPP" TO "SYS" WITH ADMIN OPTION;

GRANT "XDBADMIN" TO "SYS" WITH ADMIN OPTION;

GRANT "XDB_SET_INVOKER" TO "SYS" WITH ADMIN OPTION;

GRANT "AUTHENTICATEDUSER" TO "SYS" WITH ADMIN OPTION;

GRANT "XDB_WEBSERVICES" TO "SYS" WITH ADMIN OPTION;

GRANT "XDB_WEBSERVICES_WITH_PUBLIC" TO "SYS" WITH ADMIN OPTION;

GRANT "XDB_WEBSERVICES_OVER_HTTP" TO "SYS" WITH ADMIN OPTION;

GRANT "ORDADMIN" TO "SYS" WITH ADMIN OPTION;

GRANT "OLAPI_TRACE_USER" TO "SYS" WITH ADMIN OPTION;

GRANT "OLAP_XS_ADMIN" TO "SYS" WITH ADMIN OPTION;

GRANT "OLAP_DBA" TO "SYS" WITH ADMIN OPTION;

GRANT "CWM_USER" TO "SYS" WITH ADMIN OPTION;

GRANT "OLAP_USER" TO "SYS" WITH ADMIN OPTION;

GRANT "SPATIAL_WFS_ADMIN" TO "SYS" WITH ADMIN OPTION;

GRANT "WFS_USR_ROLE" TO "SYS" WITH ADMIN OPTION;

GRANT "SPATIAL_CSW_ADMIN" TO "SYS" WITH ADMIN OPTION;

GRANT "CSW_USR_ROLE" TO "SYS" WITH ADMIN OPTION;

GRANT "WKUSER" TO "SYS" WITH ADMIN OPTION;

GRANT "MGMT_USER" TO "SYS" WITH ADMIN OPTION;

GRANT "OWB$CLIENT" TO "SYS" WITH ADMIN OPTION;

GRANT "OWB_DESIGNCENTER_VIEW" TO "SYS" WITH ADMIN OPTION;

GRANT "OWB_USER" TO "SYS" WITH ADMIN OPTION;
Related Documents

ORA-39166: Object was not found, SYS tables can't be exported

In case of original export we could easily export the tables those were inside under SYS schema.

But whenever you try to export a table from sys schema using expdp it fails with ORA-39166: Object was not found. With a simple example the scenario is demonstrated below.

1)Log on as sysdba.
SQL> conn / as sysdba
Connected.

2)Create a test table and insert data into it.
SQL> create table test_export_for_sys(value1 number);

Table created.

SQL> insert into test_export_for_sys values(55);

1 row created.

SQL> commit;

Commit complete.

3)Try to take a data pump export of this table.
SQL> host expdp userid=\"/ as sysdba\" dumpfile=sys_test.dmp tables=test_export_for_sys

Export: Release 11.1.0.6.0 - Production on Saturday, 11 July, 2009 15:01:39

Copyright (c) 2003, 2007, Oracle. All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SYS"."SYS_EXPORT_TABLE_01": userid="/******** AS SYSDBA" dumpfile=sys_test.dmp tables=test_export_for_sys
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 0 KB
ORA-39166: Object TEST_EXPORT_FOR_SYS was not found.
ORA-31655: no data or metadata objects selected for job
Job "SYS"."SYS_EXPORT_TABLE_01" completed with 2 error(s) at 15:01:45

But in the database there exists test_export_for_sys table,

SQL> desc test_export_for_sys
Name Null? Type
----------------------------------------- -------- -------------
VALUE1 NUMBER

SQL> select * from test_export_for_sys;

VALUE1
----------
55

SQL> show user;
USER is "SYS"

If you try to export schema also no tables are exported.
SQL> host expdp userid=\"/ as sysdba\" dumpfile=sys_test_schema.dmp schemas=sys

Export: Release 11.1.0.6.0 - Production on Saturday, 11 July, 2009 19:14:56

Copyright (c) 2003, 2007, Oracle. All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SYS"."SYS_EXPORT_SCHEMA_01": userid="/******** AS SYSDBA" dumpfile=sys_test_schema.dmp schemas=sys
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 0 KB
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Master table "SYS"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYS.SYS_EXPORT_SCHEMA_01 is:
D:\APP\ARJU\ADMIN\ARJU\DPDUMP\SYS_TEST_SCHEMA.DMP
Job "SYS"."SYS_EXPORT_SCHEMA_01" successfully completed at 19:16:12


But this is not the fact in case of original export. Here is the original export output,

SQL> host exp userid=\"/ as sysdba\" file=sys_test.dmp tables=test_export_for_sys

Export: Release 11.1.0.6.0 - Production on Sat Jul 11 17:42:29 2009

Copyright (c) 1982, 2007, Oracle. All rights reserved.


Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set

About to export specified tables via Conventional Path ...
. . exporting table TEST_EXPORT_FOR_SYS 1 rows exported
Export terminated successfully without warnings.

Solution of the Problem
This is the restriction imposed in oracle data pump. A number of system schemas tables cannot be exported because they are not user schemas, they contain Oracle-managed data and metadata. As in every schemas there by default system schemas exist. Data pump utility designed for transferring data, not the database; so not the system schemas. However if you want to export sys tables like SYS.AUD$ then first transfer that table into non-restricted schema and export the table from non restricted schema.

Related Documents

Friday, July 10, 2009

Import data into an existing table-TABLE_EXISTS_ACTION(ORA-39151)

In many cases we need to import data into in existing table. A common example is you take a data pump export, truncate the table, then table undergoes for normal operation. Suddenly your manager ask to get back old data while running in tact current operation as well as leave current data in place. Just you need to append data into an existing table.

Both original export and data pump export can be used to append data into an existing table but data pump import offer flexible option.

Below is an example about the happenings to import a table which already exist in the database.

SQL> $impdp arju/a

Import: Release 11.1.0.6.0 - Production on Friday, 10 July, 2009 23:07:08

Copyright (c) 2003, 2007, Oracle. All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "ARJU"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "ARJU"."SYS_IMPORT_FULL_01": arju/********
Processing object type TABLE_EXPORT/TABLE/TABLE
ORA-39151: Table "ARJU"."TEST" exists. All dependent metadata and data will be skipped due to table_exists_action of skip
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Job "ARJU"."SYS_IMPORT_FULL_01" completed with 1 error(s) at 23:07:13

In data pump import the parameter TABLE_EXISTS_ACTION help to do the job. The default value of this parameter is SKIP which means if table to be imported already existed in the database table will be skipped and data not to be imported and continue processing next object. However if in your import job if CONTENT=DATA_ONLY is specified, the default is APPEND, and then data will be appended into existing table.

TABLE_EXISTS_ACTION can have following values.

1)SKIP: It leaves the table as is and moves on to the next object. This is not a valid option if the CONTENT parameter is set to DATA_ONLY.

2)APPEND: This option loads rows from the source and leaves existing rows unchanged. This is a default option is CONTENT=DATA_ONLY is specified.

3)TRUNCATE: This option deletes existing rows and then loads rows from the source.

4)REPLACE: This option drops the existing table in the database and then creates and loads it from the source. This is not a valid option if the CONTENT parameter is set to DATA_ONLY.

Important Note
- If you use TRUNCATE or REPLACE, make sure that rows in the affected tables are not targets of any referential constraints.

- If you use SKIP, APPEND, or TRUNCATE then existing table dependent objects in the source, such as indexes, grants, triggers, and constraints, are ignored. In case of REPLACE, the dependent objects are dropped and again created from the source, if they were not explicitly or implicitly excluded (using EXCLUDE) and they exist in the source dump file or system.

- If you use APPEND or TRUNCATE, checks are made to ensure that rows from the source are compatible with the existing table prior to performing any action. If the existing table has active constraints and triggers, it is loaded using the external tables access method. If any row violates an active constraint, the load fails and no data is loaded. You can override this behavior by specifying DATA_OPTIONS=SKIP_CONSTRAINT_ERRORS on the Import command line.

If you want data must be loaded but causes constraint voilations, you can disable constraints, import data, delete the rows which causes problems and then enable constraints.

- When you use APPEND, the data is always loaded into new space. So if you have any existing space available the space is not reused. So after the import operation, you may wish to compress your data after the load.

- TRUNCATE cannot be used on clustered tables or over network links.

In case of original import use ignore=y option to append data into an existing table. ignore=y causes rows to be imported into existing tables without any errors or messages being given.
Related Documents

Step by step to create a paypal donation button

Many one specially if you are a blogger or webmaster or own a site, you might show an interest to create a paypal donation button and integrate it inside your page so that you can accept online donation through paypal. I myself run this blog http://arjudba.blogspot.com and like to add a paypal donation button. I am sharing the steps so that you too can do it in your site.

Step by step procedure to create PayPal donation button.

1. Login your PayPal account. You will see "My Account". Click on the "Merchant Tools". Scroll down and click to "Website Payments Standard".

2.Click on "Create payment buttons". You will see "Create PayPal payment button" page. There is three steps. In,
Step 1: Choose button type and enter payment details
-Select Accept payment for from dropdown menu. You can select "Donations".

-You can select customized button, country, language, you have the option to use your own button image, currency.

-The important radio box is "Contribution amount". You have two options, 1)Donors enter their own contribution amount. 2)Donors contribute a fixed amount. If you select 2) the donator cannot donate more than or less than the specified amount.

-From the Merchant ID for purchase transactions radiobox it is better to choose Secure merchant account ID. If you choose a plain text e-mail address, it will be displayed in the button code. So, anyone, including spammers, can copy this address for their own use.

3.Step 2)Track inventory, profit & loss (optional)
and Step 3: Customize advanced features (optional)
both are optional and they are only available if you upgrade to a PayPal Business account.

4.Click "Create Button".

5.You will see a HTML code for the donation button. Copy it and paste it into your website. Done.

Here is my PayPal donation button. It is real! Click it to donate USD$1 to me, credit card accepted. :)







Advanced Techniques
Below is the code which accept a fixed amount 10$ for donation.
<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="aly.mir1@gmail.com">
<input type="hidden" name="item_name" value="Team In Training">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="amount" value="10.00">
<input type="image" src="http://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>

If you paste above code inside your site it will look like,









Related Documents
http://arjudba.blogspot.com/2009/07/draw-google-adsense-money-using-western.html
http://arjudba.blogspot.com/2009/06/debit-card-credit-card-atm-card-charge.html