miércoles, 5 de diciembre de 2018

SET EDITFILE

Hice un login en un servidor UNIX con el usuario oracle:

UNIX: who -m
oracle     pts/42       Dec  5 11:53    (10.80.14.246)
UNIX:


Sin darme cuenta, me moví a un directorio donde no tenía permisos para crear archivos:

UNIX: cd /
UNIX: pwd
/
UNIX: touch andrew
touch: cannot create andrew: Permission denied
UNIX:

Hice un login en una base de datos y escribí SQL que no fue corecto:

UNIX: sqlplus /

SQL*Plus: Release 11.2.0.1.0 Production on Wed Dec 5 18:11:55 2018

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

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select count(*) from dba_tabbles
  2  /

select count(*) from dba_tabbles
                     *
ERROR at line 1:
ORA-00942: table or view does not exist

SQL>

Intenté a cambiar el SQL pero no podía crear el archivo necesario:


SQL> ed
SP2-0110: Cannot create save file "afiedt.buf"
SQL>

Me serví de la comanda SET EDITFILE para crear el archivo en otro directorio:

SQL> set editfile /tmp/andrew
SQL>

Luego podía crear mi archivo y cambiar mi SQL: