Commit 06e7d19a authored by O'Reilly Media, Inc.'s avatar O'Reilly Media, Inc.
Browse files

Initial commit

parents
Loading
Loading
Loading
Loading

9781565922372

0 → 120000
+1 −0
Changes for 9781565922372: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
9781565922372
 No newline at end of file

Appg/appg.txt

0 → 100755
+3776 −0

File added.

Preview size limit exceeded, changes collapsed.

Chap10/blokrows.sql

0 → 100755
+17 −0
Changes for Chap10/blokrows.sql: 17 added lines, 0 removed lines.
Original line number Diff line number Diff line
Doc

    Name:    blokrows.sql

    This script lists how many rows are being stored per block
    for a selected table

#

ttitle 'Table Rows Per Block'

SELECT   SUBSTR(T.ROWID,1,8)  || '-' ||
             SUBSTR(T.ROWID,15,4)  BLOCK,
         COUNT(*)                              ROW_CNT
FROM     &TAB_NAME T
WHERE    ROWNUM  <  2000
GROUP BY SUBSTR(T.ROWID,1,8) || '-' || SUBSTR(T.ROWID,15,4);
 No newline at end of file

Chap10/coldiffs.sql

0 → 100755
+30 −0
Changes for Chap10/coldiffs.sql: 30 added lines, 0 removed lines.
Original line number Diff line number Diff line
Doc

    Name:    Mark Gurry

    Author:  Mark Gurry

    This script lists columns that have the same name but
    different characteristics. They may cause problems
    when tables are joined on the columns or unexpected 
    results are returned. 

#

break on owner on column_name;
ttitle ' Columns with Inconsistent Data Lengths '
  
select owner, column_name
      , table_name||' '||data_type||'('||
      decode(data_type, 'NUMBER', data_precision, data_length)||')' "Characteristics"
  from all_tab_columns 
where  (column_name, owner)
   IN
  (select column_name, owner
     from all_tab_columns
    group by column_name, owner
    having min(decode(data_type, 'NUMBER', data_precision, data_length))
            < max(decode(data_type, 'NUMBER', data_precision, data_length)) )
  and  owner not in ('SYS', 'SYSTEM')
/

Chap10/datafile.sql

0 → 100755
+34 −0
Changes for Chap10/datafile.sql: 34 added lines, 0 removed lines.
Original line number Diff line number Diff line
Doc

    Name:    datafile.sql

    Author:  Mark Gurry


    this script checks the locations of all datafiles for the selected database
    Remember to balance your disk I/O load across disks 

#

column value  format a40
column name   format a40
column member format a40


spool datafile.lis  

ttitle ' Checking Locations of Database Files' 

select value
  from v$parameter
 where name = 'log_archive_dest'
UNION
select name 
  from v$datafile 
UNION
select member      
  from v$logfile 
/
spool off

Loading