How to deploy multiple PLSQL files at once

This article describes how to deploy multiple pl/sql files (.api, .sql, .etc) at once using command prompt.

First of all you have to store names of the plsql fiels in a text file in below way and save it in the folder where your plsql files are saved.


Then open the command prompt and  change directory path to where your plsql files and text file is saved.
Then type below commands in the command prompt and press enter.

sqlplus/nolog

conn username/password@service_name


Then write @ sign and drag and drop the text file to command prompt or type the path of the text file.
Press enter button.
Do not forget to type @ sign before the path of the text file.

Now all oracle files included in text files are deployed in your oracle database at once. If there are any compile errors in your db files, those are shown in the command prompt clearly.

If There are more db files, it is difficult to type all file names in the text file. So you can create a script for this.
Open a text file and type below code there


dir /b *.* >test.txt

::-----bo Batchl....
@echo off & setlocal

For /F "tokens=1*" %%i in (test.txt) do call :doSomething "%%i"
goto :eof

:doSomething

set "str1=@"
Set "str2=%~1"
set "str3=%str1%%str2%"
echo.%str3% >> result.txt

goto :eof
::-----eo Batch....

Then save it as run.bat in the location where your db files are saved. Then double click on the bat file and it creates two files called result.txt and test.txt. Now, you can use result.txt file for deploying db files because it contains all file names of the files which are saved in your folder.

Comments

Popular posts from this blog

How to add standard and custom Metadata to PDF using iTextSharp

How to set and get Metadata to image using BitmapMetadata class in C#

How to generate direct line token to start a new conversation between your own client application and bot framework in Java