Tuesday, 23 February 2016

Not able to connect as rman catalog "RMAN-04004: error from recovery catalog database: ORA-12154: TNS:could not resolve the connect identifier specified"

Hi,

If you have created catalog user and you want to connect to rman with that user and you are getting the following error-

RMAN-04004: error from recovery catalog database:
ORA-12154: TNS:could not resolve the connect identifier specified

see below errors--

rman catalog = catalog/metalog@catdb
Recovery Manager: Release 11.2.0.3.0 - Production on Tue Feb 23 15:02:03 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-04004: error from recovery catalog database: ORA-12154: TNS:could not resolve the connect identifier specified


I thing you are trying with connect identifier on same machine on which you have database like @catdb in this command.

Action - Don't use @catdb because if you are using same server to connect there is no need to give connect identifier.

export ORACLE_SID=catdb
-bash-4.1$ rman catalog = catalog/metalog

by giving this you will easily connect to your rman.

If you are trying to connect to  catalog database on different host then you have to create tns entry in tnsnames.ora file .


like  ----

catdb =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = hostname )(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SID = DB_NAME)

Thanks

If  You have any query please comment your query.


 

Monday, 8 February 2016

ORA-01940: cannot drop a user that is currently connected

SQL> DROP USER test CASCADE;
DROP USER test CASCADE
*
ERROR at line 1:
ORA-01940: cannot drop a user that is currently connected




Reason - User connected to the database.To Drop user ask user to disconnect or Do
it by yourself.

To Disconnect the session .Check for the SID and SPID using this command-

SELECT s.sid, s.serial#, s.status, p.spid   FROM v$session s, v$process p  WHERE s.username = 'test'   AND p.addr(+) = s.paddr  /

It will Give output like this---

       SID    SERIAL# STATUS   SPID ---------- ---------- -------- ------------------------        162          9 ACTIVE   29613

Now Use this command to kill session.

alter system kill session 'SID,SPID';

alter system kill session '162,9';

It may take time to kill session.

Thanks For reading this blog. -Saurabh


 

ORA-00018: maximum number of sessions exceeded

cause - Whatever value you specified for SESSIONS  in parameter file .sessions created till that value.

action - Increase the value of  SESSIONS in Parameter files.

Try This -

1. alter system set sessions = 'VALUE' scope=spfile;
2. alter system set sessions = 'VALUE' scope=pfile;
3. alter system set sessions = 'VALUE' scope=both;