Posts

Showing posts from August, 2015

Create Materialized Views

Create table table for views: CREATE TABLE ABC  ( FNAME VARCHAR2(20 BYTE)  , LNAME VARCHAR2(20 BYTE)  , ID NUMBER NOT NULL  , UPD_TSTAMP TIMESTAMP(6) DEFAULT systimestamp ) TABLESPACE USERS; CREATE UNIQUE INDEX ABC_PK ON ABC (ID ASC)  LOGGING  TABLESPACE USERS ; ALTER TABLE ABC ADD CONSTRAINT ABC_PK PRIMARY KEY  ( ID ) USING INDEX ABC_PK ENABLE; Insert some data into it table: SET DEFINE OFF; Insert into ABC (FNAME,LNAME,ID,UPD_TSTAMP) values ('ravi','reddy',2,to_timestamp('09-JAN-15 11.44.39.000000000 AM','DD-MON-RR HH.MI.SSXFF AM')); Insert into ABC (FNAME,LNAME,ID,UPD_TSTAMP) values ('arvind','reddy',3,to_timestamp('16-JAN-15 12.06.01.293176000 PM','DD-MON-RR HH.MI.SSXFF AM')); Insert into ABC (FNAME,LNAME,ID,UPD_TSTAMP) values ('raghu','kumar',4,to_timestamp('20-JAN-15 04.33.35.616985000 PM','DD-MON-RR HH.MI.SSXFF AM')); Insert into ABC (FNAME,LNAME,ID,UPD_TSTAMP) values ('ranii'...

Materialized Views

Create table table for views: CREATE TABLE ABC  ( FNAME VARCHAR2(20 BYTE)  , LNAME VARCHAR2(20 BYTE)  , ID NUMBER NOT NULL  , UPD_TSTAMP TIMESTAMP(6) DEFAULT systimestamp ) TABLESPACE USERS; CREATE UNIQUE INDEX ABC_PK ON ABC (ID ASC)  LOGGING  TABLESPACE USERS ; ALTER TABLE ABC ADD CONSTRAINT ABC_PK PRIMARY KEY  ( ID ) USING INDEX ABC_PK ENABLE; Insert some data into it table: SET DEFINE OFF; Insert into ABC (FNAME,LNAME,ID,UPD_TSTAMP) values ('ravi','reddy',2,to_timestamp('09-JAN-15 11.44.39.000000000 AM','DD-MON-RR HH.MI.SSXFF AM')); Insert into ABC (FNAME,LNAME,ID,UPD_TSTAMP) values ('arvind','reddy',3,to_timestamp('16-JAN-15 12.06.01.293176000 PM','DD-MON-RR HH.MI.SSXFF AM')); Insert into ABC (FNAME,LNAME,ID,UPD_TSTAMP) values ('raghu','kumar',4,to_timestamp('20-JAN-15 04.33.35.616985000 PM','DD-MON-RR HH.MI.SSXFF AM')); Insert into ABC (FNAME,LNAME,ID,UPD_TSTAMP) values ('ranii'...

Linux commands

REMOVE ALL FILES OLDER THAN 15 DAYS: [oracle@Linux01 dpump]$ find /u01/app/oracle/dpump/*.dmp -mtime +15 -exec rm {} \; GZIP ALL FILES OLDER THAN 15 DAYS: [oracle@linux01 dpump]$ find /u01/app/oracle/dpump/*.dmp -mtime +15 -exec gzip {} \; FIND ALL EXTENSION TYPES IN CURRENT DIRECTORY -  Linux/Unix: find . -type f | grep -E ".*\.[a-zA-Z0-9]*$" | sed -e 's/.*\(\.[a-zA-Z0-9]*\)$/\1/' | sort | uniq -c | sort -n [atoorpu@Linux01 trace]$ find . -type f | grep -E ".*\.[a-zA-Z0-9]*$" | sed -e 's/.*\(\.[a-zA-Z0-9]*\)$/\1/' | sort | uniq -c | sort -n SAMPLE OUTPUT : [atoorpu@Linux01 trace]$ find . -type f | grep -E ".*\.[a-zA-Z0-9]*$" | sed -e 's/.*\(\.[a-zA-Z0-9]*\)$/\1/' | sort | uniq -c | sort -n         1 .log     1 .txt     952 .trc     952 .trm Note :  Will update more.