SQL & PL/SQL :: Generates CSV File In Directory
Feb 17, 2012
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
ADVERTISEMENT
Dec 12, 2012
How to get the file name from directory without Java. Is there any way to do it in Pl/Sql.
View 13 Replies
View Related
Oct 7, 2009
have 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]...
View 1 Replies
View Related
Jan 6, 2013
I 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
View 8 Replies
View Related
Jun 17, 2010
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
View 16 Replies
View Related
Jun 7, 2013
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
View 5 Replies
View Related
Sep 6, 2013
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;
View 1 Replies
View Related
Oct 3, 2013
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.
View 1 Replies
View Related
May 25, 2010
Is there anyway to get a listing of the files in a specified directory on an ftp server using webutil?
View 2 Replies
View Related
Jul 6, 2012
I 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 Related
May 31, 2013
I 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 Related
Oct 31, 2011
how do i copy an image or a text file from ex: directory c to directory d
View 5 Replies
View Related
Jun 13, 2012
how can save pdf file from apex to user local directory on button click?
View 2 Replies
View Related
Nov 20, 2012
Oracle 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" .
View 2 Replies
View Related
Jul 27, 2010
I just completed a capture and I am trying to calibrate the workload but I get this error and I have not info about it.
I chmod the dir to 777 (just to make sure it wasn't permission) My sid is set to the correct db. Oracle_home, etc are set.
wrc MODE=calibrate REPLAYDIR=.
Workload Replay Client: Release 11.2.0.1.0 - Production on Tue Jul 27 14:59:33 2010
Copyright © 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Errors in file :
ORA-15557: workload replay client cannot access the replay directory or the database version do not match the preprocessing one
View 3 Replies
View Related
Jan 31, 2013
I'm looking for errors in alert.log, I thought that every "ORA-XX" would be a incident in adrci, but "i have missed" some ORAS-XX
I have a wrong job in my test environment which generates an ORA-12012 every 5 minutes. If we chech the alert.log trace we can see that there is a recor every five minutes (more of less)
oooo--oo--oo--oo--oo--oo--oo--oo--oo--oo--oo--oo--oo--oo--oo--oo--oo--oo--oo--oo
adrci> show alert -tail 2
2013-01-31 12:59:01.901000 +01:00
SMCO started with pid=23, OS id=20719
2013-01-31 13:00:23.033000 +01:00
Errors in file /u01/app/oracle/diag/rdbms/xe/XE/trace/XE_j000_20765.trc:
ORA-12012: error on auto execute of job "TEST"."WRONG_JOB"
ORA-04063: package body ""TEST"."WRONG_JOB"" has errors
ORA-06508: PL/SQL: could not find program unit being called: ""TEST"."WRONG_JOB""
[code].....
But, if we look for for incidents
oooo--oo--oo--oo--oo--oo--oo--oo--oo--oo--oo--oo--oo--oo--oo
adrci> show incidents
ADR Home = /opt/oracle/diag/rdbms/xe/XE:
*************************************************************************
INCIDENT_ID PROBLEM_KEY CREATE_TIME
-------------------- ----------------------------------------------------------- ----------------------------------------
23393 ORA 600 [kzsviver:1] 2012-09-27 09:19:55.054000 +02:00
23394 ORA 600 [kzsviver:1] 2012-09-27 09:20:13.540000 +02:00
23409 ORA 600 [kzsviver:1] 2012-09-27 09:56:35.688000 +02:00
[code].....
This ORA-12012 doesn't appears.
View 8 Replies
View Related
Dec 7, 2011
Whenever any transaction happen in database redo has generated for this transaction. Do select statement treat as a transaction as it doesn't modify any thing in database. And If select statement should not be a transaction, there should not be any redo generation for select statement.
So is select statement generate redo? If yes then Why ?
View 1 Replies
View Related
Jul 24, 2013
I am trying the new Oracle 12c and its feature to create columns with the keyword IDENTITY. I create a table CREATE TABLE xt (a NUMBER GENERATED by default AS IDENTITY PRIMARY KEY, b VARCHAR2(10));
And populate it, sometimes specifying the value for a and sometimes relying on the system to generate the value:
INSERT INTO xt (b) values ('a');INSERT INTO xt (b, a) values ('b', default);INSERT INTO xt (b, a) values ('c', 3);INSERT INTO xt (b) values ('d');INSERT INTO xt (b) values ('e');
The problem is that the fourth INSERT fails because the system tries to use the value 3 which is already taken. The fifth statement gets the value 4.
And the table now contains: A B - -1 a 2 b 3 c 4 e Is there something I am missing? I understood that by specifying BY DEFAULT, I would be allowed to sometimes specify values on my own without them interfering with the generated values. I now that the same thing works correctly in MySQL (where I would get five rows from 1 to 5 with the same INSERT statements) /nikos
View 11 Replies
View Related
Aug 9, 2011
Calling function
select PACK.MAIN('blah') from dual
generates:
ORA-14551: cannot perform a DML operation inside a query
ORA-06512: at "SYSADM.NEW_QUANTUM_PACK", line 756
ORA-06512: at "SYSADM.NEW_QUANTUM_PACK", line 245
Unfortunately the Body is not accessible to see.The spec of the function is:
FUNCTION MAIN (mvar IN varchar2) RETURN varchar2; I read somewhere that I can call it like:
var myVar VARCHAR2; call PACK.MAIN('blah') into :myVar
But this generates: ORA-01008: not all variables bound
View 3 Replies
View Related
Nov 11, 2011
I set 'maxopenfiles 4' when allocating channel to sbt in my products env, I got 2 backup pieces in one backup set because that tablespace has 7 datafiles. Other configuration is kept as default, such as no maxsize, no MAXPIECESIZE, and etc setting.
I read document from Oracle. It says:"By default a backup set contains one backup piece. To restrict the size of each backup piece, specify the MAXPIECESIZE option of the CONFIGURE CHANNEL or ALLOCATE CHANNEL commands. " And also, maxopenfiles configure does not force another backup piece generated. So, why do I get another backup piece?
BTW, I tried this on another testing environment. I only get one backup piece even there are more than 2 times maxopnefiles datafiles.
View 7 Replies
View Related
Jul 16, 2013
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!!
View 4 Replies
View Related
Apr 17, 2013
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 Related
Apr 21, 2011
If ORACLE_HOME Directory crash/lose then how ? is there any option to recovery ? if yes how?
View 2 Replies
View Related
Jun 3, 2013
I 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 Related
Aug 19, 2009
I am trying to authenticate Oracle 10g through Active Directory ..But i am not able to do that successfully...
View 2 Replies
View Related
May 6, 2008
I 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]....
View 5 Replies
View Related
Nov 4, 2011
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 Related
Jun 30, 2010
I 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.
View 6 Replies
View Related
Oct 27, 2011
I create a directory using this:
CREATE DIRECTORY xml_data AS 'c:\mytest';
How can I retrieve the 'C:mytest' in a select statement?
View 5 Replies
View Related
May 2, 2013
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?
View 3 Replies
View Related