Windows :: PL/SQL With Batch File

Aug 17, 2012

I am executing multiple PL/SQL files(.sql) with single batch file. The batch file sql.bat has got 3 sub sql sub-tasks to complete once its run. The sql.bat is show below

@Echo off

CD C:Report
echo Loadin tables from text file Report.txt
sqlplus security/password <c:Reportloader_security.sql
echo Creating Security table
sqlplus security/password <c:Reportcreating_security_final.sql
echo Inserting text file Security table
sqlplus security/password <c:Reportinsert_security_final.sql

PAUSE

The sql.bat runs perfectly if I double click on the sql.bat file separately. But if I call the sql.bat from a different batch file 'Final.bat' it throws the below error.

Error
-----------
Executing SQL commands and loading file into SQL tables
Loadin tables from text file Report.txt
Error 6 initializing SQL*Plus
SP2-0667: Message file sp1<lang>.msb not found
SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
[code].....

The Final.bat file calls other bat files too. It is as show below.

CD C:ReportSecurity
echo Merging all Files
CALL merge.bat

CD C:ReportSecurity
echo Deleting old files
CALL del.bat

CD C:ReportSecurity
echo Executing SQL commands and loading file into SQL tables
CALL sql.bat

View 11 Replies


ADVERTISEMENT

Windows :: Batch File Versus SQL Developer

Aug 23, 2012

I have a particular sql code which works perfectly fine on sql developer. But if I run the same sql code through a batch file it does not get executed. It does not throw an error too.

SQL code - clean_tables.sql

begin
execute immediate 'drop table external_tables';
execute immediate 'drop table security';
exception
when others then
null;
end;

Batch file - Clean.bat

set ORACLE_SID=orcl
set ORACLE_HOME=C:oracleproduct11.2.0dbhome_1
set PATH=C:oracleproduct11.2.0dbhome_1BIN

sqlplus security/password@orcl <c:Reportclean_tables.sql

pause

View 2 Replies View Related

Windows :: Passing Values / Arguments To Batch File

Aug 26, 2012

I have a batch file Menu.bat which should pass accept the input parameters from the end users and pass the entered values to a different batch file.

After entering option 2 the user should be prompted with an option to enter the path. E.g. /shared/folder.

Now '/shared/folder' should be passed to a different batch file named R.bat

Below is the Menu.bat file.

@echo off
color 00
title Security Audit Adaptor

:main
cls
echo //MAIN MENU\
echo.
echo 1. Got to Google
echo 2. Enter path
[code].......

View -1 Replies View Related

Windows :: Calling Stored Procedure With Input And Output Parameters From Batch File?

Oct 4, 2011

when i am calling stored procedure with input and output parameters from batch file .. I am getting the following message ..

SQL*Plus: Release 10.2.0.1.0 - Production on Tue Oct 4 11:48:51 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options 14

code which i have written ...

DEClARE
RETCODE NUMBER;
RETMSG VARCHAR2(200);
EXEC SP_SELCT_EMPLOYEE_DATA(277080,'EMPNAME ','EMAIL@EMAIL.COM', 9028045686,111333,25000,'PUNE',35,RETCODE ,RETMSG );
EXIT

Procedure Name :

