Oracle Study Guide

For 10g OCP DBA
  • Home
  • Site Map
  • Getting OEM to work on Vision 12i

    OEM 09.05.2009 Comments Off

    1. emca -config dbcontrol db -repos create

    2. by default the sys user is NOT in the remote password file and will NOT be able to login via OEM. Add the user:
    $ORACLE_HOME/bin/orapwd file=$ORACLE_HOME/dbs/orapw<INST> password=hullahoop

  • Show grants for a specific user

    GRANTS 09.05.2009 Comments Off

    select privname,object_name from ku$_objgrant_view join all_objects on object_id=obj_num where grantee=’THE_USER’;

  • Identify invalid online redo logs

    REDO LOGS, SQLPLUS 04.05.2009 Comments Off

    select group#,l.sequence#,archived,l.status running, lf.status os_status,member from v$log l join v$logfile lf using(group#) order by group#;

    NOTES:

    • The STATUS column of v$logfile (os_status) is NOT refreshed in real-time. Information is updated on log switch.
  • Adding new databases to OEM

    OEM 03.05.2009 Comments Off

    emca -deconfig dbcontrol db

    and

    emca -config dbcontrol db

  • Create raw devices for ASM

    ASM, Linux 03.05.2009 Comments Off

    http://oracle.3dub.com/ASM_20.shtml

  • Recovery Scenario: bad datafile AND missing online redo

    Database Recovery, RMAN 02.05.2009 Comments Off

    1. Trying to start the database using ’startup’ will fail trying to open the datafile. It will give the datafile number let’s say D.

    2. Make sure we have backups of all the datafiles. In RMAN type:
    REPORT NEED BACKUP REDUNDANCY 1;

    If there are datafiles that were not backed up as yet, there are 2 options:
    a) delete the datafiles. (RMAN will create them and apply their data from redo logs).
    b) issue RMAN command:
    BACKUP DATAFILE N;

    3. Use RMAN to restore and recover the datafile found missing in step #1. The recovery operation will fail because the online redo is missing.
    RESTORE DATAFILE D;
    RECOVER DATAFILE D;

    4. Find the last log sequence:
    SELECT SEQUENCE# FROM V$ARCHIVED_LOG WHERE RECID = (SELECT MAX(RECID) FROM V$ARC
    HIVED_LOG);

    5. Run the following RMAN script. The nunber X will be 1 more than the number you got from step 4. This is because the UNTIL SEQUENCE clause of RMAN goes to one less than the number specified.

    RUN {
    SET UNTIL SEQUENCE X THREAD 1;
    RESTORE DATABASE;
    RECOVER DATABASE;
    ALTER DATABASE OPEN RESETLOGS;
    }

  • Add databases to OEM

    Enterprise Manager, OEM 01.05.2009 Comments Off

    emca -deconfig dbcontrol db

    then

    emca -config dbcontrol db

  • Enabling different block size for a tablespace

    BLOCK SIZE 01.05.2009 Comments Off

    You have to setup a cache for the size you want to create if it is different from DB_BLOCK_SIZE initialization parameter like so:

    alter system set db_<N>k_cache_size=<REQUESTED SIZE> scope=BOTH;

  • Get block_size for a datafile

    DBVERIFY, SQLPLUS 01.05.2009 Comments Off

    You may need to get the block size of a datafile before running dbv (DBVERIFY) on it. The following will do this in sqlplus:

    set wrap off
    select t.name tablespace, file#, d.name datafile, block_size BS from v$datafile d join v$tablespace t using (ts#);

  • Moving datafiles/logfiles to another disk/location

    Database Recovery 31.08.2008 Comments Off
    $ sqlplus "/ as sysdba"
    
    SQL> shutdown immediate
    
    SQL> !mv orig_file target_file
    ...
    SQL> startup mount
    
    SQL> alter database rename file 'orig_file' to 'target_file';
    ...
    
        Do not disconnect after this step. Stay logged in
        and proceed to open the database!
    
    SQL> alter database open;
    
    SQL> exit

Category:

  • Administration
    • ASM
    • BLOCK SIZE
    • Database Recovery
    • DBVERIFY
    • GRANTS
    • OEM
    • REDO LOGS
  • APPS
    • AutoConfig
    • Change EBS IP Address
    • Cloning
    • DB Environment Vars
    • Discoverer
    • Environment Vars
    • Patching
    • Problems
    • Resources Online
    • Tricks & Tips
    • Upgrading
    • Workflow
  • Backup & Recovery
  • Certification
  • Configuration
  • DATABASE STRUCTURE
    • Data Dictionary
    • Logical Database Structure
    • Physical Database Structure
    • SCHEMA
  • DATAGUARD
  • Documentation
    • ASM (Automatic Storage Magement)
    • Command Reference
    • DataPump
    • Documentation Library
    • SQL Developer
  • EBS
  • Enterprise Manager
  • FLASHBACK
  • HACKING
  • HEADS UP
  • Installation
    • RAC
  • JDeveloper
  • Linux
  • NXclient/server
  • Online Resources
  • PERL
  • python
  • RMAN
    • RMAN Catalog Setup
  • Scripts
  • Serial-Parallel-Port-Testers
  • SNMP
  • Software
  • Solaris
  • Spiritual
  • SQL & PL/SQL
  • SQLPLUS
  • Startup/Shutdown
  • Streams
  • Tuning
    • INDEXES
    • SQL Tuning
      • TKPROF and sql_trace
  • VNC
  • Windows XP
© Blogname. All Rights Reserved. Entries RSS Comments RSS Login Open Source