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,
Kishore

Hi 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

Similar Messages

  • Check oracle db status from windows batch file?

    Hi
    any body have a batch to do that
    i want to check connecting , not just the service
    thanks very much

    I have a process in batch files (dos programming )which prepare some files then call oracle store procedures, i need to have a way to check >if the database is up(open) before i start my processingHow can I tell if the light will light without turning on the switch?
    While it can be done, the simplest & easiest way is to try to connect for real & trap any error which may result from it not working.

  • How to remove Oracle 11g client from Windows 7 64-bit workstation.

    When the Oracle 11g client was installed on a Windows 7 64-bit workstation, it was mistakenly installed as "Administrator".
    We do not wish to do this; instead we want to install this client as a user with Administrator privileges.
    PLEASE NOTE THE DIFFERENCE BEFORE REPLYING TO THIS THREAD!!!!!!!!
    When I try to install the client, I get a message sending me to this directory:
    F:\app\Administrator
    I do not know why this message is produced; the directory it refers to DOES NOT EXIST.
    My suspicion is that there extraneous entries in the registry which have not been removed; the obvious ones such as HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE have been deleted.
    What I believe I need is a COMPLETE list of entries placed in the registry upon installation of the Oracle client.
    The obvious problem is that the Uninstall feature of Oracle client does NOT FULLY remove all of the above entries.
    As a side note, the Oracle client software installation needs to be revamped to detect situations such as this and provide a course of corrective actions.

    I've not done it yet with 11g, but prior editions, there are 3 things that have to be done to eradicate an oracle client installation from Windows, after running uninstaller
    1) delete the registry key HKLM\software\oracle
    2) delete the ORACLE_HOME directory from the file system
    3) delete c:\Program Files\oracle

  • 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.
    Thanks

    Hello,
    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

  • 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

  • Installing Oracle 11gR2 client from a batch file and it returns before done

    Hello,
    While installing Oracle 11gR2 client on XP and 7 from a batch file. When it launches the OUI from the batch file, it returns to the batch file before the installer finishes. So, there is no way for my script to know when the installer is done, or to glean a return code to test for success. This is particularly annoying...
    I've also used the "call" command to force my batch file to wait, to no avail. Anyone have any clues about this one?
    Thanks in advance!
    --Robert                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Srini,
    Awesome! Worked like a charm.
    Many thanks!
    --Robert                                                                                                                                                                                               

  • How to access oracle R12 applications from windows client

    Hi All,
    I installed R12 oracle applications on Linux through VMWare and every thing was fine now. My database listener, database and applications are up and running. I installed Java and Mozillla and established a soft link on LInux but was not able to access oracle applicaitons from Uniix box. I was seeing if i can do it from windows client. Mine is windows vista and i pinged the ipaddress and its connecting but was not able to access applications from windows client and also from linux.
    Can any one help me accessing applications from windows client and unix box

    Hi;
    I installed R12 oracle applications on Linux through VMWare and every thing was fine now. My database listener, database and applications are up and running. I installed Java and Mozillla and established a soft link on LInux but was not able to access oracle applicaitons from Uniix box. I was seeing if i can do it from windows client. Mine is windows vista and i pinged the ipaddress and its connecting but was not able to access applications from windows client and also from linux.
    Can any one help me accessing applications from windows client and unix box1. Be sure you can ping your linux from your client
    2. Be sure your selinux and firewal disable on linux machine
    3. Add your IP and hostaname to your windows C:\WINDOWS\system32\drivers\etc\hosts file
    4. Add your url to your trusted site on windows
    5. Use IE7 or check below note to can use certified browswer and access EBS
    Recommended Browsers for Oracle E-Business Suite Release 12 [ID 389422.1]
    Regard
    Helios

  • How to call SQL job step by step from windows batch file

    Hi ,
    I have a SQL agent job [POC_IOD_RunPkgJob]  which is being called from bat file with below command.
    Could you please tell me how to call only one step of this job, what command I need to mention in the batch file.
    SQLCMD -Sabcwi\SQLI01,51565 -E -Q"exec msdb.dbo.sp_start_job [POC_IOD_RunPkgJob]"

    Hi RameshDravid,
    Regarding your description,though not aware of what is the purposed to call only one step of that job, the below sample can somewhat help to achieve your requirement.
    --find the job steps
    SELECT
    steps.step_id,steps.step_name,steps.subsystem,steps.command
    FROM msdb.dbo.sysjobsteps steps
    JOIN msdb.dbo.sysjobs jobs
    ON steps.job_id = jobs.job_id
    WHERE jobs.name = 'youJobName'
    --find the command runs in that step, usually that is some command exec stored procedure
    SQLCMD -Sabcwi\SQLI01,51565 -E -Q"exec stored procedure found in the above query"
    If you have any question, feel free to let me know
    Eric Zhang
    TechNet Community Support

  • How to check DFS replication status in windows 2008 r2 file server

    Hi,
    I have created File server DFS namespace between 2 windows 2008 R2 server. namespace mode is 2008. I have copied 3 TB data on file server 1. now it is getting replicated from file server 1 to file server 2. till now the data is not fully replicated.
    My question is how can I check the status of DFS replication? how will I come to know that the initial replication is completed.

    Scorpio. Yes you are right. Microsoft officially says it will not work. My apologies. Thanks for the correction.
    Do Ultrasound and Sonar work with DFS Replication?
    No. DFS Replication has its own set of monitoring and diagnostics tools. Ultrasound and Sonar are only capable of monitoring FRS.
    Is there a way to know the state of replication?
    Yes. There are a number of ways to monitor replication:
    DFS Replication has a management pack for System Center Operations Manager 2007 that provides proactive monitoring.
    DFS Replication has an in-box diagnostic report for the replication backlog, replication efficiency, and the number of files and folders in a given replication group.
    Dfsrdiag.exe is a command-line tool that can generate a backlog count or trigger a propagation test. Both show the state of replication. Propagation shows you if files are being replicated to all nodes. Backlog shows you how many files still need to replicate
    before two computers are in sync. The backlog count is the number of updates that a replication group member has not processed. On computers running Windows Server 2008 R2, Dfsrdiag.exe can also display the updates that DFS Replication is currently
    replicating.
    Scripts can use WMI to collect backlog information—manually or through MOM.
    Miguel Fra /
    Falcon IT Services
    Computer & Network Support, Miami, FL
    Visit our Knowledgebase and Support Sharepoint Site

  • Moving oracle 9i database from windows 2000 to windows 2003 server

    hi everybody,
    plz provide me a solution how to move oracle 9i database from windows 2000 server to windows 2003 server with step by step and also with commands plz as i am very new to oracle
    thanks in advance
    suresh

    Install 9i on windows 2003 server and patch to the same level as the Oracle on Windows 2k
    Shutdown and make a cold backup of your old database. That includes datafiles, controlfiles, redo files, init file (spfile)
    Copy and put these files to the exact same directory structure/location, for example if old file is under D:\oradata\mysid\ then the file on new file should be under same directory. (If you are using Network Storage that make things easier, just mapping to the same drive letter.)
    Also make sure archive log dest and all dump dest directories are created. You don't have to copy all old logs and dump files over.
    Use oradim to create a new service for the database instance
    http://www.psoug.org/reference/oradim.html
    Set proper ORACLE_HOME, ORACLE_SID envionment varibles
    Run netca to configure listener, actually copy listener.ora and tnsnames.ora to $ORACLE_HOME\network\admin will do
    Try to start the database

  • How to check system status from Windows command line?

    Does anyone has an idea how to check system status from Windows command line? In UNIX we use startsap check, unfortunately I didn't find an appropriate command provided by SAP.
    The only idea we have is to use
    tasklist /FI "Username eq SAPService<SID>" | find "disp+work"
    which isn't as nice as startsap check.

    Hi,
    In windows you can use the command
    go to profile directory in command prompt and the give the following command to check the status of the instance.
    sapstart check pf=START_DVEBMGS<nr>_<hostname>
    that means you need to mention start profile or instance profile. So that it will say whether the instance is running or not.
    If you want any other information please reply back to me.
    Thanks,
    Chaitanya.

  • How to view Work process status from Operating System level???

    Hi,
    How can I check work process status from Operating System in Unix. For example : In Windows, I can see the work process status from SAP MMC in WP Table.
    How can I view from Unix?
    Appreciate your feedback. Thanks.

    Hi,
    You can terminate. Please look into the menu given by DPMON carefully. You can kill the process using the k option.
    Otherwise you can also kill the process kill -9 <PID of the process>.
    Please do not terminate update and ENQ work process. This may lead to data loss. If the condition can not be control by killing some processes and again all the WPs are occupied. I recommend SAP system restart.
    Restart will ensure that all necessary roll backs happen and no data loss.
    With Regards,
    Saurabh

  • I had migrated Oracle 10g database from Windows to Oracle 11g Linux

    I had migrated Oracle 10g database from Windows to Oracle 11g Linux.  The database is performing very slow.
    Please guide me where I have to begin (starting point) looking into it.
    Some document stated gather system statistics.  How to check system statistics is up to date
    What are the crucial initialization parameter ?

    Hi,
    Let me just point you out to the documentation, which may concern you:
    I had migrated Oracle 10g database from Windows to Oracle 11g Linux.  The database is performing very slow.
    Managing Optimizer Statistics
    How to check system statistics is up to date
    Managing Optimizer Statistics
    What are the crucial initialization parameter ?
    Configuring a Database for Performance
    Thanks &
    Best Regards,

  • How to turn a database status from "in recovery" to "online"?

    How to turn a database status from "in recovery" to "online"?
    We were trying to turn a datase to offline status using management studio - the operation was closed before it could reach the end.

    Hi Brian,
    Thanks for your feedback;
    I have completed the following actions to solve the issue:
    1. Start SQL Server in single user mode.
    2. Check database status: there i noticed that it was normal
    3. Restart SQL Server in multi-user mode
    4. Check database status: normal
    5. Check my data: ok
    Thank you again
    Lulu01
    You should have wait for an while or atleaset you need to check in the sql errorlog, what phases it is or if any issues persists that shows in the errorlog messages.
    also you would have been used sys.databases, to seewhat's the value for state_desc for your database.
    Thanks, Rama Udaya.K (http://rama38udaya.wordpress.com) ---------------------------------------- Please remember to mark the replies as answers if they help and UN-mark them if they provide no help,Vote if they gives you information.

  • Migration of Oracle Database 8i from Windows 2000 to Windows XP

    Hi experts,
    I have to migrate Oracle 8i database from windows 2000 platform to windows XP platform.
    What are the steps that I need to follow in order to migrate.
    Please help me out..
    Waiting for your response.
    Regards,
    Imtiyaz

    Hi;
    Please see below note which could be helpful for you:
    Different Upgrade Methods For Upgrading Your Database [ID 419550.1]
    Minimizing Downtime During Production Upgrade [ID 478308.1]
    Master Note For Oracle Database Upgrades and Migrations [ID 1152016.1]
    Oracle Database on Unix AIX,HP-UX,Linux,Mac OS X,Solaris,Tru64 Unix Operating Systems Installation and Configuration Requirements Quick Reference (8.0.5 to 11.2) [ID 169706.1]
    Please check my blog
    http://heliosguneserol.wordpress.com/2010/06/17/move-to-oracle-database-11g-release-2-wiht-mike-dietrich/
    In this pdf you can see patch of to upgrade db from x to n wiht many senerios wiht all related metalinks notes which is created by Oracle worker Mike Dietrich
    Regard
    Helios

Maybe you are looking for

  • Passing parameters between views in different Web Dynpro applications

    Hi everyone, I would like to pass the value of one parameter between one view in a webdynpro application and another view that is in other webdynpro application. How can I do this in a secure way?

  • Word 2007 Acrobat 8.1.4 - Convert URLs not clickable

    All, Using the above versions. In word Acrobat>Create PDF. Using Standard preset.  Can't find 'ebook preset', even though copied all from extras folder...is it known by an another name? Word doc has urls to websites on the www.  They all work in Word

  • Can you split a large PHP form in the tabbed panels?

    I have a large PHP customer feedback form that posts to my mySQL server.  The customer experience isn't great.  Can you split a large form into seperate tabbed panels?

  • Trying to print on envelope...

    Hi Canon Community! I am trying to use my PIXMA MG5422 to print on A7 envelopes (5 x 7). I have them loaded in the top tray per the instructions on the printer but every time I try to actually print, they jam. Any ideas?

  • Database Level Patching

    Hi all i am new in Oracle.I had installed Oracle 10g on windows ...can any one explain how to do database level patching (step by step)..its urgent. Thanks in advance.