Tuesday, May 28, 2013

Global Temporary Tables in Oracle

Global temporary table exists solely for your session or whose data persists for the duration of your transaction.

When you create a temporary table, you can specify whether
- it should last for the duration of your session (on commit preserve rows)
- or whether its rows should be deleted when the transaction completes (on commit delete rows)

Unlike a permanent table, a temporary table does not automatically allocate space when it is created. Space will be dynamically allocated for the table as rows are inserted:

create global temporary table EMP
(
    EMPNO NUMBER(4),
    ENAME VARCHAR2(9),
    SALARY NUMBER
)
on commit preserve rows;

 Global temporary tables are very useful in optimizing a oracle transaction basically a large PL/SQL block, where we need to hold a large set of data temporary.




Tuesday, May 21, 2013

Create External Table from CSV File

Follow these simple Steps 
 
1) Create a Directory
2) Grant Read/Write Permission to that Directory
3) Place your CSV file in that directory at OS Level
4) Create EXTERNAL Table

For Example: 
 
1) create or replace directory MYCSV as 'E:\test'; 
 Note: E:\test has to be physical location on disk.
 
2) grant read, write on directory MYCSV to scott;

3) Put your csv file on E:\test at OS level

4) create table ext_table
   (
     ENAME VARCHAR2(10),
     DNAME VARCHAR2(14),
     JOB VARCHAR2(9)
   )
   organization external
   (
     type ORACLE_LOADER
     default directory MY_DIR
     access parameters 
     (
       records delimited by newline
       fields terminated by "~"
     )
     location ('testfile.csv')
   )
   reject limit unlimited;

   
To create this CSV File you may use following command

set pagesize 0 newpage 0 feedback off

select ENAME || '~' || DNAME || '~' || JOB from SCOTT.EMP, SCOTT.DEPT 
WHERE EMP.DEPTNO=DEPT.DEPTNO;

spool E:\test\testfile.csv
/
spool off


Oracle Default Username and Password

Here is the complete List of Default username and passwords

User Name Default Password Script (in $ORACLE_HOME) Additional Information
ANONYMOUS ANONYMOUS /rdbms/admin/catqm.sql Allows HTTP access to Oracle XML DB.
APEX_PUBLIC_USER APEX_PUBLIC_USER /apex/apexins.sql The Oracle Database Application Express account
BI CHANGE_ON_INSTALL / BI /demo/schema/bus_intelligence/bi_main.sql Sample Schema
CTXSYS CHANGE_ON_INSTALL / CTXSYS /ctx/admin/ctxsys.sql To administer Oracle Text
DBSNMP DBSNMP /rdbms/admin/catsnmp.sql Used by the Management Agent of OEM to monitor and manage DB
DIP DIP /rdbms/admin/catdip.sql for Oracle Internet Directory-enabled Oracle Label Security
EXFSYS EXFSYS /rdbms/admin/exfsys.sql Used internally and enables us to build complex PL/SQL rules and expressions
FLOWS_FILES FLOWS_FILES /apex/apexins.sql Owns objects created during installation of Oracle Database Application Express
HR CHANGE_ON_INSTALL / HR /demo/schema/human_resources/hr_main.sql Sample Schema
IX CHANGE_ON_INSTALL / IX /demo/schema/info_exchange/ix_main.sql Sample Schema
MDDATA MDDATA /md/admin/catmd.sql Used by Oracle Spatial Feature
MDSYS MDSYS /ord/admin/ordinst.sql The Oracle Spatial and Oracle Multimedia Locator administrator account
MGMT_VIEW MGMT_VIEW /sysman/admin/emdrep/bin/RepManager Used by Oracle Enterprise Manager Database Control
OE CHANGE_ON_INSTALL / OE /demo/schema/order_entry/oe_main.sql Sample Schema
OLAPSYS MANAGER / OLAPSYS /olap/admin/amdsys.sql Owns the OLAP Catalog, has been deprecated
ORACLE_OCM ORACLE_OCM /rdbms/admin/catocm.sql Associate the configuration information of Database instance with OracleMetaLink
ORDPLUGINS ORDPLUGINS /ord/admin/ordinst.sql Enables Oracle Database to store, manage and retrieve heterogeneous media data
ORDSYS ORDSYS /ord/admin/ordinst.sql Oracle Multimedia administrator account
OUTLN OUTLN /rdbms/admin/sql.bsq (after recovery) Provides plan stability prevents certain db environment changes from affecting performance characteristics
OWBSYS OWBSYS /owb/UnifiedRepos/cat_owb.sql For administrating the Oracle Warehouse Builder repository
PM CHANGE_ON_INSTALL / PM /demo/schema/product_media/pm_main.sql Sample Schema
SCOTT TIGER /rdbms/admin/utlsampl.sql Sample Schema
SH CHANGE_ON_INSTALL / SH /demo/schema/sales_history/sh_main.sql Sample Schema
SI_INFORMTN_SCHEMA SI_INFORMTN_SCHEMA /ord/admin/ordinst.sql Stores the information views for the SQL/MM Still Image Standard
SPATIAL_CSW_ADMIN_USR SPATIAL_CSW_ADMIN_USR /md/admin/sdocswpv.sql Used by Oracle Spatial CSW Cache Manager to load record-type metadata andrecord instances
SPATIAL_WFS_ADMIN_USR SPATIAL_CSW_ADMIN_USR /md/admin/sdowfspv.sql Used by Oracle Spatial WFS Cache Manager to load all feature type metadata and feature instances
SYS CHANGE_ON_INSTALL /rdbms/admin/sql.bsq (after recovery) An account used to perform database administration tasks
SYSMAN OEM_TEMP /rdbms/admin/sql.bsq (after recovery) The account used to perform Oracle Enterprise Manager administration tasks
SYSTEM MANAGER /rdbms/admin/sql.bsq (after recovery) Default generic database administrator account
WMSYS WMSYS /rdbms/admin/owmctab.plb Used to store the metadata information for Oracle Workspace Manager.
XDB CHANGE_ON_INSTALL / XDB /rdbms/admin/catqm.sql Provides high-performance XML storage and retrieval
XS$NULL
/rdbms/admin/sql.bsq (after recovery) Represents the absence of a user in a session


Monday, May 6, 2013

Documents that may help you get a job



I have 4 documents that may help you get a job.

1) A checklist with 160 items.
The items are divided into these categories:
• Marketing yourself
• Keeping track of the places you submit your resume to
• Preparing for the interview
• Immediately before the interview
• During the interview
• Immediately after the interview
• After a rejection letter
• After a offer letter
• Business cards and signature block for all correspondence

2) an outline of important things to say and do at the interview.
A document to take to the interview. There are 63 items on this outline. The items are divided into these categories:
• Tell me about yourself
• The top 3 points you want to make sure you get across.
• What makes me different:•
• Job related questions to ask at the beginning of the interview. For example:
• Job related questions to ask at the end of the interview. For example:
• My Strengths:
• My Weaknesses:
• Future employment goals
• Gap in work
• Elevator speech

3) An excel spreadsheet used to keep track of:
• The places you have applied for work at
• Each time you have communicated with those places.
• What was said and if it was an email, phone call, in person interview, phone interview etc.
• The phone number, address etc. of the head hunters and employers

4) A document is all about cover letters.
Fallow up letters, letters of introduction, post interview letter, post rejection latter etc