Wednesday, January 25, 2012

Startup of RAC database fails with ORA-01105 & ORA-01677

Visit the Below Website to access unlimited exam questions for all IT vendors and Get Oracle Certifications for FREE
http://www.free-online-exams.com
Problem Description
Oracle Data Guard was setup between two RAC databases and after switch-over operation is performed one node of primary database can be opened but another node can't be mounted. Following is the output while starting the instance using srvctl command. 

$ srvctl start database -d orcl1
PRCR-1079 : Failed to start resource ora.orcl1.db
ORA-01105: mount is incompatible with mounts by other instances
ORA-01677: standby file name convert parameters differ from other instance
CRS-2674: Start of 'ora.orcl1.db' on 'rac1' failed
CRS-2632: There are no more servers to try to place resource 'ora.orcl1.db' on that would satisfy its placement policy

If we try to start the instance using SQL*Plus it also fails with error message ORA-01105 and ORA-01677 while mounting the database. 

Cause of the Problem
The 'ORA-01105: mount is incompatible with mounts by other instances' error indicates that the parameter file does not match with the parameter file of another instance. So, you must verify the list of initialization parameters of one node with the list of initialization parameters on another node. The 'ORA-01677: standby file name convert parameters differ from other instance' error message gives you a hint which specific initialization parameter mismatch with another instance. It means the log_file_name_convert initialization parameter differs between two nodes. 

Solution of the Problem
1) The best way to solve the problem is to use shared storage for your database initialization parameter (spfile) and keep same spfile for both instances so that if you perform any modification from database using ALTER SYSTEM command both instance are affected. So, check the spfile location from one instance and use same spfile for another instance. 

2) If you use different spfile/pfile to start your database instance then set log_file_name_convert parameter to the same as it is used in another instance so that both instance has same value. 

3) Once you ensure same parameter value in both database try to mount and start the instance.
Get Oracle Certifications for all Exams
Free Online Exams.com

ORA-600 or Data Corruption during database shutdown of RAC instance

Visit the Below Website to access unlimited exam questions for all IT vendors and Get Oracle Certifications for FREE
http://www.free-online-exams.com


Problem Description
Today I want to introduce one terrible Oracle bug that fires in Oracle RAC environment, cause data corruption while shutting down RAC instances. The issue can occur when shutting down Oracle RAC instances using the shutdown mode "normal, transactional, or immediate" and the instance(s) are shutdown in a rolling fashion; i.e. other instances remain to operate normally. The issue does not occur, if the instances are shutdown using "shutdown abort" or the database is shutdown as a whole as a workaround. 

Cause of the Problem
Data corruption happens due to Oracle bug. Oracle named this bug as 10205230. The following symbols found in the alert log when you hit this bug. 
- ORA-600 [kclchkblk_3]
- ORA-600 [kclwcrs_6]
- ORA-600 [ktubko_1]
- ORA-600 [kcratr_scan_lostwrt]
- ORA-600[3020] on the standby database
And data corruption happens in your database. When one RAC instance is working normally and you shutdown another instance either by any of following commands then this corruption happens.
So avoid these commands. 
- shutdown normal
- shutdown transactional
- shutdown immediate

Solution of the Problem
1)Shutdown abort whole database instead of shut down one to avoid corruption:

SQL> alter system checkpoint;

$ srvctl stop database -d -o abort -f

The first command from SQL*plus writes out dirty buffers for all instances to minimize instance recovery; The srvctl command shutdown all instances with abort option and its dependent resources. Shutdown abort completely by-passes the vulnerable code path of the bug.

2) If you need shutdown only one instance or in rolling fashion then instead of shutdown normal/transactional/immediate, you should shutdown each instance with the following 2 commands:
SQL> alter system checkpoint local;
SQL> shutdown abort;


The first command writes out dirty buffers for this instance to minimize instance recovery. Shutdown abort completely by-passes the vulnerable code path of the bug. Instance can also be shutdown abort using "srvctl stop instance -d db_unique_name -i instance_name -o abort". 

