Ask The Real Tom

December 24, 2008



Is it possible to execute a alter table drop unused columns parallel?

Filed under: Uncategorized — Tags: , , — admin @ 10:50 am

No.

Only following DDL can be executed parallel (in 10g):

The parallel DDL statements for nonpartitioned tables and indexes are:

  • CREATE INDEX
  • CREATE TABLE … AS SELECT
  • ALTER INDEX … REBUILD

For Partitioned Tables:

  • CREATE INDEX
  • CREATE TABLE … AS SELECT
  • ALTER TABLE … [MOVE|SPLIT|COALESCE] PARTITION
  • ALTER INDEX … [REBUILD|SPLIT] PARTITION

Btw: If you find my articels useful, support me with a click to the google adds.

December 22, 2008



Oracle’s Shared Memory Segment ID

Filed under: Uncategorized — admin @ 3:52 pm

Just found out - Oracle’s Shared Memory Segment Id get genereated from the ORACLE_SID and the ORACLE_HOME variable.

If you get this:
sqlplus / as sysdba
SQL*Plus: Release 10.2.0.3.0 - Production on Mon Dec 22 15:17:10 2008
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Connected to an idle instance.

but the instance is running
ps -ef |grep SID

You probably have an error in the ORACLE_SID or ORACLE_HOME variable.
An example could be if you have a link (on filesystem) to you oracle home, so there are two valid paths possible for ORACLE_HOME

December 19, 2008



What if Oracle SQL Profiles are not allowed?

Filed under: Uncategorized — admin @ 1:09 pm

Company rules may be strange sometimes. If you are not allowed to use oracle sql profile because the feature is not “engeneered” or “provied to be secure” or “reviewed by your dog”…. you can just copy the sql profile hints to the statement like a normal oracle hint.

  1. Create a sql profile
  2. Get the signature
    select * from dba_sql_profiles
    (may be check the right one by the create date )
  3. get the sql profile content (the hints)
    select * from SQLPROF$ATTR where signature = ...
  4. Copy them to the statement
    SELECT /*+ OPT_ESTIMATE(@"SEL$1", TABLE, "SA"@"SEL$1", SCALE_ROWS=0.009625439405)
    OPT_ESTIMATE(@"SEL$1", TABLE, "SS"@"SEL$1", SCALE_ROWS=84.6422725)
    */ col1,
    .......
  5. drop the sql profile

    BEGIN
    DBMS_SQLTUNE.DROP_SQL_PROFILE(name => 'SYS_SQLPROF_01478ecfc70xxxxxx');
    END;

    /

The method can be used if:

  • You are not allowed to use Sql Profiles
  • If you can not find a better plan than the tuning advisor
  • If you have no idea about sql tuning and you want to impress somebody with your skill
  • If you have no time for real tuning because you build a private homepage during worktime
  • If you have no time for real tuning because you have to watch the stock market 24H a day

December 15, 2008



Oracle Backup Verification

Filed under: Uncategorized — admin @ 11:22 am

I hat to write a short managment summary about backup verification. They want to verify the backups (who knows why). I just recomened them to verify the restores, not the backups!

Check if the backup pieces are available on netabackup catalog
The CROSSCHECK command checks only objects marked AVAILABLE or EXPIRED by examining the files on disk for DISK channels or by querying the media manager for sbt channels. Table 2-2 describes the meaning of each status.


allocate channel for maintenance type 'sbt_tape' parms='ENV=(NB_ORA_POLICY=DBA_RMAN,NB_ORA_SCHED=INC_3M)';
CROSSCHECK BACKUP;
# COMPLETED BETWEEN '01-JAN-01' AND '01-SEP-01';
RELEASE CHANNEL;

crosschecked backup piece: found to be ‘AVAILABLE’
backup piece handle=inc0_TART01_2008-12-11_14-32-41_s19_p1 recid=15 stamp=673194774
crosschecked backup piece: found to be ‘AVAILABLE’
backup piece handle=inc0_TART01_2008-12-11_14-32-41_s20_p1 recid=16 stamp=673194774
crosschecked backup piece: found to be ‘AVAILABLE’
….

If the backup is found, it is tagged as avaliable.

check backup pieces

RESTORE... VALIDATE causes RMAN to select existing backups that it would use to perform a RESTORE operation, and scan them all to ensure that they are present and free of corruption

allocate channel for maintenance type ’sbt_tape’ parms=’ENV=(NB_ORA_POLICY=DBA_RMAN,NB_ORA_SCHED=INC_3M)’;
restore database validate;

Starting restore at 12-DEC-08
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: sid=210 devtype=SBT_TAPE
channel ORA_SBT_TAPE_1: Veritas NetBackup for Oracle - Release 6.5 (2007111606)
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=196 devtype=DISK

channel ORA_SBT_TAPE_1: starting validation of datafile backupset
channel ORA_SBT_TAPE_1: reading from backup piece inc0_TART01_2008-12-11_14-44-22_s26_p1
channel ORA_SBT_TAPE_1: restored backup piece 1
piece handle=inc0_TART01_2008-12-11_14-44-22_s26_p1 tag=TAG20081211T144428
channel ORA_SBT_TAPE_1: validation complete, elapsed time: 00:01:05

reads the oracle backups for real

verify the netbackup log:

09:21:26 (65382.xxx) Restore job id 65382 will require 1 image.
09:21:26 (65382.xxx) Media id AG1154 is needed for the restore.
...
09:21:42 (65382.001) INF - Waiting for positioning of media id AG1154 on server svzpbck03 for reading.
09:21:51 (65382.001) INF - Beginning restore from server svzpbck03 to client scztmdb06.
09:22:45 /inc0_TART01_2008-12-11_14-44-22_s27_p1
09:22:45 /inc0_TART01_2008-12-11_14-44-22_s27_p1
09:22:45 (65382.001) Status of restore from image created Thu Dec 11 14:46:08 2008 = the requested operation was successfully completed
...

verification coverage

This method verifiy that the available backup are avaliable in the media manager and readable.

The verification does not cover:

  • missing backups (backup that not have taken place)
  • logical errors
  • not backup items (ex. readonly tablespaces) can not be found
  • does not confirm that a backup procedure would be successful
  • does not cover and backup procedure or dokumentation

Summary:
This test method cover just a very small part of a backup method. It is not suitable to verify if the backup would be working in a
desaster case. -> useless.
To ensure that the backup can be restored, it is nessesary to restore the full database periodicaly to a test host. That confirms, that the backups and resotre procedures are working and provide a regular training to the DBA.

Powered by WordPress