oakcli "delete database" fails on Oracle Database Appliance


[root@oda1 ~]# oakcli delete database -db dbx
2016-02-20 19:12:55: Will be running following sql statements as user: oracle:
                  export oracle_home=/u01/app/oracle/product/,
                  export sid= dbx,
                  /u01/app/oracle/product/ -L sys/password@/dbx as sysdba
                  set heading off
set echo off
select name from  v$datafile
2016-02-20 19:12:55: Removing file /tmp/filenoqI0r
2016-02-20 19:12:55: Successfully removed file: /tmp/filenoqI0r
2016-02-20 19:12:55: /bin/su exited with rc=1
2016-02-20 19:12:55: ERROR:  Failed to connect to the database  
ORA-12154: TNS:could not resolve the connect identifier specified 
SP2-0751: Unable to connect to Oracle. Exiting SQL*Plus 
Died at /opt/oracle/oak/lib/oakutilslib/ line 91. 
[root@oda1 ~]# less /opt/oracle/oak/log/oda1/tools/ 
/u01/app/oracle/product/ -L sys/password@/dbx as sysdba 
[root@oda1 ~]# /u01/app/oracle/product/ -L sys/welcome1@/dbx as sysdba 
ORA-12154: TNS:could not resolve the connect identifier specified 

[root@oda1 ~]# /u01/app/oracle/product/ -L sys/welcome1@dbx as sysdba 
SQL*Plus: Release Production on Sat Feb 20 19:16:08 2016 
Copyright (c) 1982, 2014, Oracle. All rights reserved. 
Connected to: 
Oracle Database 12c Enterprise Edition Release - 64bit Production 


The problem is the additionsl slash "/" in the connect descriptor oakcli produces when calling SQLPlus.

This is an Oracle bug, see also: ODA: Running "oakcli delete database -db <dbname>" Fails With Error ORA-12514 (Doc ID 2034612.1)

The solution is to reset the db_domain database parameter:

SQL> alter system reset db_domain scope=spfile;

And restart the database

[oracle@oda1:dbx1 ]$ /u01/app/oracle/product/ stop database -d dbx
[oracle@oda1:dbx1 ]$ /u01/app/oracle/product/ start database -d dbx

The solution is also valid if the parameter is not set:

SQL> show parameter domain 
------------------------------------ ----------- ------------------------------ 
db_domain string 

Related articles

Related articles appear here based on the labels you select. Click to edit the macro and add or change labels.

Related issues