What to do if corruption already happens
As this bug may cause logical corruption to the redo stream so we need to recover corrupt blocks. I have written a topic regarding Handling block corruption in oracle. Also I have written another topic about how torecover data from corrupt blocks. 

The solution can be followings at the end.
- Drop and recreate the corrupt object. This may work for objects like indexes.

- Use DBMS_REPAIR package to repair and skip the corrupted blocks, and recreate the object with create table as select. This may work for objects like tables and partition tables, but may result in data loss.

- Failover to a standby database that has not been affected by the data corruption. This may result in data loss. Flashback or perform point-in-time recovery. This may also result in data loss.

- If a standby database encounters ORA-600[3020] stuck recovery, you can invoke trial recovery to see if there are other corrupt blocks:

SQL> recover automatic standby database allow n corruption test;

Here n can be 1 or any other integer.

One can also use the following command to allow standby recovery to continue by marking the problematic block as corrupt:

SQL> recover automatic standby database allow n corruption;
Get Oracle Certifications for all Exams
Free Online Exams.com

ORA-600 [4194] or ORA-600 [4193]

Visit the Below Website to access unlimited exam questions for all IT vendors and Get Oracle Certifications for FREE
http://www.free-online-exams.com


Problem Description
ORA-600[4194] or ORA-600[4193] occurs when there is mismatch detected between Redo records and rollback (Undo) records. ORA-600[4194] / ORA-600[4193] error comes with two more arguments within bracket. 
Arg [a] indicates Maximum Undo record number in Undo block
Arg [b] indicates Undo record number from Redo block
Sample error is below:
ORA-00600: internal error code, arguments: [4194], [19], [33], [], [], []

Solution of the Problem - Drop the undo tablespace
This solution does not deal with Oracle unsupported parameter like _offline_rollback_segments and @_corrupted_rollback_segments to resolve ora-00600[4193]/[4194]. 

Step 01: 
Startup the database in nomount stage using spfile.
SQL> Startup nomount; 

In this case ensure you have started your database using spfile. "show parameter spfile" will display the location of spfile.

Create pfile from spfile.
SQL> Create pfile='/tmp/pfile.ora' from spfile ;

Shutdown the database.
SQL> Shutdown immediate; 

Step 02: 
Modify the pfile.ora and set Undo_managment=Manual
$vi /tmp/pfile.ora
undo_managment=manual

Start the database in mount mode using modified pfile.
SQL> Startup mount pfile='/tmp/pfile.ora'

Ensure that you have undo_managment initialization parameter set to manual.
SQL> Show parameter undo

SQL> Alter database open ;

Once it open, create a rollback segment.

SQL> Create rollback segment r01 ;

SQL> Alter rollback segment r01 online ;

Create a new undo tablespace

SQL> Create undo tablespace undotbs_new datafile 'datafile_name.dbf' size 100M ;

Drop the old undo tablespace

SQL> Drop tablespace undotbs_old including contents and datafiles

Step 03:

Shutdown the database.
SQL> Shutdown immediate;

Start the database using spfile where it had undo_managment initialization parameter set to AUTO.

SQL> Startup nomount ; 

Change the undo_tablespace parameter to use new tablespace.

SQL>Alter system set undo_tablespace=undotbs_new scope=spfile;

SQL> Shutdown immediate ;

SQL> Startup

Check if error is reported.

In case of RAC database instances from Instance which is up and running do the following:

SQL> Create undo tablespace undo_new datafile 'undotbs_new' size 100m ;

SQL> Alter system set undo_tablespace=undo_new sid={instance which has corrupt undo tablespace and is down} ;

Now Startup the Instance which is down

SQL> Startup mount

SQL> Show parameter undo

Should show the new undo tablespace created above

SQL>Alter database open ;

SQL>Drop tablespace undotbs_old including contents and datafiles


If all the Instance is down in the RAC due to this error then following the instruction given for Single instance and create new undo tablespace.
Get Oracle Certifications for all Exams
Free Online Exams.com

DataPump Parameters INCLUDE and EXCLUDE - How to Load and Unload Specific Objects

