Pass tablespace(s) as a parameter to RMAN using batch file (windows2000)

I want to make a backup of one or more than one tablespaces.
For Example:
Backup tablespace USERS,TOOLS;
Backup tablespace USERS;
In this regards I am using windows batch file. Below you find the code of batch file which I am using to perform this operation (windows 2000)
Batch file (c:\rman.cmd)
set tbs1=%1
set tbs2=,%2
if exist tbs1 == goto usage
if exist tbs2 == goto usage
echo BACKUP tablespace %tbs1% %tbs2% ; > c:\temp\tbs.rman
rman TARGET / @ c:\temp\tbs.rman
Problem
I run this batch file on command line .
When I issue this command its ok and backed up both the tablespaces.
Host @c:\rman.cmd USERS,TOOLS
But when I want to backup only one tablespace and issue the command like that:
Host @c:\rman.cmd USERS
It gave the following error
BACKUP tablespace users , ;
Found comma after first tablespace.
Point of focus
How to get rid of the comma after first tablespace on run time, when I want to backup only one tablespace.
BACKUP tablespace users , ;
How to avoid that comma on run time when I only want to make a backup of single tablespace.
Please check this matter it is only the batch file side problem.
With Best Regards
Fawad Ahmed

I am not expert is DOS but I think you can fix this with
a simple programming logic elements in the script.
You have 2 cases:
1 case ) When you have only one parameter
2 case ) When you have more or equal than two parameters
if exist tbs1 == goto mark1
if exist tbs2 == goto mark2
mark2:
echo BACKUP tablespace %tbs1% %tbs2% ; > c:\temp\tbs.rman
goto end
mark1:
echo BACKUP tablespace %tbs1% ; > c:\temp\tbs.rman
goto end
end:
rman TARGET / @ c:\temp\tbs.rman
This can be one the case for 1 or 2 parameters . If
you think to pass more parameters you have to use
another logic.
I hope this can help you!
Joel P�rez

