Schlagwort: Datenbanken
Oracle: enable UTL_FILE.PUT_LINE to write output to a file
Today I wanted to log some database output to a text file with UTL_FILE.PUT_LINE but when I called this procedure: CREATE OR REPLACE PROCEDURE writeLog(line varchar2) iS file utl_file.file_type; BEGIN file := utl_file.fopen(‘/tmp’, ‘test.txt’, ‘A’); utl_file.put_line(file, line); utl_file.fflush(file); utl_file.fclose(file); dbms_output.put_line(line); END writeLog; it produced an ORA-29280 error: invalid directory path:…
SQL command for killing Oracle user sessions
Here’s a small piece of SQL to generate SQL commands for killing all user sessions of a given user (you need to be sys/system): select ‘alter system kill session ”’ || sid || ‘,’ || serial# || ”’;’ from gv$session where username=’USER’ and machine=’PCNAME’;
MySQL: Host ist not allowed to connect to this MySQL server
When connecting to a (development) MySQL server from a remote machine (e.g. with Oracle SQL Developer) I got the following error message: Host [my host name] is not allowed to connect to this MySQL server. All user permissions in the mysql.user table were set correctly (host % for user root)…
Oracle: enable UTL_FILE.PUT_LINE to write output to a file
Today I wanted to log some database output to a text file with UTL_FILE.PUT_LINE but when I called this procedure: CREATE OR REPLACE PROCEDURE writeLog(line varchar2) iS file utl_file.file_type; BEGIN file := utl_file.fopen(‘/tmp’, ‘test.txt’, ‘A’); utl_file.put_line(file, line); utl_file.fflush(file); utl_file.fclose(file); dbms_output.put_line(line); END writeLog; it produced an ORA-29280 error: invalid directory path:…
SQL command for killing Oracle user sessions
Here’s a small piece of SQL to generate SQL commands for killing all user sessions of a given user (you need to be sys/system): select ‘alter system kill session ”’ || sid || ‘,’ || serial# || ”’;’ from gv$session where username=’USER’ and machine=’PCNAME’;
MySQL: Host ist not allowed to connect to this MySQL server
When connecting to a (development) MySQL server from a remote machine (e.g. with Oracle SQL Developer) I got the following error message: Host [my host name] is not allowed to connect to this MySQL server. All user permissions in the mysql.user table were set correctly (host % for user root)…