Visit the Below Website to access unlimited exam questions for all IT vendors and Get Oracle Certifications for FREE
http://www.free-online-exams.com

DataPump Parameters INCLUDE and EXCLUDE - How to Load and Unload Specific Objects

With the export/import new technology data pump we can filter to load/unload certain objects. This so-called 'Metadata filtering' is implemented through the EXCLUDE and INCLUDE parameters.
Incorrect usage of metadata filters, can result in errors such as:

ORA-39001: invalid argument value 
ORA-31655: no data or metadata objects selected for job
UDE-00011: parameter include is incompatible with parameter exclude 


How metadata can be filtered with the EXCLUDE and INCLUDE parameters.
 


1. Syntax of the INCLUDE and EXCLUDE Data Pump parameters.


EXCLUDE = object_type[:name_clause] [, ...]
INCLUDE = object_type[:name_clause] [, ...] 

EXCLUDE=SEQUENCE, TABLE:"IN ('EMP', 'DEPT')"
INCLUDE=FUNCTION, PACKAGE, TABLE:"= 'EMP'" 

2. SQL Operator usage. 

EXCLUDE=TABLE:"IN ('EMP', 'DEPT')"

or:

EXCLUDE=INDEX:"= 'MY_INDX'"

or:

INCLUDE=PROCEDURE:"LIKE 'MY_PROC_%'"

or:

INCLUDE=TABLE:"> 'E'" 

3.Double quotes and single quotes usage. 

The name clause is separated from the object type with a colon. The name clause must be enclosed in double quotation marks. The single-quotation marks are required to delimit the name strings. Using the INCLUDE or EXCLUDE parameter in a parameter file is the preferred method.
Parameter file: exp.par
-------------------------
DIRECTORY = my_dir
DUMPFILE = exp_tab.dmp
LOGFILE = exp_tab.log
SCHEMAS = scott
INCLUDE = TABLE:"IN ('EMP', 'DEPT')"


> expdp system/manager parfile=exp.par

To run this job without a parameter file, you need to escape the special characters. Incorrect escaping can result in errors such as: ksh: syntax error: '(' unexpected.
expdp system/manager DIRECTORY=my_dir \
DUMPFILE=exp_tab.dmp LOGFILE=exp_tab.log SCHEMAS=scott \
INCLUDE=TABLE:\"IN \(\'EMP\', \'DEP\'\)\"


4. Using the same filter name for an object type more than once. 

If multiple filters are specified for an object type, an implicit AND operation is applied to them. That is, the objects that are exported or imported during the job have passed all of the filters applied to their object types.

5. The EXCLUDE and INCLUDE parameters are mutually exclusive. 


It is not possible to specify both the INCLUDE parameter and the EXCLUDE parameter in the same job.
Parameter file - incorrect syntax (error: UDE-00011):

INCLUDE=TABLE:"IN ('EMP', 'DEPT')"
EXCLUDE=INDEX:"= 'PK_EMP'"

Parameter file - correct syntax:

INCLUDE=TABLE:"IN ('EMP', 'DEPT')" 


6. Specified object types depend on the export/import Data Pump mode. 
During a TABLE level export/import, certain object types that are directly related to SCHEMA or DATABASE level jobs, cannot be specified. The same applies to a SCHEMA level export/import where no DATABASE level object types can be specified.

To determine the name of the object types can be specified with EXCLUDE and INCLUDE,

database_export_objects
schema_export_objects
table_export_objects

7. Only specific object types can be named with a Name clause.


The name clause applies only to object types whose instances have names (for example, it is applicable to TABLE, but not to GRANT).
To determine which object types can be named, you can use,database_export_objects and ....

EXCLUDE = TRIGGER:"IN ('TRIG1', 'TRIG2')", INDEX:"= 'INDX1'", REF_CONSTRAINT 

8. Excluding/Including an object, will also exclude/include it's dependent objects.

Dependent objects of an identified object are processed along with the identified object. For example, if a filter specifies that an index is to be included in an operation, then statistics from that index will also be included. Likewise, if a table is excluded by a filter, then indexes, constraints, grants, and triggers upon the table will also be excluded by the filter. 

