Specify different location of SQL*PLUS EDIT/SPOOL directory

Where can I specify the location of the SQL*PLUS edit/spool directory such that I can change it from the default? I'm running on Linux (Ubuntu 6.10) if that helps...

Check this Link :
Error while Invoking Editor
Regds.

Similar Messages

  • Archivelogs to different locations - only with Enterprise Edition?How to?

    Hello,
    while searching for an answer to 'how to store my archivelogs to different locations' I came across a post, that says, that this is only possible with enterprise edition? Is that true?
    In case it is not: How do I add to an online database a second or more targets? I tried it on a test database, but the new target was not accepted, the entry pointing to the FRA was deleted, and everythin stopped, of course. Is there a way to add a second target without shutting down the database? Could anyone please explain, I am afraid to crash our live database. But living without a second target makes me nervous...
    Thank you very much for your help,
    Chris

    Did you look at the documentation for 10g?
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/log_transport.htm#i1265402
    This was only for remote db site but there is more in the book.
    5.2.2.1 Changing Destination Attributes
    You can dynamically update most of the attribute values of the LOG_ARCHIVE_DEST_n and the LOG_ARCHIVE_DEST_STATE_n parameters using the ALTER SYSTEM SET statement.
    The modifications take effect after the next log switch on the primary database. For example, to defer redo transport services from transmitting redo data to the remote standby database named boston, issue the following statements on the primary database:
    SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='SERVICE=boston
    2> VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)';
    SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=DEFER;
    Read and have fun.
    I think the point you missed is that you got to set the state of the destination as well.
    Regards
    Tim

  • Different behaviour in SQL*Plus and PL/SQL

    Does anyone know why the following SQL works from the command line in SQL*Plus but results in a syntax error when included within a cursor in a PL/SQL procedure?
    SELECT (SELECT 'dummy' FROM dual)
    FROM dual;
    null

    Is this what you require? This works...
    declare
    cursor cur_dummy is
    SELECT d.dum
    FROM (
    SELECT 'dummy' dum
    FROM dual
    ) d
    v_dummy varchar2(30);
    begin
    open cur_dummy;
    fetch cur_dummy into v_dummy;
    close cur_dummy;
    dbms_output.put_line(v_dummy);
    end;
    Cheers
    BigB
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Aqueel ([email protected]):
    In PL/SQL, every SELECT Statement must have a INTO clause. But still It's not working. Anyother know the answer?
    <HR></BLOCKQUOTE>
    null

  • How to connect as different user in SQL Plus Worksheet in SQL Developer

    This is driving me nuts! I have a script with different "CONNECT" commands to different schemas. What is the right synatx when using SQL Worksheet in SQL Developer when connecting to a different user? Greatly appreciate help on this. Thanks!

    Which version of SQL Developer are you using? What syntax are you using?
    Using SQL Developer 2.1.0.63.73, running selected statements as a script, I could get connect to work fine with the following examples:
    connect
    select user, global_name from global_name;
    connect;
    select user, global_name from global_name;
    connect user/password@tnsalias
    select user, global_name from global_name;
    connect user/password@tnsalias;
    select user, global_name from global_name;Unfortunately, even though the connect on it's own prompts for user, password and tns alias (and says a blank tns alias is the current connection), the following don't work:
    connect user/password
    select user, global_name from global_name;
    connect user/password;
    select user, global_name from global_name;Also note that the connection performed by this only exists while the script is being executed - only the script stops/ends the connection is disconnected.
    theFurryOne

  • A query runs in under 1 minute is sql plus, but takes 15 in Discoverer

    I have a query that runs in under 1 minute is sql plus, but takes 15+mins in Discoverer. I use 3 parameters in discoverer which i specify as conditions in sql plus query. Any ideas on how to make it run faster??? BTW the query returns 10,000+ records. There is no formatting or sorting involved. Any ideas??? Seems the query execution plan is wrong...

    Hi,
    I agree with Michael to check your preference settings. Particulary since Plus/Viewer reads the pref.txt on the middle-tier and Desktop reads each individual PC registry.
    I would start with checking Query Prediction setttings.
    Try turning off Query Prediction. If it is not setup properly it can cause a delay. This is one difference between Discoverer and SQL*PLUS
    See forum post:
    Re: 20 mins and still predicting!!
    Re: Different Performance between Desktop-Query and SQL-Plus
    Hope that helps,
    Steve.

  • Print out table desc from sql/plus

    Hello,
    I'm trying to print out the desc table from the database .
    What is the syntax for it in the sql/plus ?
    Thanks very much.
    TPham
    null

    tpham (guest) wrote:
    : Hello,
    : I'm trying to print out the desc table from the database .
    : What is the syntax for it in the sql/plus ?
    : Thanks very much.
    : TPham
    Jerome wrote:
    Hi! Tipham!
    Here is the command:
    In Sql/plus
    1. spool on --these command set spool on
    2. spool c:\desc_table.sql -- these command open desc_table.sql
    file for spooling. It is
    user-defined it will be created if
    it is not existin
    3. desc table_name -- the result will be recorded to
    desc_table file. Open it in any text
    editor and print it.
    from [email protected]
    null

  • SQL*Plus/iSQL*Plus login as DBA

    I just installed 10g Enterprise on a Windows platform and am a bit confused to why I cannot log into SQL*Plus/iSQL as a DBA. I can login as one of the user accounts then use 'connect' to login as dba in SQL*Plus or at the Windows command prompt. I cannot do this, however, in iSQL*Plus. One of the threads on this forum pointed me to using JAZN after installing OC4J. I am in the process of doing this, but I need to understand something apparently fundamental: why should I have to perform another install when the Universal Installer installed iSQL and all the features that came with it? Didn't the 10g download give me the tools necessary to administer its application's accounts? The OC4J download page states that this tool should not be used to replace an existing 10g installation.
    Moreover, why iSQL knows about the 'users' authorization level, but not 'system?' I can see the users and groups in the Enterprise Manager, but no features to set WebDBA users as iSQL*Plus requests.
    Your comments would be much appreciated.

    Hi,
    in order to use iSQL*Plus as DBA, you have to perform additional configuration. See
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch2.htm#BCEIHEJF
    By the way: Get used to a different tool like SQL*Plus linemode or SQL Developer, because iSQL*Plus disappears in future versions.
    Kind regards
    Uwe

  • How to change the default directory from within SQL*Plus ?

    Hello,
    I want to change the default directory directly from within SQL*Plus to be able to launch my command files with simple instructions like :
    @my_command.sql
    If I haven't launched SQL*Plus from the directory containing the file my_command.sql, how do I change the default directory to the directory of my command files ?
    I've searched through the Oracle documentation, there's no SET DEFAULTDIR or something like that. When I do a SHOW ALL, there's no variable containing the default directory.
    If you have an idea...
    regards,
    Jérôme.

    Hi Jérôme (J鲴me ?),
    You cannot directly do that, but you can use @@ instead of @ to run subscripts in the same directory as the superscript
    # head /tmp/tl30/xxx/[xyz].sql                    
    ==> /tmp/tl30/xxx/x.sql <==
    prompt call y
    @y
    prompt call z
    @@z
    quit
    ==> /tmp/tl30/xxx/y.sql <==
    prompt i am in y
    ==> /tmp/tl30/xxx/z.sql <==
    prompt i am in z
    # pwd                                             
    /root
    # sqlplus -s scott/tiger@lsc62 @/tmp/tl30/xxx/x.sql
    call y
    SP2-0310: Datei "y.sql" konnte nicht geöffnet werden
    call z
    i am in zKind regards
    Laurent Schneider
    OCM DBA

  • SQL*Plus script with a dynamic SPOOL File Location?

    Anyone,
    I have a numbr of SQL Plus scripts that I need to run many times but each run against a different database. Each script SPOOLS the output like this:
    spool c:\temp\BUILD_ASSET.lis
    spool c:\temp\BUILD_WORKORDER.lis
    etc
    (each spool is a seperate script run)
    The spool is at the top of each BUILD SQL Script.
    Example:
    set time on
    SET FEEDBACK ON
    SET ECHO ON
    SET TIMING ON
    spool c:\temp\BUILD_ASSET.lisBut I need each run to go into its own directory based on the database I am connected to. Like this:
    CONNECT DB1
    @C:\temp\BUILD_ASSET.SQL =====> spool c:\temp\DB1\BUILD_ASSET.lis
    @c:\temp\BUILD_WORKORDER.SQL =====>  spool c:\temp\DB1\BUILD_WORKORDER.lis
    etc
    CONNECT DB2
    @C:\temp\BUILD_ASSET.SQL =====> spool c:\temp\DB2\BUILD_ASSET.lis
    @c:\temp\BUILD_WORKORDER.SQL =====> spool c:\temp\DB2\BUILD_WORKORDER.lisIs there a way to dynaically code this without having to create a version of the BUILD scripts for every single DB I connect to?
    I would like to have one big script that executes all the individual BUILD scripts.
    Seems very easy in concept but I can not see an easy way. I would appreciate any help I can get.
    Thanks in advance,
    Miller

    column db new_Value db
    select sys_context('userenv','db_name') db from dual;
    spool c:\temp\&db\file.lis

  • SQL Plus Error - "Can't open file" when spooling

    Hi:
    I have a user who is either able or unable to spool when running a script depending on what Oracle user she logs in as. She's always logging in as the same Linux user but connecting to Oracle as different Oracle users via SQL Plus. When spool files are created they are created with that user's account and group settings, so the OS account seems to be fine.
    I'm having a problem with the idea that there is an Oracle role or something that controls this. Spool isn't UTL_FILE. Is this a SQL Plus application setting or something?
    We're using Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    Thanks

    Well, I'm working off an email so maybe they cut and pasted and maybe they didn't. They say the error is
    spool error: "Cannot create spool file"
    I'll have to recreate their situation and see what it really says. But either way, my confusion is how this same OS user can log in as a different Oracle user and spool away. Perhaps the comment above is correct. It worked the first time and they tried to run under the other account without removing the current file. I tend not to think so because these users have been running similar reports for years and they usually have to remove the old output file before re-running.

  • Seek help to format spool file from SQL*PLUS

    I am running a Unix shell script to call a Oracle 11g SQL script from a Oracle database. In this SQL script, I need to connect to many different remote databases to select data, then sool these records as one big text file to a directory. Then email the file to related Group users. In the spool file, there is a line on the top of each page like this:
    DUMMY
    DB_NAME
    I know this is caused by connect to remote database in SQL*PLUS. My connection string is like this:
    Conn system/password@Oracle_SID
    How can I remove these lines or how to skip these lines into spool file? Please advise. Thanks in advnce. Wish all of you Happy New Year!!!

    Hi,
    It sounds like you have some kind of formatting (such as SQL*Plus TTITLE) producing the output you don't want. If that's the case, temporarily stopping the spooling might not help you. Find out what is causing the output that you don't want. You say that you know it is caused by the CONNECT statements, but it must be more than that. I've written scripts with CONNECT statements that don't have anything like what you reported at the top of each page; in fact, they don't even have pages: the output is one continuous stream. Find out what's putting the unwanted output there, and that will be a big clue as to how you can stop it.
    You say that you know the unwanted titles are there because of the CONNECT statements. If so, use database links instead of CONNECT. You don't have to use dbms_scheduler or utl_file; just eliminate the CONNECT statements. (I'm not saying that there's anything wrong with dbms_scheduler or utl_file; you should definitely investigate those tools. I'm just saying that using database links is independent of them.)
    What would happen if you did all your connecting to different databases at the OS level? Can you write a shell script that connects to each database in turn, and runs a SQL*Plus script in each one. Each SQL*Plus script would have a SPOOL or SPOOL ... APPEND command, or maybe you could build the SPOOL into a LOGIN.SQL script.

  • SQL Server two database at two different locations

    Hi Guys,
    We are having same database at two different locations (Database A with Sqlserver 2008/Express, database B with Sqlserver 2012).
    Our requirement is when ever a row is inserted in a table of Database A from location 1. Same value should also be added in Server 2 at different location.
    So that at any point of time both the database base values should be same.
    Which is the best method to do it ?
    Regards,
    Raghu.G
    raghu

    Could you please give more information about the editions of SQL Server? Is SQL 2012 express as well?
    Do you also need udpates/deletes to be moved to another server? Also do you want changes in SQL 2012 to be moved to 2008 as well?
    With Express edition you have very limited options.
    Regards, Ashwin Menon My Blog - http:\\sqllearnings.com

  • Would like to write SQL code to generate a 'spool' statement in SQL Plus.

    Hi,
    We're using Oracle 11.1.
    I'm spooling data to a file from a SQL Plus shell script .
    The format of the file name they're giving me has the current date on the end, so something like:
    filenameMMDDYYYY.txtWhen I write my spool statement I'd like to do it so that I give it the file name with a formatted sysdate at the end.
    I think I need to generate SQL to do this but I don't have experience in generating SQL.
    How would I do this in a SQL Plus Linux shell script?

    set termout off
    col dt new_value dt
    select to_char(sysdate,'YYYYMMDDHH24MISS') dt from dual;
    set termout on
    spool file_&dt
    Handle:      816567
    Status Level:      Newbie
    Registered:      Nov 29, 2010
    Total Posts:      73
    Total Questions:      30 (20 unresolved)
    so many questions & so few answers.
    Edited by: sb92075 on May 12, 2011 4:27 PM

  • SQL*Plus - how to suppress the SQL in a spool file

    This is my SQL*Plus script. I thought I had solved the problem, but it is back now and I don't know what I am missing. But I don't want the query at the top of the file.
    SET SERVEROUTPUT ON
    SET MARKUP HTML ON -SILENT
    SET ECHO OFF
    SET PAGESIZE 33
    SET TERMOUT OFF
    Spool C:\DuaneWilson.xls
    SELECT *
    FROM RPT_DS1_CNT_CAT_vw
    WHERE ROWNUM <=100
    ORDER BY CVBI_KEY;
    SET MARKUP HTML OFF
    SET ECHO ON
    SET PAGESIZE 20
    SET TERMOUT ON
    SET SERVEROUTPUT OFF

    It turns out when I run the script with the @ or Start with the file name, there is no SQL put out to the file. But when I just copy the text out of the file and run it at the prompt, the SQL appears in the output file. In reference to the -SILENT, I put that in after the MARKUP statement and got an error. Maybe I don't know where that goes. And I am not sure why there is a difference if it is run as a script or just pasted to the buffer. At least it should be the same in the output file, I would think.

  • Explain plan results are different in SQL Developer than SQL Plus

    My Environment:
    SQL Developer 1.0.0.15.27
    Platform where SQL Developer is running: Windows XP 2002 SP2
    Oracle Database and Client 9.2.0.7
    Optimizer_mode: FIRST_ROWS
    I have the following SQL statement:
    SELECT a1.comp_id
    FROM temp_au_company a0, au_company a1
    WHERE :b2 = a0.temp_emp_code
    AND a0.comp_id = a1.comp_id
    AND a0.sls_terr_code != a1.sls_terr_code
    AND a1.last_mdfy_date > :b1
    When I run an Explain in SQL Developer I get the following access path (which is the one I really want):
    SELECT STATEMENT                          TABLE ACCESS(BY INDEX ROWID) FEDLINK.AU_COMPANY          NESTED LOOPS                                   INDEX(RANGE SCAN)
    FEDLINK.UX2_TEMP_AU_COMPANY
              INDEX(RANGE SCAN) FEDLINK.PX1_COMPANY
    However, when I execute the statement with sql_trace turned on and use tkprof to generate the actual access path, the statement executes as follows (which is WAY more expensive):
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 1 3.58 6.68 28136 29232 0 0
    total 3 3.58 6.69 28136 29232 0 0
    Misses in library cache during parse: 1
    Optimizer goal: FIRST_ROWS
    Parsing user id: 979 (FEDLINK) (recursive depth: 1)
    Rows Row Source Operation
    0 NESTED LOOPS
    0 TABLE ACCESS FULL AU_COMPANY
    0 INDEX RANGE SCAN UX2_TEMP_AU_COMPANY (object id 49783)
    Notice the FULL access of au_company.
    I understand that SQL Developer has nothing to do with why the statement executed the way it did, but why is the Explain in SQL Developer different than the actual execution plan?
    Added note....when I run the explain in SQL Plus it is the same as the actual execution. Here is the explain from SQL Plus:
    explain plan for SELECT a1.comp_id
    FROM temp_au_company a0, au_company a1
    WHERE '1' = a0.temp_emp_code
    AND a0.comp_id = a1.comp_id
    AND a0.sls_terr_code != a1.sls_terr_code
    AND a1.last_mdfy_date > '01-MAY-2006';
    PLAN_TABLE_OUTPUT
    | Id | Operation | Name | Rows | Bytes | Cost |
    | 0 | SELECT STATEMENT | | 2 | 76 | 2597 |
    | 1 | NESTED LOOPS | | 2 | 76 | 2597 |
    | 2 | TABLE ACCESS FULL | AU_COMPANY | 2 | 42 | 2595 |
    | 3 | INDEX RANGE SCAN | UX2_TEMP_AU_COMPANY | 1 | 17 | 2
    Thanks,
    Brenda

    The explain is different (full scan of au_company in SQL Plus / index access in SQL Developer) even when I use variables in SQL Plus. Here is the output for SQL Plus using variables instead of literals:
    SQL> variable b1 varchar2
    SQL> variable b2 char
    SQL> explain plan for SELECT a1.comp_id
    2 FROM temp_au_company a0, au_company a1
    3 WHERE :b2 = a0.temp_emp_code
    4 AND a0.comp_id = a1.comp_id
    5 AND a0.sls_terr_code != a1.sls_terr_code
    6 AND a1.last_mdfy_date > :b1
    7 /
    Explained.
    PLAN_TABLE_OUTPUT
    | Id | Operation | Name | Rows | Bytes | Cost |
    | 0 | SELECT STATEMENT | | 3184 | 118K| 2995 |
    | 1 | HASH JOIN | | 3184 | 118K| 2995 |
    | 2 | INDEX RANGE SCAN | UX2_TEMP_AU_COMPANY | 3187 | 54179 | 3 |
    | 3 | TABLE ACCESS FULL | AU_COMPANY | 24009 | 492K| 2983 |
    Any other ideas? They should be the same.
    Brenda

Maybe you are looking for

  • After 10.5.1 update, Pages won't save

    After I installed Leopard, Pages would not save new documents or save new versions of existing documents. It would crash and leave a black outline of the Save window on the desktop, requiring me to Force Quit. I trashed the preferences and repaired p

  • IPhoto 9 - Photoshop Elements 9: Saved photos not showing thumbnails

    After editing iPhoto images in PE9 and saving them, I cannot see the updated thumbnail in iPhoto. If I double-click on the photo, I can see the edited version, but where is the updated thumbnail? I read Old Toad's advice to set the file saving prefer

  • Two queries in one report?

    I have Three tables like Device_table columns are d_id, d_name, date Software_table sw_id, software, version, serial_no, sw_type, d_id(foreign_key) hardware_table hw_id, hardware, specification, d_id(foriegn_key) now in reports i want to attach both

  • Regrading IF statement

    Hi All, Please check the below code in that i am able to fetch the w_duedate for first and third if condition. But i am not able to fetch the w_duedate for the second if condition can anyone let me know how deal with this issue.  I have made bold for

  • How to achieve BPM functionalities in Business Connectors

    Hi I would like to ask how BC scenario implements the corresponding BPM scenario in XI. I had to present a white paper on this topic. thanx in advance Prateek