Sap job to delete OS level files
Hello SAP Admins,
I have a question: is there a sap job that can delete files from OS level, to prevent the file system to become full.
Thank you
Chris
Hi Chris,
As such there is no standard job to remove OS level files.
You may write some abap program which contains execution of OS level commands.
You may schedule this ABAP program based on your requirement to cleanup the files at OS level.
We had done it for cleaning up interface files at one of our customers.
Hope this helps.
Regards,
Deepak Kori
Similar Messages
-
Hi all,
Please can anyone advice on how to write a batch file to trigger the sap job. For example: If file exists in an external folder (e.g. C:\Temp), a command will trigger to run the SAP job.
Many thanks,
ShashiYou could do this.
Check if file exists.
Do something when it does.
Move file to another directory and rename file with data/time stamp
Renamed file give history of activity
Schedule this program to run every X amount of time
data: w_result type c.
data: w_file type string value 'C:\temp\test_down.spf'.
data: w_file_size type i.
call method cl_gui_frontend_services=>file_exist
exporting
file = w_file
receiving
result = w_result
exceptions
cntl_error = 1
error_no_gui = 2
wrong_parameter = 3
not_supported_by_gui = 4.
if w_result ne 'X' .
else.
write: / w_file.
write: / 'File exists'.
Do something when it does.
Move file to another directory and rename file with data/time stamp
Renamed file give history of activity
endif.
flush needed for some methods of class cl_gui_frontend_services
call method cl_gui_cfw=>flush
exceptions
cntl_system_error = 1
cntl_error = 2
others = 3.
Bruce -
SAP certified printers & deleting spool files
Hello,
Could you please tell me what does a SAP certified printer mean?
Also I would like to ask you if is it possible to make settings in a job to delete the spoolfiles after the end of the job?
(I have a job which creates large spool files and I do not need these files)
Thank you in advance,
NoemiHi,
For deletion of spool file, you can schedule job SAP_REORG_SPOOL.
You can check below link:
http://help.sap.com/saphelp_46b/helpdata/en/c4/3a7ede505211d189550000e829fbbd/content.htm
Thanks
Sunny -
Where to find entry level sap jobs with a Terp10 Certification
Hello I am a soon to be college graduate graduating this December.
My question is with a Terp10 certification and no work experience what can I expect from the job market. Are there companies that hire college graduates with no SAP work experience? Are there any resources that help graduates find entry level SAP jobs.Hi ,
Welcome to the World of SAP !
As a fresher there are lot of options to start the career in SAP domain . As a fresher doing a certification *** training with out any prior experience , the opportunities for getting a job will be very less. SAP is a Enterprise business software which has the Technical ( ABAP,BASIS .......) Functional (SD,PP,MM,FI,...) Techno Functional modules . Choose a very option to get started . Getting a right career is not a tough job for you , search in web , read about sap , lot of online information ,forums available . choosing a career is a brainstorming work , my suggestion drop the idea of doing certification , as you are a fresher and very difficult to get a job without any experience . Please check the links to get start . good luck
SAPEDU Twitter account http://twitter.com/sapedu
SAP Education Facebook page http://www.facebook.com/SAPEducation
Education@SAP LinkedIn group http://www.linkedin.com/groups?gid=1856570
Want to switch to SAP consultancy The specified item was not found.
Career Switch in the SAP World The specified item was not found.
What would I do if I were a SAP newbie? Must read career advice for all beginners - check out this blog
HELP@ SAP : http://help.sap.com/
Online Knowledge Products : https://websmp202.sap-ag.de/okp
Knowledge burst - Business Rule Frame work BRF : http://www.sdn.sap.com/irj/bpx/education?rid=/media/uuid/50879cee-f9b5-2e10-039e-b2d6c4b10e6b
Regards,
S.Rajeshkumar -
Deleting the core file in HP Unix is it recommended for SAP?
when killing the work process select the option for cancel with core option then it generates the core file in HP UNIX .When i go to tcode ST11 core file length is 108,828,880.if we delete the core file in OS level is there any issue.
Regards,
RangaNo there is no issue, its only a Dump file to allow for further investigation why the process hung...
You can delete them without an issue... they are very big so they consume allot of valuable storage space....
Cheers,
B -
Creating a Job to execute a .sh file
Hi,
I have an important issue creating a Job to execute a .sh file,
the .sh (start_execution.sh) contains a lot of random calls like this:
#!/bin/bash
. /home/crm/.bash_profile
. /home/crm/argentina/crm/crmdw/clusters/mt/mt_pull_push/start.sh
. /home/crm/argentina/crm/crmdw/clusters/ota/ota/start.sh
sqlplus dware/argu01@crmarg @/home/crm/crmdw/AR/exec_dw.sql "MT"
sqlplus dware/argu01@crmarg @/home/crm/crmdw/AR/exec_dw.sql "OTA"
sqlplus dware/argu01@crmarg @/home/crm/crmdw/AR/exec_dm.sql "DAILY_DOWNLOADS"then creating the next job
Begin
dbms_scheduler.create_job
(job_name=>'job_AR',
job_action=>'/home/crm/crmdw/AR/start_execution.sh',
number_of_arguments=>1,
job_type=>'executable',
start_date => SYSDATE,
repeat_interval => 'FREQ=MINUTELY; INTERVAL=20',
enabled=>false,
auto_drop => TRUE,
comments=> 'Run shell-script test_dbms_scheduler.sh');
dbms_scheduler.set_job_argument_value(job_name =>'job_AR', argument_position => 1, argument_value => 'Parameter passed from Oracle to Unix');
dbms_scheduler.enable('job_AR');
end;
/the system executes all process at the same time instead of one to one,
Is necessary the system executes one to one becouse is a Hierarchy of process with
corresponding dependencies.
what could I do to resolve the issue??
any ideas??
Thanks in advanced...the problem is the content of the .sh file(start_execution.sh) is generated ramdomly and automatically and the code is :
FUNCTION F_GET_EXECUTION_PLAN
CONN_STRING_TRG VARCHAR2--'dwa/arg@arg'
, EXEC_TEMP_DIR VARCHAR2--'/home/crm/crmdw/AR/'
) RETURN CLOB AS
BEGIN
DECLARE
v_conn_string_trg VARCHAR2(255);
v_exec_temp_dir VARCHAR2(255);
v_select_aux VARCHAR2(32767);
v_select CLOB := ' ';
v_process_type VARCHAR2(5);
v_process_name VARCHAR2(50);
v_location VARCHAR2(255);
v_result NUMBER := 0;
TYPE t_array IS TABLE OF VARCHAR2(255);
TYPE t_cursor IS REF CURSOR;
v_array t_array := t_array();
c1 t_cursor;
BEGIN
v_conn_string_trg := CONN_STRING_TRG;
v_exec_temp_dir := EXEC_TEMP_DIR;
DBMS_LOB.TRIM(v_select, 0);
DBMS_LOB.APPEND(v_select, '#!/bin/bash' || chr(13) || chr(10));
DBMS_LOB.APPEND(v_select, BASH_PROFILE || chr(13) || chr(10));
DBMS_LOB.APPEND(v_select, chr(13) || chr(10));
v_select_aux := '
SELECT A.process_type, b.process_name, b.LOCATION
FROM
SELECT process_type, process_id, LEVEL level2
FROM
SELECT process_type, process_id, dep_process_type, dep_process_id
FROM crmdw_master_dependencies
WHERE dependency_type <> ''PREVIOUS_DATE''
UNION ALL
SELECT process_type, process_id, NULL, NULL
FROM
SELECT ''STG'' process_type, ID process_id
FROM crmdw_master_stg
UNION ALL
SELECT ''DW'', ID
FROM crmdw_master_dw
UNION ALL
SELECT ''DM'', ID
FROM crmdw_master_dm
MINUS
SELECT d.process_type, d.process_id
FROM crmdw_master_dependencies d
START WITH dep_process_type IS NULL
CONNECT BY PRIOR process_type = dep_process_type
AND PRIOR process_id = dep_process_id
) a
INNER JOIN
SELECT 1 ordinal, ''STG'' process_type, s.ID process_id, s.process process_name, c.location, s.active
FROM crmdw_master_stg s
INNER JOIN crmdw_master_clusters c ON (c.id = s.id_cluster)
UNION ALL
SELECT 2, ''DW'', ID, process, ''' || v_exec_temp_dir || ''', active
FROM crmdw_master_dw
UNION ALL
SELECT 3, ''DM'', ID, process, ''' || v_exec_temp_dir || ''', active
FROM crmdw_master_dm
) b ON (A.process_type = b.process_type AND A.process_id = b.process_id)
WHERE b.active = 1
ORDER BY b.ordinal, a.level2
BEGIN
OPEN c1 FOR v_select_aux;
LOOP
FETCH c1 INTO v_process_type, v_process_name, v_location;
EXIT WHEN c1%NOTFOUND;
v_result := F_CHECK_NEED_TO_EXECUTE (
v_process_type
, v_process_name
IF (v_result = 1) THEN
IF (v_process_type = 'STG') THEN
v_select_aux := '. ' || nvl(v_location, '/') || lower(v_process_name) || '/start.sh';
ELSIF (v_process_type = 'DW') THEN
v_select_aux := 'sqlplus ' || v_conn_string_trg || ' @' || v_location || 'exec_dw.sql "' || v_process_name || '"';
ELSIF (v_process_type = 'DM') THEN
v_select_aux := 'sqlplus ' || v_conn_string_trg || ' @' || v_location || 'exec_dm.sql "' || v_process_name || '"';
ELSE
v_select_aux := '';
END IF;
IF (v_array.COUNT > 0) THEN
FOR i IN v_array.FIRST .. v_array.LAST LOOP
IF ((v_array.EXISTS(i)) AND (v_array(i) = v_select_aux)) THEN
v_array.DELETE(i);
EXIT;
END IF;
END LOOP;
END IF;
v_array.EXTEND;
v_array(v_array.LAST) := v_select_aux;
END IF;
END LOOP;
CLOSE c1;
FOR i IN v_array.FIRST .. v_array.LAST LOOP
IF (v_array.EXISTS(i)) THEN
DBMS_LOB.APPEND(v_select, v_array(i) || chr(13) || chr(10));
END IF;
END LOOP;
EXCEPTION
WHEN OTHERS THEN
DBMS_LOB.APPEND(v_select, chr(13) || chr(10));
END;
RETURN v_select;
END;
END F_GET_EXECUTION_PLAN; -
Issue while scheduling job of Delete program of Archiving Object
Please help me.
I am working on SARA and clicked on delete program for Purchase Order.
When the job was executed, i checked logs and i found that there is some error and the job was cancelled.
The main problem is when i checked the EKKO table, the entries were also deleted which should not happen.
The Error Log was:
Job started
Step 001 started (program RM06ED47, variant SAP&PROD, user ID ABAPUSER)
Archive file 001273-001MM_EKKO cannot be processed because of its status
Job cancelled after system exception ERROR_MESSAGE
Can anyone suggest me what shud i do to avoid such scenario??i know that..but i was working in production mode and the data got deleted when the delete job status = cancelled..
Usually when delete fails, the data isnt deleted but this time the data got deleted which is wrong i guess.. -
Question related to deletion of archived files.
Hi everyone,
I have used the archiving object 'idoc' to archive data. However, this attempt to archive(write) failed twice and now i have two invalid sessions 632 and 633.
It has created archvied files worth 80 GB in my UNIX system, which are useless now. Is there some way by which i can clean up this data through SAP.
Please help.
Thanks,
Vinod.Hi Vinod,
Since the archive file belongs to invalid session you can simply delete the archive files at the unix level.
Cheers,
Samanjay -
Retention policy and deletion of archived files
hello, I 'am a novice DBA having a backup question.
Our retention policy is set to 14 days; weekly we have full database backup; daily we have an incremental backup.
See scripts below.
The drive "\\is003s012\rhea\rman" where the backup files reside has files older than 2 months.
I expected these files to be deleted already by rman.
I can't find the cause why these files are not removed.
The database backup jobs are running fine ; logs file do not contain any errors and once and a while you see that rman removes obsolete files.
list expired / report obsolete do not return any files.
thanks for the assistance
chris
================= full db
c$rman_script="backup incremental level 0 cumulative device type disk tag '%TAG' database;
backup device type disk tag '%TAG' archivelog all not backed up delete all input;
allocate channel for maintenance type disk;
delete noprompt obsolete device type disk;
release channel;
&br_save_agent_env();
&br_prebackup($l_db_connect_string, $l_is_cold_backup, $l_use_rcvcat, $l_db_10_or_higher, $l_backup_strategy, "TRUE");
my $result = &br_backup();
exit($result);
================ incr db
$rman_script="backup incremental level 1 cumulative device type disk tag '%TAG' database;
recover copy of database;
backup device type disk tag '%TAG' archivelog all not backed up delete all input;
allocate channel for maintenance type disk;
delete noprompt obsolete device type disk;
release channel;
&br_save_agent_env();
&br_prebackup($l_db_connect_string, $l_is_cold_backup, $l_use_rcvcat, $l_db_10_or_higher, $l_backup_strategy, "TRUE");
my $result = &br_backup();
exit($result);
================== rman setting
RMAN> show all;
RMAN configuration parameters for database with db_unique_name RHEA are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 14 DAYS;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '\\is003s012\rhea\rman\%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '\\is003s012\rhea\rman\%U';
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO 'SBT_TAPE';
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'D:\ORACLE\PRODUCT\11.2.0\DBHOME_1\DATABASE\SNCFRHEA.ORA'; # defaultChris,
Thanks for the info; my current setting for this parameter:
SQL> show parameter CONTROL_FILE_RECORD_KEEP_TIME;
NAME TYPE VALUE
control_file_record_keep_time integer 7
I found another thread that elaborated on this: Re: CONTROL_FILE_RECORD_KEEP_TIME vs Retention Policy in RMAN
a) RMAN Retention Policy set to recovery window of 30 days means backups and archivelogs that you need to do a Point in Time Recovery to before 30 days do not get obsolete.
b) CONTROLFILE_RECORD_KEEP_TIME=7 will keep (potentially, if space pressure in the controlfile) the records of these files for only 7 days
Effect: Your old backups and archivelogs (+7 days) are no longer known by the system and will not get deleted (automatically or by delete obsolete) and your recovery area/backup location/archive destination will get filled up with old files.
Therefore set b) > a)
Based on this I changed the parameter:
alter system set CONTROL_FILE_RECORD_KEEP_TIME=35 scope=both;
Even tho the 'stale' backupsets are still invisible (still getting 'no obsolete backups found' when doing REPORT OBSOLETE), I guess that's because it will take a while (23 days?) for the CONTROL_FILE_RECORD_KEEP to catch up to the RMAN Retention Policy of 30 days)....
Barry -
How to delete TMS log file and and request log no.
Dear experts,
How to delete TMS log file and and request log no...My TMS log is not deleted since 2007. Please advice
ThnksYou can delete them from OS level. You can delete safely the following files:
/usr/sap/trans/log/SAP*.<SID>
Is this you were looking for?
Regards,
Faisal -
Hi Experts,
I have a requirement to trigger SAP job whenever there is a new file in a network folder which is outside SAP. File name is like worklistYYYYMMDDHHMMSS.CSV. Timing of this file creation are unpredictable.
Also, this new file should be passed to SAP job for running.
Do you have any idea about possible solution? Can we user Event based trigger (SAPEVT command)?
Please let me know the details.
Many thanks,
AppsHi
You can do it in this way.
Creat a program in ABAP which picks up the file from Application Server
Put all the reocrds in an internal table and post it in SAP.
This program will be batch program and it will run once in every hr and
it will store the last captured file name in a Z table so whenever it picks up new file it will
compare the name old file and if they are not same delete the old file name and insert the new file name in the Z table.
Your batch program can pick up the file name from this Z table.
Hope it is useful.
Regards
Neha -
How to delete the Generated files from application server(open hub)?
hi experts,
when i try to execute process chain the DTP it is giving below dump. Exception CX_RSBK_REQUEST_LOCKED logged.
when i execute the DTP manually and trying to delete the previous request, it is giving for dump ITAB_DUPLICATE_KEY.
so to delete the generated file from application server, how to delete it for specific dates?
Information on where terminated
Termination occurred in the ABAP program "GPD6S3OE0BCVGC6L9DBNVYQARZM" - in
"START_ROUTINE".
The main program was "RSBATCH_EXECUTE_PROZESS ".
In the source code you have the termination point in line 2874
of the (Include) program "GPD6S3OE0BCVGC6L9DBNVYQARZM".
The program "GPD6S3OE0BCVGC6L9DBNVYQARZM" was started as a background job.
and when i check the dump it is point out at below code
" Populate the lookup table for 0STOR_LOC
SELECT * from /BI0/TSTOR_LOC
into CORRESPONDING FIELDS OF table L_0STOR_LOC_TEXT
FOR ALL ENTRIES IN SOURCE_PACKAGE WHERE
STOR_LOC = SOURCE_PACKAGE-STOR_LOC.
but the programme is syntactically correct only.
how to rectify the issue.
regards
venuscm
Edited by: venugopal vadlamudi on Sep 28, 2010 1:59 PMhi experts,
We have written start routine to get the storage location text and sending to File located at Application server through OPEN HUB.
here is the code written in the Transformations
In the global section
Text for 0STOR_LOC
DATA: l_0stor_loc_text TYPE HASHED TABLE OF /bi0/tstor_loc
WITH UNIQUE KEY stor_loc.
DATA: l_0stor_loc_text_wa TYPE /bi0/tstor_loc.
and in the code to get the text
" Populate the lookup table for 0STOR_LOC
*SELECT * from /BI0/TSTOR_LOC*
into CORRESPONDING FIELDS OF table L_0STOR_LOC_TEXT
FOR ALL ENTRIES IN SOURCE_PACKAGE WHERE
STOR_LOC = SOURCE_PACKAGE-STOR_LOC.
im sure there is problem with the Routine only. i think i need to change the code if so please provide me the modified one.
thanks
venuscm
Edited by: venugopal vadlamudi on Sep 29, 2010 9:37 AM -
Error Deleting/Archiving processed files
Hi all,
I'm working with a File (xml) to Idoc scenario. I have configured Sender File Channel to read files and after that deleting . SAP XI can read the files (xml files) and send to my SAP R/3 system but I in communication channel monitoring I get a message "Could not delete file 'p:.xml' after processing".
I have tried with archiving and I get a similar error, but in this case it makes the archiving twice (I get 2 files in the archiving directory) and it doesn´t delete the original file from the reading directory, so SAP XI is ever reading and archiving.
Does anyone know any solution?
Thanks.
Antonio.Hi Antonio,
can you check if those files have <b>read only</b> attributes?
if so you cannot delete them from the directory ? (or archive )
Regards,
michal -
Is it safe to delete the cache file folder from library
is it safe to delete the cache file folder from library ?
As I understand it Robo doesn't really 'do' third-party
source control. We use SourceGear Vault, but really only as a
repository for the files. We can't really work concurrently because
Robo needs exclusive access to the top level project files. But it
kind of works for us, because we're on opposite sides of the globe.
I see what you're saying on the 'local' versions of (say) the
cpd files conflicting. If anyone else has an informed view, I'm all
ears. We've set it up this way ourselves - I don't know of anyone
doing the same. If someone tells me this is a bad idea, I'm happy
to think again.
Cheers! -
Delete a .csv file from desktop system
Hi All,
My requirement is to read the .csv file from the desktop system having the shared folder and delete the file after read successfully.
Here I can read the .csv file from the location using the function RFC_REMOTE_FILE and updated the content into internal table.
But I cant delete the file from the presentation server ( Desktop system).
Can anyone tell me how to delete the .csv file from the desktop system on different location.
Note:
I followed this link to read file:
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/9831750a-0801-0010-1d9e-f8c64efb2bd2&overridelayout=trueHi Rob,
Thanks. I solved this problem myself.
The solution to delete the file from remote system is
concatenate 'DEL' i_filename i_dirname into v_bkfile separated by space .
call function 'RFC_REMOTE_EXEC'
destination c_dest
exporting
command = v_bkfile
exceptions
system_failure = 1 MESSAGE v_ermsg
communication_failure = 2 MESSAGE v_ermsg.
Maybe you are looking for
-
Hi All, I am new to the forum so i dont know if i can post this message in this section or not but i did not find any related section in the menu so i am posting it here. I want to read a .CSV (comma separated file) in a particular location and see i
-
Uploading a .doc with a form
I am using FormMail to send form data name address etc, to my site. I would Like users to be able to upload a c.v. or any small document and have it attached to an email to go to my reciepient? FormMail does not seem to be able to handle that i NEED
-
Whenever I work on my Mac it keeps reverting back to the previous settings once I restart.....Please Help!
-
Adobe Indesign CS6 Fonts issue
Dear Support, We have performed a re-installation of Windows 7 Professional 64 bit. We also had to re-install Microsoft Office Home and Business 2010 as well as Adobe Indesign CS6 and Photoshop CS6. We have installed all Windows Updates and all Adobe
-
Iphoto 9.5 not supporting color profiles supported in '11
JPG Photos in iphoto 11 from Scancafe.com with color profile OS14000_A2_B8_oG that worked with iphoto '11, now not working with iphoto 9.5 and now unable to re-import. First some background. I was using iphoto 11 and had no problem importing the sca