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;
Similar Messages
-
Create A JOB must execute in every 20 minutes from 8:00 AM to 8:00 PM
Hi,
Can any one a write a script to create a job suppose “ERP_CONS_POST_JOB” in a database.
This job must execute in every 20 minutes from 8:00 AM to 8:00 PM.
Thanks in advance.Please reply me its urgent.bpat wrote:
Go through the below link
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_job.htm
http://psoug.org/reference/dbms_job.html
It will provide a better understanding.
Look at the INTERVAL procedure.That's not really correct.
The dbms_job package is the "old" way of scheduling jobs.
Since 10g the dbms_scheduler package has superceded that and is the preferred option, as well as it offering greater flexibility. dbms_job is only kept for backwards compatibility. -
Creating the job to execute automatically the program RSWUWFML2
Hi guys,
Iu2019m setting up the job to send Workitems to internet periodically with the program RSWUWFML2, when I create the job It ask me for a responsible user in the u201Cstepu201D, this user is going to be the one to execute this job, I usually call this user u201CWORKFLOWu201D and I need to set the Email account (Workflow) for this user (Tcode SU01) because on this Email account the system will be sending a kind of log for the workitems sent to users and which of them have been opened by the user.
The question I have is in SU01 which u201CROLESu201D have to be set for this user to be able to make all the thinks to send the workitmes to the users and send this Email as a log and make all the things related to execute the RSWUWFML2 report.
Tanks a lot>
FelipeUribe wrote:
> Hi Ravi, tanks a lot for your answer, The problem using user WF-BACH as a user to be placed in the Job (Tcode SM36 -> Step u2026 field u201CUser = Background User Name for Authorization Checku201D) is that I get an error because this user canu2019t be a u201Ccommunicationu201D useru2026.the Tcode SWU3 create this user WF-BATCH automatically with this features.
Hi Felipe
Here's Help from the user type field in SU01 for B it says,
System 'B'
Use the system user type for internal system processes (-> background processing) or system-related processes (-> ALE, workflow, TMS, CUA).
Dialog logon (using SAP GUI) is not possible.
A user of this type is excluded from the general settings for password validity. Only user administrators can change the password using transaction SU01 (Goto -> Change Password).
Multiple logons are permissible.
I have checked one of our productive systems and it is set to B for WF-BATCH. The error message you get is because your WF-BATCH is a C type.
Hope this helps.
Good Luck
Ravi -
Error while executing the .sql file
Hello,
Every time when i execute the below plsql it's keep throwing the error message as show in below output, this happens even when i manually create the trigger before executing the .sql file of all the below statements, can you please correct me what i am doing wrong here. Thank you.
DROP TABLE FCSDWH.REF_DATA_MASTER;
CREATE TABLE FCSDWH.REF_DATA_MASTER
REF_DATA_MASTER_ID NUMBER PRIMARY KEY,
DESCRIPTION VARCHAR2(255 CHAR),
CREATE_ID VARCHAR2(10 CHAR),
CREATE_DT DATE,
LST_UPD_ID VARCHAR2(10 CHAR),
LST_UPD_DT DATE,
ACT_STRT_DT DATE,
ACT_END_DT DATE
TABLESPACE FCSDWH
STORAGE(INITIAL 50K);
DROP SEQUENCE FCSDWH.REF_DATA_MASTER_SEQ;
CREATE SEQUENCE FCSDWH.REF_DATA_MASTER_SEQ START WITH 1 INCREMENT BY 1;
DROP TRIGGER "FCSDWH.REF_DATA_MASTER_TRG";
CREATE OR REPLACE TRIGGER FCSDWH.REF_DATA_MASTER_TRG
BEFORE INSERT ON FCSDWH.REF_DATA_MASTER
FOR EACH ROW
BEGIN
SELECT FCSDWH.REF_DATA_MASTER_SEQ.NEXTVAL INTO :NEW.REF_DATA_MASTER_ID FROM DUAL;
END;
/Output:
SQL> @/home/smadala/REF_DATA_MASTER.SQL
Table dropped.
Table created.
Sequence dropped.
Sequence created.
DROP TRIGGER "FCSDWH.REF_DATA_MASTER_TRG"
ERROR at line 1:
ORA-04080: trigger 'FCSDWH.REF_DATA_MASTER_TRG' does not exist
Trigger created.
SQL>The trigger is "attached" to the table so when you drop the table the trigger goes as well.
John -
Doubt to create a job to run a executable oracle 10g
Hi guys,
I´m using oracle 10gR2 and trying to schedule a job to execute a automatic import every night and then drop the dmp file.
I would like to know if it´s possible..
I´m configuring via web enterprise manager and in the option :
"Command
Select the command type for the job, then enter the command requirements."
And I´m changing the command type to executable and passing
$ORACLE_HOME/bin/imp sys/password file=mydump.dmp fromuser=user1 touser=user2
but it´s failing. Anybody knows what I´m doing wrong ?No, that you cant.
Instead create a shell script for the import and then put that as the command in oem.
Message was edited by:
orafad -
File not creating in AL11 wen executing in Background
Hi,
I have written code to upload some data to Appln server(AL11). When i execute in foreground, file is creating. But wen i execute in background, i couldnt find that file in the path which i have given.
Since we cant debug the program in Background, i dont know whether OPEN DATASET returns SUBRC = 0 or not. I even checked with the Path thr AL11. The same path is accessible too..
Plz help me out for this.
Thanks,
RameshRamesh,
You can debug a background job.
go to sm37 and select the job and type /JDBG in the command prompt.
search in sdn on how to debug a background job
Thanks
Bala Duvvuri -
Where is the account to execute ssis in file system when run a job
Hi
I have a ssis package in file system, and create a job, in general... the section package:... select "File System".
but it thrown: access denegate: the user should be administrator..
what is the account or where is it, that use to run the job in agent, this is owner of the job?
this is my configuration..
http://blog.sqlauthority.com/2011/05/23/sql-server-running-ssis-package-in-scheduled-job/By default it would be the service account which SQLAgent uses
You can see this from services properties
for that go to start-> run
type services .msc
In local services window right click SQL Agent Service and check the properties and in LogOn tab you will see the account configured for it
Most cases it would be network service account and in some cases local system account (if not in a domain)
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page -
SIS package works in development environment but fails when job scheduler executes, file path invalid
Relatively simple package to get OLE-DB connection to MS FoxPro 9.0 DB
The failure in the job log states that the path is invalid its a network path (\\192.168.1.xxx\foldername) this has been run several ways with the remote computer being mapped as a network drive and through the \\ notation described above.
Thinking it was a security issue between the SQL agent account and my account I tested by subsitution myself as a proxy account for the agent when running this job, again same result failed on network path.
One issue I see is that the remote computer is running Server 2000 (legacy software incompatable with newer versions)
Is it possible that this is a security issue, since if i understand correctly the current MS domain security model didn't exist until Server 2003.Hi REIData,
Have you got the issue resolved? Based on your description, please make sure the target folder is shared properly. If the computer on which the SQL Server Agent job runs doesn’t join the domain as the server that hosts the shared folder, you have to share
the folder with everyone by adding “Everyone” to the people list on the File Sharing page of the folder and assign "Read/Write" permission to it.
Regards,
Mike Yin
TechNet Community Support -
I created a class file , if i execute this class file it has to be always o
i created a class file , if i execute this class file it has to be always on top if i open any other programms or applications then also this class file application has to show me on the screen top , i meas ti has to show me first and behind all applications which i opend other applications
How to do this please help me
bhaskarIt sounds like you might be able to write a .bat script to run the application, create a desktop icon for that and set its properties so it runs in the background.
-
Creating backup Job with DBMS_SCHEDULER
Hello,
Can someone please help me out here:
I'm using Oracle10g release 1 on windowsXP
I'm trying to create a backup job with dbms_scheduler and it's not working.
This is what I did:
I created a job as follows:
BEGIN
dbms_scheduler.create_job (
job_name => 'RMAN_FULL',
job_type => 'EXCUTABLE',
job_action => 'E:\wkdir\rman_bkp',
enabled => TRUE,
start_date => '24-NOV-2007 2:10:00 PM',
repeat_interval => 'FREQ=WEEKLY',
comments => 'Full Database Backup');
END;
While rman_bkp is an RMAN command but it wasn't working.
Please where do I get it wrong?
Kindly put me through the EXECUTABLE or should I use PL/SQL_BLOCK and how?
Thanks.
Regards,
CherishHi,
There is a guide to running external jobs using the Scheduler here
Guide to External Jobs on 10g with dbms_scheduler e.g. scripts,batch files
You need to use the full path to a real Windows executable and the arguments to it e.g. for a batch script you would have to do something like
c:\windows\cmd.exe /q /c c:\myscript.bat
There is a forum dedicated to the Scheduler here
Scheduler
Hope this helps,
Ravi. -
Create SQL Job with Invoke-Sqlcmd
I'm trying to run a set of .sql files, i didn't know how to pass a common variable to all, so i've started running the statements directly in ps. One of these creates a job but i'm running into all of the errors due to the special characters and the
variables, can someone help?
$Client = "C0212"
$Instance = "SQL03\"+$Client
$sqlscript3 = "
--NEED TO CHANGE THE LOG LOCATION BELOW
USE [msdb]
GO
/****** Object: Job [DatabaseBackup - USER_DATABASES - FULL] Script Date: 11/15/2013 8:40:20 AM ******/
BEGIN TRANSACTION
DECLARE @ReturnCode INT
SELECT @ReturnCode = 0
/****** Object: JobCategory [Database Maintenance] Script Date: 11/15/2013 8:40:20 AM ******/
IF NOT EXISTS (SELECT name FROM msdb.dbo.syscategories WHERE name=N''Database Maintenance'' AND category_class=1)
BEGIN
EXEC @ReturnCode = msdb.dbo.sp_add_category @class=N''JOB'', @type=N''LOCAL'', @name=N''Database Maintenance''
IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
END
DECLARE @jobId BINARY(16)
EXEC @ReturnCode = msdb.dbo.sp_add_job @job_name=N''DatabaseBackup - USER_DATABASES - FULL'',
@enabled=1,
@notify_level_eventlog=2,
@notify_level_email=0,
@notify_level_netsend=0,
@notify_level_page=0,
@delete_level=0,
@description=N''Source: http://ola.hallengren.com'',
@category_name=N''Database Maintenance'',
@owner_login_name=N''sa'', @job_id = @jobId OUTPUT
IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
/****** Object: Step [DatabaseBackup - USER_DATABASES - FULL] Script Date: 11/15/2013 8:40:20 AM ******/
EXEC @ReturnCode = msdb.dbo.sp_add_jobstep @job_id=@jobId, @step_name=N''DatabaseBackup - USER_DATABASES - FULL'',
@step_id=1,
@cmdexec_success_code=0,
@on_success_action=1,
@on_success_step_id=0,
@on_fail_action=2,
@on_fail_step_id=0,
@retry_attempts=0,
@retry_interval=0,
@os_run_priority=0, @subsystem=N''CmdExec'',
@command=N''sqlcmd -E -S `$(ESCAPE_SQUOTE(SRVR)) -d DBA -Q `"EXECUTE [dbo].[DatabaseBackup] @Databases = ''''USER_DATABASES'''', @Directory = N''''T:\SQLsafe Backups\SQL Native Backup'''', @BackupType = ''''FULL'''',
@Verify = ''''Y'''', @CleanupTime = 170, @CheckSum = ''''Y'''', @LogToTable = ''''Y''''`" -b'',
--NEED TO CHANGE THE LOG LOCATION BELOW
@output_file_name=N''C:\Program Files\Microsoft SQL Server\MSSQL11.$Client\MSSQL\LOG\DatabaseBackup_`$(ESCAPE_SQUOTE(JOBID))_`$(ESCAPE_SQUOTE(STEPID))_`$(ESCAPE_SQUOTE(STRTDT))_`$(ESCAPE_SQUOTE(STRTTM)).txt'',
@flags=0
IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
EXEC @ReturnCode = msdb.dbo.sp_update_job @job_id = @jobId, @start_step_id = 1
IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
EXEC @ReturnCode = msdb.dbo.sp_add_jobschedule @job_id=@jobId, @name=N''Saturday 4am'',
@enabled=1,
@freq_type=8,
@freq_interval=64,
@freq_subday_type=1,
@freq_subday_interval=0,
@freq_relative_interval=0,
@freq_recurrence_factor=1,
@active_start_date=20131109,
@active_end_date=99991231,
@active_start_time=40000,
@active_end_time=235959,
@schedule_uid=N''5b3c3fcf-28dc-4f4c-95ce-a624667ee378''
IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
EXEC @ReturnCode = msdb.dbo.sp_add_jobserver @job_id = @jobId, @server_name = N''(local)''
IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
COMMIT TRANSACTION
GOTO EndSave
QuitWithRollback:
IF (@@TRANCOUNT > 0) ROLLBACK TRANSACTION
EndSave:
GO"
Invoke-Sqlcmd –ServerInstance $Instance –Database msdb –Query $sqlscript3 -QueryTimeout 300So, if I try this:
$Client = "C0212"
Invoke-Sqlcmd -InputFile "C:\NewInstanceScripts\PSNI -3 - Create Full Backup job for ALL User Databases.sql" -Variable $Client
and in my .sql file that line that contains the variable looks like this:
@output_file_name=N'C:\Program Files\Microsoft SQL Server\MSSQL11.`$(Client)\MSSQL\LOG\DatabaseBackup_$(ESCAPE_SQUOTE(JOBID))_$(ESCAPE_SQUOTE(STEPID))_$(ESCAPE_SQUOTE(STRTDT))_$(ESCAPE_SQUOTE(STRTTM)).txt',
I get the error:
Invoke-Sqlcmd : The format used to define the new variable for Invoke-Sqlcmd cmdlet is invalid. Please use the 'var=value' format for defining a new variable.
If i try like this:
Set @Client = "C0212"
Invoke-Sqlcmd -InputFile "C:\NewInstanceScripts\PSNI -3 - Create Full Backup job for ALL User Databases.sql" -Variable @Client
Line in .sql file like this:
@output_file_name=N'C:\Program Files\Microsoft SQL Server\MSSQL11.@Client\MSSQL\LOG\DatabaseBackup_$(ESCAPE_SQUOTE(JOBID))_$(ESCAPE_SQUOTE(STEPID))_$(ESCAPE_SQUOTE(STRTDT))_$(ESCAPE_SQUOTE(STRTTM)).txt',
I get the error: Set-Variable : A positional parameter cannot be found that accepts argument '2'. -
Hi,
I'm using Oracle9iR2 database.
I create a package procedure that loop through a list of jobs from user_jobs table and run it using dbms_job.run(jobid).
Then I schedule this package procedure as a job (say JobA) itself to execute the above procedure every 15 minutes.
However, it always fail. When I execute JobA manually from sqlplus, I get the folllowing error. Any idea what's wrong?
SQL> exec dbms_job.run(55805);
BEGIN dbms_job.run(55805); END;
ERROR at line 1:
ORA-12011: execution of 1 jobs failed
ORA-06512: at "SYS.DBMS_IJOB", line 406
ORA-06512: at "SYS.DBMS_JOB", line 272
ORA-06512: at line 1
Please advise.
Thank you.
Message was edited by:
bchurnHi,
I am bchurn's colleague who is currently also looking into this problem. The code that we have is similiar to yours except there's a cursor looping through all the failed jobs and executing them.
I am not sure what is the actual difference but it is actually a job running a procedure instead of through SQL Plus.
However, we found out that a job cannot run another job. But it seems to be alright with your settings :-/
What we have is actually a job created for every email to be sent out to our users (jobA). But many a times, the emails were not sent out because of unknown problems (during that time - I think it's the ORA-00600 error).
The last time we created the second job (jobB) for the purpose of re-executing failed jobA jobs. The errors are that a job cannot execute another job.
Then, we worked around to change jobB to re-adjust the execution time for all the jobA jobs instead of directly reexecuting them. While some failed jobA jobs are executed successfully because of it, some still remains. We found out that the errors from failed execution of jobA jobs as following:
ORA-00600: internal error code, arguments: [kgassg_2], [], [], [], [], [], [], []
ORA-29279: SMTP permanent error: 555 5.5.4 <fieldNameHere> parameter unrecognized
The second error very seldom. First one most common. The jobs eventually being executed successfully after many re-execution (sometimes about 3 to 4 times, some over 20 or 60 times). Anyone can give suggestions or inputs on the first error? The error log file and its trace files do not give much information on the errors with something like the following:
Error log file:
Errors in file /opt/app/oracle/products/920/admin/testapp/bdump/somefilename.trc:
ORA-00600: internal error code, arguments: [kgassg_2], [], [], [], [], [], [], []
And when I go and search for the somefilename.trc, it does not exist.
Any idea on how to solve this or identifying the actual problem?
Thank you in advance. -
ORA-20213: Unable to create standalone job record
We are currently in the process of upgrading our repository from 9.0.2.56.0 to 9.2.0.2.8 and we have moved our mappings into new repository by importing an MDL file. We have successfully deployed a mapping from new repository but when we attempt to execute this mapping using:
DECLARE
retval NUMBER;
BEGIN
retval:=Map_Wm_Osa_Fund_Pl.Main(F_Initialize_Owb);
END;
we get the following:
ORA-20213: Unable to create standalone job record - there may be no task defined for this map
ORA-06512: at "PRM_OWB_RUNTIME.WB_RT_MAPAUDIT", line 1252
ORA-06512: at "PRM_OWB_RUNTIME.WB_RT_MAPAUDIT", line 2084
ORA-06512: at "PRM.MAP_WM_OSA_FUND_PL", line 3832
ORA-06512: at "PRM.MAP_WM_OSA_FUND_PL", line 3913
ORA-06512: at line 4
Any help on this would be much appreciated.Alright, here's the work around for this, I'm also using the following to run mapping.
DECLARE
RetVal NUMBER;
P_ENV WB_RT_MAPAUDIT.WB_RT_NAME_VALUES;
BEGIN
-- P_ENV := NULL; Modify the code to initialize this parameter
RetVal := SCHEMA.MAPPING.MAIN ( P_ENV );
END;
My mapping was running fine until I have tried to deploy it under a different location.
Somehow OWB Runtime remembered my old location and was confused between the two. That's why you see this error.
Option 1.
Rewrite your mapping, this is ok if it's a small mapping.
Option 2.
1. Export your mapping(s) (MDL file)
2. Delete your mapping from the repository.
3. Import a backup of your mapping before the second location was created. (It’s doesn't matter if it's a old backup)
(At that point you should be able to run the old mappings without error)
4. Import the good backup over the old mapping, (use merge option during import)
Your mapping should run now.
Jean -
hi all
i want to execute a sql file from Pl/sql block.
plz help me...
thanx
AshishThis is one way
-- Program Name: EXTcmd.sql
-- This sql will create a java class.
-- Parameters: &1 = OS command string
CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED "EXTcmd" AS
import java.lang.Runtime;
public class EXTcmd
public static void execute (String command)
try
Runtime rt = java.lang.Runtime.getRuntime();
rt.exec(command);
catch(Exception e)
System.out.println(e.getMessage());
return;
-- Program Name: EXT_execute_cmd.sql
-- This sql will create a stored procedure to using java class to execute the command.
-- Parameters: &1 = OS command string
create or replace procedure EXT_execute_cmd (cmd IN VARCHAR2) as
language java name 'EXTcmd.execute( java.lang.String)';
-- Program Name: EXT_job_execute.sql
-- Called by: Oracle job
-- Call : EXT_execute_cmd
create or replace procedure EXT_job_execute
(P_EXEC_CMD IN VARCHAR2) is
cmd_string varchar2(200);
begin
cmd_string := 'PUT YOUR SCRIPT HERE';
EXT_execute_cmd(cmd_string);
end EXT_job_execute;
null -
Execution problem while creating a job
Hi,
I have written a procedure to generate a csv file to a destination ( procedure name - sp_write_to_file).
I have created a job for this procedure to be executed after every 2 minutes using the package dbms_job as follows;
sql>VARIABLE jobno NUMBER;
sql>execute DBMS_JOB.SUBMIT(:jobno,'sp_emp_write_file;',INTERVAL =>
'SYSDATE+(2/24/60)');
---- I got a successful execution message as;
PL/SQL procedure successfully completed.
But the file is not getting generated.
When i execute the job manually as;
exec dbms_job.run(25); --- i got the job number as 25.
Then the file gets created.
What is the error ?
plz guide.How about:
execute DBMS_JOB.SUBMIT(25,'sp_emp_write_file;',INTERVAL => 'SYSDATE+(2/24/60)');
commit;Also I'm not sure about the interval. Maybe you don't have to enter the interval as a string.
Message was edited by:
Sven W.
Maybe you are looking for
-
Randomly when I plug my Iphone 4s into Itunes it will tell me that it can't detect my phone and that I need to restore it. It doesn't happen every time, but maybe every two weeks.I restore it and then it works for a while, but then a couple weeks lat
-
My ipod will not let me access any apps using wifi, it indicates at the top of the screen that there is a strong wifi source but it refused to work on wifi apps. I think this is because if need an update but will not let me as it says an error occurr
-
Need BAPI or FM to update vendor payment transactions
Hi , I upload vendor master data now i am want to update payment transactions but here in some cased multiple payments should also select. Thanks, Asha
-
i installed windows 7 via bootcamo itself!... the installation nd stuff went all well!... but now my macbook it luncking only windows 7 automaticaly when ever i switch it on! plzz tell me how to switch which back to os x mavericks.... plzz help me wi
-
Why is there still no Reports integration with JDev (9.0.3)
see http://otn.oracle.com/products/reports/htdocs/getstart/demonstrations/JDEV1/index.html This doesn't work since the Reports feature disappeared with the 'upgrade' to JDev 9.0.3. When will this integration be reestablished? One step forward and thr