Batch File Commands
Hi,
I have my oracle database with following details:
OS- Windows 2003 R2 64-bit
DB- Oracle 10g R2 Enterprise Editiion 10.2.0.1.0
I want to run a scheduler on OS Level such that it moves the archives log created one hour before the runtime to different location. For example:- If the batch file is scheduled to run at 5:00 pm, it must move all the archivelogs created uptil 4:00 pm to seperate location.
Please help me how to do it ? I m stuck at how to mention time of creation of all the files.
Thanks
Vinita
1º Sunday you do a backup.
2º Monday you move archive log.
3º Tuesday you move archive log.
4º Wednesday you move archive log.
5º Thursday database crash.
1º Restore database from backup of sunday
2º Recover database... ops, you need all archive logs on his dest... recover fails...
3º You try to move all archive logs to original dest but you don't have space...
4º You find a dest with enough space to move all archivelog and recover database.
I don't know about your scenario but there is not a good backup polity move the archivelog with Os commands. I suggest:
1º Sunday you do a full RMAN backup.
2º Monday you do a incremental RMAN backup. With delete noprompt archivelog all backed up 1 times to device ....
3º Tuesday you do a incremental RMAN backup. With delete noprompt archivelog all backed up 1 times to device ....
4º Wednesday you do a incremental RMAN backup. With delete noprompt archivelog all backed up 1 times to device ....
5º Thursday database crash. Use Rman Restore Database; Recover Database;
You also can use rman backup archivelog with delete noprompt archivelog all backed up 1 hourly.
. :-) Any help with my english will be welcome :-).
Edited by: Agustin UN on 03-nov-2010 10:15
Edited by: Agustin UN on 03-nov-2010 10:16
Similar Messages
-
Using JSP to run batch file - command launches excel but doesn't open file
I have written a jsp on a server which runs a batch file. Every command line in the batch works fine except the following:
CALL "C:\Program Files\Microsoft Office\Office\Excel.exe" C:\Temp\spreadsheet.xls
I can see that a command prompt has been opened and an instance of Excel has been created, but it does not open the file.
I tried running the batch file on its own. It worked fine. I tried putting the java code in the jsp into a java class, that worked okay too. I think it might be to do with the fact that the client is trying lauch the application through the web, but it's missing some information such as paths.
I am totally running out of ideas.. please helpI guess if I know JSP stands for Java Server Pages..
I would most probably know it runs on servers.Yes, you might, but if you were assuming that the path you gave would always lead to an executable running on the client you'd have a problem. It's worth asking.
I must admit it's probably not the best idea, but if
you can give me some advice on that, that would be
greatJSPs shouldn't have code in them that doesn't pertain to view. I'd wrap something like a system call or Runtime.exec in a Java Bean that you can test off-line without the JSP. Then have the JSP instantiate an instance, invoke its method, and display the value that's returned.
You've read this, of course:
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
Everyone who uses Runtime.exec should.
% -
Hi Guys I have this batch file called via ant build script.The batch file has 10 different function .Now i have this requirement to break it into smaller parts.
Example the functionality should now be broken into three parts
1)employee data processing
2)employee working days
3)employee salary
4)employee promotion history
1)employee data processing
2)employee working days
3)employee salary
1)employee data processing
2)employee working days
4)employee promotion history
Problem is absence of OR statment in batch file will force me to write this
command in separate batch file.(I was trying to put it into one so that I dont have to repeat statments).Basically I was trying to execute target and target will execute the batch file with a parameter,which will then decide which functionality to execute , but in absence of OR is causing me some headache.Not able to decide the best strategy.
help
Yang ShetlingMaybe I missed it, but where is the Java question?
-
Hello dears
Please guide me about below command:
@echo off
cd\
cd inetpub
cd temp
cd Host_4.1.11.5
md IPC
move SecurityOld IPC
xcopy Accounting IPC\Accounting /s /i
xcopy OrgFundamental IPC\OrgFundamental /s /i
setlocal
set "location=c:\inetpub\temp\Host_4.1.11.5"
for /d %%d in (%location%\*) do (
md "%%d\bin"
move "%%d\*.dll" "%%d\bin"
ren "%%d\*.exe.config" "web.config"
rd "%%d\IPC\bin"
i need exclude two folders from %location% in for section.
please guide me.Try this cleaned up version. It will skip folders xx and yy.
@echo off
setlocal
cd /d \inetpub\cd temp\cd Host_4.1.11.5
md IPC
move SecurityOld IPC
xcopy Accounting IPC\Accounting /s /i /y
xcopy OrgFundamental IPC\OrgFundamental /s /i /y
set location=c:\inetpub\temp\Host_4.1.11.5
for /d %%d in (%location%\*) do call :Sub %%d
goto :eof
:Sub
if %*==xx goto :eof
if %*==yy goto :eof
md "%*\bin"
move "%*\*.dll" "%*\bin"
ren "%*\*.exe.config" "web.config"
rd /s /q "%*\IPC\bin" -
Using 10g SQL Plus from a batch file
I installed the Oracle Database 10g Express Client and configured my ODBC and tnsnames.ora settings, and I think I have it all right, because when I open the SQL Command Line I can connect to the database just fine using:
connect <username>/<password>@<database>
However, when I try to log in through a non-SQL command line or batch file using the syntax:
sqlplus <username>/<password>@<database>
I get the error "ORA-12154: TNS:could not resolve the connect identifier specified." That syntax used to work for me with 9.2. Does the functionality still exist in 10.2?
Update #1:
The sqlplus login works from a normal command widow if I first CD C:\XEClient\bin. I still can't get it to work from a batch file, even when I specify the path. Does this mean the batch file command can't find my tnsnames.ora? If so, what environment variable do I need to set? I already have the client directory in the Path and ORACLE_HOME variables.
Update #2:
I started randomly trying every Oracle environment variable I could find a reference to, and found that setting TNS_ADMIN to the C:\XEClient\bin directory worked.
I don't need any responses to this post, so it can be deleted by an admin.
Edited by: user11241849 on Jan 13, 2010 12:05 PMHi Toni,
It is my first post here and I though telepathy already operated here :)
it is Oracle 9 I am talking about.
actually, I have 2 batch files
File 1, lets say the file name is batch1.bat and the contents are
sqlldr user/pwd@tnsname control='Control.ctl' data='data.txt'
File 2, batch2.bat and the contents are
Batch1.bat
Sqlplus user/pwd@tnsname @callproc.sql
Now if I run Batch2.bat, then only the first line to be executed which calling the batch1.bat , the second line (sqlplus) never executed!
Best Regards,
Yousef
Edited by: yousef_bayyari on 10-Nov-2009 06:25 -
I am trying to write a script that will execute a batch file on a remote Windows server.
This line below is basically what I'm trying to do and it works without error, however I would like to use a variable for the path\filename of the batch file.
invoke-command -computername QSC-A-ICE01 -scriptblock {Start-Process "\\qsc-a-ice01\D$\Test\RunThis.bat" }
If I try to use a variable as in this example below I receive the error below. The error seems to indicate it's it expecting a "FilePath" parameter. Is this true? How would I change this script to make it work when substituting a variable.
$MyProcess = "\\qsc-a-ice01\D$\Test\RunThis.bat"
Write-Host $MyProcess
invoke-command -computername QSC-A-ICE01 -scriptblock {Start-Process "$MyProcess"}
This is the error text I receive when using a variable:
PS C:\Windows\system32> D:\Test\ThisWorks.ps1
\\qsc-a-ice01\D$\Test\RunThis.bat
Cannot validate argument on parameter 'FilePath'. The argument is null or empty. Supply an argument that is not null or
empty and then try the command again.
+ CategoryInfo : InvalidData: (:) [Start-Process], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.StartProcessCommand
+ PSComputerName : QSC-A-ICE01
PS C:\Windows\system32>Mike,
Thanks for providing the link, it was very informative. The link described how to use the args in a ScriptBlock and provided me with an explaination as to why it works the way it does on a remote server. This is my 1st post to the forum and I don't know
how the points system works yet.
I would like to split the points , but I don't see that this is possible.
You're very welcome, I'm glad that the information was helpful.
You can mark as many posts as answers as you'd like, there's not a restriction on only having a single answer per thread. You certainly don't have to though, David's answer is more than sufficient to help any future people who find this thread.
Also, on a side note, you may want to post in the thread below. Posting there will get your account verified so you'll be able to post links and images.
http://social.technet.microsoft.com/Forums/en-US/200c33c9-abe9-494a-953a-bf53fccb3c76/verify-your-account-11?forum=reportabug
(Future people - don't use that link.
Click here and look for the current thread as a sticky.)
Don't retire TechNet! -
(Don't give up yet - 12,575+ strong and growing) -
The reverse of the "findstr" command in a batch file.
Hi.
I hope I'm in the right place. I am trying to run a command/batch file on a really large text file to replace all lines of text with the exception of certain lines which contain a certain word. I know this can be done to 'delete' certain lines
and keep the others using the "findstr" command. What this command does is deletes all lines in a text file that contain specific words whilst keeping all other lines.
I want to do the exact opposite to this. I want to keep certain lines of text containing specific words whilst deleting all others.
Does anyone know what this command might be? Or is there a switch one can use with "findstr" command to do it?
All help appreciate
JIn general you could write:
(Get-Content.\inputfile.txt)
-match"keyword"|Out-File.\outputfile.txt-Encodingascii
Outputfile.txt would then contain all lines that contain "keyword".
This should work for files with a size <4GB.
I've just tried: The powershell.exe process didnt get more than 4GB RAM. :-)
Walter -
In batch file i want to execute sql commands
in x.bat file i write the following
sqlplus user/pass@host @c:\a.sql
@c:\b.sql
when i execute this batch file it is connected to the databse
and the table of a.sql is created in the database.
but b.sql is not created.
it is creating only one table
i want ot create more no of tables with different .sql files
like @c:b.sql
@c:c.sql
@c:d.sql
please any body helpThe problem you are running into is that SQL Plus only recognizes the first command you have written in the batch file.
sqlplus user/pass@host
SPOOL c:\master.log
@c:\a.sql
@c:\b.sql
SPOOL OFF
SQLPlus will recognize the spool and first sql command, but the batch file gets command back after the first sql command executes and doesn't recognize @c:\b.sql or know what to do with it. To run multiple SQL commands you have to create an external SQL file with all the sql commands in it with the Spool files you want created, then in the batch file you only call the one SQL script.
Create a master file like so:
-- Script Name : AllFiles.sql
SPOOL c:\master.log
@c:\a.sql
@c:\b.sql
SPOOL OFF
In x.bat
CALL SQLPlus user/password@database @AllFiles.sql
This should get you your required results. -
Is there any command in windows batch file similar to the unix grep command
Hi,
I have a batch file which will return status of the Database to a file ex: "OPEN". Now I want to read this output file and check for the "OPEN" string from another batch file. any suggestions?. This is similar to "grep" command in unix. I want this to be done in windows batch file.
This is my actual batch file
rem -- Description: Check whether the Database is UP
rem -- Usage:
rem -- ORACLE_SID is input parameter for the file
rem --
rem --start of batch file
@echo off
set ORACLE_SID=%1
echo connect plp/ltd1plp@%1
echo set cmdsep on
echo set cmdsep '"'; --"
echo set term on
echo spool c:/status_log.log
echo select status from v$instance;
echo spool off
) | sqlplus /nolog
rem --end batch file
Thanks.The same link from [google cache|http://209.85.229.132/search?q=cache:EJrm9tgj0a8J:www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/find.mspx+windows+find&cd=1&hl=en&ct=clnk&client=opera]. Also you can use help:
find /? -
Unable to run a Batch File Operating System Command
Using XI 3.0, I am unable to run a Batch File Operating System Command After Message Processing.
My Batch file:
gpg -se -r BOA3RSKY --armor --passphrase-fd 0 %1 < C:\Progra~1\GNU\GnuPG\gpgin
My Command Line (ID scenario)
exec "cmd.exe /c C:\Progra~1\GNU\GnuPG\boagpg.bat %F"
If I execute
exec "cmd.exe /c type C:\Progra~1\GNU\GnuPG\boagpg.bat >xis.txt"
It displays the contents of boagpg.bat file in xis.txt.
I just don't understand why when I run the batch file, I would expect an %F.asc encrypted file in the same directory as the %F unencrypted file.
Any ideas?
or will I need Basis to create commands that will allow me to run GPG from XI Command Line?Check this links if its helpful
http://help.sap.com/saphelp_nw04/helpdata/en/bb/c7423347dc488097ab705f7185c88f/frameset.htm
/people/sap.user72/blog/2004/01/30/command-line-help-utility
Check this thread a similar problem
Process Integration (PI) & SOA Middleware
Note 841704 - XI File & JDBC Adapter: Operating system command
http://service.sap.com/sap/support/notes/841704
Try to see the below links
/people/michal.krawczyk2/blog/2005/08/17/xi-operation-system-command--error-catching
OS Command on FTP
OS command line script - Need help
FTP - Run OS Command before file processing
Note: reward points if solution found helpfull
Regards
Chandrakanth.k -
How to write sql command in batch file
hi,
i m using oracle 9i on windows. i want to know how can i write sql command on batch file. i want to use a batch file to use sql command like shutdowm & startup command and any select command too.
so plz tell how can i do it ?
thxssuperdba wrote:
thxs u all , i got it at i wanted to do.
thaks u all for yr precious time.
thxsYou've 67 questions with 63 UNanswered. Please mark this question as "answered" and give points to the users whose answer you accept as "helpful" or "correct"
Kamran Agayev A. (10g OCP)
http://kamranagayev.wordpress.com
[Step by Step install Oracle on Linux and Automate the installation using Shell Script |http://kamranagayev.wordpress.com/2009/05/01/step-by-step-installing-oracle-database-10g-release-2-on-linux-centos-and-automate-the-installation-using-linux-shell-script/] -
Batch file gives error "is not recognized as internal command.." after first character
For every batch file I create, I receive the same error displaying after only running the first character in the file: ' d' is not recognized as an internal or external command, operable command or batch file.
This occurs whether I run 'dir' cd '../..' or java.exe
I've confirmed the path environment variable has the correct paths, cmd.exe is assigned to comspec, I'm running as admin, etc. What have I not setup correctly to run batch files. I can run these same commands directly at the command line.
I'm running the latest version of 8.1, on Toshiba Satellite C855We do not have access to your computer, we cannot read your mind, and we cannot see your screen.
Please copy and paste the exact command you are using and also copy and paste the
exact error message.
-- Bill Stewart [Bill_Stewart] -
Please help how to run System commands and batch files thru java program
Sir,
I want execute OS commands like dir,cls..etc and batch files,.exe filesthru java program.
I have tried it sofar thru Runtime.getRuntime().exec("execute.bat");
but it is not working.anybody knows about how to run the system commands thru java please give me the code.
thank you,
regards,
j.mouliI've seen other posts with this questions, and answers. Unfortunately I didn't pay much attention. But the basic idea is to exec command.com and pass the specifc batch or command as an argument.
-
Hi All,
anybody knows how to call a batch file from java
is there any DOS command aor dll file like url.dll by wich i can call my batch file from a java file
or may be some body can tell me how to use FileUploadProtocal to call a batch file from java
Please help me
ASAP
Thanks in advanceActuly I got these lines from a frnd
String loadPath = "rundll10 url.dll,FileProtocolHandler D:\\a.bat";
Process process = Runtime.getRuntime().exec(loadPath);
but my original code was
try{
boolean imported = true;
String _cmd = "cmd /c ";
cmd =cmd+"sqlldr ";
cmd = cmd + " userid=" + userId + "/" + passwd + "@"+ tnsEntry;
cmd = cmd + " control=" + controlFilePath;
cmd = cmd + " log=sql.log skip=1";
System.out.println(_cmd);
String envArr[] = new String[2];
envArr[0] = "ORACLE_HOME=" + System.getProperty("ORACLE_HOME");
envArr[1] = "PATH=" + System.getProperty("PATH");
try{
Runtime r = Runtime.getRuntime();
Process process = r.exec(_cmd);
catch(RuntimeException re )
System.out.println("Failed to runtime run the process.123.."+re);
it was not working even i m not getting any error or excep. so I tried that two lines above.
but still frustating results -
LabView equivalent to running batch files using the "shell" command (VisualBasic)
I'm converting a VisualBasic app to LabView and am having trouble figuring out how to run a batch file with LabView.
The VB code that I'm trying to replicate is:
'UNLOAD RTX DRIVERS
Dim ProcessId As Long
ProcessId = Shell(App.Path + "\UnloadReloadRTX.bat", vbNormalFocus)
Wait 400
I haven't found a LabView equivalent to the Shell command. Any suggestions will be appreciated.
thanks,
ToddIt seems as if this question pops up every week. Use the System Exec.vi found under Funtions - Communications palette. It is the equivalent of Shell.
- tbob
Inventor of the WORM Global
Maybe you are looking for
-
Why won't digital editions recognise a fulfillment server when I am connected to the internet?
Hi Digital editions has always worked well but now when I try to download a book it tells me it cannot find the fulfillment server and make sure I am connected to the internet. I have tried reloading it but still get the same response.
-
Selection of approvers for Bid
Hello all, My one more thread is going on for Bid approval workflow problem. But since the subject requirement is different opened a new thread. Version: SRM 4.0SP08 SRM server 5.0 Set up: Strategic purchaser has role SAP_BBP_STAL_STRAT_PURCHASER and
-
My Lingualeo add-on works wrong with latest versions of Firefox
Hi! This add-on allows to translate English words into Russian and remember them to study later as shown in attached screenshot. After latest upgrades of Firefox it doesn't show list of possible translations, so I can't pick any translation and remem
-
I'm Ecuadorian student and developer. Excuse me by my bad English. I don`t know how to use https in my web application, I'm developing a e-commerce and I need to use https. please I need help. thanks.
-
Does anyone have a clue why my 5/11 MBP has a HUGE decrease in network speed when I connect to my older ACD + Logitech Wave wireless keyboard + external hard drive. I also use the same wireless keyboard and mouse and another firewire external HD *bu