Send your questions to appsdbauniverse@gmail.com
Showing posts with label Oracle. Show all posts
Showing posts with label Oracle. Show all posts

Friday, March 18, 2016

Do you know how to create a database link without full TNS connect string starting 11g ?


SQL> CREATE DATABASE LINK test
  2  CONNECT TO remoteschema IDENTIFIED BY password
  3  USING 'remoteserver:port/VIS1';
  
Database link created.

========================================================================

Monday, February 22, 2016

How to connect to database using jdbc connect string directly


$ sqlplus apps/apps@VISdbnode1:1521/VIS1

SQL*Plus: Release 10.1.0.5.0 - Production on Mon Feb 22 22:22:08 2016

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL> 

========================================================================

Sunday, February 21, 2016

srvctl add database gives PRCR-1006, PRCT-1011 error


As oracle user 

$ srvctl add database -d VIS1 -o $ORACLE_HOME 

PRCR-1006 : Failed to add resource ora.vis1.db for vis1
PRCT-1011 : Failed to run "osdbagrp". Detailed error: null 

$ osdbagrp -a
Memory fault

- Enable detailed SRVM trace as follows.

script /tmp/srvctl_trace.log 
date
export SRVM_TRACE=TRUE 
srvctl add database -d VIS1 -o $ORACLE_HOME 
exit 

cat /tmp/srvctl_trace.log 

[main] [ 2014-12-04 07:44:18.533 EST ] [RuntimeExec.runCommand:192] Returning from RunTimeExec.runCommand 
[main] [ 2014-12-04 07:44:18.534 EST ] [UnixSystem.dorunRemoteExecCmd:3232] retval = 139 
[main] [ 2014-12-04 07:44:18.534 EST ] [CmdToolUtil.doexecute:474] nativeSystem.runRemoteExecCmd failed. Command = /vis1/11.2.0.4/bin/osdbagrp arguments = [-a] env = null error = null 
[main] [ 2014-12-04 07:44:18.535 EST ] [AddAction.executeDatabase:667] removing server group vis1 that was created 
[main] [ 2014-12-04 07:44:18.536 EST ] [CRSNative.internalQueryResources:1577] About to doQueryResources: eType resource, nodeName null, filter ((TYPE == ora.database.type) && (SERVER_POOLS CONTAINS ora.vis1)) 
[main] [ 2014-12-04 07:44:18.565 EST ] [CRSNative.internalQueryResources:1585] found 0 resources 
[main] [ 2014-12-04 07:44:18.565 EST ] [DatabaseFactoryImpl.getDatabases:1145] No database was found hosted by server pool =ora.vis1
[main] [ 2014-12-04 07:44:18.566 EST ] [ServerPoolImpl.remove:1250] The dblist size is 0 
[main] [ 2014-12-04 07:44:18.566 EST ] [CRSNative.unregisterEntity:791] About to unregister: name: ora.vis1, force: false, type: 3 
[main] [ 2014-12-04 07:44:18.626 EST ] [FrameworkException.<init>:72] Set warning status: 2 
PRCR-1006 : Failed to add resource ora.vis1.db for vis1
PRCT-1011 : Failed to run "osdbagrp". Detailed error: null 

- Action plan to fix the above issue:

Copy the "osdbagrp" from the $GI_HOME/bin to the $RDBMS_HOME/bin

1) take a back up of $RDBMS_HOME/bin/osdbagrp 
2) copy $GI_HOME/bin/osdbagrp to $RDBMS_HOME/bin/ 
3) try below command again from RDBMS Home 
   osdbagrp -a  --> this should now result asmadmin instead of Memory fault
4) srvctl add database -d VIS1 -o $ORACLE_HOME <-- this works now.

========================================================================

How to make Invalid object from dba_registry table to Valid


SQL> select comp_id,comp_name,status from dba_registry where status='INVALID';

COMP_ID    COMP_NAME                    STATUS
---------- ---------------------------- --------
SDO        Spatial                      INVALID
ORDIM      Oracle Multimedia            INVALID
EXF        Oracle Expression Filter     INVALID


SQL> exec dbms_registry.valid('SDO');

PL/SQL procedure successfully completed.

SQL> exec dbms_registry.valid('ORDIM');

PL/SQL procedure successfully completed.

SQL> exec dbms_registry.valid('EXF');

PL/SQL procedure successfully completed.

SQL> select comp_id,comp_name,status from dba_registry where status='INVALID';

no rows selected

========================================================================

Compiling an Object returns ORA-00600: internal error code, arguments: [kqlobjlod-no-result-from-proc$], [1403], [14145284]


SQL> alter package apps.GMD_TECH_PARAMS compile body; 

alter package apps.GMD_TECH_PARAMS compile body 
* 
ERROR at line 1: 
ORA-00600: internal error code, arguments: [kqlobjlod-no-result-from-proc$], [1403], [14145284], [], [], [], [], [], [], [], [], [] 

The error is self explanatory.

1403 - no data found
14145284 - object# from sys.procedure$ table

This happens when utlrp.sql trying to compile an object and DBA killed the session in the database.

SQL> select * from sys.procedure$ where obj# = 14145284;

no rows selected

SQL> select owner, object_name, object_type, status from dba_objects where object_id=14145284;

no rows selected

There is no direct solution for the dictionary table corruption.

Workaround is to insert a record in sys.procedure$ table for the missing object#.

Make sure you have complete backup of your database, atleast the sys.procedure$ table.

SQL> insert into sys.procedure$ values (14145284,'--------------------------------',null,2);

1 row created.

SQL> commit;

Commit complete.

Recompile the object again.

SQL> alter package apps.GMD_TECH_PARAMS compile body;

Package body compiled.


========================================================================