Creating Oracle Job with Task Scheduler

Hi,
Platform: Oracle10g R2, Windows 2003 Server
I have the below script on my Linux server that backups up the database. It's run via crontab.
--------------- script ---------------------
-- Environment variables goes here
cd $ORACLE_HOME/bin
./rman target / <<EOF
startup mount;
backup database plus archivelog delete input;
delete noprompt obsolete;
alter database open;
I want something similar I can do on windows like .bat file that I can schedule to run via Task Scheduler.
Any help please?
Thnaks and regards,
Creems

Hi AG,
I tried to do that but it's not working.
But I did something similar for auto-delete of flashback logs and it works but the backup thing aint working.
What can I do?
Here is what I did for the auto-flashback delete
=======
RunSQL.bat
=======
-- content of RunSQL.bat
@ECHO OFF
TITLE Resetting Flashback Logs
CLS
ECHO Please be patient. This will take some time.
ECHO.
ECHO.
SET ORACLE_SID=PROD
sqlplus.exe /nolog @del_flashback.sql
ECHO.
ECHO.
ECHO FLASHBACKs reset. Please continue with your other procedures.
ECHO.
==========
del_flashback.sql
==========
-- content of del_flashback.sql
connect /nolog
conn sys/oracle as sysdba
SHOW USER
shutdown immediate
startup mount
alter database flashback off;
alter database flashback on;
alter database open;
SHOW USER
exit
This works, but when I did the same with RMAN backup it doesn't.
Any more help please?
Thanks and regards,
Creems