To determine which objects are dependent, e.g. for a TABLE, you can run the following query,
SELECT named, object_path, comments 
FROM database_export_objects 
WHERE object_path LIKE 'TABLE/%';


9. Exporting or Importing a large number of objects.


If a large number of objects needs to be exported (or imported), it is possible that an internal buffer limit is exceeded (e.g. for the parameters INCLUDE or TABLES). If that happens it will cause the Data Pump job to abort with an error such as: ORA-06502 (PL/SQL: numeric or value error: character string buffer too small). This happened especially in Oracle10g Release 1 where the value for the internal buffer was set to 3000 bytes. With the fix for Bug 4053129 "EXPDP fails with ORA-39125 ORA-6502 on large list of table names" (not a public bug; fixed in 10.1.0.5.0 and 10.2.0.x), this value was increased to 4000 bytes.
When exporting a large number of objects, we recommend to make use of a table inside the database that contains the names of the objects.
Example:
-- create a table that contains the names of the objects:

CONNECT scott/tiger
CREATE TABLE expdp_table (owner VARCHAR2(30),
object_name VARCHAR2(128), object_type VARCHAR2(19));
INSERT INTO expdp_table VALUES ('SCOTT','EMP','TABLE');
INSERT INTO expdp_table VALUES ('SCOTT','DEPT','TABLE');
INSERT INTO expdp_table VALUES ('SCOTT','BONUS','TABLE');
...
COMMIT;
-- run export DataPump job:

expdp system/manager DIRECTORY=my_dir \
DUMPFILE=expdp_scott.dmp LOGFILE=expdp_scott.log SCHEMAS=scott \
INCLUDE=TABLE:\"IN \(SELECT object_name FROM scott.expdp_table WHERE \
owner=\'SCOTT\' AND object_type=\'TABLE\'\)\"

On windows in one line following is valid.
expdp system/a SCHEMAS=aRJU INCLUDE=TABLE:\"IN \(SELECT object_name FROM dba_objects WHERE owner=\'ARJU\' AND object_type=\'TABLE\'\)\"

10. Other issues when excluding objects at a Data Pump job.

10.1. Excluding Constraints.
The following constraints cannot be excluded:
- NOT NULL constraints.
- Constraints needed for the table to be created and loaded successfully (for example, primary key constraints for index-organized tables or REF SCOPE and WITH ROWID constraints for tables with REF columns).

10.2. Excluding Grants.
Specifying EXCLUDE=GRANT excludes object grants on all object types and system privilege grants.

10.3. Excluding Users.
Specifying EXCLUDE=USER excludes only the definitions of users, not the objects contained within users' schemas. To exclude a specific user and all objects of that user, specify a filter such as the following (where SCOTT is the schema name of the user you want to exclude):
EXCLUDE=SCHEMA:"='SCOTT'"

If you try to exclude a user by using a statement such as EXCLUDE=USER:"= 'SCOTT'", only the CREATE USER scott DDL statement will be excluded, and you may not get the results you expect.
11. Other issues when including objects at a Data Pump job.

When specifying the INCLUDE parameter for en Export Data Pump or Import Data Pump job, only object types explicitly specified in INCLUDE statements (and their dependent objects) are exported/imported. No other object types, such as the schema definition information that is normally part of a schema-mode export when you have the EXP_FULL_DATABASE role, are exported/imported.
Get Oracle Certifications for all Exams
Free Online Exams.com

Monday, January 23, 2012

User export failed with error EXP-00008/ORA-00904: "OLEVEL": invalid identifier

Visit the Below Website to access unlimited exam questions for all IT vendors and Get Oracle Certifications for FREE
http://www.free-online-exams.com

Applies to:

Oracle Server - Enterprise Edition - Version: 11.1.0.6 and later   [Release: 11.1 and later ]
Information in this document applies to any platform.

Symptoms

Checked for relevance on 10-27-2010

A schema level export fails with the following errors:

exporting views
. exporting stored procedures
. exporting operators
EXP-00008: ORACLE error 904 encountered
ORA-00904: "OLEVEL": invalid identifier
EXP-00000: Export terminated unsuccessfully


