HANDY ONE-LINERS FOR SED (Unix stream editor)

HANDY ONE-LINERS FOR SED (Unix stream editor) Apr. 26, 2004 compiled by Eric Pement - pemente[at]northpark[dot]edu version 5.4Latest version of this file is usually at: http://sed.sourceforge.net/sed1line.txtTYPICAL USE: Sed takes one or more editing commands and applies all of them, in sequence, to each line of input. After all the commands have been applied to the first input line, that line is output and a second input line is taken for processing, and the cycle repeats. The preceding examples assume that input comes from the standard input device (i.e, the console, normally this will be piped input). One or more filenames can be appended to the command line if the input does not come from stdin. Output is sent to stdout (the screen). more »

HANDY ONE-LINERS FOR AWK

HANDY ONE-LINERS FOR AWK 22 July 2003 compiled by Eric Pement version 0.22Latest version of this file is usually at: http://www.student.northpark.edu/pemente/awk/awk1line.txtMost of my experience comes from version of GNU awk (gawk) compiled for Win32. Note in particular that DJGPP compilations permit the awk script to follow Unix quoting syntax '/like/ {"this"}'.However, the user must know that single quotes under DOS/Windows do not protect the redirection arrows ( ) nor do they protect pipes (|). Both are special symbols for the DOS/CMD command shell and their special meaning is ignored only if they are placed within "double quotes." more »

Rebuild all the users index directly

Userful DBA script for rebuilding indexes online. more »

Get all tables accessibles by users and the reason

You know the all_tables view. It gives you all the tables you can access. But who doesn't ask "which are the tables user foo can access ?" and "why can he access this table".The following view gives you for all users (column username), the owner and the name of the accessible tables (columns owner and table_name) and the origin of the access privilege (column why) with: more »

How to follow the growth of your database

As a DBA, it was often asked me how the database grows and when we'll full up the disc space. Now, when i create a database, i automatically add a job to follow the space occupation. more »

How to get the object when you have a file# and a block#

Often you get a message (for instance, corruption) or query dynamic table (for instance, hot block) giving you a file and a block. This tip will show you how to retrieve the object belonging to these informations. more »

How to get all objects that can't extend and the reason

This query will give you how to find all the objects that can't extend and the reason why they can't extend: max extent reached, no free extend in the tablespace to fit the next extent, quota exceeded: more »

How to copy all the privileges from one user to another

When we add a new user we often have to grant him some privileges that are the same of another previous user. The following script generates a script to copy all the privileges from one user to another. It needs 3 parameters : more »

Creating Virtual Private Databases with Oracle

With Oracle 8i/9i, you can implement security?once, in the server?and give users, customers, and suppliers access to production systems at the same time.Achieving the right balance between providing appropriate access and enforcing security is no easy task. Giving each user access to all that he or she needs?but only that?can involve complex development and administration scenarios, particularly with a large number of applications and different types of users requiring different levels of access?administrator or user, manager or staff, marketing or manufacturing, for example. more »

EXPLAIN PLAN :: Demystification - Part 2

Whenever you read or write data in Oracle, you do so by issuing an SQL Statement. One of Oracle's task when it receives such a statement is to build a statement execution plan. An execution plan defines how Oracle finds or writes the data. For example, an important decision that Oracle has to take is if it uses indexes or not. And if there are more indexes, which of these is used. All this is contained in an execution plan.If one wants to explore such an execution plan, Oracle provides the SQL Statement EXPLAIN PLAN to determine this.The general syntax of EXPLAIN PLAN is: more »

EXPLAIN PLAN :: Demystification - Part 1

In TOAD simply write your query, then hit Ctrl-E to display your explain plan. If you see a permissions window popup regarding access to the PLAN_TABLE, then coordinate with DBA's to obtain the appropriate grants. Generally speaking low cost means better performance. Fewer outer joins and full table scans, generally means better performance. Remember also, that under your TOAD options, your Plan Table should be defined as PLAN_TABLE and the explain identifier is your workstation id.In SQLPLUS you will need to run a statement like the following : more »

Create a Temporary Work table

Occassionally you may run into a situation which requires you to capture some test information while your process is running. You could always create a standardized log table just for your process and log items to it. You could even build one specific to your process. However, often it would be nice if there was already something there that you could easily use any time.What I might suggest is the creation of a temporary log table. This table would have a key identifier on it to separate your items from other individuals/processes logging to the table. Also it would have some date, number, character, blob, clob fields to pass data into.In your stored proc, you would have code to insert data into the table as your process runs. Then you could simply review the table when things are completed. I would recommend cleaning up your data from the temporary table when you are done analyzing the data. more »

Oracle Applications :: Processing Applicants and Hires

Well our Applicant Tracking project is off and running. It has been quite the tangled path too. I didn't really have any knowledge of how to process Hires into the OA environment, let alone applicants. My trusty skills at google and metalink did not help too much either.For obvious reasons I can't divulge my entire packaged solution, however given the trouble I had finding anything, I will divulge some secrets. more »

Batch Element Entry Loader process

Batch Element Entry has significant advantages over PAYMIX, but it should also be noted that PAYMIX is being phased out in 11.5.4 of the application. BEE can be utilized manually, but can be batch loaded as well. In 11.0.3 the application did not provide the api's required for loading, so we emulated the PAYMIX api's on our own. These were later replaced by 11.5.4 api's. more »

Email Files Script for OraApps

We ran into a situation where we needed to email encrypted zip files to a client generated from reports. Using the Oracle Applications as a platform for entering the parms, I created a simple approach to fulfilling this requirement. It could be expanded to support PGP, Mime attachments, etc. However, it works as is. To see the setup of job and shell script, click the Read More link below. more »

Not on 10g yet and need CLOB2BLOB or BLOB2CLOB conversion ?

Noticed that on 10g there is functionality for CLOB to BLOB and BLOB to CLOB converson. Problem is that we are a few months away still from being on 10g. So whats a 9iR2 guy supposed to do... write your own.Here are two handy functions you can use.. not sure what the max size conversions is but I would assume whatever LOB size max is.. so 4 GB for now ? and in 10g+ ... Terrabytes. more »

RANKING FUNCTION [RANK vs ROW_NUMBER vs DENSE_RANK]

Always forgetting about these useful functions... and even we do, how to use them to our advantage....Ranking Function Rank:-assigns A Unique Number For Each Row Starting With 1,except For Rows That Have Duplicate Values,in Which Case The Same Ranking Is Assigned And A Gap Appears In The Sequence For Each Duplicate Ranking.Row_number:-returns A Unique Number For Each Row Starting With 1.for Rows That Have Duplicate Values,numbers Are Arbitarily Assigned.Dense_rank:-assigns A Unique Number For Each Row Starting With 1,except For Rows That Have Duplicate Values ,in Which Case Same Ranking Is Assigned. more »

Stardate entry 2009.01.29.072926

Thought I would migrate away from my CMS setup of previous to a blob type environment. A bit easier to run in and post something without all the frills. So this makes for my first entry of many to come. Initially, it will be just catch up until I get everything posted. So stay tuned and enjoy. more »

Migrate from Windows XP 64bit to Ubuntu Intrepid Ibex 8.10 64bit

I’ve been using the newest and the greatest version of Ubuntu (Intrepid 8.10) for almost a month now and I’m happy with it Finally I’m using a Linux OS, and not even dual booting.. I’m an RHCT who’s aiming to be an RHCE by… more »