Child pages
  • ODA: oakcli 12 cannot delete database

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

 

[root@oda1 ~]# oakcli delete database -db pcerautfdbx
2016-02-20 19:12:55: Will be running following sql statements as user: oracle:
                  export oracle_home=/u01/app/oracle/product/12.1.0.2/dbhome_2,
                  export sid= pcerautf1dbx,
                  /u01/app/oracle/product/12.1.0.2/dbhome_2/bin/sqlplus -L sys/password@/pcerautfdbx 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  
ERROR: 
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/SqlUtils.pm line 91. 
[root@oda1 ~]# less /opt/oracle/oak/log/oda1/tools/12.1.2.5.0/deletedatabase_pcerautfdbx_43801.log 
/u01/app/oracle/product/12.1.0.2/dbhome_2/bin/sqlplus -L sys/password@/pcerautfdbx as sysdba 
[root@oda1 ~]# /u01/app/oracle/product/12.1.0.2/dbhome_2/bin/sqlplus -L sys/welcome1@/pcerautfdbx as sysdba 
ERROR: 
ORA-12154: TNS:could not resolve the connect identifier specified 

[root@oda1 ~]# /u01/app/oracle/product/12.1.0.2/dbhome_2/bin/sqlplus -L sys/welcome1@pcerautfwelcome1@dbx as sysdba 
SQL*Plus: Release 12.1.0.2.0 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 12.1.0.2.0 - 64bit Production 

...

And restart the database

[oracle@oda1:pcerautf1dbx1 ]$ /u01/app/oracle/product/12.1.0.2/dbhome_2/bin/srvctl stop database -d pcerautfdbx
[oracle@oda1:pcerautf1dbx1 ]$ /u01/app/oracle/product/12.1.0.2/dbhome_2/bin/srvctl start database -d pcerautfdbx

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

...