SQL & PL/SQL :: How To Get The File Name From Directory
Dec 12, 2012How to get the file name from directory without Java. Is there any way to do it in Pl/Sql.
View 13 RepliesHow to get the file name from directory without Java. Is there any way to do it in Pl/Sql.
View 13 Replieshave a log file in unix server under(/usr/home/oraj/log/abc.log) I am trying to access from oracle stored procedure as fallows
src_clob BFILE := BFILENAME('/usr/home/oraj/log', 'abc.log');
Exception:
ERROR at line 1:
ORA-22285: non-existent directory or file for FILEOPEN operation
ORA-06512: at "SYS.DBMS_LOB", line 716
ORA-06512: at "usr.LOAD_CLOB_FROM_XML_FILE", line 39
ORA-06512: at line 1
I dont want to create directory as such ('/usr/home/oraj/log') as it is already exists and all log files sits there.
CREATE OR REPLACE PROCEDURE Load_CLOB_From_XML_File
IS
dest_clob CLOB;
src_clob BFILE := BFILENAME('/usr/home/oraj/log/', 'abc.log');
dst_offset number := 1 ;
src_offset number := 1 ;
[code]...
This generates a CSV file in an directory. When it runs for the 1st time it take SYSDATE -7 data. After the 1st run it appends the data since the last run. Now my problem is the appending happens at the bottom of the file and every time the header appears. I want the header only the first time and the new data should keep appending at the top so that i get the latest data always at the top.
View 18 Replies View RelatedI have an issue when I enable auditing feature in oracle,I use 'DB' to store the audit from user in oracle, my command is
SQL>alter system set audit_trail=db scope=spfile;
SQL>shutdown immediate;
SQL>startup;
in show parameter audit, I see that the audit_trail already changed to DB after I create a user and enable audit for this user, I can see in the audit table dba_audit_trail for insert, update, delete,etc but If I am not wrong, if I using DB to setting the audit parameter then I will get audit file both in oracle table and in adump oracle folder installation, but in my case I cannot find any file in adump directory.
my operating system is windows7 and I use oracle database 10g express edition
This is the error message iam getting when trying to open EM... Im new to DBA and also to this DB....
[sandeep@Linux4 ~]$ emctl start dbconsole
TZ set to US/Eastern
Unable to locate file /home/sandeep/oracle/product/10.2.0/db_1/Linux4.localdomain.com_orcl/sysman/config/emd.properties : No such file or directory
i have one directory in this directory contains 100 file these files are related to table structured creation with dependence
so how to read file names from directory and executed in scheme with logs also
procedure or script
I want to get file directory path dynamically with out using directory in database or not hard code like below
the purpose is i need to check image in the path directory if not found i unable to generate report, is there any possible to get dynamically
function CF_URLFormula return Char is
v_handle utl_file.file_type;
v_file_dir VARCHAR2(60) := '/u002/app/applmgr/temp/';
begin
v_handle := utl_file.fopen(v_file_dir, :photo_name, 'R');
utl_file.fclose(v_handle);
RETURN v_file_dir||:photo_name;
exception
when others then
srw.message(100,SQLERRM);
return null;
end;
I write a file on database server by following
CREATE OR REPLACE DIRECTORY TEST_DIR AS 'c: emp'
GRANT READ, WRITE ON DIRECTORY TEST_DIR TO myuser
SQL> select * from all_directories;
OWNER DIRECTORY_NAME
------------------------------ ---------------------
DIRECTORY_PATH
----------------------------------------------------
SYS TEST_DIR
c: emp
SYS PUBLIC_DIR
E:PUBLIC_dir
and then
PROCEDURE run_query(p_sql IN VARCHAR2
,p_dir IN VARCHAR2
,p_header_file IN VARCHAR2
,p_data_file IN VARCHAR2 := NULL) IS
[code]...
but I get error wut_118.
Is there anyway to get a listing of the files in a specified directory on an ftp server using webutil?
View 2 Replies View RelatedI noticed that listener file in diag/trace is rapidly increasing. I am using 11g Rel 1 on window 2008 server Its 1 GB in couple of days. Is there any way if I can turn it off ?
View 5 Replies View RelatedI have an application where I generate a excel using data in a table and write excel file in oracle directory.Now my requirement is to open that file from local machine .How can i achieve it.I am using Apex 4.2,Oracle 10g .
View 1 Replies View Relatedhow do i copy an image or a text file from ex: directory c to directory d
View 5 Replies View Relatedhow can save pdf file from apex to user local directory on button click?
View 2 Replies View RelatedOracle Database 10g Express Edition Release 10.2.0.1.0 - Product
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
I am new in external table so i have tried following cmd.
create directory dir_1 as 'E:ora_dirt' ;
grant read, write on directory dir_1 to HR;
select * from all_directories;
create table emp_ext
(emp_id number,
emp_name varchar2(30)
[code]...
since I am not able to see DIR_1 in E: drive due to which i havnt created 'emp.dat' file and on executing select on external table i m geting expected error *"ORA-29913: error in executing ODCIEXTTABLEOPEN callout ORA-29400: data cartridge error KUP-04043: table column not found in external source: EMP_ID"*
how to create that file in directory "DIR_1" .
I want to create a xml file for a particular query and i have used the following
SELECT DBMS_XMLGEN.getXML('SELECT * FROM EMPL_NEW') FROM dual:
the output of this is
<?xml version="1.0"?>
<ROWSET>
<ROW>
<ENO>10001</ENO>
<ENAME>rajkumar</ENAME>
[Code]....
and i need to save this as .xml file in a particular file directory in client machine and i have coded like this
DECLARE
F UTL_FILE.FILE_TYPE;
MYCLOB CLOB;
DIR_STR varchar2(100);
BEGIN
DIR_STR:='XML';
SELECT
DBMS_XMLGEN.GETXML('
[Code]...
XML is the name of directory name i have created in my user and I have also created the directory manually in D:/xml.
UTL_FILE package access given to public..
but still this error(refer the pic) exists!!
For now we have a directory defined as /exp wherein we do the export using expdp. Can we define a new directory and use this directory for expdp.
View 3 Replies View RelatedIf ORACLE_HOME Directory crash/lose then how ? is there any option to recovery ? if yes how?
View 2 Replies View RelatedI have task to integrate AD users with oracle ebs r12 . Is there any mechanism to do it directly without OID between oracle ebs and Active directory during login to ebs or i have to install OID to finish that task .
View 1 Replies View RelatedI am trying to authenticate Oracle 10g through Active Directory ..But i am not able to do that successfully...
View 2 Replies View RelatedI restored a date in my database (the backup of that date was taked by a snap on Windows Server 2003), now I try to startup the database it gives me the following error
ORA-02778: Name given for the log directory is invalid
here is a copy of my spfile
*.background_dump_dest='H:\oracle\oradata\gdwh2401\BDUMP'
*.bitmap_merge_area_size=16777216
*.cluster_database=FALSE
*.compatible='9.2.0.0.0'
*.control_files='G:\oracle\oradata\DWHLIVE\CONTROL01.CTL','H:\oracle\oradata\DWHLIVE\CONTROL02.CTL','I:\oracle\oradata\DWHLIVE\CONTROL03.CTL'
*.core_dump_dest='H:\oracle\oradata\gdwh2401\CDUMP'
[code]....
this is a picture of my alert_log file
Tue May 06 09:42:15 2008
Starting background process EMN0
EMN0 started with pid=53, OS id=13704
Tue May 06 09:42:16 2008
Shutting down instance: further logons disabled
Tue May 06 09:42:18 2008
Stopping background process QMNC
Tue May 06 09:42:19 2008
[code]....
I have a major problem my oracle_home/bin directory was delete mistakenly by on of our user. Because i cannot use all oracle utitilessqlplus,dbca,netca,netmgr. how do i the cover this problem?
View 2 Replies View RelatedI have customized my sqlprompt. I put the code for that in a script p.sql.
Now I log into sql from multiple directories as I have different scripts in different directories. How do I access p.sql which is not in the currect directory.
Also I wanted to know if I could change directories from the sql prompt.
I create a directory using this:
CREATE DIRECTORY xml_data AS 'c:\mytest';
How can I retrieve the 'C:mytest' in a select statement?
I have a directory defined as TDM_IN where a directory has been created. There is a table which has been created as
create table abc.IFP_GRP_D_INT
(
IFP_GRP_DIM_KEY VARCHAR2(10),
.....
[Code]...
Now how can i select the records from this table?
Is it possible to export data to another directory other than datapump default directory(DATA_PUMP_DIR) in Linux.
View 5 Replies View RelatedI'm trying to install forms 10g on my windows 2000 professional os which is having oracle 9i client. but while installing 10g i'm geting oracle universal installer error. error in writing to directory c:...
My D drive is having 10GB free space and C drive is having 800MB free space (both drive have normal attribute i.e it's not read only ) and oracle have already copied some temp files in C drive (size 13.6 MB) .
Am creating a form for some processing text files available in a local users system. Now I would like to get the directory name from the user using dialog box and read the files
[ I am already reading the file, but I allow the user to select the specific file name using get_file_name ]
I have 100 image file in C:My_PIC/ i want read these image files and put in a table .
My table have 2 column : Id_pic varchar2(20) ,
PIC BLOB
I want read all files in C:MY_PIC and Insert in My table with a BUTTON in My form
ID_PIC = file name
PIC = image
Using PL/SQL I want to search inside a directory and execute the script files with a specific pattern.
I know that with @@ command I can execute a script, however when the name of the files come in a variable I don't know how to execute the script.
Here is the code for searching the files:
set serveroutput on
declare
directory2 varchar2(1024):='/home/oracle/dir';
[Code].....
I started working on utl_files. When i Am working on this topic I struck with an error: Quote:ORA-29280: invalid directory path. Below are the steps I followed to work on utl_files,
STEP1: connect sys as sysdba
STEP2: @$ORACLE_HOME/rdbms/admin/utlfile.sql
STEP3: create or replace directory utl_data_files as '/home/oracle/siva/data/'; --(the directory path is already exists in the OS)
STEP4: below is the code
DECLARE
out_file UTL_FILE.file_type;
linebuf varchar2(1999);
directory_name varchar2(100):='utl_data_files';
BEGIN
out_file:=UTL_FILE.fopen(directory_name,'emp.dat','W');
for emp_cur in (SELECT * FROM scott.EMP)
[code].....
STEP5: then it's giving the below result/error info
Quote:
SQL ERRORCODE IS:-29280
SQL ERROR MSG IS:ORA-29280: invalid directory path
PL/SQL procedure successfully completed.