Similar Messages

  • Rman backup fails on windows when using batch file

    Hello Gurus ..
    I am trying to setup incremental backup on my windows OS based server using RMAN command in batch file. When I use batch file in OS scheduler it is working fine, when I am calling same batch file from my LOCAL desktop PC it throws errors as below.
    D:\> \\3.193.211.19\sgdba\rman\bkp_acressit.bat
    D:\>rman catalog rman/******@acressit target / cmd
    file=E:\sgdba\rman\bkp_arch.rcv log E:\sgdba\rman\sit_arch_rman_backup.log
    RMAN-00557: could not open MSGLOG "E:\sgdba\rman\sit_arch_rman_backup.log"
    Argument Value Description
    target quoted-string connect-string for target database
    catalog quoted-string connect-string for recovery catalog
    nocatalog none if specified, then no recovery catalog
    cmdfile quoted-string name of input command file
    log quoted-string name of output message log file
    trace quoted-string name of output debugging message log file
    append none if specified, log is opened in append mode
    debug optional-args activate debugging
    msgno none show RMAN-nnnn prefix for all messages
    send quoted-string send a command to the media manager
    pipe string building block for pipe names
    timeout integer number of seconds to wait for pipe input
    checksyntax none check the command file for syntax errors
    Both single and double quotes (' or ") are accepted for a quoted-string.
    Quotes are not required unless the string contains embedded white-space.
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-00556: could not open CMDFILE "E:\sgdba\rman\bkp_arch.rcv"
    Contents of the batch file and RCV file as below:
    Batch File:
    rman catalog rman/*******@acressit target / cmdfile=E:\sgdba\rman\bkp_arch.rcv log E:\sgdba\rman\sit_arch_rman_backup.log
    RCV File:
    RUN {
    ALLOCATE CHANNEL ch1 TYPE
    DISK FORMAT 'E:\ORA_RMAN_BACKUP\ARCH_%d_%u_%s_%p';
    BACKUP ARCHIVELOG delete input;
    RELEASE CHANNEL ch1;
    EXIT;
    --------------------------xxxxxxxxxxxxxx------------------------
    * on my DB server I am login using my administrator account, on my PC I dont have admin account.
    * I have checked remote execution using local user as well as admin user.
    * I have checked the permission and my local ID & EVERYONE has all permission in that folder.
    Any help will be appriciated.
    Thanks & Regards
    Ashish

    Ashish wrote:
    hi Atil,
    u have guessed it correctly, I came to know that issue later I copy file on local PC and it works fine.
    Now I am working on netbackup server. I want to use the same script to initiate backup from netbackup server. Do you have any idea or any guidelines from you will appriciate.
    Thanks
    AshishAshish,
    Is it "symantec's netbackup"? I do not know that product and if it has an option to enter your own RMAN scripts. On the other hand, it should be able to create irman scripts according to your backup job definition.
    Regards
    Gokhan

  • Powershell script calling batch file, how to "echo" or otherwise pass in two or more values asked for by batch file

    I've been having a lot of problems trying to get an old batch file we have laying around, to run from my powershell script. The batch file actually asks for two inputs from the user. I've managed to put together a powershell that echos a response, but of
    course, that only will answer one of the prompts. As usual, I've simplified things here to get my testing done. The batch file looks like this:
    @ECHO OFF
    SET /P CUSTID=Customer Number:
    SET /P DBCOUNT=Number of Live Databases:
    ECHO Customer Id was set to : %CUSTID%
    ECHO Database Count was set to : %DBCOUNT%
    Two inputs, two echos to verify values have been set. Now, the powershell looks like this:
    Param(
     [string]$ClientADG,
        [string]$ClientDBCount,
        [scriptblock]$Command
    $ClientADG = '1013'
    $ClientDBCount = '2'
    $Response = $ClientADG + "`r`n" + $ClientDBCount
    $Command = 'Invoke-Command -ComputerName localhost -ScriptBlock {cmd /c "echo ' + $ClientADG + ' | E:\Scripts\Setup\Company\DatabaseSetupTest.bat"}'
    powershell -command $Command
    Output looks like:
    Customer Number: Number of Live Databases: Customer Id was set to : 1013
    Database Count was set to :
    As expected, as I'm only passing in one value. I can't figure out how to get a second value passed in for the second prompt. Instead of $ClientADG, I tried to mash the two value together in the $Response variable with a cr/lf or a cr or a lf in between,
    but no go there either. The first input gets set to the second value, and second input is blank still. In the essence of time, I need to get this batch file called from Powershell to get some folks productive while I actually rewrite what the batch file does
    in another powershell, so it can be integrated into other things. (I'm automating what a bunch of people spend hours doing into multiple scripts and eventually one BIG script so they can focus on doing their real jobs instead).
    How do I get this right in powershell? I don't want to modify the batch file at all at this point, just get it running from the powershell.
    Thanks in advance!
    mpleaf

    It's a "simple" test so I can figure out how to get the arguments passed from ps to bat. The bat file looks like this:
    @ECHO OFF
    SET CUSTID = %1
    SET DBCOUNT = %2
    ECHO Customer Id was set to : %CUSTID%
    ECHO Database Count was set to : %DBCOUNT%
    That's it. The PS script looks like this:
    Invoke-Command-ComputerName myserver-ScriptBlock{cmd/c"E:\Scripts\Setup\Company\DatabaseSetupTest.bat
    1013 2"}
    That's it. The bat file exists on "myserver", and I'm getting the echo back, but without the values.
    mpleaf

  • Passing value to multi value parameter from SSIS using Report server webservice

    Hi
    I am triggering SSRS report from SSIS(Script task). I am passing parameter values from SSIS package.
    So far working fine. Now, I have a report which has 2 parameters. One is single value parameter and the other is multi value parameter.
    No issue assigning value to single value parameter. But how can I pass multi value to multi value parameter?
    My code as below
    ReportExecutionService rs = new ReportExecutionService()
    rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
    rs.Url = _webserviceURL;
    rs.LoadReport(_reportPath, null);
    ParameterValue[] paramval = new ParameterValue[2];
                            paramval[0] = new ParameterValue();
                            paramval[0].Name = "CountryCode";
                            paramval[0].Value = _countryNames;
                            **paramval[1] = new ParameterValue();
                            paramval[1].Name = "BusinessCode";
                            paramval[1].Value = _businessCode;****
                            rs.SetExecutionParameters(paramval, "en-us");
    I am not sure how to pass value to BusinessCode(Multi value parameter)

    Hi Rajkm,
    In order to pass a multi-value parameter through the Reporting Services Web services, you need to define the same numbers of ParameterValue objects as the number of the values of the multi-value parameter being past into the report. The Name property
    of these ParameterValue objects must be specified same to the parameter name.
    I found a good FAQ article for this scenario:
    How do I pass a multi-value parameter into a report with Reporting Services Web service API?:
    http://blogs.msdn.com/b/sqlforum/archive/2010/12/21/faq-how-do-i-pass-a-multi-value-parameter-into-a-report-with-sql-server-reporting-services-ssrs-web-services-api.aspx
    Hope this helps.
    Elvis Long
    TechNet Community Support

  • Passing Inner class name as parameter

    Hi,
    How i can pass inner class name as parameter which is used to create object of inner class in the receiving method (class.formane(className))
    Hope somebody can help me.
    Thanks in advance.
    Prem

    No, because an inner class can never have a constructor that doesn't take any arguments.
    Without going through reflection, you always need an instance of the outer class to instantiate the inner class. Internally this instance is passed as a parameter to the inner class's constructor. So to create an instance of an inner class through reflection you need to get the appropriate constructor and call its newInstance method. Here's a complete example:import java.lang.reflect.Constructor;
    class Outer {
        class Inner {
        public static void main(String[] args) throws Exception{
            Class c = Class.forName("Outer$Inner");
            Constructor cnstrctr = c.getDeclaredConstructor(new Class[] {Outer.class});
            Outer o = new Outer();
            Inner i = (Inner) cnstrctr.newInstance(new Object[]{o});
            System.out.println(i);
    }

  • How to pass a parameter into RMAN script

    Hello,
    I have the following rman script :
    run {
    CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
    CONFIGURE CONTROLFILE AUTOBACKUP OFF;
    CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
    CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'c:\oracle\RmanORCL102\ora_df%t_s%s_s%p';
    This script called configure.rman is launch by a .bat script with the following command:
    rman target 'sys/sys12@ORCL102 as sysdba' @c:\oracle\RmanORCL102\configure.rman
    How can I pass a parameter into rman script, I want to pass an additional directory like this:
    rman target 'sys/sys12@ORCL102 as sysdba' @c:\oracle\RmanORCL102\configure.rman v_dir_name
    And use it in rman script:
    CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'c:\oracle\RmanORCL102\$v_dir_name\ora_df%t_s%s_s%p';
    Is it a way to do this?
    Regards,
    Elodie

    One option would be to create a file called backup.bat with the following:
    echo run {
    echo CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
    echo CONFIGURE CONTROLFILE AUTOBACKUP OFF;
    echo CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
    echo CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'c:\oracle\RmanORCL102\%1\ora_df%t_s%s_s%p';
    echo } ) | rman target sys/sys12@orcl102and then call the script as:
    c:\> backup.bat backup_directory_name

  • How to pass parameter to RMAN command?

    Hi,
    When i am execute delete.sh file. the following error coming. it expecting to pass parameter YES or NO.
    How I can pass parameter to RMAN command in shell scripts.
    [oracle@dbNode1 rman]$ sh delete.sh
    Executing Command : Backup as copy to file system
    Recovery Manager: Release 10.2.0.3.0 - Production on Mon Apr 20 12:13:18 2009
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    connected to target database: HERMESQA (DBID=3819666523)
    connected to recovery catalog database
    RMAN> 2> 3>
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=135 devtype=DISK
    List of Backup Pieces
    BP Key BS Key Pc# Cp# Status Device Type Piece Name
    98 96 1 1 AVAILABLE DISK /u01/app/oracle/flash_recovery_area/HERMESQA/backupset/2009_03_17/o1_mf_ncnnf_TAG20090317T180639_4vz6bqkl_.bkp
    Do you really want to delete the above objects (enter YES or NO)?
    Error occurred getting response - assuming NO response
    thanks
    settu gopal

    Use
    DELETE NOPROMPT - then no questions will be asked.

  • Passing a value to a Parameter Field From a VB Form

    Post Author: as1971
    CA Forum: General
    Hello everyone
    I'm using Visual Basic 6.0 and Crystal Report 9.0
    I built a report using Crystal Report and named it Player_Statement.rpt. I then included it to my VB project and named it Player_Statement.Dsr
    In this report I have a Parameter Field called P_Player_ID which I'm using in Record Selection Formula.
    I'm using the following code to pass a value to the parameter:
    Dim Report As CRAXDRT.ReportSet Report = New Player_StatementReport.ParameterFields.GetItemByName("P_Player_ID").AddCurrentValue CLng(cmbPlayerNB.BoundText)
    When I execute the application I get the error message "The value or range you are adding has already existed" at the last line of code (Where I'm assigning the parameter a value)
    Could anybody help me please

    Post Author: VinoTinto
    CA Forum: General
    Dim Report As CRAXDRT.ReportSet Report = New Player_StatementReport.GetItemByName("P_Player_ID").ClearCurrentValueAndRange                                               Report.ParameterFields.GetItemByName("P_Player_ID").AddCurrentValue = CLng(cmbPlayerNB.Boundtext)

  • Passing multiple values to a parameter in report

    Can anyone help me how to pass multiple parameters to a parameter in my report.
    As user is able to select multiple values from list of values , can I pass the selected values to calling function.
    Suppose if User selects Value1,Value2,Value3 from list of values of a parameter P_Org,
    I need to pass all these values to parameter P_Org in my Before Trigger Function in Discoverer reproting tool.
    Thanks in advance

    I have a Before trigger Function to which the parameters will be passed.
    Suppose if User selects multiple values for a parameter then how to pass these multiple Values to that parameter?
    eg:In first Workbook Before Trigger is fired and the paramters for the trigger are
    'par1','par2','par3' etc.
    If User selects multiple values for a parameter 'par1' from the list of values displayed then how to pass all these values to 'par1' in Function?
    After firing the trigger rows are inserted in a temp_table .My second Workbook will
    fetch the rows inserted in this Temp Table.
    I hope u understood what my requirement is...
    Thanks in advance

  • Passing parameter values to powershell function from batch file

    Hello ,
       I haven't used powershell for a while and getting back to using it. I have a function and I want to figure out how to pass the parameter values to the function through batch file.
    function Check-FileExists($datafile)
    write-host "InputFileName : $datafile"
    $datafileExists = Test-Path $datafile
    if ($datafileExists)
    return 0
    else
    return -100
    <#
    $datafile = "C:\Dev\eMetric\PreIDWork\PreIDFiles\SampleInputFile_011.txt"
    $returncode = Check-FileExists -datafile $datafile
    Write-Host "ReturnCode : $returncode"
    $datafile = "C:\Dev\eMetric\PreIDWork\PreIDFiles\SampleInputFile_01.txt"
    $returncode = Check-FileExists -datafile $datafile
    Write-Host "ReturnCode : $returncode"
    #>
    The above code seems to be work when I call it. But when I try to call that script and try to pass the parameter values, I am doing something wrong but can't figure out what.
    powershell.exe -command " &{"C:\Dev\eMetric\PreIDWork\PowerShell\BulkLoad_Functions.ps1" $returncode = Check-FileExists -datafile "C:\Dev\eMetric\PreIDWork\PreIDFiles\SampleInputFile_01.txt"}"
    Write-Host "ReturnCode : $returncode"
    $file = "C:\Dev\eMetric\PreIDWork\PreIDFiles\SampleInputFile_01.txt"
    powershell.exe -file "C:\Dev\eMetric\PreIDWork\PowerShell\BulkLoad_Functions.ps1" $returncode = Check-FileExists -datafile $datafile
    Somehow the I can't get the datafile parameter value being passed to the function. Your help would be much appreciated.
    I90Runner

    I am not sure about calling a function in a script like how you want to. Also I see you are setting the values of the parameters, this is not needed unless you want default values if nothing is passed. The values for the parameters will be passed via the
    batch file. So for me the easiest way is as indicated.
    param
    [string]$DataFile
    function Check-FileExists($datafile)
    write-host "InputFileName : $datafile"
    $datafileExists = Test-Path $datafile
    if ($datafileExists)
    return 0
    else
    return -100
    Write-Host "Return Code: $(Check-FileExists $DataFile)"
    Then you create a batch file that has
    start powershell.exe
    -ExecutionPolicy
    RemoteSigned -Command
    "& {<PathToScript>\MyScript.ps1 -DataFile 'C:\Dev\eMetric\PreIDWork\PreIDFiles\SampleInputFile.txt'}"
    Double click the batch file, and it should open a powershell console, load your script and pass it the path specified, which then the script runs it and gives you your output
    If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful.
    Don't Retire Technet

  • How to passing multiple values for a parameter of discoverer(url parameters

    Hi All,
    I am trying to pass multiple values for a parameter of disco report. I am trying to include my url for discoverer viewer report. the values has the following
    'jeff,mark'
    'sfophiee,angela'
    Thanks and Regards
    Venkat

    Hello Venkat,
    I know there are some problems with 10.1.2.0.2, maybe if you haven't done yet you can try with 10.1.2.2, assuming this version should be working for multiple parameter values :
    OracleAS Discoverer 10.1.2.2 is installed with the following patch :
    Patch 4960210 PLACEHOLDER BUG FOR AS/DS 10G R2 PATCH SET 2 10.1.2.2
    So, once installed you can try adding your parameter as param_<parameter_name>='sfophiee,angela'
    Hope this helps, otherwise feel free to log a Service Request to Support.
    Best Regards,
    Gianluca

  • How to pass Cascading Parameter in SSRS using Java

    How to pass Cascading Parameter in SSRS using Java---
    We are having a problem with dependent parameters.There are three drop down--
    1.first dropdown is of Country.When we select a country--Accordingly next dropdown(State)will populate
    2.Second dropdown is of State. When we select a state--Accordingly next dropdown(City)will populate.
    I have three data sources are
    CountryList-
    SELECT CountryRegionCode, Name
    FROM Person.CountryRegion
    ORDER BY Name
    StateList
    SELECT StateProvinceID, StateProvinceCode, CountryRegionCode
    FROM Person.StateProvince
    WHERE CountryRegionCode = @CountryRegionCode
    ORDER BY StateProvinceCode
    CityList
    SELECT StateProvinceID, City
    FROM Person.Address
    GROUP BY StateProvinceID, City
    HAVING (StateProvinceID = @StateProvinceID)
    ORDER BY City
    Ihave to show report that has been deployed on server on the besis of these parameters
    I am using ReportViewer in JSP Page through url--
    http://192.168.90.149/ReportServer/Pages/ReportViewer.aspx?%2fReport+Project1%2fCascading_Parameters&rs:Command=Render&rs:parameter=true&Country="+Country+"&State="+State;
    But it is not accepting parameter if they are cascaded.It is working fine if Both parameters are independent.
    Edited by: kaushlee on May 11, 2010 9:22 PM

    Take a look at set_custom_property:
    public static final ID SETTEXT = ID.registerProperty("SETTEXT");
    public boolean setProperty(ID pid, Object value)
        if (pid == SETTEXT)
    String text = value.toString();
    and in forms
    set_custom_property('beans.bean_item', 1, 'SETTEXT', 'some text');
    cheers

  • Pass table name as a parameter to function

    Is there a way to pass table name as a parameter to functions? Then update the table in the function.
    Thanks a lot.
    Jiaxin

    Hi, Harm,
    Thank you very much for your suggestion and example. But to get my program work, i need to realise code like follows:
    CREATE OR REPLACE FUNCTION delstu_func(stuno char) RETURN NUMBER AS
    BEGIN
    EXECUTE IMMEDIATE 'DELETE FROM student s' ||
    'WHERE' || 's.student_number' || '=' || stuno;
    LOOP
    DBMS_OUTPUT.PUT_LINE('record deleted');
    END LOOP;
    END;
    SELECT delstu_func('s11') FROM STUDENT;
    The intention is to check if such a function can perform operations such as update, delete and insert on occurence of certain values. When executing the above statement, the system returns an error message:
    ERROR at line 1:
    ORA-00933: SQL command not properly ended
    ORA-06512: at "SCMJD1.DELSTU_FUNC", line 3
    Could you tell me where is wrong?
    Jiaxin

  • Passing Item Number as a Parameter takes long time,need to make it optional

    Hi,
    I am trying to pass Inventory Item as a parameter in the discoverer report and it is taking long time to query the results. I am not sure how to make a parameter optional (Not Required)
    Please advice
    Thanks,
    user12048986
    Edited by: user12048986 on Apr 19, 2010 2:54 PM

    Hi
    In order to use the value ALL in a list of values you have to do two things. These are:
    1. Create the LOV like you did with a SELECT 'ALL' FROM DUAL unioned to the real LOV
    2. Create a condition that looks for the word ALL
    Here's the condition:
    COLUMN_VALUE = :Parameter_Value OR :Parameter_Value = 'ALL'
    You could also make sure the value is in uppercase using this:
    COLUMN_VALUE = :Parameter_Value OR UPPER(:Parameter_Value) = 'ALL'
    This way if a user keyed 'all' it would still work.
    Best wishes
    Michael

  • From scorecard Pass parameter to be used as Measure in query of analytic Grid report in PPS in SP2013

    From scorecard Pass parameter  to be used as Measure in query of analytic grid report in PPS
    Any idea of how we can pass this parameter while connecting scorecard and report
    any use of MDX in connection formula ?
    Parameter needs to be assigned on click of scorecard cell

    Hi,
    That API has restrictions on its usage. Please see http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_util.htm#CHDICGDA
    The lines to be referred to are Also, this method requires that the parameters that describe the BLOB to be listed as the format of a valid item within the application. That item is then referenced by the function.Regards,
    PS: Your report must be on Page 98 , so it is able to reference the item P98_NAV_IMAGE. List being a Shared Component it may not be able reference that Item.
    Edited by: Prabodh on May 28, 2012 3:16 PM

Maybe you are looking for

  • A/P Invoice Vendor Ref Number Field updating after adding the Invoice Copy

    Hi All,               I am able to change the Vendor Reference number in A/P Invoice Document after adding the Document.  I want to restrict this to happen. Plzz help how to do this???? Regards, Sree.

  • EL 27 Correction of Implausible Meter Reads

    Hi All, I am trying to release impalusible Meter Readings via TCode EL27, by entering a Premise. Two things are happening: 1. Direct Release of MR occurs . (no idividual correction screen opens) 2. Individual Correction screen opens. (no direct relea

  • Network killed by Gnome

    Hi, Tried to install Gnome today. Curiosity killed more than one cat, sure. There are no connections for me, in good old KDE - and in Gnome, too. Right now I'm sitting in front of Archbang livecd system, the main arch install properly chrooted. Unfor

  • Two digital triggers

    Hi!, I´m in need for a little help. My problem is that I´dont know is it possible to use two digital triggers simultaneusly in 6225-daq. I try to do two same tests at same time. PFI4 line should be as a trigger for a line ai20 and PFI5 should be as a

  • IMac monitor mess

    The week for before Christmas 2005 I got a new iMac G5 iSight. From the first boot the monitor sucked--staticky, multiple docks, triple finder menus, etc. After about 30 seconds the screen problems stopped and the Mac behaved as it should. I took it