How and where to run utlxplan.sql script?

Hi,
A basic question: where and how to run utlxplan.sql script? I'd like to know both in window and linux environment.
regards.....

From sqlplus, you can connect as sys and run the utlxplan.sql. Then you need to grant privileges to other users and create synonyms...

Similar Messages

  • Running a SQL Script to Create an Object Type

    When I do Database Development with JDeveloper and fellow the instruction at
    http://www.oracle.com/technology/obe/obe1013jdev/dbdevelopment/obe_%20dbasedevmt.htm
    and try to Running a SQL Script to Create an Object Type by Right-clicking emp_rec.sql in the editor and
    choose Run in SQL*Plus > hrconn, the new Obuect type can not created. The screen flashs and I only got the
    message
    "Invoking SQL*Plus...
    D:\oracle\product\10.2.0\db_1\BIN\cemutls.exe
    hr@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))(CONNECT_DATA=(SID=ORCL)))
    @emp_rec.sql" and nothing else (No error like JBO-XXXXX).
    Can anybody Help Me? Thanks a lot!
    SID: ORCL

    Hi Simon,
    Having had a closer look at your original message it seems that rather than selecting the SQL*Plus executable in the directory you have managed to select the file 'D:\oracle\product\10.2.0\db_1\BIN\cemutls.exe'.
    If you go to 'Tools | Preferences' and select the 'Database Connections' node and alter the 'SQL*Plus Executable' field to 'D:\oracle\product\10.2.0\db_1\BIN\sqlplus.exe' and then try again, this should then work.
    Regards,
    Lisa

  • How can I run a SQL script file...

    How can I run a SQL script file from a location on my computer without providing the whole path?
    Is there some way I can set a "Working folder" in SQL Plus??
    Thanks!
    Tom

    You can create an environment variable called "SQLPATH" which is a list of directories that SQL*Plus will search for your .SQL
    scripts.
    I would like to use another directory than the oracle/bin...
    How can I do this ??
    Hello,
    U can do this by this way:
    Save odm_script.sql file to the default Oracle
    directory i.e. Oracle-Home/bin and Run following command
    through SQL Plus.
    SQL>@Script_Name
    I hope this will resolve ur problem.
    Regards,
    Omer Saeed Khan.

  • How to run a sql script in oracle forms

    Hi,
    For me there is an sql script. I need to run that sql script in forms.
    Actually we will run that sql file in pl/sql developer by giving @and the file name.
    But how to run that file in forms.
    Can any one help on these.Which book I have to look.
    Thanks

    Actually there is a script files which will drop all the indexes and tables.
    DROP querry will be there for each index and each table.
    So I run the script all the indexes and all the tables will be deleted. So using forms I have to run that script.
    Thanks

  • How to run the SQL Script in SQL Prompt?

    Hi ExpertGroup,
    I have written one SQL Script name called "MySQLSCript.SQL". I want to know how to run the SQL Script in SQL Prompt?.
    Generally, I run SQL Script in PL/SQL Developer tool. But In this case, some SET command is not working/supporting in PL/SQL Developer Tool.
    Let me know, How to Run in SQl Prompt.
    Thanks & Regards,
    Senthil K Kumar.

    This is my SQL Script....
    SET COLSEP '|'
    SET LINESIZE 32767
    SET PAGESIZE 50000
    /* SET LINESIZE 3000
    SET PAGESIZE 50000
    SET DEFINE OFF */
    SET ECHO OFF
    SET FEEDBACK OFF
    --SET HEADING OFF
    SET TRIMSPOOL ON
    SET NEWPAGE NONE
    SET UNDERLINE OFF
    SPOOL &&EnterPath;
    SELECT * FROM &&TableName;
    SPOOL OFF
    SET FEEDBACK ON
    --SET DEFINE ON
    PROMPT Done.
    I am able to run this script in SQL Prompt....
    Its executing fine...
    But, If I am executing again it maynot asking for new set of data....
    alternativily its taking old values only.....
    how can i exeute with new set of data in the sql prompt.....

  • How to define variables in toad sql script editor - newbie

    I have just pull out the script of a Function and want to run it on toad SQL editor.
    I am little bit confused how to define the VARIABLEs here in toad SQL editor to run my script.
    SELECT
    NVL(SUM(debit), 0) - NVL(SUM(credit), 0)
    INTO l_accountBalance
    FROM
    GLP_VoucherMaster vm
    INNER JOIN GLP_VoucherDetail vd ON vm.GLP_VoucherMaster_ID = vd.GLP_VoucherMaster_ID
    INNER JOIN GLP_ChartOFAccounts coa ON vd.GLP_ChartOfAccounts_ID = coa.GLP_ChartOfAccounts_ID
    WHERE
    vm.isActive = 'Y' AND vd.isActive = 'Y'
    -- *** how to define variables in toad sql script editor ***
    AND vm.voucherDate < p_cDate
    AND coa.AccountCode LIKE p_accountCode || '%';
    Thanks
    w\

    Just prefix with a colon (:)
    SELECT   NVL (SUM (Debit), 0) - NVL (SUM (Credit), 0)
      INTO   L_accountbalance
      FROM           Glp_vouchermaster Vm
                 INNER JOIN
                     Glp_voucherdetail Vd
                 ON Vm.Glp_vouchermaster_id = Vd.Glp_vouchermaster_id
             INNER JOIN
                 Glp_chartofaccounts Coa
             ON Vd.Glp_chartofaccounts_id = Coa.Glp_chartofaccounts_id
    WHERE       Vm.Isactive = 'Y'
             AND Vd.Isactive = 'Y'
             AND Vm.Voucherdate < :P_cdate
             AND Coa.Accountcode LIKE :P_accountcode || '%';
    /:p

  • Getting windows error during running the sql scripts from form 6i

    I made a little form application. The purpose of this application is to generate explain plan for a particular SQL. Some sql scripts run internally in order to populate the result on form’s screen after pressing the form’s button but I am getting windows error during running the sql scripts from form 6i.
    I am using forms 6i with patch 17 with Oracle 10G database on windows 2000 professional on same computer.
    This application runs fine with 8i.
    Please inform me where the problem is and how to overcome it.
    Zafri.

    I am using Text_IO in my form's when button press trigger , inorder to create the
    text file, then in the same when button press triger
    I am calling RMAN via host command in order to run the script which was created by text_IO.
    Below you find some of the code. I will appreciate if you solve the problem.
    when button press trigger:
    Declare
    in_file3 Text_IO.File_Type;
    linebuf3 VARCHAR2(1800);
    output11 varchar2(1000);
    BEGIN
         output11:='C:\EXPLAIN_PLUS\misc\rm_file.bat ';
    Host(output11,no_screen);
    :sql.execution_plan:= 'Working........................';
    synchronize;
    in_file3 := Text_IO.Fopen('c:\explain_plus\misc\create_table.txt', 'w');
    Text_IO.Put_Line(in_file3, linebuf3);
    Text_IO.put_line(in_file3,' ');
    Text_IO.put_line(in_file3,' run { sql "create table PLAN_TABLE (statement_id,...object_name varchar2(30),object_instance numeric,object_type varchar2(30),optimizer varchar2(255),search_columns number,id .....partition_start varchar2(255),partition_stop  varchar2(255),partition_id numeric,other long,distribution varchar2(30)) "; } ');
    Text_IO.put_line(in_file3,' ');
    Text_IO.put_line(in_file3,' ');
    Text_IO.FCLOSE(in_file3)
              Declare
    un VARCHAR2(80);
    pw VARCHAR2(80);
    cn VARCHAR2(80);
    output VARCHAR2(1000);
    output2 VARCHAR2(1000);
    dummy varchar2(40);
    in_file Text_IO.File_Type;
    linebuf VARCHAR2(1800);
    BEGIN
         Get_Connect_Info(un,pw,cn);
         /* for Plan_table Begg. Second INNER BLOCK */
         declare
              dummy2 varchar2(40);
         begin
         select table_name into dummy2 from all_tables where table_name='PLAN_TABLE';
         if dummy2 = 'PLAN_TABLE' then
         output2:='rman target/ nocatalog @C:\EXPLAIN_PLUS\MISC\TRUNC2.txt ' ;
    Host(output2,no_screen);
         end if;
         exception
         when no_data_found     then
    output2:='rman target/ nocatalog @C:\EXPLAIN_PLUS\misc\create_table.txt ';
    Host(output2,no_screen);
         end; --

  • How to put pause in an SQL script.

    I am using Oracle 11g. I run an sql script called Queries.sql. The script has a lot of create and insert statements. I want to put a few delays in the execution of the script (eg. 5 second delays) so that I can watch the output as the script is being executed. How to do this?

    Hi,
    EXEC  dbms_lock.sleep (5);will pause for 5 seconds. You may not have EXECUTE privileges on dbms_lock; if not, log on as SYS and grant them, or ask your DBA to grant them to you.
    Another thing you can do is the SQL*Plus command:
    ACCEPT  dmy  PROMPT "Press [Enter] to continue ..."which will wait indefinitely for the user to press the [Enter] key before continuing.
    Edited by: Frank Kulash on Apr 26, 2011 7:59 PM

  • Silent installation then run a sql script

    I'm trying to do a silent install of 10g on a windows server.
    I have created the response file and it works correctly.
    After the oracle software has successfully installed I want to run some sql scripts on the newly created database, how do I do this automatically?
    I have tried to create a batch script to do it but because the setup command opens in a separate window it never returns back to the batch script to run the sql.
    install.bat:
    start /wait c:\oracle_software\database\install_oraclesw.bat
    call run_sqlscripts.bat
    pause
    install_oraclesw.bat:
    setup -silent -responseFile c:\oracle_software\database\response\standard.rsp -nowait
    Thanks in advance

    I'm doing a 10gr1 silent install and one problem I ran into was the setup executes when cause java, then it closes, so the next step in my script executed immediately.
    I had to use the choice command to bring up a prompt to pause the script.
    start cmd /c setup.exe -responseFile c:\stardard.rsp -nowelcome -silent
    choice /C YN /M "Press Y if install completes successufully, else press N."

  • I want to use my grey Mac G4 desktop to Skype. How and where do I connect a microphone

    I want to use my grey Mac G4 desktop to Skype. How and where do I connect a microphone. Is it possible?

    G4 Macs have no built video/webcams or microphones.
    The best solutions are USB devices.
    First, you need to determine the version of Skype that you can use. The newest Skype version 5 can only run on Macs with a min. OS X version of OS 10.5.8 Leopard.
    Tthe older version of Skype that can run in your Mac is Skype 2.8 found here.
    http://www.skype.com/intl/en/get-skype/on-your-computer/macosx/2-8/
    There are not a lot of webcams or microphones that work with both Macs and Skype.
    Here is the only webcam, from Logitech, that I was using on my previous G4 that was both PC and Mac compatible, but the requirements say you need 1.0 Ghz CPU and OS X 10.5.8 Leopard.
    http://www.logitech.com/en-us/webcam-communications/webcams/hd-webcam-c615
    Logitech also has a few Mac compatible USB headset audio/microphones, but don't mention Skype compatibilty.
    You would need to buy and try to test.
    Plantronics makes only one or two models that will work with Macs and general Internet Telephony and include Skype, also.
    Here is one here.
    http://www.plantronics.com/us/product/audio-345?skuId=sku4920019&mftr=&prodfind= trutrue
    Good Luck!

  • AWM 11.1.0.7B question running global_11g_create_cubes.sql script

    Hi everybody,
    I installed AWM 11.1.0.7B and Oracle Database 11g software, version 11.1.0.6.0.
    I am trying to install Sample Schemas & Code.
    I got an error running global_11g_create_cubes.sql script that I downloaded from the http://www.oracle.com/technology/products/bi/olap/olap_downloads.html#software
    Here is an error:
    Begin installation
    ... deleting GLOBAL AW (if it exists)
    ... creating GLOBAL AW
    begin
    ERROR at line 1:
    ORA-37162: OLAP error
    XOQ-00506: Unable to parse XML string sent from the client to the server
    ORA-06512: at "SYS.DBMS_CUBE", line 88
    ORA-06512: at "SYS.DBMS_CUBE", line 134
    ORA-06512: at "SYS.DBMS_CUBE", line 154
    ORA-06512: at "SYS.DBMS_CUBE", line 144
    ORA-06512: at "SYS.DBMS_CUBE", line 181
    ORA-06512: at line 2
    The following line in the script gives an error:
    dbms_cube.import_xml('GLOBAL_INSTALL', 'GLOBAL_MV.XML');
    Any help will be greatly appretiated.
    Thank you.
    - t

    I suspect the problem is that you are using an 11.1.0.7 client to access an 11.1.0.6 server. This configuration should work, but there was a bug at some point with new clients and old servers. In any case you would be advised to upgrade your server to either 11.1.0.7 or, at least, the latest 11.1.0.6 OLAP patch.

  • How and where I can build the logic to calculate between cal days?

    Hi
    I have the cube having data like below. When I run the report based on calendar day as input, I would like to get output data how many Line Items based on my selection (status, Trans status) from between calendar day to calendar day+150 days.
    0Calday     Sold-to-Party           Status                 Trans No     Trans Status      Line Items
    03.10.2008     2000028074     50     216270          28                       1
    05.11.2008     2000024917     40     216281          15                       1
    06.10.2008     2000006277     33     216292          28                       1
    15.12.2008     2000019927     33     216303          10                       1
    If I provided calendar day as input at query how and where I can build the logic u201Cbetween calendar days to calendar day+150 daysu201D?
    For example, If I run a report as caleder input  03.10.2008 with selections status = 40,33, Trans statu =15,10, with above data, I can get the output below.
    05.11.2008     2000024917     40     216281          15                       1
    15.12.2008     2000019927     33     216303          10                       1
    Please help me to build the above logic?
    Thanks,
    Mannev

    Hello,
    There are some informtion in SDN that can be useful regarding customer exit for variables in BEX, for example:
    need clarification on BEX variable usage in customer exit.
    you can also try to use the variable offset:
    variable offset in Bex
    Best Regards,
    Ricardo

  • Error 45 Initializing In SQL*Plus When Running A Sql Script

    Hi All
    I have a daily scheduled jobs running on Windows server 2003 and 2008. Oracle Version :10.2.0.1 and 10.2.0.4
    right now jobs are not even starting when i run them manually. Found the error Error 45 Initializing In SQL*Plus When Running A Sql Script.
    it says Bug:3039738.
    what is the solution to fix this Bug ?
    thanks
    Shawn

    user9174724 wrote:
    Hi
    do you think the Problem is not with the script ?
    when i run the job its reaching SQLPLUS and giving error
    Error 45 Initializing In SQL*Plus When Running A Sql Script .
    Server:windows 2003 and oracle version :10.2.0.1
    CMD /C %ORACLE_HOME_PRIME%\bin\sqlplus.exe /NOLOG @ %xxxx_HOME%\DBA_Backup\BackupDo.sql testdb BackupFull
    The above line does the following:
    1) launches a command procesor
    2) passes that command processor the following command line parms:
    /C
    (process the following command, then terminate)
    %ORACLE_HOME_PRIME%\bin\sqlplus.exe
    the launched processor will process the executable 'sqlplus.exe' found in the \bin subdirectory, found in the directory indicated by the environment variable ' ORACLE_HOME_PRIME'. The remainder of the command line will be passed to sqlplus.exe for interpretation and processing
    /NOLOG
    tell sqlplus to start up without trying to immediately log on to a database
    typically used to indicate to sqlplus that the immediately following string names a file of sql and sqlplus commands to be processed.
    %xxxx_HOME%\DBA_Backup\BackupDo.sql
    tell sqlplus to execute the commands found in the file 'BackupDo.sql', found in the subdirectory DBA_Backup, found in the directory name by the environment variable 'xxxx_HOME'.
    testdb
    BackupFull
    pass the values 'testdb' and 'BackupFull' to be used as values for substitution variables &1 and &2 in the file 'BackupDo.sql'
    Script:
    rmanbackup.rman
    BACKUP AS COMPRESSED BACKUPSET DATABASE FORCE PLUS ARCHIVELOG;
    DELETE NOPROMPT ARCHIVELOG ALL BACKED UP 2 TIMES TO DEVICE TYPE DISK;
    LIST BACKUP SUMMARY;
    LIST BACKUP;
    EXIT;I don't know what you expect of this. It is an rman script and we've seen no sign of an rman script being executed in any of what you've shown us. RMAN commands are processed by rman, not sqlplus.
    Unfortunately, you didn't think showing us the contents of BackupDo.sql was of any value in finding out what your problem was.
    Edited by: EdStevens on Jul 11, 2011 7:58 PM

  • How can I extract the full SQL script for a schema?

    Hi,
    How can I extract the full SQL script for a schema?
    I am looking for some method that needs jus SQL*Plus and preferably doesn’t need any extra tool.
    Thank you,
    Alan

    How can I extract the full SQL script for a schema?What are you looking for? PL/SQL code? DDL for objects?

  • How and where can I combine several pdf files?

    I have written a Guide Book for Music Teachers in Word, converted it into a pdf file and would now like to insert sheet music files written with Sibelius Notation Program which have also been converted into pdf files, since they are otherwise not compatible with Word. How and where can these diverse pdf files be combined?

    First, make sure you open Acrobat, and not Adobe Reader.  It's a common mistake.
    From Acrobat, use File | Create | Combine Files into a Single PDF:
    On the next panel you can select the files you want to combine, rearrange them, etc., and finally click Combine.
    P.S. your menu may look slightly different, as we may not be using the same Acrobat version.

Maybe you are looking for