PROCEDURE SP_SELCT_EMPLOYEE_DATA (
-- A_EMPLOYEE_ID IN VARCHAR2,
--A_JOB_ID IN EMPLOYEES.JOB_ID%TYPE,
P_EMPLOYEE_ID IN EMPLOYEES.EMPLOYEE_ID%TYPE,
P_EMPLOYEE_NAME IN EMPLOYEES.EMPLOYEE_NAME%TYPE,
P_EMAIL IN EMPLOYEES.EMAIL%TYPE,

[code]....

View 2 Replies View Related

Backup & Recovery :: RMAN Backup Fails On Windows When Using Batch File?

May 3, 2011

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.19sgdba
mankp_acressit.bat
D:>rman catalog rman/******@acressit target / cmd
file=E:sgdba
mankp_arch.rcv log E:sgdba
mansit_arch_rman_backup.log
RMAN-00557: could not open MSGLOG "E:sgdba

[code]....

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
mankp_arch.rcv"

[code]....

* 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.

View 2 Replies View Related

Windows :: Unattended Install Via DOS Batch For Client 8.1.7

Apr 27, 2004

I have got an unattended install (via the Oracle provided response file) working fine for Oracle Client 8.1.7, however the setup isn't working quite as I would like it...

I am calling the setup.exe with appropriate switches for the response file from a DOS Batch file.� Once setup.exe has been called, the batch file then assumes it has finished its job with the Oracle setup, and continues processing as normal, however the Oracle setup has only just started.

command line switch to add on the end of setup.exe to make sure that the batch file pauses until the Oracle client installation has completed?� Just using Sleep.exe from the Windows Res Kits isn't really good enough, as I don't want to be guessing how long an Oracle install takes - I'd much rather have the setup.exe tell the batch file when it has finished, so the Batch can carry on.

View 3 Replies View Related

SQL & PL/SQL :: How To Run A Batch File In Oracle

Aug 18, 2009

I have a .bat file in my client system,which will open a web page after executing(after double clicking on it).I want to execute the same batch file from my pl/sql block.So,after executing my pl/sql block that .bat file should execute,and it should open the same web page.

View 12 Replies View Related

SQLPlus Script To Run In Batch File

Nov 1, 2010

I am trying to create a batch file which will be executed with windows scheduled task. This batch file will have sqlplus script running Oracle query. I can run this query from the command prompt, no problem,

This is the sqlplus scipt to run query:
C:\Documents and Settings\testuser>sqlplus
SQL*Plus: Release 10.2.0.4.0 - Production on Mon Nov 1 19:54:25 2010
Copyright © 1982, 2007, Oracle. All Rights Reserved.
Enter user-name: TEST1
Enter password:
Connected to:
Oracle Database 10g Release 10.2.0.4.0 - Production
TEST1@DB> spool testuserfile
here goes my query
TEST1@DB> spool off
TEST1@DB> exit
Disconnected from Oracle Database 10g Release 10.2.0.4.0 - Production
C:\Documents and Settings\testuser>

How do I put this in a batch file. I was able to figure how to logon, but I get stuck at the spool command. My batch file starts like this:

cd C:\Documents and Settings\testuser
sqlplus TEST1/Password

View 1 Replies View Related

Forms :: Run Batch File Through Form?

Jan 12, 2012

I create a form with button....whenever i click button my batch file should be run..

My batch file code :

@ECHO OFF
cd
ipconfig /all
pause

When-button-pressed trigger :

======================================
client_host('D: est_ipa.bat');

When i double click .bat file, it will get proper info.But when i call this .bat file thru form, it will show blank screen..why this .bat file not running ?

View 2 Replies View Related

PL/SQL :: Validating Connection From Batch File?

Sep 3, 2012

I am trying to create a .bat file where I need to take inputs for below variables

DNAME
UNAME
PSWD
So I have done like this
SET /p DNAME="Enter the Database Name "
SET /p UName="Enter the Username "
SET /p Pswd="Enter the Password "

Now I need to validate whether I am able to establish the connection

sqlpus -s "%UName%/%Pswd%@%DNAME%"

if the above connection is valid one then perform certain action else need to echo user that Access is denied.

(ex: I am trying to say if cond is valid

stmt-1
else
echo message to user. )

View 3 Replies View Related

Server Utilities :: Backup Through Batch File

May 18, 2011

exp system/abc@c file=c:dmp_%date%.dmp log=c:log.txt owner=xyz

I run this script through batch file its working.Problem is dump file showing with this format C:dmp_wed.dmp.I want to date format like that C:dmp_18052011.dmp.

for date formatting.How I can add date format in a batch file.

View 5 Replies View Related

Forms :: Call Batch File From Oracle 10g?

Jun 25, 2010

I want to call .bat file from oracle froms 10g.

I tried given below code but failed.

---------------------------------
declare
v1 varchar2(200);
begin
v1 := 'D:FolderLogicalbackup.bat';
HOST('cmd /c start'||v1,no_screen);
--HOST(v1);
end;
-----------------------------

The Logicalbackup.bat file contains:-

Cd d:oracleproduct10.2.0db_1in
d:
exp mw6/mw6@mw file=d:mw6ackupackupRGLHR.dmp log=d:mw6ackupackuplogRGLHR.log

View 4 Replies View Related

Check If Database Is Idle Or Not From Batch File?

Aug 4, 2012

I am running Oracle Database 10g R2 on windows 2003, I want to create a batch file to check if the database is idle or not, and if it is idle shut it down and start it up.

View 13 Replies View Related

Client Tools :: Conditionals In A SQLPlus Batch File?

Oct 23, 2012

From within a DOS batch file I make the following call:

sqlplus [User]/[password]@[server] @batch_script.sql [Server] [User]

Within the file batch_script.sql I have the following lines:

spool output_batch.lst
connect &&2/[password]@&&1;
@SomeOtherFile.sql

I want to change the last line to something like this:

if &&1 = 'Something' then
@SomeOtherFile1.sql
else
@SomeOtherFile2.sql
end if;

I get the following result

SQL> if &&1 = "something" then
SP2-0734: unknown command beginning "if &&1 = "..." - rest of line ignored.

I took a shot at using the "If" statement and missed.

View 12 Replies View Related

Backup & Recovery :: Execute A BATCH File Through PLSQL?

May 30, 2012

execute a BATCH File through PLSQL.

BEGIN
dbms_scheduler.Create_schedule(schedule_name => 'RMAN_TICKER_STARTING',
repeat_interval => 'FREQ=DAILY;BYHOUR=9; BYMINUTE=15,30,45,59',
comments
=> 'schedule to run daily');
dbms_scheduler.Create_program (program_name => 'TICKER_PROGRAME',

[code]....

It was created successfully, but when I execute, it shows the error message.

BEGIN
dbms_scheduler.Run_job ('RMAN_TICKER_JOB', TRUE);
END;
begin
dbms_scheduler.run_job (
'RMAN_TICKER_JOB',TRUE);
end;
Error at line 1
ORA-27370: job slave failed to launch a job of type EXECUTABLE
ORA-27300: OS system dependent operation:accessing execution agent failed with status: 2

[code]....

But I have the CMD file in the location - "F:FEEDLGRTOOLSfeedlgr.cmd".

View 2 Replies View Related

Server Utilities :: Handling Errors In Batch File?

Aug 21, 2010

i get flat file and i have set up a control M job so that it runs at a particular time.

initially my control file was as below:

LOAD DATA
INFILE 'DFILEabcd.dat'
BADFILE 'BDabcd.bad'
REPLACE
INTO TABLE abcd_table
(A position(01:09) CHAR,
B position(11:12) CHAR,
C position(14:33) CHAR,
D position(37:50) char)

this was working fine. control M did not send FAIL message.but later i had to change the ctl file due to requirement. i had to add a when clause.

my code after modification is:

INFILE 'DFILEabcd.dat'
BADFILE 'BDabcd.bad'
REPLACE
INTO TABLE abcd_table
when A<>'10'
(A position(01:09) CHAR,
B position(11:12) CHAR,
C position(14:33) CHAR,
D position(37:50)

now the control M is sending an erro message after it runs the job. error is Return 5. thats all it gives.

i think it is due to errorlevel 1. in log file it says zero records inserted due to data error. then what is causing control M to send fail message??

sqlloader is loading all the required records correctly.

View 10 Replies View Related

Installation :: Create Silent Install As Part Of Batch File

Aug 1, 2012

I am trying to create a silent install as part of a batch file that does other things after. I'm running into the following issues

1) I need the batch file to wait until the install is done to continue. Trouble is that running setup with a response file opens up a new windows to run the install. I tried the wait command but doesn't work right either
2) Same issue with DBCA and a response file.

Any way to run the silent installs and have the batch file wait until the install is done and then continue? The less user intervention required, the better.

View 11 Replies View Related

Forms :: How To Call Batch File Existing In Network Path Through 6i

Aug 10, 2011

How to call a batch file existing in network path through oracle forms 6i. I am using following code in Forms 6i which is supposed to FTP some .text files to a UNIX box.

Host( '\guww.netdfs.root.Global Shared Data$(LEV)Leven Shared DataLeven Shared DataPublicCOMMONMatsEmpty Bottle ReportsSchedules Preliminaryftp_files_to_ddd.bat');

When I am running this batch file ftp_files_to_ddd.bat from local directory of my PC,it is working properly.

View 1 Replies View Related

Client Tools :: Catch Oracle Login Error In Batch File?

Feb 6, 2012

I have a Batch file(.bat) where I get the user name password ans schema name as a input . Based on that input I connect the sql and run some update query from bat file itself. Now I have issue ,when the user give wrong credintials it ask for the credintials again.

Is there any way to check the credintials of oracle and give the invalid credintial error via bat file. The sample of my Bat file is as follows.

@echo off
for /f %%i in ('sqlplus -s usename/password@db @H: est_db_connection.sql') do @set count=%%i
echo %count%
IF %count% EQU 1 ECHO ("Database connection working fine")
IF %count% NEQ 1 ECHO ("Not able to connect to database")

This is not working fine.

View 2 Replies View Related

PL/SQL :: Procedure / Batch File To Export Data From Sql To Excel (predefined Path)

Apr 5, 2013

I have countries, sites, states tables (total 3) in database (i have user id and password to connect to this database).

every week i need to extract data from these tables into excel files and i need to save those in shared drive for team use.

Currently i am connecting to database every time running sql query and manually exporting that latest data to excel and saving that as excel files in (G: eamcommon) folder with specific name.

output format should be :

excel (.xls)
file names should - countries.xls,sites.xls,states.xls
server name : ap21
output location : G: eamcommon ( G is shared drive).

i heard that we could create batch file to do this task and also we could use oracle procedure to do this task. but not sure which one is the best option.

View 3 Replies View Related

Windows :: Export With Dynamic File Name?

Aug 19, 2010

I want to know how export oracle tables with dynamic file name which contains (system date and database name) on windows XP platform.

View 5 Replies View Related

Windows :: Create BAT File With Query To Run A Package

Dec 14, 2010

I need to create a bat file which include a query to run a package. I use plsql developer to develop the package. its username,password and database is user,pswd,db1 respectively. the query to run the package is "SELECT

COLUMN1 AS "LAST NAME",
COLUMN2 AS "FIRST NAME",
COLUMN3 AS "LOCATION"

FROM TABLE(PKG.GET_SUM('09-NOV-2010','12-NOV-2010')) "

what code should I write to create a bat file.

View 13 Replies View Related

Windows :: Unable To Find DLL Library File

Nov 21, 2012

We are getting below error....Our one package called orawpcom.dll library file.

ERROR at line 1:
ORA-06520: PL/SQL: Error loading external library
ORA-06522: Unable to find library
'/oracle9i/app/product/11.1.0.7.0inorawpcom.dll'.
ORA-06512: at "GFSAM.OAINVOKEDOUBLE", line 1
ORA-06512: at "GFSAM.ORDCOM", line 229
ORA-06512: at "GFSAM.ORDEXCELSB", line 450
ORA-06512: at line 43
ORA-06520: PL/SQL: Error loading external library
ORA-06522: Unable to find library

Attach this orawpcom.dll file?

View 1 Replies View Related

PL/SQL :: Spool File Output From Unix To Windows

May 22, 2013

I'm running a sql file in Unix (using SQLPLUS command) and i want the file output to be sent to local windows directory. I specified the windows directory name in my Spool command (Spool C:/<Directory Name> ) , But it is not working

Our Unix server is a FTP server but i don't want to FTP the spool file from unix to Windows as the spool file is Huge and it takes hours for the transfer to complete (and we have to run the script multiple times).

Is there a way i can have the spool file created in Local windows directory when i run my sql script in Unix?

View 5 Replies View Related

Unable To Deleted Archive Log File On Windows Server?

Sep 20, 2010

version: 10.2.0.4
OS: windows server 2003

I am not able to delete one month old archive log file manually on windows which doesn't having info about the standby on v$archived_log view of primary database. the sequence were already applied to the standby database. It shows the status as deleted in v$archived_log. while deleting the file manually. it showing an error like another program or person is using it.

View 10 Replies View Related

Backup & Recovery :: Windows RMAN - Bat File Using Variable?

Oct 16, 2012

I'm trying to write a bat file for the rman backups that can be used for any of our databases. I'm passing variables into the bat file and that is working fine (i.e. oracle_sid, drive letter, oracle_home), my problem is when the rman actually runs and calls the ctl file, the variables aren't being passed thru to that file.

View 3 Replies View Related

Windows :: Oracle 11g R2 Install On 7 64 Bit Setup EXE File Does Not Work

Jul 5, 2010

I am trying to install Oracle 11g R2 on my Windows 7 Ultimate 64 bit. When I execute setup.exe as Administrator the command window flashes and exits. I could not even see what the message is. Also tried command prompt.

View 12 Replies View Related

Windows :: Unable To Delete SMON Trace File?

Oct 4, 2012

In my database smon tracefile was huge,now we want to delete the same,I also tried with ordebug operation but no use, delete tracfile which Smon generates.

View 5 Replies View Related

SQL & PL/SQL :: Copy CSV File From Windows Server Shared Path

Jul 12, 2012

I need to copy .CSV File from a Windows Server shared path (\hostnameoutput) to another server which i believe is on unix.The other server name is abc.hcl.com. On this server i need to put it in the root directory. I will have to use SFTP and not FTP.

View 19 Replies View Related

PL/SQL :: ORA-29283 Invalid File Operation On Windows System

Jul 31, 2012

Windows 2003, DB 10.2.0.3...I have to read some files from remote folder, so on remote Windows machine I shared folder c:est (grant Everyone first, and Administrator then) and on DB Server I mapped the remote folder with letter T..All these operations were made with administrator privileges.

In Oracle I create a directory object with this command:
CREATE OR REPLACE directory T_DIR AS 'T:';

Then I granted read and write privileges to my user
GRANT READ, WRITE ON DIRECTORY T_DIR TO <user>; (I tried also to set PUBLIC and SYSTEM)

But when I try to open a file with UTL_FILE with this command

file_handler := UTL_FILE.fopen( 'T_DIR', 'Dati.ini', 'r' ) ;

the error is
Exception: ORA-29283: operazione file non valida
ORA-06512: a "SYS.UTL_FILE", line 475
ORA-29283: operazione file non valida

If I change my directory object in 'C: est' (local folder) it works correctly.I tried also restart DB while shared folders were connected but with the same result.I tried, from sqlplus, the command host (dir t:) and it works (folder is accessible)

Is it an Oracle bug? Is it a Windows bug?

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved