by http://webgeektutorials.blogspot.com

Tuesday, February 28, 2012

Detecting IPhone Device

There are few ways you can detect Iphone Device, and tell browser to behave accordingly. The iPhone launched with this user agent:

Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3

Todetect User Agent
Using ASP code
For those on a Windows Server, create a file called user-agent.asp and put the following lines of code in:
<%
Response.Write Request.ServerVariables (“HTTP_USER_AGENT”)
%>
Using PHP Code
For those on Linux based servers
<?php

Friday, February 17, 2012

Data Pump in Oracle Database 10g

Oracle Data Pump is a newer, faster and more flexible alternative to the "exp" and "imp" utilities used in previous Oracle versions. In addition to basic import and export functionality data pump provides a PL/SQL API and support for external tables.

Getting Started

For the examples to work we must first unlock the SCOTT account and create a directory object it can access:
CONN sys/password@db10g AS SYSDBA
ALTER USER scott IDENTIFIED BY tiger ACCOUNT UNLOCK;
GRANT CREATE ANY DIRECTORY TO scott;
 
CREATE OR REPLACE DIRECTORY test_dir AS '/u01/app/oracle/oradata/';
GRANT READ, WRITE ON DIRECTORY test_dir TO scott;

Table Exports/Imports

The TABLES parameter is used to specify the tables that are to be exported. The following is an example of the table export and import syntax:
expdp scott/tiger@db10g tables=EMP,DEPT directory=TEST_DIR 
dumpfile=EMP_DEPT.dmp logfile=expdpEMP_DEPT.log
 
impdp scott/tiger@db10g tables=EMP,DEPT directory=TEST_DIR 
dumpfile=EMP_DEPT.dmp logfile=impdpEMP_DEPT.log


For example output files see expdpEMP_DEPT.log and impdpEMP_DEPT.log.

The
TABLE_EXISTS_ACTION=APPEND parameter allows data to be imported into existing tables.

Schema Exports/Imports

The OWNER parameter of exp has been replaced by the SCHEMAS parameter which is used to specify the schemas to be exported. The following is an example of the schema export and import syntax:
expdp scott/tiger@db10g schemas=SCOTT directory=TEST_DIR 
dumpfile=SCOTT.dmp logfile=expdpSCOTT.log
 
impdp scott/tiger@db10g schemas=SCOTT directory=TEST_DIR 
dumpfile=SCOTT.dmp logfile=impdpSCOTT.log
For example output files see expdpSCOTT.log and impdpSCOTT.log.