|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Advanced Oracle Utilities: The Definitive Reference by Rampant TechPress is written by top Oracle database experts (Bert Scalzo, Donald Burleson, and Steve Callan). The following is an excerpt from the book.The dbms_repair utility provides a mechanism to repair the corrupt database blocks, which is the fix_corrupt_blocks procedure. Corrupt blocks are not really repaired, but instead are simply marked as corrupt.
Below is the syntax for the fix_corrupt_blocks procedure.
Note that the only OUT parameter is the fix_count. dbms_repair.
schema_name
IN VARCHAR2,
object_name
IN VARCHAR2,
partition_name
IN VARCHAR2
DEFAULT NULL,
repair_table_name IN
VARCHAR2
DEFAULT 'REPAIR_TABLE',
fix_count
OUT BINARY_INTEGER);
If
the object repaired is a table, then any corresponding index also needs to be
fixed. The dump_orphan_keys procedure will indicate if any keys are broken.
If they are, the index will need to be rebuilt.
The
dbms_repair utility provides a mechanism to rebuild the impacted freelists
and bitmap entries after fixing block corruption.
This procedure recreates the header portion of the datafile, allowing
Oracle to use the newly repaired blocks.
Below is the syntax for the
rebuild_freelists procedure: dbms_repair.REBUILD_FREELISTS (
schema_name
IN VARCHAR2,
Dbms_repair provides
a new method of addressing ORA-600 errors dealing with block corruption.
The utility is very easy to use and very functional.
As described earlier, it is one of many potential
solutions when resolving block corruption.
Dbms_repair does basically the same thing as analyze_table -validate
structure.
Managing files on the Oracle server have been reviewed.
In the next section, the managing of user processes on the Oracle
server will be detailed.
The
Orakill Server Process Utility
In
Windows, there are a couple of kill utilities: the Oracle-centric
orakill utility and the Windows
taskkill program.
The
kill utilities should be used as a last resort only. If the session
cannot be killed
more gracefully via alter system kill session, or the instance is
inaccessible via SQL, then orakill should be used to terminate the offending
session. Access to the Windows
machine containing the database must be secure to use orakill. Any user with
access to the box could access orakill or the Windows Task Manager and damage
database processes.
The Windows command to kill this session would be as follows:
C:\Oracle\bin>orakill
In
this example, the Windows thread corresponding to the Oracle session can be
killed in the operating system without ever logging into the database. For
another example, the Windows command to kill a session would be:
C:\Oracle\bin>orakill
b.username, a.sql_text from v$sqltext_with_newlines a, v$session b, v$process c where c.spid = to_number('300', 'xxx') and c.addr = b.paddr and b.sql_address = a.address;
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Copyright © 1996 - 2011 by
Burleson Enterprises. All rights reserved.
Oracle® is the registered trademark
of Oracle Corporation. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||