Similar Messages

  • Could not create a Job with BI Scheduler

    Hi all, we are attempting to create a job but when it runs we receive the following error:
    +++ ThreadID: 564 : 2007-06-11 10:10:08.000
    Global Error: [nQSError: 77006] Oracle BI Presentation Server Error: Authentication failed.
    Error Codes: WKY9UVRD:
    Authentication Failure.
    Error Codes: IHVF6OM7:OPR4ONWY:U9IM8TAC
    Odbc driver returned an error (SQLDriverConnectW).
    State: 08004. Code: 10018. [NQODBC] [SQL_STATE: 08004] [nQSError: 10018] Access for the requested connection is refused.
    [nQSError: 43001] Authentication failed for Administrator in repository Star: invalid user/password. (08004)
    +++ ThreadID: 564 : 2007-06-11 10:10:08.000
    ...Trying main loop again.
    +++ ThreadID: 564 : 2007-06-11 10:10:08.000
    ... Sleeping for 9 seconds.
    +++ ThreadID: 564 : 2007-06-11 10:10:17.000
    Global Error: [nQSError: 77006] Oracle BI Presentation Server Error: Authentication failed.
    Error Codes: WKY9UVRD:
    Authentication Failure.
    Error Codes: IHVF6OM7:OPR4ONWY:U9IM8TAC
    Odbc driver returned an error (SQLDriverConnectW).
    State: 08004. Code: 10018. [NQODBC] [SQL_STATE: 08004] [nQSError: 10018] Access for the requested connection is refused.
    [nQSError: 43001] Authentication failed for Administrator in repository Star: invalid user/password. (08004)
    +++ ThreadID: 564 : 2007-06-11 10:10:17.000
    Terminal Error: Exceeded number of retries.
    +++ ThreadID: 564 : 2007-06-11 10:10:08.000
    Global Error: [nQSError: 77006] Oracle BI Presentation Server Error: Authentication failed.
    Error Codes: WKY9UVRD:
    Authentication Failure.
    Error Codes: IHVF6OM7:OPR4ONWY:U9IM8TAC
    Odbc driver returned an error (SQLDriverConnectW).
    State: 08004. Code: 10018. [NQODBC] [SQL_STATE: 08004] [nQSError: 10018] Access for the requested connection is refused.
    [nQSError: 43001] Authentication failed for Administrator in repository Star: invalid user/password. (08004)
    +++ ThreadID: 564 : 2007-06-11 10:10:08.000
    ...Trying main loop again.
    +++ ThreadID: 564 : 2007-06-11 10:10:08.000
    ... Sleeping for 9 seconds.
    +++ ThreadID: 564 : 2007-06-11 10:10:17.000
    Global Error: [nQSError: 77006] Oracle BI Presentation Server Error: Authentication failed.
    Error Codes: WKY9UVRD:
    Authentication Failure.
    Error Codes: IHVF6OM7:OPR4ONWY:U9IM8TAC
    Odbc driver returned an error (SQLDriverConnectW).
    State: 08004. Code: 10018. [NQODBC] [SQL_STATE: 08004] [nQSError: 10018] Access for the requested connection is refused.
    [nQSError: 43001] Authentication failed for Administrator in repository Star: invalid user/password. (08004)
    +++ ThreadID: 564 : 2007-06-11 10:10:17.000
    Terminal Error: Exceeded number of retries.
    Any help?
    Thank you.,
    Regards.

    I have the same Problem :-(
    In adittion I have an authentivication with LDAP.
    If I create the user in the Repository I can connect to it but I receive the following Problem:
    +++ ThreadID: 82c : 2007-10-10 12:17:40.000
    [nQSError: 77006] Oracle BI Presentation Server Error: A fatal error occurred while processing the request. The server responded with: Odbc driver returned an error (SQLDriverConnectW).
    Error Codes: OPR4ONWY:U9IM8TAC
    State: 08004. Code: 10018. [NQODBC] [SQL_STATE: 08004] [nQSError: 10018] Access for the requested connection is refused.
    [nQSError: 13024] Successful completion of init block 'IB_LDAP' is required. (08004)
    If drop the User the Repository and use an LDAP User, I receive the following:
    +++ ThreadID: 38c : 2007-10-10 13:13:21.000
    [nQSError: 77006] Oracle BI Presentation Server Error: A fatal error occurred while processing the request. The server responded with: Authentication Failure.
    Error Codes: IHVF6OM7:OPR4ONWY:U9IM8TAC
    Odbc driver returned an error (SQLDriverConnectW).
    State: 08004. Code: 10018. [NQODBC] [SQL_STATE: 08004] [nQSError: 10018] Access for the requested connection is refused.
    [nQSError: 43001] Authentication failed for ExtOV01 in repository Star: invalid user/password. (08004)
    Regards,
    Stefan Hess

  • Creating a job with arguments

    Hi,
    This might sound really remedial, but can someone explain to me how I go about creating a job with arguments with programs. It errors out when I try to use DEFINE_PROGRAM_ARGUMENTS and when I try to use SET_JOB_ARGUMENTS_VALUE. Maybe it's the order I do it in. Any directions would be much appreciated. Thanks!
    Tony

    Hi Tony,
    Almost any internal error is an Oracle bug and you should report this to support.
    This is definitely not supposed to happen and I haven't seen this error before, do you have a test case throwing the error ?
    Using program arguments should be fairly straightforward. Here's a simple example with two varchar2 arguments
    -- create a stored procedure with two arguments
    create or replace procedure myproc (arg1 in varchar2, arg2 in varchar2)
    is BEGIN null; END;
    -- create a program with two arguments and define both
    begin
    dbms_scheduler.create_program
    program_name=>'myprog',
    program_action=>'myproc',
    program_type=>'STORED_PROCEDURE',
    number_of_arguments=>2, enabled=>FALSE
    dbms_scheduler.DEFINE_PROGRAM_ARGUMENT(
    program_name=>'myprog',
    argument_position=>1,
    argument_type=>'VARCHAR2',
    DEFAULT_VALUE=>'13');
    dbms_scheduler.DEFINE_PROGRAM_ARGUMENT(
    program_name=>'myprog',
    argument_position=>2,
    argument_type=>'VARCHAR2');
    dbms_scheduler.enable('myprog');
    end;
    -- create a job pointing to a program and set both argument values
    begin
    dbms_scheduler.create_job('myjob',program_name=>'myprog');
    dbms_scheduler.set_job_argument_value('myjob',1,'first arg');
    dbms_scheduler.set_job_argument_value('myjob',2,'second arg');
    dbms_scheduler.enable('myjob');
    end;
    Hope this helps,
    Ravi.
    -Ravi

  • Job with Multiple Schedule of same time & only one is executed, Why

    Hi ALL,
    I've Created a package to notify report in email  as excel, which is using a path to render report and save it as excel.
    This package was need to be schedule every first day of month and on every Friday even at morning 7 AM.
    So logically these are two events.
    But if we see on 1 May 2015 we have Friday and plus first day of month
    So technically this should fail.
    either for IO operation for render &
    storing data over same location with same file name.
    To replicate this i created two three schedule
    Below is the job history, job is invoked by only one schedule
    Question-
    1) Why one one schedule execute?
    2) why "sched2" only , it could be "sched3" only or "DentalOperationStackAndRank-Sched1" Only?
    Another this i result into error if different job executing same package at same schedule.
    FYI- package is deployed at database level
    HS

    Hi HS,
    As described in this
    article, more than one job can run on the same schedule, and more than one schedule can apply to the same job.
    And I make a test about your scenario, when configuring a SQL Server job with three schedules that reference same dates and times, my job behaves as yours that only one schedule is executed, but the job is invoked by schedule2 or schedule 3 in my environment.
    It is a normal behavior of SQL Server job in my opinion. For more details about such scenario, you can track the job following this
    blog.
    However, when I configure three jobs that run on the same schedule, everything works well and the three jobs all run successfully.
     I recommend you configure three different jobs that execute same package at same schedule .
    Thanks,
    Lydia Zhang
    Lydia Zhang
    TechNet Community Support

  • How to exclude create oracle job when during oracle imp

    Hi Expert,
    I would like to know how to exclude create oracle job during oracle import . It is schema export. Tks
    Regard
    Liang

    Oracle attempts to reimport job definitions as well. However, if you have an existing job with the same JOB_ID, the job definition fails (as there is a Unique Constraint on it).
    So, one "workaround" is to precreate dummy jobs before the import (which also means that the database account must be created in advance). To ensure that the JOB_ID is the same, you may have to keep incrementing the JOB_ID sequence.
    Hemant K Chitale

  • 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,
    Cherish

    Hi,
    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.

  • Issue with Task Scheduler on win 2012 R2

    Hi All,
    I am running a powershell script on windows server 2012 R2. It runs fine when i run it with powershell.
    And when i create task and choose option " Run only when the user is logged in" it works fine.
    But the issue is when i select "Run whether is the user is logged in or not" And with highest privilege it doesn't work.
    Tried solution:
    created a folder (or two on a 64bit-windows):
    (32Bit, always)
    C:\Windows\System32\config\systemprofile\Dektop
    (64Bit)
    C:\Windows\SysWOW64\config\systemprofile\Desktop
    as the powershell creates a excel and saves it in the some folder.
    not sure what is causing it.
    Any help on this will be appreciated.

    Hi,
    From the
    Task Security Context article, we can get following description.
    You can specify that a task should run even if the account under which the task is scheduled to run is
    not logged on when the task is triggered. To do this, select the radio button labeled Run whether user is logged on or not. If this radio button is selected, tasks will not run interactively. To make a task run interactively, select the Run only when user
    is logged on radio button.
    Just a confirmation, did your PowerShell script involve any operation of mapped drive? If involved, please
    use the full UNC path and monitor the result. Please refer to following similar thread and check if can help you.
    Task
    Scheduler Problem (run whether user is logged on or not)
    Meanwhile, please open this scheduled task’s Properties and navigate to History tab, then check if find some
    relevant events.
    View Task Properties and History
    If any update, please feel free to let us know.
    Hope this helps.
    Best regards,
    Justin Gu

  • Server 2008 R2: Setting up a custom schedule with task scheduler

    I am trying to schedule a task using Server 2008 R2 Task Scheduler
    I've been googling and searching for an answer on how to do this. I could easily do it on Server 2003.
    I need to run a program (custom) that updates some tables in a database.
    I need to run it Monday thru Saturday at 20 minutes after the hour from 7:20 am through 5:20pm. Not on Sunday and not at night (only normal business hours)
    These are the steps I am following: I create task, General, I enter the description, Then triggers, new, select weekly, select start date and time, select the days I want (every day except sunday), repeat the task every hour, for a duration of (all I can
    choose is 12 hours).. This is where I am stuck. I guess I could choose 12 hours but I need it to stop at 5:20 pm not 7:20pm. Has anybody done something similar to this?

    Go ahead and choose something appropriate in dropdowns on Edit Trigger then over-type them with whatever you want.
    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

  • Dynamically creating oracle table with csv file as source

    Hi,
    We have a requirment..TO create a dynamic external table.. Whenever the data or number of columns change in the CSV file the table should be replaced with current data and current number of columns...as we are naive experienced people in oracle please give us a clear solution.. We have tried with a code already ..But getting some errors. Code given below..
    thank you
    we have executed this code by changing the schema name and table name ..Remaining everything same ...
    Assume the following:
    - Oracle User and Schema name is ALLEXPERTS
    - Database name is EXPERTS
    - The directory object is file_dir
    - CSV file directory is /export/home/log
    - The csv file name is ALLEXPERTS_CSV.log
    - The table name is all_experts_tbl
    1. Create a directory object in Oracle. The directory will point to the directory where the file located.
    conn sys/{password}@EXPERTS as sysdba;
    CREATE OR REPLACE DIRECTORY file_dir AS '/export/home/log';
    2. Grant the directory privilege to the user
    GRANT READ ON DIRECTORY file_dir TO ALLEXPERTS;
    3. Create the table
    Connect as ALLEXPERTS user
    create table ALLEXPERTS.all_experts_tbl
    (txt_line varchar2(512))
    organization external
    (type ORACLE_LOADER
    default directory file_dir
    access parameters (records delimited by newline
    fields
    (txt_line char(512)))
    location ('ALLEXPERTS_CSV.log')
    This will create a table that links the data to a file. Now you can treat this file as a regular table where you can use SELECT statement to retrieve the data.
    PL/SQL to create the data (PSEUDO code)
    CREATE OR REPLACE PROCEDURE new_proc IS
    -- Setup the cursor
    CURSOR c_main IS SELECT *
    FROM allexperts.all_experts_tbl;
    CURSOR c_first_row IS ALLEXPERTS_CSV.logSELECT *
    FROM allexperts.all_experts_tbl
    WHERE ROWNUM = 1;
    -- Declare Variable
    l_delimiter_count NUMBER;
    l_temp_counter NUMBER:=1;
    l_current_row VARCHAR2(100);
    l_create_statements VARCHAR2(1000);
    BEGIN
    -- Get the first row
    -- Open the c_first_row and fetch the data into l_current_row
    -- Count the number of delimiter l_current_row and set the l_delimiter_count
    OPEN c_first_row;
    FETCH c_first_row INTO l_current_row;
    CLOSE c_first_row;
    l_delimiter_count := number of delimiter in l_current_row;
    -- Create the table with the right number of columns
    l_create_statements := 'CREATE TABLE csv_table ( ';
    WHILE l_temp_counter <= l_delimiter_count
    LOOP
    l_create_statement := l_create_statement || 'COL' || l_temp_counter || ' VARCHAR2(100)'
    l_temp_counter := l_temp_counter + 1;
    IF l_temp_counter <=l_delimiter_count THEN
    l_create_statement := l_create_statement || ',';
    END IF;
    END;
    l_create_statement := l_create_statement || ')';
    EXECUTE IMMEDIATE l_create_statement;
    -- Open the c_main to parse all the rows and insert into the table
    WHILE rec IN c_main
    LOOP
    -- Loop thru all the records and parse them
    -- Insert the data into the table created above
    END LOOP;

    The initial table is showing errors and the procedure is created with compilation errors
    After executing the create table i am getting the following errors
    ERROR at line 1:
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-00554: error encountered while parsing access parameters
    KUP-01005: syntax error: found "identifier": expecting one of: "badfile,
    byteordermark, characterset, column, data, delimited, discardfile,
    disable_directory_link_check, exit, fields, fixed, load, logfile, language,
    nodiscardfile, nobadfile, nologfile, date_cache, processing, readsize, string,
    skip, territory, varia"
    KUP-01008: the bad identifier was: deli
    KUP-01007: at line 1 column 9
    ORA-06512: at "SYS.ORACLE_LOADER", line 19

  • Error faced while creating Oracle Job

    Hi,
    I have the following script to create a job.
    It executed successfully on my database. When we tried to execute the same at our clients place we got some error,
    ===========================================
    SQL> DECLARE
    2 job NUMBER;
    3 m_sleeptimegap NUMBER;
    4 job_interval VARCHAR2(100);
    5
    6
    7 BEGIN
    8 SELECT to_number(tdvalue)
    9 INTO m_sleeptimegap
    10 FROM tabledetails
    11 WHERE tdidcode = 'LICENSE_PULSE'
    12 AND tdkey = 'STATUS_DELAY';
    13
    14 job_interval := 'SYSDATE +'|| m_sleeptimegap / 86400;
    15
    16 DBMS_JOB.SUBMIT(job, 'License_Pulse_Check;', SYSDATE, job_interval, 'FALSE');
    17 UPDATE tabledetails
    18 SET tdvalue = LTRIM( RTRIM( TO_CHAR(job) ) )
    19 WHERE tdidcode = 'LICENSE_PULSE'
    20 AND tdkey = 'ORACLE-JOB-ID';
    21 COMMIT;
    22 END;
    23 /
    DECLARE
    ERROR at line 1:
    ORA-23319: parameter value "SYSDATE
    +,000347222222222222222222222222222222222222" is not appropriate
    ORA-06512: at "SYS.DBMS_JOB", line 60
    ORA-06512: at "SYS.DBMS_JOB", line 138
    ORA-06512: at line 16
    ===========================================
    'm_sleeptimegap' is = 30 , which we have configured in a table called "tabledetails".
    This is present at the client's place.
    What could be the reason of this script failure ?
    Could it be grants issue or something else ?
    Thanks.

    Hi,
    But that parameter in the dbms_job.submit procedure is of VARCHAR2 type,
    dbms_job.submit(
    JOB OUT BINARY_INTEGER,
    WHAT IN VARCHAR2,
    NEXT_DATE IN DATE DEFAULT SYSDATE,
    INTERVAL IN VARCHAR2 DEFAULT 'NULL',
    NO_PARSE IN BOOLEAN DEFAULT FALSE,
    INSTANCE IN BINARY_INTEGER DEFAULT 0,
    FORCE IN BOOLEAN DEFAULT FALSE);
    [http://www.psoug.org/reference/dbms_job.html?PHPSESSID=5a94d055d8b65bd4b4661d1d24dedbf8]
    Thanks.

  • 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 300

    So, 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'.

  • Creating batch job with 5 classes

    Hi All,
    I have a requirement in which I have to do five different operations at different time instances.
    1.Generate a report at morning 11.00 AM.
    2.update a table with more than 6000 rows at night 12.30 AM
    3.Generate a second report querying from the database at 10.00 AM Everyday.
    4.Generate an automail at 11.30 Am Everyday
    All these are plain Java classes and not web components. How could I effectively design the batch job so that it doesnot take nmuch memory and design classes so that they must be reusable like DB connection,Getting a db field value frequently etc.
    Can any one help me on this.

    http://www.google.com/search?q=job+schedule+in+java&client=netscape-pp&rls=com.netscape:en-US

  • Create meeting agenda with tasks

    My client wants to have meeting minutes in one document / library.  
    All meetings minutes should all be in one list for the MD to manage.  From that list he wants to assign tasks to individuals for follow up.  Also he wants to print a report - like in a Word format, that would look like a Meeting minute document.
     He wants to select a from and to date, and print a report that lists 
    I'm not sure which to use - Doc lib or list?  If I create a Infopath form that submits to a document library, how would I assign individual tasks (from the meeting minutes) to individuals?  If I create a list, then I'll have to repeat the fields
    like meeting date, location, attendee, ect for each meeting item.

    Hi 
    If you want to have a simple approach with the OOTB features, you can try the following.
    1. Create a Document Library to store your meeting minutes.
    2. Create a Word Template for storing your meeting meetings with all the headings inside the document.
    3. Associate the Template to the Document Library. Now  in the Document library you can store your meetings.
    4. Create a List to store your action items in the meeting. 
    5. Now create a new Task List where the Action items List needs to be joined ( Create a field in Action items list, which will act as Primary Key. Lookup this key to the task List.)
    6. In the same way a field needs to be created in the Meeting Minutes document library and linked to Action items List.
    Meeting Minute(Doc Lib)--> Action items (List)--> Tasks(Task List)
    This is the basic approach for your requirement. If you can use coding then we can do it more effectively with Custom ASPX approach.
    R.Mani http://rmanimaran.wordpress.com

  • Creating a job with DBMS_SCHEDULE  from Forms?

    I'm new to DBMS_SCHEDULER. I'd like to run a stored procedure from an Oracle Forms application passing some parameters from the Form to the procedure, then immediately running the procedure and after the procedure has finished dropping it from the job list. The procedure may take some time to run and the user doesn't want to wait before exiting the form. Can this be done?

    Sure, no problem. The job will be dropped after termination by default (autodrop). If privileges are ok it should work. Things to think about are error reporting and retries.
    regards,
    Ronald
    http://ronr.nl/unix-dba

  • Create Oracle Object with array inside

    Hi
    I want create a db type with an attribute of dbms_sql.varchar2_table  type
    Example:
    create or replace type t_obj_gest_csv_h
       as object
    column_value_list dbms_sql.varchar2_table,
    It's possible?
    Stefano

    Not with dbms_sql.varchar2_table. You can't reference PL/SQL types when creating SQL type. You can create SQL nested table type and use it in object type:
    SQL> create or replace
      2    type StringList
      3      as table of varchar2(4000)
      4  /
    Type created.
    SQL> create or replace
      2    type t_obj_gest_csv_h
      3      as object(
      4                id number,
      5                s  StringList
      6               )
      7  /
    Type created.
    SQL>
    SY.

Maybe you are looking for

  • The home folder for user isn't located in the usual place......

    ....or can't be accessed. Ok so I have trawled the internet and found this to be a known problem, however mine has an extra twist. Ok, my Mac has a local admin account, lets call it Admin, but the account I use is a network account called PBN. This n

  • Problem with Barcode printing in sapscript

    Hello All, I am currently facing an issue with printing a bar code in my sap script. Below is the scenario: I am trying to print a delivery number as a bar code. I am using the system bar code BC_CD39C for the same. i.e the system bar code is attache

  • Back order reporting

    Hi, I have a simple question. What is back order reporting? and howz it done! This is not a technical term i know. What is the market significance of backorder reporting? i need to know this. And howz a proposal is created? Please help me with this!!

  • How to store Java ArrayList or any Collection object

    Hi, How Can I store Java ArrayList or any Collection object into Oracle tables. In that case what should be the Oracle datatype of that column. Can anybody tell me in details... Thanks in advance. Ashok R

  • Error when creating the Oracle SOA Suite Schema in the Oracle Database

    Hi all, I got errors as below, when trying to run /u02/soft/Disk1/install/soa_schema /irca/irca.sh [oracle@scs irca]$ ./irca.sh Integration Repository Creation Assistant (IRCA) 10.1.3.5.1 (c) Copyright 2006 Oracle Corporation. All rights reserved. Ex