(Sysdate-1) in filename using scheduler and ftp
Hello,
I'm having a little problem with BI Publisher.
What i am trying to do is use the sysdate-1 in the filename when using the scheduler in BIP.
I found out that for using the regular date there are functions like %d %m %y, so obviously the first thing i tried was using the %d-1 but that didn't work :(
Then i went looking on the internet and found the following article:
http://obiee-bip.blogspot.com/2010/05/dynamic-delivery-file-naming-in-bi.html
This mentions things like:
dd : CAST( DAYOFMONTH(NOW()) AS CHAR) ( ex, 01 - 31)
mon : CAST( SUBSTRING(MONTHNAME(NOW()) FROM 1 FOR 3) AS CHAR) (ex, Jan - Dec)
yyyy : CAST( YEAR(NOW()) AS CHAR) (ex, 2006,2010)
But when i use those in the same filename field then it just displays the string as text in the filename.
Could someone tell me what i am doing wrong, or what i need to do to make this work?
Thanks in advance
BIP version : Oracle BI Publisher 10.1.3.4.1
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
"CORE 10.2.0.4.0 Production"
TNS for HPUX: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
Hi Raafje,
Like I've already discussed in my Blog ,Using Date Expressions on Filenames of Burst Query has its own limitations. This date expression that you have tried for sysdate-1 (%d-1%m%y) will not hold good to the requirement. Anyways you can resolve the issue using other work arounds.
Method I (Using CAST and DATE Functions)
1.Previous Day -> CAST(DAYOFMONTH(TIMESTAMPADD(SQL_TSI_DAY, -1, CURRENT_DATE)) AS CHAR)
2.Month of Previous Day -> CAST(MONTH(TIMESTAMPADD(SQL_TSI_DAY, -1, CURRENT_DATE ) ) AS CHAR)
3.Year of Previous Day -> CAST(YEAR(TIMESTAMPADD(SQL_TSI_DAY, -1, CURRENT_DATE)) AS CHAR)
Sample Code
+'ReportName'||'-'||CAST( DAYOFMONTH(TIMESTAMPADD(SQL_TSI_DAY, -1, CURRENT_DATE)) AS CHAR)||'-'||CAST(MONTH(TIMESTAMPADD(SQL_TSI_DAY, -1, CURRENT_DATE ) ) AS CHAR)||'-'||CAST( YEAR(TIMESTAMPADD(SQL_TSI_DAY, -1, CURRENT_DATE)) AS CHAR)||'.pdf'+
Method II (Using Server Variables)
1. Create a Dynamic Repository Variable like Previous_Date(Non-System Session variables can also be used)
2. Create a Initialization blocks
In Data Source Section - Edit Data Source and place the below query
Select TO_CHAR(SYSDATE-1,'MM/DD/YYYY')
FROM Dual (you can use any date format as required)
3. In Variable Target Section
Edit Target -
Give the Name as Previous_Date (as you created in Step1) and Enable the Radio Button as Dynamic
Place date in Default Value like '9/22/2010'
4. Now use this Repository Variable in the filename parameter of the burst query as VALUEOF("Previous_Date") for Repository Variable
and VALUEOF(NQ_SESSION.Previous_Date) in case you have created a session variable for the query
Thanks & Regards,
Goushalya
http://obiee-bip.blogspot.com/2010/05/dynamic-delivery-file-naming-in-bi.html
Edited by: Goushalya on Sep 29, 2011 7:09 AM
Similar Messages
-
FILE and FTP Adapter file size limit
Hi,
Oracle SOA Suite ESB related:
I see that there is a file size limit of 7MB for transferring using File and FTP adapter and that debatching can be used to overcome this issue. Also see that debatching can be done only for strucutred files.
1) What can be done to transfer unstructured files larger than 7MB from one server to the other using FTP adapter?
2) For structured files, could someone help me in debatching a file with the following structure.
000|SEC-US-MF|1234|POPOC|679
100|PO_226312|1234|7130667
200|PO_226312|1234|Line_id_1
300|Line_id_1|1234|Location_ID_1
400|Location_ID_1|1234|Dist_ID_1
100|PO_226355|1234|7136890
200|PO_226355|1234|Line_id_2
300|Line_id_2|1234|Location_ID_2
400|Location_ID_2|1234|Dist_ID_2
100|PO_226355|1234|7136890
200|PO_226355|1234|Line_id_N
300|Line_id_N|1234|Location_ID_N
400|Location_ID_N|1234|Dist_ID_N
999|SSS|1234|88|158
I would need a the complete data in a single file at the destination for each file in the source. If there are as many number of files as the number of batches at the destination, I would need the file output file structure be as follows:
000|SEC-US-MF|1234|POPOC|679
100|PO_226312|1234|7130667
200|PO_226312|1234|Line_id_1
300|Line_id_1|1234|Location_ID_1
400|Location_ID_1|1234|Dist_ID_1
999|SSS|1234|88|158
Thanks in advance,
RV
Edited by: user10236075 on May 25, 2009 4:12 PM
Edited by: user10236075 on May 25, 2009 4:14 PMOk Here are the steps
1. Create an inbound file adapter as you normally would. The schema is opaque, set the polling as required.
2. Create an outbound file adapter as you normally would, it doesn't really matter what xsd you use as you will modify the wsdl manually.
3. Create a xsd that will read your file. This would typically be the xsd you would use for the inbound adapter. I call this address-csv.xsd.
4. Create a xsd that is the desired output. This would typically be the xsd you would use for the outbound adapter. I have called this address-fixed-length.xsd. So I want to map csv to fixed length format.
5. Create the xslt that will map between the 2 xsd. Do this in JDev, select the BPEL project, right-click -> New -> General -> XSL Map
6. Edit the outbound file partner link wsdl, the the jca operations as the doc specifies, this is my example.
<jca:binding />
<operation name="MoveWithXlate">
<jca:operation
InteractionSpec="oracle.tip.adapter.file.outbound.FileIoInteractionSpec"
SourcePhysicalDirectory="foo1"
SourceFileName="bar1"
TargetPhysicalDirectory="C:\JDevOOW\jdev\FileIoOperationApps\MoveHugeFileWithXlate\out"
TargetFileName="purchase_fixed.txt"
SourceSchema="address-csv.xsd"
SourceSchemaRoot ="Root-Element"
SourceType="native"
TargetSchema="address-fixedLength.xsd"
TargetSchemaRoot ="Root-Element"
TargetType="native"
Xsl="addr1Toaddr2.xsl"
Type="MOVE">
</jca:operation> 7. Edit the outbound header to look as follows
<types>
<schema attributeFormDefault="qualified" elementFormDefault="qualified"
targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/file/"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:FILEAPP="http://xmlns.oracle.com/pcbpel/adapter/file/">
<element name="OutboundFileHeaderType">
<complexType>
<sequence>
<element name="fileName" type="string"/>
<element name="sourceDirectory" type="string"/>
<element name="sourceFileName" type="string"/>
<element name="targetDirectory" type="string"/>
<element name="targetFileName" type="string"/>
</sequence>
</complexType>
</element>
</schema>
</types> 8. the last trick is to have an assign between the inbound header to the outbound header partner link that copies the headers. You only need to copy the sourceDirectory and SourceGileName
<assign name="Assign_Headers">
<copy>
<from variable="inboundHeader" part="inboundHeader"
query="/ns2:InboundFileHeaderType/ns2:fileName"/>
<to variable="outboundHeader" part="outboundHeader"
query="/ns2:OutboundFileHeaderType/ns2:sourceFileName"/>
</copy>
<copy>
<from variable="inboundHeader" part="inboundHeader"
query="/ns2:InboundFileHeaderType/ns2:directory"/>
<to variable="outboundHeader" part="outboundHeader"
query="/ns2:OutboundFileHeaderType/ns2:sourceDirectory"/>
</copy>
</assign>you should be good to go. If you just want pass through then you don't need the native format set to opaque, with no XSLT
cheers
James -
Scheduling a background job using Job_Submit and Job_Close FM
Hi Guys,
I am calling a report in background using Job_Submit and Job_Close FM's.
I am not providing start time and date in the Job_close FM, in this case, when the job will be scheduled to start.
Even after an hour, job status is still scheduled.
I am not exporting variant, since I am using memory ID.
Thanks
Edited by: sapgeek007 on May 11, 2009 4:11 AMIn Job_close fm use the parameter 'STRTIMMED'
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = LV_NUMBER
jobname = LV_NAME
STRTIMMED = 'X'
EXCEPTIONS
CANT_START_IMMEDIATE = 1
INVALID_STARTDATE = 2
JOBNAME_MISSING = 3
JOB_CLOSE_FAILED = 4
JOB_NOSTEPS = 5
JOB_NOTEX = 6
LOCK_FAILED = 7
INVALID_TARGET = 8
OTHERS = 9
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
That would start the background job immediately.
Regards,
Deepak -
How to generate .pdx file using File Adapter and FTP Adapter
Hi,
is it possible to genearate .pdx file using oracle ESB Adapters(File Adapter and FTP adapter).
Can you anyone guide me.
Thanks,
Raj.hi,
regarding report, there is a dedicated report forum. you should post there.
but answer for your question is form is nothing to do with the pdf generation. you can call the report from the as usual.
In the report you should set the properties like
destype to 'file'
desname to 'path with file name'
desformat to 'pdf' -
Use of Dowload Scheduler , and Formatted Reporting
Hi friends,
in our Business Explorer i can able to see lot of tools..along with Analyser and Query Designer .. those are.. <b>Download Sceduler </b> and <b>Foramtted Reporting</b>... and <b>Browser</b> ..
can any one plz give me the brief idea.. abt those tools...
helpful answers will be rewarded....
THANKS
BabuHI,
<b>Download scheduler</b> can be used to download a package - create a package for precalculation in the reporting agent and then open the same using the download scheduler and schedule the same...
procedure:
1. create a web template
2. In report agent -Do setting for the web template
3. schedule the setting in the package.
4. the setting was for
data calculation
Excel sheets
HTML pages
Then check the preview, you will get data in it.
5. run the package
6. use download scheduler to create HTML pages and Excel workbooks
BTW - download scheduler is taken away in NW2004s
<b>Formatted reporting</b> is for producing a report in an exact format required by the user. For stringent formatting requirements (e.g., financial reports, government reporting, etc.), this usually implies the use of a reporting tool like Crystal Reports.
<b> Bex Browser</b> makes it possible for you to access all document types of the Business Information Warehouse that are assigned to your role, or that you have stored in your favorites. In the BEx Browser, you can select and open the documents assigned to you, or store and manage new documents.
The document types which you can work with in the BEx Browser are:
BW workbooks
Documents stored in the Business Document Served (BDS)
Links (references to the file system, shortcuts)
Links to Internet pages (URLs)
SAP transaction calls.
BW Web reports
Hope this helps!!
Regards,
dhanya. -
Explain How delivery date is calculated using backward and forward schedul
How can anyone please explain how delivery date is calculated using forward and backward scheduling
I want to have it broken down into the following steps
for eg for delivery date calculation following dates are used
Material Availabilty Date
Material Staging Date
Pick/pack time
Transportation PLanning date
Loading date
Goods issue date
Transit Date
Delivery Date
Can some one please give me an example and explain wht these dates are
for eg customer needs delivery date on 11/20/2008
how would the system cacluate whether it can meet the delivery date using backward scheduling
and if it doesnt meet how does the system do the forward scheduling
also i am not clear with the following dates
material avaialibilty date
material staging date
transportation date
can some one please explain me all this in detail
ThanksHi,
Basically this is the CRSD(Customer requested ship date logic)logic in which system calculates the ship date depends upon the material availability. If material is available system calculates ship date on the basis of master data maintained in customisation.Master data is maintained in the following link.
If material is not available then system takes into consideration vendor delivery date & then calculate customer ship date.
Please go through the link in SPRO
LE-Shipping -Basic shipping functions-Scheduling -Delivery scheduling & Transportation scheduling-Maintain duration.
In customisation following data is maintained
Material Availabilty Date
Material Staging Date
Pick/pack time
Transportation PLanning date
Loading date
Goods issue date
Transit Date
Delivery Date
Hope you got the idea of CRSD calculation
Regards,
Prashant. -
DW on Mac, CS3/CS5 using SFTP and/or FTP, need it secure!
Folks:
DW CS3 or CS5 running on an quad-Intel iMac, 10.6.4, connecting to a host that uses identical credentials for SFTP and FTP.
It's important to be assured that the connection is in fact secure.
If you set "connect using SFTP" will DW CS3 complain if the connection cannot be made securely? Will DW then default to ordinary, insecure FTP? If so, will DW inform you? Is there an easy way of verifying the current connection mode, SFTP or FTP, within DW? (The FTP connection log does not say.) Is there an easy way of doing it in MacOS or with a simple utility? (Can be done, but not conveniently, with L'il Snitch.)
Is DW CS5 any different?
TIA,
hen3ryFolks:
Problem solved.
It's clear that FTP and SFTP are fundamentally different protocols, but the DW protocol selection strongly implies similarity by offering SFTP as a minor option under the main selection of FTP. I think it would be much clearer if SFTP were offered as a major option -- and then there would be an opportunity for offering SFTP options, too.
Here's a way of distinguishing which of these two is active: Connecting to the target site using FTP results in a succession of text entries in the optionally viewable FTP log -- no surprise. I discovered that connecting to the same site with the same credentials and the addition of checking the "Use SFTP" option results in only line feeds --scrolling, but no visible text-- in the FTP log window. I guess that's a reasonable though a bit indirect way of informing users that the link is active and secure. (What does one do to diagnose problems with SFTP for hosting services that don't support FTP? I don't know there are such services but it should be the great majority of them.) Works in DW CS3 but I didn't check CS5.
Another option, untested but fairly obvious: It's fairly easy these days to control host s/w (personal) firewalls -- even for low-tech users. Establish and verify a link to your server using SFTP, then disable FTP; the link should fail. And vice-versa. This meets my specification of "simple" and should be available with no extra expense and little trouble.
Brief Editorial: From the recent reading I've done on FTP versus SFTP, it is clear that the time to discontinue all support for FTP is long past.
hen3ry -
Incremental and Full backups using WBADMIN and Task Scheduler in Server 2008 R2
I'd like to create an automated rotating schedule of backups using wbadmin and task scheduler, which would backup Bare Metal Recovery; System State; Drive C: and D: to a Network Share in a pattern like this:
Monday - Incremental, overwrite last Monday's
Tuesday - Incremental, overwrite last Tuesday's
Wednesday - Incremental, overwrite last Wednesday's
Thursday - Incremental, overwrite last Thursday's
Friday - Incremental overwrite last Friday's
Saturday - Full, overwrite last Saturday's
I need to use the wbadmin commands within the Task Scheduler and do not know any of the required Syntax to make sure everything goes smoothly, I do not want to do this through the CMD.I know each backup for the previous corresponding day will be replaced, how do you figure I wont be able to do incremental backups...
Because incremental backup is based on Volume Shadow Copy (VSS) feature and due to Windows Server 2008 R2 limitations (this limitation is resolved in Windows 8) only one version of backed up data can be stored in a shared folder. So the
result is that every time you back up some data on a shared folder, you actually creating a full backup of them.
is it not supported through task scheduler?
The Task Scheduler is only a feature that does the tasks that you have defined for it. Actually it runs the
wbadmin command that runs on an operating system with the mentioned limitation.
I know you can do Incremental backups through Windows Server Backup, but my limitation using that is I cant setup multiple backups.
Yes, you are right. Windows Server Backup feature in Windows Server 2008/2008 R2 has not this functionality (although
ntbackup in Windows XP and Windows Server 2003 had this functionality). So, the only workaround to this limitation is through using Task Scheduler feature with wbadmin command. For more information see the following article:
http://blogs.technet.com/b/filecab/archive/2009/04/13/customizing-windows-server-backup-schedule.aspx
So are you saying that even though I want each backup to go to a different place on the Shared Folder that it will replace the previous backup anyways?
No and because of this I said in my previous post that with some modifications and additions you can do the scenario. For example, you back up to a shared folder with the name of Shared1 on Mondays. You also have been configured the backup feature to back
up data on another shared folder, named Shared2, on Wednesday. When you repeat the backup operation in Shared1, only the backed up data that resides on it will be affected, and the data on Shared2 remains intact.
Please feel free to let us know if you have any question or concern.
Please VOTE as HELPFUL if the post helps you and remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading
the thread.
Hi R.Alikhani
Then do you know if wbadmin supports incremental backup in Windows 8? As you said the VSS issue is fixed in Win8. However, the wbadmin has less options then in windows server. I tried a bit but it seems it only supports full backup? ps, I use a network share
- will the incremental backup works if I define a ISCCI then? My remote backup PC is also running Win8. -
Doh, I thought I had to cram the question into those few words - didn't realise it wa sa title! Our iCal has just recently refused to automatically refresh - if you delete it and subscribe again it won't let you. All machines affected. We use MobileMe and I've been on the account and all looks good. Is there someone we can phone to talk this through? We're a mag so we really need to all work on the same schedule and know who is off etc? Any clues?
Cheers
BeverleyHave you got a firewall? - these can sometimes cause problems.
If you are in a business environment and all on the same LAN, you might like to consider abandoning MobileMe and buying BusyCal. It's like iCal Pro in effect, with more facilities, including the ability to display ToDos in the day area: it uses the same database as iCal.
You would revert to local calendars, and BusyCal can sync them instantly between computers on the same network, with read/write access if required. (Syncing can only take place when Macs are on).
It's available in the Mac App Store and their site has a free trial period (it's more expensive on the site so you would want to delete the trial and buy from the App Store).
http://www.busymac.com
Instructions on syncing over a LAN - http://www.busymac.com/help/sync/busycal-lan.html
Instructions on publishing on a server - http://www.busymac.com/help/sync/busycal-lan-host.html
It's possible to do all this over the internet, though it's more complicated - http://www.busymac.com/help/sync/busycal-wan.html
I have no connection with this firm. -
Date Extension on Crystal Output Filename in Scheduler
Post Author: mek
CA Forum: General
We use Crystal Reports 10. When we schedule reports through the CMC scheduler we add the date to the output filename by selecting the DateTime option from the variable properties list ( ex. ExpoSalesSummaryReport_%DateTime%.xls generates a file named ExpoSalesSummaryReport_2007-04-25-10-46-33.xls). The date format that is automatically concatenated onto the filename by Crystal is not what we need. We do not want the time in the date extension and we want the date format simplified, without dashes.
Our team needs to have additional values available in the variable properties list of the report scheduler that would allow us to select a specific date format to be concatenated to the filename when we schedule reports. For example, we would like to have the following selections in the picklist (new options that we want to add and use are bolded), ex:
Title
ID
Owner
DateTime
FileExtension
DateMMDDYY
DateMMDDYYYY
DateMONDDYY
DateMONDDYYYY
Is it possible to create new parameters for the scheduler picklist that can add a date extension to the filename in the format we want? I would think that there must be some way to customize the file extension mask behind the scenes in Crystal 10.
Thanks in advance for your help.Hi Raafje,
Like I've already discussed in my Blog ,Using Date Expressions on Filenames of Burst Query has its own limitations. This date expression that you have tried for sysdate-1 (%d-1%m%y) will not hold good to the requirement. Anyways you can resolve the issue using other work arounds.
Method I (Using CAST and DATE Functions)
1.Previous Day -> CAST(DAYOFMONTH(TIMESTAMPADD(SQL_TSI_DAY, -1, CURRENT_DATE)) AS CHAR)
2.Month of Previous Day -> CAST(MONTH(TIMESTAMPADD(SQL_TSI_DAY, -1, CURRENT_DATE ) ) AS CHAR)
3.Year of Previous Day -> CAST(YEAR(TIMESTAMPADD(SQL_TSI_DAY, -1, CURRENT_DATE)) AS CHAR)
Sample Code
+'ReportName'||'-'||CAST( DAYOFMONTH(TIMESTAMPADD(SQL_TSI_DAY, -1, CURRENT_DATE)) AS CHAR)||'-'||CAST(MONTH(TIMESTAMPADD(SQL_TSI_DAY, -1, CURRENT_DATE ) ) AS CHAR)||'-'||CAST( YEAR(TIMESTAMPADD(SQL_TSI_DAY, -1, CURRENT_DATE)) AS CHAR)||'.pdf'+
Method II (Using Server Variables)
1. Create a Dynamic Repository Variable like Previous_Date(Non-System Session variables can also be used)
2. Create a Initialization blocks
In Data Source Section - Edit Data Source and place the below query
Select TO_CHAR(SYSDATE-1,'MM/DD/YYYY')
FROM Dual (you can use any date format as required)
3. In Variable Target Section
Edit Target -
Give the Name as Previous_Date (as you created in Step1) and Enable the Radio Button as Dynamic
Place date in Default Value like '9/22/2010'
4. Now use this Repository Variable in the filename parameter of the burst query as VALUEOF("Previous_Date") for Repository Variable
and VALUEOF(NQ_SESSION.Previous_Date) in case you have created a session variable for the query
Thanks & Regards,
Goushalya
http://obiee-bip.blogspot.com/2010/05/dynamic-delivery-file-naming-in-bi.html
Edited by: Goushalya on Sep 29, 2011 7:09 AM -
File to File scenario using Transport Protocol FTP Problem
Hi,
my scenario is a file to file scenario using Transport Protocol FTP
there are 3 systems involved
a. computer 1 ( My system-source)
b. computer 2 (XI server)
c. computer 3 (Target system)
I want XI to pick file from computer 1 and post it to computer 3
I am logging on to XI server from computer 1(thro SAP GUI),
<u><b>Sender communication channel :</b></u>
Transport protocol:FTP
Messsage protocol: file
<u><b>In FTP connection Parameters:</b></u>
Server: computer 1 IP address
port:21
User name and PW---> I have given computer 1 Username and password.
Connection mode: permanently
Transfer mode: Binary
Folder: C:\ftproot\output
filename : given
<u><b>In Receiver Communication Channel</b></u>
Transport protocol:FTP
Message protocol: file
<u><b>In FTP connection Parameters:</b></u>
Server: computer 3 IP address
port:21
User name and PW---> I have given computer 3 Username and password.
Connection mode: permanently
Transfer mode: Binary
Put File: Use Temporary File
Folder:
eccserver\saploc\tmp
filename scheme: given
When I activate the scenario file is not getting picked from the source
In Adapter Framework: Message says up and running No message processing now
How to check FTP server is up and running on computer 1 (source system)and Computer 2 (XI server)?
What could be the problem ?
Thanks
dushanthHi
Consider that I dont have FTP installed on my computer. According to this blog
/people/shabarish.vijayakumar/blog/2006/08/01/along-came-a-file-adapter-mr-ftp-and-rest-of-the-gang
I have configured.
In sender comm channel I have given Ipaddress of computer 1 (which has a file to be picked)
In Receiver Comm channel I have given IP address of computer 3 (in which file to be posted)
and computer 2 is the XI server
Computer 1 has FTP installed
1. XI server should have FTP installed or not ? IF yes is it FTP client or FTP server or Guild FTP (according to the blog is enough)
2. Computer 3 should have FTP installed or not ?
Please help me I am really confused.
Thanks
dushanth -
[Oracle 11g] Store filename as VARCHAR2 and its content as XMLType
Hi all,
The version of Oracle used is 11.2.0.3.0.
I would like to load a XML file into a table from AIX with a Shell script.
Here is the test case table:
ALTER TABLE mytable DROP PRIMARY KEY CASCADE;
DROP TABLE mytable CASCADE CONSTRAINTS;
CREATE TABLE mytable (
filename VARCHAR2 (50 BYTE),
created DATE,
content SYS.XMLTYPE,
CONSTRAINT pk_mytable PRIMARY KEY (filename) USING INDEX
XMLTYPE content STORE AS BINARY XML;The problem is to store the the file name too.
So I add a step to create the control file from a generic one like this:
#!/bin/ksh
FILES=$(sample.xml)
CTL=generic.CTL
for f in $FILES
do
cat $CTL | sed -e "s/:FILE/$f/g" > $f.ctl
sqlldr scott/tiger@mydb control=$f.ctl data=$f
rc=$?
echo "Return code: $rc."
doneThe filename and the data are stored in the table, but I get this error message after executing the Shell script:
SQL*Loader: Release 11.2.0.3.0 - Production on Mon Jun 11 13:42:21 2012
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
SQL*Loader-275: Data is in control file but "INFILE *" has not been specified.
Commit point reached - logical record count 64And here is the content of the log file:
SQL*Loader: Release 11.2.0.3.0 - Production on Mon Jun 11 14:13:43 2012
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
SQL*Loader-275: Data is in control file but "INFILE *" has not been specified.
Control File: sample.ctl
Data File: sample.xml
Bad File: sample.bad
Discard File: none specified
(Allow all discards)
Number to load: ALL
Number to skip: 0
Errors allowed: 50
Bind array: 64 rows, maximum of 256000 bytes
Continuation: none specified
Path used: Conventional
Table MYTABLE, loaded from every logical record.
Insert option in effect for this table: APPEND
Column Name Position Len Term Encl Datatype
FILENAME CONSTANT
Value is 'sample.xml'
CONTENT DERIVED * EOF CHARACTER
Dynamic LOBFILE. Filename in field FILENAME
Record 2: Rejected - Error on table MYTABLE.
ORA-00001: unique constraint (PK_MYTABLE) violated
Record 3: Rejected - Error on table MYTABLE.
ORA-00001: unique constraint (PK_MYTABLE) violated
Record 4: Rejected - Error on table MYTABLE.
ORA-00001: unique constraint (PK_MYTABLE) violated
Record 5: Rejected - Error on table MYTABLE.
ORA-00001: unique constraint (PK_MYTABLE) violated
and so on...
Record 52: Rejected - Error on table MYTABLE.
ORA-00001: unique constraint (PK_MYTABLE) violated
MAXIMUM ERROR COUNT EXCEEDED - Above statistics reflect partial run.
Table MYTABLE:
1 Row successfully loaded.
51 Rows not loaded due to data errors.
0 Rows not loaded because all WHEN clauses were failed.
0 Rows not loaded because all fields were null.
Space allocated for bind array: 1664 bytes(64 rows)
Read buffer bytes: 1048576
Total logical records skipped: 0
Total logical records read: 64
Total logical records rejected: 51
Total logical records discarded: 0
Run began on Mon Jun 11 14:13:43 2012
Run ended on Mon Jun 11 14:13:43 2012
Elapsed time was: 00:00:00.23
CPU time was: 7586:56:08.38It seems that the control file try to insert as many rows than the number of lines in the file sample.xml !!!
So, I cannot check if load is done correctly since return code is allways 2!
Is it the correct way to solve my problem ?
What can I do to get it better ?Another question !
Here is an other way of doing it.
#!/bin/ksh
FILEPATH=./data/sample.xml
FILENAME=$(basename ${FILEPATH})
CTLFILE=load_data.ctl
cat > ${CTLFILE} <<EOF
LOAD DATA
INFILE *
INTO TABLE mytable APPEND
filename CONSTANT "${FILEPATH}",
created "SYSDATE",
content LOBFILE (filename) TERMINATED BY EOF
BEGINDATA
${FILEPATH}
EOF
sqlldr scott/tiger@mydb control=${CTLFILE}
rc=$?
echo "Return code: $rc."I've tested this script, it's okay.
Now I want to store the basename of the file : ${FILENAME}.
How can I do that ?
The problem is that I can no more write "LOBFILE (filename)" because it does not point to the correct path of the file !!!
Someone can help me please ?
Thanks. -
(Urgent) Sysdate issue in Oracle applications scheduler.
Hi All
I have used the query 'SELECT SYSDATE FROM DUAL' for a parameter in concurrent request. If I execute this concurrent as a single request, then it returns exact sysdate (current date) in a parameter.
If i schedule this program for daily execution using scheduler, then the sysdate is always giving value of the date when i have configured the scheduler.
For example,
My Requirement :The scheduler configured such a way that it should run everyday.Whenever it runs my query has to return the current date.
Current Issue: I schedule the scheduler on 23-Dec-2008. If it runs on 24-DEC-2008,it returns as '23-DEC-2008', If it runs on 28-DEC-2008 also,it returns as '23-DEC-2008.However If I execute this as a single request, it works fine.
Can anyone help me please,,It is very urgent.
Thanks in AdvanceHi,
I can confirm that this does work properly on 11.1.0.6 . Here is the code I used
-- create a table for output
create table job_output (log_date timestamp with time zone,
output varchar2(4000));
begin
dbms_scheduler.create_job (
job_name => 'myjob',job_type => 'plsql_block',
job_action =>
'insert into job_output values(systimestamp, ''myjob runs'');',
repeat_interval=>'freq=minutely',
number_of_arguments => 0, enabled => true);
end;
exec dbms_lock.sleep(130);
select * from job_output order by log_date ;The table job_output clearly shows dates increasing by one minute every run. If you use "freq=daily" instead then the job will run once a day instead of once a minute.
Does this example work for you ? If not could you post output from the job_output table and tell us what version database you are using.
Thanks,
Ravi. -
Mainframe Integration using File Adapter (FTP Mode):: ftp commands
Hi,
We are trying to integrate with Mainframe system using File Adapter. (FTP mode). We are able to write the file to Mainframe system but not able to format it properly. We had to provide FTP parameter, <b>ftp.quote site recfm=fb lrecl=150</b>
As per SAP Note 801926 :: XI 3.0 File Adapter: Additional Parameters, the only parameter that can be used is <b>ftp.timeout</b>. Has anyone tried out using other FTP parameters? (like ftp.quote)
Any help is grealy appreciated.
Regards,
Siva MarananiI am looking at running some OS commands especially the QUOTE SITE FILENAME, and found this OSS note:
https://service.sap.com/sap/support/notes/841704
In this note it says...
"Note that for the File Adapter transport protocol "FTP", the operating system command is NOT executed on the FTP server, but on the server hosting the Adapter Engine." -
SAP XI support SFTP and FTPS?
Hi Gurus,
I would like to find out if SAP XI supports both SFTP and FTPS. If yes, how do I perform the configuration?
Thanks in advance.Business Case:
In many implementations Business requirement is to "secure" the file/data transfer between XI and any third-party system. So there is a need of secured connection between XI/PI and any file based third-party legacy systems.
Following solutions are proposed to cater secure connection between XI/PI and any third party systems.
1) SFTP (Secure File Transfer Protocol)
"SSH File Transfer Protocol" or SFTP is a network protocol that provides file transfer and manipulation functionality over any reliable data stream. It is typically used with the SSH-2 protocol to provide secure file transfer. SFTP encrypts the session, preventing the casual detection of username, password or anything that is being transmitted. One key benefit to SFTP is its ability to handle multiple secure file transfers over a single encrypted pipe. By using a single encrypted pipe, there are fewer holes in the corporate firewall.
2) FTPS (FTP over SSL)
FTPS (FTP-SSL) is a real ftp that uses TSL/SSL to encrypt the control session and if required the data session. With FTPS, the control session is always encrypted, but the data session may not be always encrypted. FTPS is a file transport layer on top of SSL. SSL, or Secure Sockets Layer, is a method by which an encrypted u2018pipe' or tunnel is established between the FTP client and FTP server. Once the secure tunnel has been established (which is done using 128-bit encryption techniques), standard FTP is used to transfer data over the secure connection.
Feasibility of SFTP and FTPS in XI:
SFTP:
As per the latest SAP PI/XI support pack, it does not support SFTP via File Adapter.
So alternative approach to cater this requirement from XI is to make use of Unix Script at OS level to transfer the files from/to third-party systems.
Inbound Interface - i.e. third-party system ->XI->SAP:
File is transferred to a folder in SAP XI landscape from the third-party legacy system using UNIX Script with secured protocol. Once the file is ready in the XI landscape, File Adapter will poll this directory and file is picked up by NFS protocol.
Outbound Interface u2013 i.e. SAP->XI->third-party system:
XI is responsible for writing a file into a folder in the XI landscape. These files are transferred to the third-party system by executing UNIX scripts with secured protocol i.e. via sFTP.
Pre-Requisites:
Public key should be exchanged between external systems and the PI system.
UNIX shell script has to be developed and scheduled.
Advantages:
Highly Secured.
Ability to handle multiple secure file transfers over a single encrypted pipe .By using a single encrypted pipe, there are fewer holes in the corporate firewall.
Disadvantages:
Two-Step process i.e. XI>Temporary folder>External System and vice-versa
Files have to be temporarily stored in XI server.
Multiple failure points i.e. XI and Unix script execution
Maintenance of an external UNIX script.
Difficulty in monitoring the execution of the shell script as it cannot be monitored thru XI.
Need to generate keys and install it in the SFTP site as a pre-requisite i.e. SFTP clients must install keys on the server.
SFTP uses keys rather than certificates. This means that it can't take advantage of the "chains of trust" paradigm facilitated through Certificate Authorities.
Files from the XI server should be deleted/archived in a periodic manner to increase the disc space so that it will increase the performance.
Note: UNIX shell Script can be executed as a background job u2018or' can be triggered from SAP XI through OS command at File adapter level.
FTPS (File Transfer Protocol Using SSL/TLS):
This is a built-in feature of File adapter in XI. But SAP Java Cryptographic Toolkit must be deployed as a prerequisite. (Refer to note https://service.sap.com/sap/support/notes/821267 Question 28). By default following ports are used:
Implict FTPs 990 (Control) and 989 (Data)
Explicit FTPs 21 (Control) and 20 (Data)
Both use cases can be combined with active and passive mode.
Advantages:
Direct transfer of files to/from third-party systems. It is not required to store the files in the XI server temporarily.
Built-In feature from XI File adapter
No extra effort in development and maintenance of Unix Script.
Centralized Monitoring tool from XI
FTPS uses certificates and therefore can take advantage of "chains of trust" paradigm facilitated through Certificate Authorities. This paradigm makes it possible for two entities to establish a trust relationship without directly exchanging security information, which is important for some applications.
Disadvantages:
Requires opening multiple ports forenabling SSLin the firewall. So there are multiple holes in the corporate firewall.
Not every FTP server supports FTPS and many that do, require a configuration change to activate the FTPS protocol extension.
Cryptographic toolkit should be installed in XI system though it is not very complex or expensive.
Conclusion:
Though SFTP seems more secure as it works through one port, FTPS is easier to configure, monitor and maintain from XI point of view. However, the decision depends on many parameters like, cost/effort, flexibility in use, ease of maintenance, company security policy, failure possibilities etc.
regards
kummari
Maybe you are looking for
-
Pages '09 version 4.2 (1008) won't update.
I have Pages '09 version 4.2 (1008) that I bought as an add-on through the Apple Store on my iMac, not the App Store. App store has update but won't work, bc there is no record of purchase. How do I update apps not bought on App Store? If it was not
-
Hello, I'm new to SharePoint development. I just created a empty sharepoing app in VS2010, added a webpart and in .cs file of this webpart, add hello inside RenderContents. Its compiling fine. but giving following error while deploying Error occurred
-
POSTING_INTERFACE_DOCUMENT with PA segments/CO-PA
Does anybody able post the document using function module POSTING_INTERFACE_DOCUMENT with PA Character ( CO-PA) segment(Product,Brand, equipment type). If so, can you please suggest me. Iam using the structure "CE01000" which was in FB01 screen but i
-
Dear Fr, Whenver I am clicking the action Add to Solution database for addition I am getting the error Page can't be displayed. Please help me.
-
Last execution query and last user
Hello, I'd like to know last execution time of a query and last user - table RSZCOMPDIR provides the "Owner" and "Last changed by" only. I don't want to install the technical content. Have you any idea, which table contains this information (BW 3.1 u