Maxl within Windows Batch File
Hello,
I am trying to schedule an Automatic Essbase Archiving command . Function is to Disable connects , Archive , Unarchive and Enable connects . I know the Maxl commands which perform this action but just wanted to make sure how to portray this within a Windows Batch file.
Within the Batch file , abc.bat can I insert those commands . To enter the shell we need essmsh command , but I didnt wanted to get into decrypting , encrypting the ID etc to do that . So is there a way to get it done within the Windows batch file ?
Thanks !!
Yes its Straight forward case ,create a batch file which call the maxl script.The batch file should contain the user id and password of Essbase and the maxl script should contain the parameters of Essbase archiving
The content of batch file for Essbase archiving process
echo off
set ESSUSER=admin
Set ESSPWD=Password
set ESSSERVER=localhost
set ESSAPP=Sample
set ESSDB=Basic
SET ESSBASE SERVER PATH=D:\Hyperion\Middleware\EPMSystem11R1\products\Essbase\EssbaseServer
set MaxlScript=D:\Hyperion\Middleware\user_projects\epmsystem1\Essbaseserver\essbaseserver1\bin
essmsh "D:\Archieve.mxl" %ESSUSER% %ESSPWD% %ESSSERVER%
===================================================================================================
Maxlscript Content for Archieving
spool on to "D:/bck.log";
set timestamp on;
login $ESSUSER $ESSPWD on $ESSSERVER;
display session all;
alter system kill request all;
alter system logout session all force;
export database $essApp.$essDB all data to server data_file 'd:\alldata.txt';
alter database $essApp.$essDB force archive to file "D:/sample.arc";
alter database $essApp.$essDB end archive;
spool off;
logout;
exit;
Similarly can you create batch files for Cube restoration .I hope the above example helps you
Thanks,
Sreekumar Hariharan
Similar Messages
-
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 /? -
Call Oracle Stored Procedure with Parameters from Windows Batch File
Hi,
I have an oracle procedure that requires two parameters to execute, start date and end date as such:
CREATE OR REPLACE PROCEDURE insert_orders(
pSTART_DT IN varchar2
, pEND_DT IN varchar2
I want to create a windows batch file to execute the procedure but want to be able to specify the parameters (ie start and end dates) in the batch file as opposed to changing the sql file that the batch file uses to execute the procedure but I don't know what the syntax is. I tried the following but it still doesn't work.
Sql File: call_insert_orders.sql
execute insert_orders('&1','&2');
exit
Batch File:
sqlplus username/password @call_insert_orders.sql %01-jan-2010% %01-jan-2011%
When I execute the batch file, my DOS window still prompts me to enter value 1 so I think it recognizes that there is a variable being used but is not able to fill in the actual value I specify. I'm not an experienced DOS/Windows Batch File person so I'm guessing it's my syntax that's screwed up. There is not a lot of documentation on this subject matter hence my post on this forum. Any helps would be appreciated.
ThanksHello,
Just try the same DOS command without all the % sign.
In MS-DOS, the % at the beginning and at the end of a string are for variables. Which means your batch is looking for a variable called 01-jan-2010 and a variable called 01-jan-2011, but those are the values you want to pass, not the name of variables.
As they are not defined, nothing is passed to the sqlplus script, and that is why you are prompted for values.
Hope it will help.
Regards,
Sylvie -
Is it possible to call a windows batch file from PL/SQL
Hi gurus,
Would require your help.Is it possible to call a windows batch file from PL/SQL??If yes can you give an example for the same or any workaround for the same.
Regards
VijayHi!
Youn need some extproc related entries in you listener.ora and tnsnames.ora file.
*1. In the listener.ora:*
Defining the listener process is done in two parts.
The information contained in each listener differs!!!
The first part is as follows:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = extproc)) <--- *ADD THIS LINE
(ADDRESS = (PROTOCOL = TCP)(HOST = yourhostname)(PORT = 1521))
)The seoncd part is as follows:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = YOUR_GLOBAL_DBNAME)
(ORACLE_HOME = c:\oracle\product\10.2.0) <-- THIS IS YOUR ORACLE_HOME
(SID_NAME = YOUR_SID) <-- SID
(SID_DESC = <--- ADD THIS LINE
(SID_NAME = PLSExtProc) <--- ADD THIS LINE
(ORACLE_HOME = c:\oracle\product\10.2.0) <--- ADD THIS LINE AND EDIT TO YOUR ORACLE_HOME
(PROGRAM = extproc) <--- ADD THIS LINE
(ENV = "EXTPROC_DLLS=ANY") <--- ADD THIS LINE
) <--- ADD THIS LINE
)*2. In the tnsnames.ora you need to add the following entry:*
*(The KEY value entered must be match to the KEY value entered int the listener.ora file!)*
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = extproc))
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)Finally you need to restart your listiner. After restarting there will be a service called "PLSExtProc" in your listener.
This are only examples for extproc configuration, your tnsnames.ora and listener.ora can be differs.
FIRST MAKE MAKE A BACKUP OF YOUR ORIGINAL tnsnames.ora AND listener.ora FILES
For more information please check metalink note 68061.1 "EXTPROC: Creating External Procedures on Windows NT"
Bestr Regards
Norbert -
Is it possible to call a windows batch file from PL/SQL block ??
Hi gurus,
Would require your help.Is it possible to call a windows batch file from PL/SQL block ??If yes can you give an example for the same or any workaround for the same.
Regards
VijayYou didn't specify a database version, but if you are 10g or higher, it's quite straightforward using an external job type in DBMS_SCHEDULER. Funnily enough i'm looking at something similar myself at the moment.
Useful guide to some of the issues here Guide to External Jobs on 10g with dbms_scheduler e.g. scripts,batch files -
Problem in connecting to sqlplus from windows batch file (DOS)
Hi All,
We have a new 10g Oracle database installed on windows server. I am trying to write a windows batch file to
1) Connect to SQLPLUS
2) Execute a script
3) Disconnect from SQLPLUS.
Example File Name:- execsql.bat
SET ORACLE_SID=CAUT
SET SCHEMA_IN=%1
SET PASS=DEV
SET script=%2
sqlplus %SCHEMA_IN%/%PASS%@%ORACLE_SID% @%script%
if %errorlevel% NEQ 0 echo ERROR: %ERRORLEVEL% else echo OK
Now if i run this bat file like :- execsql.bat DEV script1.sql
DEV= schema name,
script1.sql = this file contains select * from dual;
The code runs fine, but if i change dual to dual1 the sql error's out but not able to catch the error in the batch file.
Reason why i would like to catch the error is this batch file would be scheduled through Autosys job scheduler and for autosys any exit code >0 is an error. Please help me in rewriting this batch script.
Thanks
Sam.Hello,
What if you run this in SQL*Plus before you run the SELECT:
whenever sqlerror exit failure -
Where windows batch file which log off windows lies ?
where windows batch file which log off windows lies ?
to which me can call from java code to log off my pc?You should use a brute-force algorithm on the on/off switch on your pc. I suggest a rate of 30 hits per minute.
-
Where windows batch file lies which log off windows ?
where windows batch file lies which log off windows ? wana log off my pc from java code
grc.com has a program (very small) that does it. The program is called "wizmo" and is written in Assembly.
If you are using Windows NT/2000/XP you can get a program in MS Windows Resource Kit called "shutdown.exe" but the program does only the shutdown job. You must manually turn the machine off. -
Commands within the batch file?
Is there any way to enter commands directly into the batch file which will take effect on the java application?
For example within the java application, there is a method "reload()" and to call that method you can type "reboot" and press enter in the batch file, is that possible? Thanks.I run my java application with a file (run.bat) (windows xp).
@echo off
title Stanyer's 503 (server)
cd bin
java -Xmx1024m net.stanyer.server 43594
pauseSo basically, it runs in a cmd box. -
Error handling from MAXL into a batch file
Hello all
I need to know how do we pass a value to a batch file from MAXL script if an error occurs.
I have used the following in my MAXL to catch an error.
========================
login username password on server01;
Iferror 'error';
Define Label 'error';
Exit;
=======================
In the batch file I used:
If %errorlevel% NEQ 0 goto catch
:catch
echo an error occurred during MAXL script
Exit
========================
This doesnt give me any error even the login info is wrong in the MAXL script
Please correct if this is wrong and provide any help if possible
Thanks in advanceHere's the error checking code I used in my last not-DOS-but-we-call-it-that script:
REM Call MaxL script with parameters
REM The 2>&1 at the end of the below line merges CMD's STDERR into STDOUT
%hyperion_home%\products\essbase\essbaseclient\bin\essmsh.exe %batAutomation%\%esbAppName%\MaxL\%mshScriptName%.msh %esbUsername% %esbPassword% %esbServer% %esbAppName% %mshScriptName% %batDrive% %batAutomation% >>%log% 2>&1
REM Test for MaxL execution errors
IF NOT %ERRORLEVEL% == 0 (SET errormsg=Error! - MaxL script %mshScriptName%.msh failed with ERRORLEVEL %ERRORLEVEL% & GOTO ERROR)The 2>&1 command at the end of the MaxL script line merges STDOUT and STDERR into an overall log file I used for other processes as well as MaxL. It's great for that purpose, but unfortunately logs the username and password -- this would be overcome by encrypting those values. It was acceptable for the solution so I didn't lose any sleep over it.
Regards,
Cameron Lackpour -
Executing sqlplus in windows batch file - URGENT
Hi
Is it possible to run sqlplus.exe thru batch file as follows.
set PATH=%PATH%;C:\oracle\product\10.2.0\client_1\BIN;
host sqlplus userid=test1/test12@testdev
sELECT * FROM CASESTATUS
Thanks
muralihI
It did not work. I have this question.
1. Do I have to run this opening SQL/PLUS and then submit
@C:\Test\SQL2.bat
2. Or from Windows command run SQL2.Bat
I tried both of them , it did not work. If I try from windows , I am getting SQLPlus connection window at all.
Please help me.
Murali
set PATH=%PATH%;C:\oracle\product\10.2.0\client_1\BIN;
sqlplus userid=test1/test12@testdev
Ok so far but your select needs to be in a file if you want this to be executed.
Put this in, f.ex, run.sql
>>
sELECT * FROM CASESTATUS
>>
then you can use
sqlplus userid=test1/test12@testdev @run.sql <complete path if needed> -
Windows batch file issue for Dbf to csv
Hello,
I am in a tough situation.I need to create a batch file in windows to convert .dbf file to .csv.
i am using below code for doing this .
dbf_2_ora.bat.....
f:
cd \Retail_Work\DATA_201\test
copy C_N_DETL.DBF C_N_DETL_TEST.csv
when I am running above bat file "C_N_DETL_TEST.csv" is creating but when I am opening this file data is separated by "tab".
kindly help me to create a csv file from dbf file withput spaces/tab/whitespaces.
hel[p meIMPORT DATA is a server side command (just as the documentation tells you)
The SAP HANA server cannot access your workstation or the folders on it.
This (and a lot more around data import/export) has been discussed a lot here in SCN already.
A little research effort would have clarified this.
- Lars -
How to check Oracle DB Status from Windows batch file
Hi,
I need a script which can be used to check the Oracle Database Status from windows command batch file.
Thanks,
KishoreHi Virendra,
I have followed the steps mentioned in ur reply, But couldn't get the output.
I am getting the below error
C:\>db_utility.bat PLPDEV
ERROR:
ORA-12560: TNS:protocol adapter error
SP2-0306: Invalid option.
Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]
where <logon> ::= <username>[<password>][@<connect_string>] | /
SP2-0306: Invalid option.
Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]
where <logon> ::= <username>[<password>][@<connect_string>] | /
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
C:\>
Below is my bat file
@echo off
set ORACLE_SID=%1
echo sys/ltd1_plp as sysdba
echo set cmdsep on
echo set cmdsep '"'; --"
echo set term on
echo "select status from v$instance;"
) | sqlplus -s
Thanks -
What is the default program to run windows batch files?
I am working on windows 7 and I found that "notepad" was set as the default program for opening my .bat files. when I try to execute the batch file by double clicking, it is opened by notepad.
I have tried setting cmd.exe as the default program, it just opens the command prompt.
What is the default program I should set for executing .bat files?
I hav also tried using assoc .bat = batfile. The batch file runs fine from command prompt.This is not a scripting question. It is a break/fix issue. Contact you support person or Admin for assistance fixing this.
http://www.sevenforums.com/general-discussion/53877-bat-files-open-notepad-instead-running-help.html
¯\_(ツ)_/¯ -
In windows batch file,how to check if connection to db is successful or not
I want to do some operations in batch file. So i use command "sqlplus usr/pwd@con @operation.sql" to in the batch file. But how can i check if i connect successfully? The %ErrorLevel% is always 0
Change your batch script as follows:
(P.S. You could prompt for the values in the batch file as well)
file: test.bat
@echo off
sqlplus /nolog @operation.sql <username> <password> <alias>file: test.sql
define username='&1'
define password='&2'
define alias='&3'
whenever sqlerror exit failure;
connect &username/&password@&alias
whenever sqlerror continue;Now you should get a failure message as a result of:
whenever sqlerror exit failure;you can also exit with a specific value
whenever sqlerror exit -5;
Maybe you are looking for
-
WebForms And Open MS Word Document EXAMPLE
Anybody who already got the sample code? Could you please share it to us :)
-
Mapping of Sales Org of CRM and R/3
Hello all, the sales org in CRM are mapped to the sales orgs in R/3 and there is data flow between R/3 and CRM.Where is the mapping done.In CRM, CRMD_ORGMAN contains org data however this is in the CRM number range.How can I find out which sales org
-
What's the arrow in the cloud that points upward or downward?
What's the arrow in the cloud that points upward or downward?
-
User Name and/or Password not accepted
I am trying to install something so it is asking for my username and password. No matter what I enter it says it is invalid. I have tried resetting my password and logging out and logging back in with the new password which worked. But still when I g
-
How to change the color of note
I posted this question last year but I do not have answers. Can anybody help me with this? I really like the Note and To Do in the Mail application. And just like you can choose the stationary for mail with Leopard - which I think is great!! Now I wa