Oracle SQL Prompt commands

1) How to identify the problem of Oracle database from SQL command prompt
  By executing a set of SQL commands one by one after connecting /as sysdba
  2)what could be possible errors and how to resolve from SQL prompt
  e.x db corrupt
        not mounted
        recovery
      .....etc
Please give more example
Thanks in ton

Ok,
I am locking this topic.
SDN is not a substitute for training.
go get your self trained with SAP course ADM505
more about this at http://www12.sap.com/services/education/catalog/netweaver/globaltabbedcourse.epx?context=%5b%5bADM_DB%7cADM505%7c%7c%7c%7cG%7c%5d%5d%7c

Similar Messages

  • How to write java hello world to run in oracle sql prompt

    Hi,
    I'm newbie of this chapter. I know JDBC. I wanted to introduce the JDBC process & start executing the same in orcle sql prompt.
    Do enlighten with an example.
    Thnx in Advance

    create or replace and compile java source named helloworld as
    public class HELLOWORLD{public static String HELLOWORLD() {return "Hello World";}}
    create or replace function printhelloworld return varchar2 as
    language java name 'HELLOWORLD.HELLOWORLD() return String';
    SQL> select printhelloworld from dual;
    Hello WorldRegards
    Laurent

  • How to connect access database through oracle sql prompt

    i want to connect access database via oracle , i am trying to import all the data in Access table into oracle table how it is possible .
    A.R

    The simplest way, if You have already created tables in Oracle DB, is to open the Access MDB, link Oracle tables via ODBC and build a query to append rows reading from Access tables to Oracle tables.
    Hope this helps
    Max

  • Oracle Connection Via Command Prompt

    Hi All,
    I am in a situation where I will have to test a connection to a Oracle Database by using just command prompt (Windows Server 2008) as I am not allowed to install any Oracle client tools. The Oracle server is located on a different server machine on the network. I need to do this before I update my web application code.
    When I search google I can only see that it is possible via SQL PLus/Oracle SQL Developer/Oracle Client Tools. But I can't install any of those due to restrictions.
    Can anyone please help me how do I achieve this by just using Command Prompt in Windows.
    Thanks.

    I think the point is that no installation in traditional sense need to take place, instead you copy or unzip a few files.
    11.2 Instant Client lite with sqlplus (32-bit for Win) is around 20 MB.
    http://www.oracle.com/technetwork/database/features/instant-client/index.html
    Edited by: orafad on Apr 7, 2011 12:25 AM

  • PROMPT Command equivalent in Oracle 7

    Hi All,
    I am working on a database Health check script . I Have to implement this on a Oracle7 server running on OS HP-unix. I have done with this health check script on all the 9i servers. The same script i have to modify and implement in Oracle7 database also. To print Headings or titles in Oracle 9i i used PROMPT command. So which is the equivalent command that can be used in Oracle7. I want to print the headings. Kindly assist me.

    877920 wrote:
    Same error. Unable to login.
    SQL> connect / as sysdba
    ERROR: ORA-01017: invalid username/password; logon deniedAs far as I recall, sqlplus back then did not support this specific logon syntax. Qualify the connection string using username and password. e.g.
    sqlplus sys/mysecretpassword
    The sysdba role will likely not be enabled - but that should not be an issue for running a bunch SQL selects.
    Also reconsider using the sys schema for logging on. The only time this schema should be used is for actual database maintenance - like doing a shutdown, changing initialisation settings, doing an upgrade and so on.
    Using it as your personal superuser logon is not a good idea and one that you will be nailed for (and very hard) in any security review or audit.
    Rather create a new schema and grant it the minimal rights needed to do perform the required job.
    PS. Cannot recall if connect internal also worked in sqlplus back then - but that can be tried if you want a sysdba connection from sqlplus itself.

  • Need command to run sql script from sql prompt

    Hi,
    I am beginner in sql i need a command to run sql file from sql prompt.In notepad i have write 10 to 15 tables creation and saved as .sql i want to run this file from sql promp pls some one help.I am very great full to all users in this forum.

    You can also use the 'start' command.
    You may also want to look in the SQLPlus User Guide and Reference (for your release) at the set command for commands to set the number of lines per page, turn headings on or off, and so on:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10823/toc.htm
    HTH -- Mark D Powell --

  • Oracle SQL Query from EXCEL 2007 with prompt

    Hello,
    I have many excel reports where I am pulling information from our Oracle 9 db through Excel using the following method:
    http://blog.mclaughlinsoftware.com/microsoft-excel/how-to-query-oracle-from-excel-2007/
    http://blog.mclaughlinsoftware.com/2009/11/30/sql-query-in-excel-2007/
    However, I am having trouble when I try the following query due to the prompt:
    SELECT
    IM.ITEM_GROUP,
    IM.ITEM,
    IM.DESCRIPTION
    FROM
    LAWSON.ITEMMAST IM
    WHERE
    IM.ITEM = '&ITEM';
    Does any one know how I can connect a prompt to an excel cell and then pass the query on to Oracle, or have a PL SQL prompt work from Excel?
    Thanks,
    Ben

    The 'prompt' as you call it is a sqlplus feature, so does not belong to the SQL language
    You would need to write a stored procedure returning a resultset.
    create or replace procedure foo(rc in out sys_refcursor, p_item) as
    begin
    open rc for
    'SELECT
    IM.ITEM_GROUP,
    IM.ITEM,
    IM.DESCRIPTION
    FROM
    LAWSON.ITEMMAST IM
    WHERE
    IM.ITEM = '||p_item;
    end;
    and call that using ODBC or asp.net
    Obviously this is profusely documented.
    Sybrand Bakker
    Senior Oracle DBA

  • Execution of xquery with sql prompt(oracle 11g)

    Hi All I am executing the following query with squl prompt:
    SELECT XMLQuery('xquery version "1.0"; (: :)
    declare default element namespace "eNodeB"; (: :)
    for $m in ora:tokenize('oracle~','~')
    return ($m)'
    RETURNING CONTENT) AS RESULT
    FROM DUAL;
    But its giving the following exception
    for $m in ora:tokenize('deepa~','~')
    ERROR at line 3:
    ORA-19109: RETURNING keyword expected
    2) With the below mentioned query
    SELECT XMLQuery('xquery version "1.0"; (: :)
    declare default element namespace "eNodeB"; (: :)
    for $x in $eNodeBRef/eNodeBFile/eNodeB/eNodeBTop[eNodeBTopIndex='1']
    for $m in ora:tokenize('eNodeBTopAttr1~','~')
    let $r:=$x/following-sibling::*[local-name(.)=$m]
    where (exists($x/*[local-name(.)=$m]) or exists($r))
    return (
    if(exists($r) and not(exists($x/*[local-name(.)=$m]))) then
    element{local-name($r)}{data($r)} else(), if(exists($x/*[local-na
    me(.)=$m])) then element{local-name($x/*[local-name(.)=$m])}{data($x/*[local-name(.)=$m])} else()' PASSING p.OBJECT_VALUE AS
    "eNodeBRef"
    RETURNING CONTENT) AS RESULT
    FROM A_ENODEB p
    WHERE
    existsNode(p.OBJECT_VALUE,
    '/eNodeBFile/fileHeader[@fileName="eNodeB_inst_1.xml"]') =1;
    its giving the below error while executing through sql prompt
    *for $x in $eNodeBRef/eNodeBFile/eNodeB/eNodeBTop[eNodeBTopIndex='1']
    ERROR at line 3:
    ORA-19109: RETURNING keyword expected*

    Login to SQL Developer as the SYS user for Getting Started tutorial

  • How to execute command(program) from external file in Oracle SQL developer

    Hi,
    Does anyone know, Oracle SQL developer version 1.0.0.14.67 got any function that can execute command from an external file?
    Example, i have 100 insert SQL inside a text file,
    and i want to use Oracle SQL developer to execute it. How do i read from my text file? Thanks a lots.

    If you're new to Oracle, do yourself and us a favour: read some tutorials and manuals. What sqldev's worth, better download the latest version (1.1.2), lots of fixes and enhancements...
    Now for the big popper: to run an external file: @file
    Best of luck,
    K.

  • How to find GUI SQL*Plus command tool in Oracle 8i (version 8.1.7)

    I had installed Oracel 8i Enterprise Edition (version 8.1.7) on my server machine (Windows NT 4.0), I'd like to use Oracle Navigator (GUI SQL*PLUS command tool), but I can not find it from the menu. I know Oracle Navigator is available in Oracle 7. Can anyone tell me where and how to use GUI SQL*PLUS command tool in Oracle 8i Enterprise Edition (version 8.1.7) ?
    thanks a lot.
    David Zhu

    Hi
    Oracle Navigator is part of Personal Oracle7 and Oracle Lite. I don't know is it available in 8i Personal Edition but I am sure that it is not part of Standard and Enterprise Edition.
    Regards
    null

  • Oracle sql commands use

    my question is will it possible to use oracle sql commands in toad and genterate the reprot like I have below.
    my second question is can I embede this oralc sql command in my apps. to have the out put I have below. I tried and got an error message. I am wondering if this is possible
    SQL> -- Multiple COMPUTEs are also allowable.
    SQL>
    SQL> SET echo off
    SQL> BREAK ON city skip1 ON start_date
    SQL> COMPUTE sum max min of salary ON city
    SQL> COMPUTE sum of salary ON start_date
    SQL> SET verify off
    SQL> SELECT id, first_name, salary, city FROM employee ORDER BY city
      2  /
    ID   FIRST_NAME     SALARY CITY
    07   David         7897.78 New York
    06   Linda         4322.78
                       4322.78 minimum
                       7897.78 maximum
                      12220.56 sum
    01   Jason         1234.56 Toronto
                       1234.56 minimum
                       1234.56 maximum
                       1234.56 sum
    05   Robert        2334.78 Vancouver
    08   James         1232.78
    03   James         6544.78
    02   Alison        6661.78
    04   Celia         2344.78
                       1232.78 minimum
                       6661.78 maximum
                       19118.9 sum

    Hi,
    All of theose SQL*Plus features can be duplicated in Oracle SQL. For example, "GROUP BY ... ROLLUP" can give you an minimum, maximum and total for each city.
    You can create a view that looks exactly like the SQL*Plus output (for example, the city column with values like 'New York', NULL, '**********', and 'minimum'), if you really need to. CASE is very useful for things like this, as are some analytic functions. (E.g., ROW_NUMBER can help in telling which is the first row for each city.)
    To make such a view, you may find it convenient to do a UNION of two queries:
    (1) One that produces one row per employee
    (2) One that produces a fixed number of rows (four, to get the results you posted) per city

  • SQl server to Oracle -- Replicat error command disallowed by current ..

    I am trying to set replication b/w sql serve *& oracle..
    Source -- SQL server 2005 SP4.
    Target - Oracle 11.2.0.3 - using ASM ..single instance..
    The error log is ....
    2012-02-10 17:33:47 ERROR OGG-00664 Oracle GoldenGate Delivery for Oracle, rcatd1.prm: OCI Error beginning session (status = 15000-ORA-15000: command disallowed by current instance type).
    2012-02-10 17:33:47 ERROR OGG-01668 Oracle GoldenGate Delivery for Oracle, rcatd1.prm: PROCESS ABENDING.
    2012-02-10 17:34:00 INFO OGG-00987 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): edit params RCATD1.
    2012-02-10 17:34:10 INFO OGG-00987 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): start replicat RCATD1.
    2012-02-10 17:34:10 INFO OGG-00963 Oracle GoldenGate Manager for Oracle, mgr.prm: Command received from GGSCI on host 10.1.7.80 (START REPLICAT RCATD1 ).
    2012-02-10 17:34:10 INFO OGG-00975 Oracle GoldenGate Manager for Oracle, mgr.prm: REPLICAT RCATD1 starting.
    2012-02-10 17:34:10 INFO OGG-00995 Oracle GoldenGate Delivery for Oracle, rcatd1.prm: REPLICAT RCATD1 starting.
    2012-02-10 17:34:11 ERROR OGG-00664 Oracle GoldenGate Delivery for Oracle, rcatd1.prm: OCI Error beginning session (status = 15000-ORA-15000: command disallowed by current instance type).
    2012-02-10 17:34:11 ERROR OGG-01668 Oracle GoldenGate Delivery for Oracle, rcatd1.prm: PROCESS ABENDING.
    edit params RCATD1
    REPLICAT RCATD1
    SOURCEDEFS /home/oracle/GG/dirdef/catalog.def
    USERID ggs,PASSWORD ggs
    MAP dbo.tmp_webskuchs,TARGET catalog.tmp_webskuchs;
    the steps I am doing are
    [oracle@fl1dvmatgdb2 GG]$ ./ggsci
    Oracle GoldenGate Command Interpreter for Oracle
    Version 11.1.1.1.2 OGGCORE_11.1.1.1.2_PLATFORMS_111004.2100
    Linux, x64, 64bit (optimized), Oracle 11g on Oct 4 2011 23:49:46
    Copyright (C) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
    GGSCI (fl1dvmatgdb2) 1> dblogin userid ggs, password ggs
    Successfully logged into database.
    GGSCI (fl1dvmatgdb2) 2> start replicat RCATD1
    Sending START request to MANAGER ...
    REPLICAT RCATD1 starting
    GGSCI (fl1dvmatgdb2) 3> info RCATD1, detail
    REPLICAT RCATD1 Initialized 2012-02-10 15:28 Status STOPPED
    Checkpoint Lag 00:00:00 (updated 02:19:44 ago)
    Log Read Checkpoint File dirdat/l2000000
    First Record RBA 0
    Extract Source Begin End
    dirdat/l2000000 * Initialized * First Record
    Current directory /home/oracle/GG
    Report file /home/oracle/GG/dirrpt/RCATD1.rpt
    Parameter file /home/oracle/GG/dirprm/rcatd1.prm
    Checkpoint file /home/oracle/GG/dirchk/RCATD1.cpr
    Checkpoint table GGS.CHKPT
    Process file /home/oracle/GG/dirpcs/RCATD1.pcr
    Stdout file /home/oracle/GG/dirout/RCATD1.out
    Error log /home/oracle/GG/ggserr.log
    can anybody give me a clue why I am getting ora-15000 on GG
    Thanks in advance..
    Edited by: 898080 on Feb 10, 2012 2:47 PM

    Konsultant wrote:
    Hi all,
    Other details: every time database is started it give message "ORA-15110: no diskgroups mounted" then we manually mount the disk and command
    complete successfully. You can find diskgroup name/s with this query :
    SQL> select name from v$asm_diskgroup;Then use that diskgroup name in the command that will modify spfile's parameter [ASM_DISKGROUPS|http://download.oracle.com/docs/cd/B28359_01/server.111/b31107/asminst.htm#BHCCHHIG] :
    SQL> alter system set asm_diskgroups = 'DISKGROUP_NAME' scope=spfile;
    when we execute some sql then recievese error "ORA-01219: database not open: queries allowed on fixed tables/views only". This simply means that your database is not open.
    Look:
    SQL> startup force mount;
    ORACLE instance started.
    Total System Global Area  209715200 bytes
    Fixed Size                  1248140 bytes
    Variable Size              92275828 bytes
    Database Buffers          113246208 bytes
    Redo Buffers                2945024 bytes
    Database mounted.
    SQL> select status from v$instance;
    STATUS
    MOUNTED
    SQL> select * from my_table;
    select * from my_table
    ERROR at line 1:
    ORA-01219: database not open: queries allowed on fixed tables/views only
    SQL> alter database open;
    Database altered.
    SQL> select status from v$instance;
    STATUS
    OPEN
    SQL> select * from my_table
      no rows selected
    when i execute alter database open command recieving "ORA-15000: command disallowed by current instance type".Most likely because your environment is set for ASM instance , and in the case of the 'alter database open' command, environment should be set for RDBMS . See disscusion about that ORA-15000: command disallowed by current instance type
    another question is that is it possible that i just drop and recreate the database and add the current diskgroups to new created database.yes

  • UTL_HTTP, different error codes: APEX SQL Commands vs. Oracle SQL Developer

    Hi, omniscient all!
    I have a code sample where I try to request some URL from an inactive server:
    declare
      l_text varchar2(32000);
    begin
      l_text := utl_http.request('http://inactive.url:7777');
    exception
      when others then
        declare
          l_errcode number := utl_http.get_detailed_sqlcode;
        begin
          dbms_output.put_line(l_errcode);
          dbms_output.put_line(sqlerrm(l_errcode));
        end;
    end;
    /When I run it in Oracle SQL Developer it shows:
    anonymous block completed
    -12541
    ORA-12541: TNS:no listenerWhen I run it in the APEX 4.0 SQL Commands window it shows:
    -29263
    ORA-29263: HTTP protocol error
    Statement processed.The question is: why?
    In real world, I need to make a HTTP POST request (no problem) and catch some exceptions. But instead of the usual ORA-12541 error APEX throws an ORA-29261 one.

    Any thoughts?

  • Tell me the COMMAND to see the Explain Plain in Oracle SQL * Plus

    HI all,
    Tell me the COMMAND to see the Explain Plain in Oracle SQL * Plus?
    Regards,
    Balaji.C

    SET AUTOT TRACE EXPor EXPLAIN PLAN ... and @?/rdbms/admin/utlxpls
    SCOTT@lsc01> explain plan for select * from dept where deptno=10;
    Explained.
    SCOTT@lsc01> @?/rdbms/admin/utlxpls
    PLAN_TABLE_OUTPUT
    Plan hash value: 2852011669
    | Id  | Operation                   | Name    | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |         |     1 |    20 |     1   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| DEPT    |     1 |    20 |     1   (0)| 00:00:01 |
    |*  2 |   INDEX UNIQUE SCAN         | PK_DEPT |     1 |       |     0   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("DEPTNO"=10)

  • Oracle SQL command

    I have read this statement on these forums many times:
    Just keep 1 thin in mind... CR will send any SQL statement, exactly as it is written, to the database. That means that if you can execute it from TOAD or the Oracle SQL Developer, you should be able to do it from CR as well.
    I have an SQL command that I have simplified so that it contains just a snippet from the original that populates a temporary table.
    Since there is a DECLARE there must be a BEGIN and END.  The required SELECT * to get the fields to show up in the field explorer will not work before the END statement.  If I put it after the END statement I get an ORA-06550 error.  "FOUND SELECT WHEN EXPECTING..." .   I got on the ORACLE website and they told me to put / before and after the SELECT.  When I try this in CR SQL command, I get ORA-06550 "ENCOUNTERED /".
    I have tried this in SQL Plus and don't get any errors.
    DECLARE Pallet  VARCHAR2(8);
            Box     VARCHAR2(8);
            ItemBox VARCHAR2(8);
            CODE    VARCHAR2(6);
    BEGIN   
        CODE := '20151';
        CODE := CONCAT(CODE, '%');
        DELETE LoadItems_temp;
       COMMIT;
    END;
    SELECT * FROM LOADITEMS_TEMP;

    Just keep 1 thin in mind... CR will send any SQL statement, exactly as it is written, to the database. That means that if you can execute it from TOAD or the Oracle SQL Developer, you should be able to do it from CR as well.
    Sounds like that may have come from me...
    99% of my reporting is done using SQL Server as a back end so I can't say if the rules change when using Oracle any of the Oracle drivers.
    That said, I can create and drop temp tables as well as declare and set variables without any issues in SQL Server... And do so regularly.
    Looking at your code... (and bear in mind that I don't know PL-SQL specific syntax...) I don't see where you are creating the temp table LoadItems_temp.
    I did a quick Google search on ORA-06550 and it appears to be syntax error. So if the code is executing in SQL-Plus without any issues but bombs in CR, my guess would be that you aren't using the right driver for your database.
    HTH,
    Jason

Maybe you are looking for