Changes

The patch for Bug 5872788 was installed to try and resolve the issue.

Cause

The problem is caused by installing the fix for Bug 5872788 but not having followed the post-installation instructions mentioned in the README of the patch.

The issue has been identified in Bug 7040430 which is closed as duplicate of Bug 5872788.

Because of this the SYS.EXU81OPRU view has not been patched properly. The patched version of the view defines the OLEVEL column.

Solution

To solve the issue, follow the post-installation instructions mentioned in the README of the patch:

# Patch Special Instructions:
# ---------------------------
# Make sure all instances running under the ORACLE_HOME being patched
# are cleanly shutdown before installing this patch. Also ensure that
# the tool used to terminate the instance(s) has exited cleanly.
#
# cd rdbms/admin
# sqlplus as sysdba
# @catexp.sql
#
# If the Oracle inventory is not setup correctly this utility will
# fail. To check accessibility to the inventory you can use the
# command
#


Get Oracle Certifications for all Exams
Free Online Exams.com

User export failed with error EXP-00008/ORA-00904: "OLEVEL": invalid identifier

Visit the Below Website to access unlimited exam questions for all IT vendors and Get Oracle Certifications for FREE
http://www.free-online-exams.com

Applies to:

Oracle Server - Enterprise Edition - Version: 11.1.0.6 and later   [Release: 11.1 and later ]
Information in this document applies to any platform.

Symptoms

Checked for relevance on 10-27-2010

A schema level export fails with the following errors:

exporting views
. exporting stored procedures
. exporting operators
EXP-00008: ORACLE error 904 encountered
ORA-00904: "OLEVEL": invalid identifier
EXP-00000: Export terminated unsuccessfully


Changes

The patch for Bug 5872788 was installed to try and resolve the issue.

Cause

The problem is caused by installing the fix for Bug 5872788 but not having followed the post-installation instructions mentioned in the README of the patch.

The issue has been identified in Bug 7040430 which is closed as duplicate of Bug 5872788.

Because of this the SYS.EXU81OPRU view has not been patched properly. The patched version of the view defines the OLEVEL column.

Solution

To solve the issue, follow the post-installation instructions mentioned in the README of the patch:

# Patch Special Instructions:
# ---------------------------
# Make sure all instances running under the ORACLE_HOME being patched
# are cleanly shutdown before installing this patch. Also ensure that
# the tool used to terminate the instance(s) has exited cleanly.
#
# cd rdbms/admin
# sqlplus as sysdba
# @catexp.sql
#
# If the Oracle inventory is not setup correctly this utility will
# fail. To check accessibility to the inventory you can use the
# command
#

Get Oracle Certifications for all Exams
Free Online Exams.com

Thursday, October 27, 2011

Wait for a undo record Wait for stopper event to be increased

Visit the Below Website to access unlimited exam questions for all IT vendors and Get Oracle Certifications for FREE
http://www.free-online-exams.com



Sometimes Parallel Rollback of Large Transaction may become very slow. After killing a large running transaction (either by killing the shadow process or aborting the database) then database seems to hang, or SMON and parallel query servers taking all the available CPU. 


In fast-start parallel rollback, the background process SMON acts as a coordinator and rolls back a set of transactions in parallel using multiple server processes.

Fast start parallel rollback is mainly useful when a system has transactions that run a long time before a commit, especially parallel Inserts, Updates, Deletes operations. When SMON discovers that the amount of recovery work is above a certain threshold, it automatically begins parallel rollback by dispersing the work among several parallel processes.

There are cases where parallel transaction recovery is not as fast as serial transaction recovery, because the PQ slaves are interfering with each other. It looks like the changes made by this transaction cannot be recovered in parallel without causing a performance problem. The parallel rollback slave processes are most likely contending for the same resource, which results in even worse rollback performance compared to a serial rollback. 




Solution
======


To disable the parallel rollback by setting the following parameter
fast_start_parallel_rollback = false

Refer to Oracle Note ID 464246.1





Get Oracle Certifications for all Exams
Free Online Exams.com