Database copy with "set define off" option

Is there an option to do a database copy with a "set define off" option ? I'm copying packages that contain ampersands (&) in strings and during the copy I'm being asked the value of these variables.

Apologies for spamming this thread, but I'd like to point out a couple of additional issues regarding Database Copy:
1) On Fedora it tries to create the script file in a system folder ( +/opt/sqldeveloper/sqldeveloper+, IIRC) which obviously doesn't work unless you are root.
2) DDL generated for objects named like the exporting schema (for example table TEST in schema TEST) is incorrect. For example (note the missing table name):
-- DDL for Table TEST
CREATE TABLE
(     "FIELD1" NUMBER,
) ;

Similar Messages

  • Set Define Off compiler option or similar?

    When I create a package in SQLDeveloper it starts off something like this:
    Create or replace package...
    I then save the file to my SVN folder and commit it to the repository. If I come back later and want to compile something from the repository, I browse to the file in my repository, open the file (read only) and compile. I'm getting the problem that it tries to put substitutions in (&). Is there a way to tell the compiler not to do this? Normally I'd put in something like "set define off" before the package to do this, but since it is not already there and it's read only, I can't do this...
    I tried to open a new worksheet and run "set define off" and then recompile, but it didn't do anything useful...
    Any ideas?
    Thanks

    That's weird, I'd say that should work. Sure you issued that in the same session on the same connection?
    You could also try:
    set scan offAnd run it as script (F5) and as statement (F9) just in case that makes any difference.
    Hope that helps,
    K.

  • Missing SET DEFINE OFF exporting tables

    Another minor bug exporting tables using the insert option is that no “SET DEFINE OFF” is created.
    If values in the exported tables contains *“&”* characters, the user is asked to edit values.
    Example:
    1. Create a table with such a value:
    SET DEFINE OFF;
    CREATE TABLE FOO (COMPANY VARCHAR2 (64));
    INSERT INTO FOO VALUES ('Meier & Co');
    2. Exporting this table creates:
    -- Datei erstellt -Freitag-April-15-2011
    -- DDL for Table FOO
    CREATE TABLE "FOO"
    (     "COMPANY" VARCHAR2(64)
    REM INSERTING into FOO
    Insert into FOO (COMPANY) values ('Meier & Co');
    3. Running in SQLPlus:
    SQL> @export.sql
    Tabelle wurde erstellt.
    Geben Sie einen Wert f³r co ein:
    Regards
    Marc
    Version:
    Java(TM)-Plattform     1.6.0_23
    Oracle-IDE     3.0.04.34
    Versionierungsunterstützung     3.0.04.34

    Thank you. As a new SQL Developer user, I didn't know what it should have been, but I found out I needed to edit the output before I could use it to load data.
    Skip

  • Setting DEFINE OFF by default

    I'm finding it tedious to occasionally ambush myself with an ampersand in a query. Can DEFINE be set off by default?

    I've a sneaking suspicion that there is no resolution, at least as regards setting DEFINE OFF within a script.
    The SQL Developer Help under section "SQL*Plus Statements Supported and Not Supported in SQL Worksheet" specifies the SET command for option PAUSE OFF alone. No other SET options are listed; although "DEFINE" is listed as a command, that is the definition of a SQLPLUS variable, not the environment setting DEFINE.
    I was looking around for a Preference, but could not see anything; OTOH, it is pretty late at night so I could have missed one.
    HTH

  • 'set scan off' or 'set define off' now working through JDBC on Oracle 10g

    Hi,
    I am using oracle 10g. I am trying to execute 'set scan off' statement through JDBC (java code) using below statement
    //get connection Connection c = this.init();  //create statement object Statement st = c.createStatement();  //execute statement st.execute("set scan off");
    but it is throwing below exception.
    'java.sql.SQLException: ORA-00922: missing or invalid option'
    I also tried 'set define off' but got same exception. But if I run these statement directly on database without using JDBC there is no exception.
    Please let me know what is the issue.

    Rajesh Panchal wrote:
    Hi,
    I am using oracle 10g. I am trying to execute 'set scan off' statement through JDBC (java code) using below statement
    //get connection
    Connection c = this.init(); 
    //create statement object
    Statement st = c.createStatement(); 
    //execute statement
    st.execute("set scan off");                              but it is throwing below exception.
    'java.sql.SQLException: ORA-00922: missing or invalid option'
    I also tried 'set define off' but got same exception. But if I run these statement directly on database without using JDBC there is no exception.
    Please let me know what is the issue.These are not SQL statements but specific Oracle commands. You would invoke them from PL/SQL through the command interpreter or by using Sqlplus on the commandline; if you try to execute this in a PL/SQL query window you'll get the same error.
    So no, you are not going to invoke them from JDBC.

  • Retain standard SAP order type after copying with user defined order type

    Hello SAP Gurus,
    We have a requirement of retaining the standard SAP order types after copying with User defined order types. But the issue is we don't want to see the standard SAP order type such as PM01, PM02 in production system while using transaction like IW31 etc.
    Is there anybody who has answer to retain these stanadard SAP order types without deleting from system configuration?
    Thanks in advance.
    Cheers,
    Vaibhav

    Vaibhav,
    When you F4 on the order type field in IW31 you will get the popup showing the order type list. At the top of this list is a button with a green "+" sign (Insert in personal list).
    You can use this button to select your favourite list.
    This function is available in most F4 drop-down lists.
    However, you cannot set this setting for all users. You will need to write an ABAP program to do this.
    PeteA

  • A trigger returned a resultset and/or was running with SET NOCOUNT OFF while another outstanding result set was active

    I have 2 servers connected over a low speed wan and we're running SQL Server 2008 with Merge replication.
    At the subscriber, sometimes when attempting to insert new rows, I get this error:
    A trigger returned a resultset and/or was running with SET NOCOUNT OFF while another outstanding result set was active.
    My database doesn't have any triggers; the only triggers are the one created by the Merge replication
    Also, whenever this error occurs it automatically rolls back the existing transaction
    I am using DataTables and TableAdapters to
    insert and update the database using transactions
    What I have checked:
    the database log file size is below 50Mb
    Checked the source code for Zombie transactions (since I wasn't able to retrieve the actual error at the beginning)
    Checked the connection between the two servers and found it congested
    Questions:
    How to avoid this behavior and why it's occurring at first place?
    Why it's cancelling the open transaction?

    did the issue happen on some specific tables or all the tables?
    I suggest to run sql server trace at publisher and subscriber when the issue happens. Please involve below events and columns
    Stored      Procedures
    RPC:Completed      
    RPC:Starting
    sp:Completed
    sp:Starting
    sp:StmtStarting      
    sp:StmtCompleted      
    TSQL
    SQL:StmtCompleted
    SQL:StmtStarting      
    SQL:BatchCompleted
    SQL:BatchStarting      
    Unprepare SQL
     ‘Errors and Warnings’
    ErrorLog
    EventLog
    Exceptoin
    attention
    columns:
     TextData ,error, LoginName, ApplicationName , StartTime ,EndTime,DatabaseName,NestLevel,ObjectName,ObjectType,ServerName,eventsequence,linenumber,cpu,reads ,writes,rowcounts,clientprocessid,spid,transactionid
    Once the issue happens, please check the trace to find which step or statement hit the error.

  • Set define off

    Hi, Everyone,
    I am using oracle 11g version on windows server 2003 R2.
    i am writing a procedure in a pacakage. My procedure is as follows:
    PROCEDURE PROC_SUBDEPT_USER_LKP
    IS
    v_command_1 VARCHAR2(30000);
    v_command_2 VARCHAR2(30000);
    v_command_3 VARCHAR2(30000);
    v_command VARCHAR2(30000);
    BEGIN
    FOR k IN
    (SELECT * from SUBDEPT_LKP
    LOOP
    V_COMMAND_1 := ' SELECT ';
    V_COMMAND_2 := ' , CUSTOMER_NO, ROWNUM NR FROM (
    SELECT DISTINCT CUSTOMER_NO
    FROM BBL_TRY_NEW A, PMM B
    WHERE A.PR_CODE = B.PR_CODE
    AND B.SUBDEPT_CODE = ';
    V_COMMAND_3 := ' AND B.SUBDEPT_DESC = ';
    V_COMMAND := ' INSERT INTO SUBDEPT_USER_LKP '||chr(10)||V_COMMAND_1||K.SUBDEPT_TN_ID||V_COMMAND_2||K.SUBDEPT_CODE||V_COMMAND_3||''''||K.SUBDEPT_DESC||''''||')';
    EXECUTE IMMEDIATE V_COMMAND;
    COMMIT;
    --DBMS_OUTPUT.PUT_LINE(V_COMMAND);
    END LOOP;
    DBMS_OUTPUT.PUT_LINE('POPULATED SUBDEPT_USER_LKP');
    END;
    for each insert statement in the loop i need to "set define off" as i have '&' symbol in my data for k.subdept_desc.
    Could anybody please help?
    Thanks in advance

    i dont think that u need to set define off, as & will not cause any issue if it is in a variable
    check my test code
    SQL> select * from test_tab;
    A
    a&b
    SQL> declare
      2  a varchar2(200);
      3  begin
      4  select a into a from test_tab where rownum = 1;
      5  execute immediate 'insert into test_tab values (''' || a || ''')';
      6  commit;
      7  end;
      8  /
    PL/SQL procedure successfully completed.
    SQL>

  • SET DEFINE OFF in Linux Operating system.

    Is "SET DEFINE OFF" will work in Linux Operating system..
    Please let me know .

    SET DEFINE OFF is an SQL*Plus tool command..
    It will work in any OS..

  • Slow calc time with SET CREATEBLOCKONEQ OFF for block creation

    Hello everyone,
    I have a problem with the slow execution of one of my calc scripts:
    A simplified version of my calc script to calculate 6 accounts looks like this:
    SET UPDATECALC OFF;
    SET FRMLBOTTOMUP ON;
    SET CREATEBLOCKONEQ ON;
    SET CREATENONMISSINGBLK ON;
    FIX (
    FY12,
    "Forecast",
    "Final",
    @LEVMBRS("Cost Centre",0),
    @LEVMBRS("Products",0),
    @LEVMBRS("Entities",0)
    SET CREATEBLOCKONEQ OFF;
    "10000";"20000";"30000";"40000";"50000";"60000";
    SET CREATEBLOCKONEQ ON;
    ENDFIX
    The member formula for each of the accounts is realtively complex. One of the changes recently implemented for the FIX was openin up the cost center dimension. Since then the calculation runs much slower (>1h). If I change the setting to SET CREATEBLOCKONEQ ON, the calculation is very fast (1 min). However, no blocks are created. I am looking for a way to create the required blocks, calculate the member formulas but to decrease calc time. Does anybody have any idea what to improve?
    Thanks for your input
    p.s. DataStorage in the member properties for the above accounts is Never Share

    MattRollings wrote:
    If the formula is too complex it tends not to aggregate properly, especially when using ratios in calculations. Using stored members with member formulas I have found is much faster, efficient, and less prone to agg issues - especially in Workforce type apps.We were experiencing that exact problem, hence stored members^^^So why not break it up into steps? Step 1, force the calculation of the lower level member formulas, whatever they are. Make sure that that works. Then take the upper level members (whatever they are) and make them dynamic. There's nothing that says that you must make them all stored. I try, wherever possible, to make as much dynamic as possible. As I wrote, sometimes I can't for calc order reasons, but as soon as I get past that I let the "free" dense dynamic calcs happen wherever I can. Yes, the number of blocks touched is the same (maybe), but it is still worth a shot.
    Also, you mentioned in your original post that the introduction of the FIX slowed things down. That seems counter-intuitive from a block count perspective. Does your FIX really select all level zero members in all dimensions?
    Last thought on this somewhat overactive thread (you are getting a lot of advice, who knows, maybe some of it is good ;) ) -- have you tried flipping the member calcs on their heads, i.e., take what is an Accounts calc and make it a Forecast calc with cross-dims to match? You would have different, but maybe more managable block creation issues at that point.
    Regards,
    Cameron Lackpour

  • Virtual private database / procedure with AUTHID DEFINER

    Dear all,
    short question (11.2.0.3 EE): is virtual private database (dbms_rls) working together with a procedure defined as AUTHID=DEFINER?
    We have the following scenario:
    User A owns table AA (mandantid number, name varchar2(20))
    Data:
    100, ABC
    102, XYZ
    User B has access to table A.AA with RLS in place seeing the record 100,ABC only.
    So far, this works correct.
    Now there is a procedure owned by B:
    create or replace procedure BB AUTHID DEFINER is
         num     number;
    begin
         select count(*) into num from A.AA;
         dbms_output.put_line('num='||to_char(num));
    end BB;
    /Execution of procedure BB by B itself returns 1 (correct)
    Now the part that causes problems:
    There is another user X, calling procedure B.BB. Actually I thought, the output of the procedure would be 1, since it runs under DEFINER, but actually it's 0.
    Why?
    Thanks for any hints on this
    Regards
    Christoph

    What is your policy function? How does it determine what rows to show?
    A common approach to building a VPD policy would be to create a context that the user populates by calling some procedure (i.e. a login procedure that you've implemented) and then refer to the value in the context in your VPD policy. If that's what your VPD policy is doing, my wager is that the problem is that when B is executing the procedure, the context is already populated appropriately but when some other user executes the procedure, the context is empty. If the policy function is using something like the USER function, that would also explain why it behaves differently for different callers.
    Justin

  • Using quote delimiter with define off.

    I am having issues with the the quote delimiter picking up the colon as a bind variable. For some reason when there is a tick infront of the colon it will break (ex. 2) but in (ex. 3) it is behind the colon it will work fine.
    set define off
    DECLARE
    s1 VARCHAR2(20);
    s2 VARCHAR2(20);
    s3 VARCHAR2(20);
    BEGIN
      s1 := 'Isn''t t:his cool';
      --s2 := q'{Isn't th:is cool}';
      s3 := q'{Isnt th:is co'ol}';
      dbms_output.put_line(s1);
      dbms_output.put_line(s2);
      dbms_output.put_line(s3);
    END;
    /

    @SY,
    Can you please explain the difference ?
    SQL> select  * from v$version;
    BANNER
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
    PL/SQL Release 9.2.0.8.0 - Production
    CORE    9.2.0.8.0       Production
    TNS for HPUX: Version 9.2.0.8.0 - Production
    NLSRTL Version 9.2.0.8.0 - Production
    SQL> SET define off
    SQL>
    SQL> DECLARE
      2     s1   VARCHAR2 (20);
      3     s2   VARCHAR2 (20);
      4     s3   VARCHAR2 (20);
      5  BEGIN
      6     s1 := 'Isn''t t:his cool';
      7     s2 := q'{Isn't th:is cool}';
      8     s3 := q'{Isnt th:is co'ol}';
      9     DBMS_OUTPUT.put_line (s1);
    10     DBMS_OUTPUT.put_line (s2);
    11     DBMS_OUTPUT.put_line (s3);
    12  END;
    13  /
       s2 := q'{Isn't th:is cool}';
    ERROR at line 7:
    ORA-06550: line 7, column 11:
    PLS-00103: Encountered the symbol "{Isn" when expecting one of the following:
    . ( * @ % & = - + ; < / > at in is mod not rem
    <an exponent (**)> <> or != or ~= >= <= <> and or like
    between ||
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE    11.2.0.2.0      Production
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    SQL> SET define off
    SQL>
    SQL> DECLARE
      2     s1   VARCHAR2 (20);
      3     s2   VARCHAR2 (20);
      4     s3   VARCHAR2 (20);
      5  BEGIN
      6     s1 := 'Isn''t t:his cool';
      7     s2 := q'{Isn't th:is cool}';
      8     s3 := q'{Isnt th:is co'ol}';
      9     DBMS_OUTPUT.put_line (s1);
    10     DBMS_OUTPUT.put_line (s2);
    11     DBMS_OUTPUT.put_line (s3);
    12  END;
    13  /
    Isn't t:his cool
    Isn't th:is cool
    Isnt th:is co'ol
    PL/SQL procedure successfully completed.Thanks in advance.

  • How to spool a file in sqlplus with feedback off option?

    Is there a way to spool a file in sqlplus with the feedback turn off? I want to capture all the logs, but do not want to see all commands and entries on my screen. When I set the feedback off, I get nothing in my logfiles due to the set feedback off option.

    here's what i did
    SET echo off
    SET feedback off
    SET term off
    SET pagesize 0
    SET linesize 200
    SET newpage 0
    SET space 0
    col name format a120
    SQL> spool test.log
    SQL> @trunc_ref_tables.sql -- this script truncates tables
    SQL> spool off
    SQL> exit
    As expected, there was no logs generated in the logfile with the set feedback off option. This is what was in my log file.
    SQL> @trunc_ref_tables.sql
    SQL> spool off
    How do i see the list of tables that were truncated in my logfiles without havign to see the following on my screen.
    Table truncated.
    Table truncated.
    Table truncated.
    Table truncated.
    Table truncated.
    Table truncated.
    Table truncated.
    Table truncated.
    Table truncated.
    Table truncated.
    Table truncated.
    Table truncated.
    Table truncated.

  • What should be done to include the current controlfile in the database copy

    Hi
    When trying to create a copy of the database it always fails copying the controlfile
    What should be done to include the current controlfile in the database copy with the %b format
    RMAN> backup as copy database format 'd:\backup\%b'
    2> ;
    Starting backup at 13-SEP-10
    using channel ORA_DISK_1
    channel ORA_DISK_1: starting datafile copy
    input datafile file number=00001 name=D:\ORACLE\ORADATA\ORCL\SYSTEM01.DBF
    output file name=D:\BACKUP\SYSTEM01.DBF tag=TAG20100913T204940 RECID=16 STAMP=729636617
    channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:45
    channel ORA_DISK_1: starting datafile copy
    input datafile file number=00003 name=D:\ORACLE\ORADATA\ORCL\UNDOTBS01.DBF
    output file name=D:\BACKUP\UNDOTBS01.DBF tag=TAG20100913T204940 RECID=17 STAMP=729636660
    channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35
    channel ORA_DISK_1: starting datafile copy
    input datafile file number=00002 name=D:\ORACLE\ORADATA\ORCL\SYSAUX01.DBF
    output file name=D:\BACKUP\SYSAUX01.DBF tag=TAG20100913T204940 RECID=18 STAMP=729636692
    channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35
    channel ORA_DISK_1: starting datafile copy
    *copying current *control file**
    RMAN-03009: failure of backup command on ORA_DISK_1 channel at 09/13/2010 20:51:36
    ORA-19715: invalid format b for generated name
    ORA-27302: failure occurred at: slgpn
    continuing other job steps, job failed will not be re-run
    channel ORA_DISK_1: starting datafile copy
    input datafile file number=00004 name=D:\ORACLE\ORADATA\ORCL\USERS01.DBF
    output file name=D:\BACKUP\USERS01.DBF tag=TAG20100913T204940 RECID=19 STAMP=729636697
    channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
    channel ORA_DISK_1: starting full datafile backup set
    channel ORA_DISK_1: specifying datafile(s) in backup set
    *including current SPFILE in backup set*
    channel ORA_DISK_1: starting piece 1 at 13-SEP-10
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03009: failure of backup command on ORA_DISK_1 channel at 09/13/2010 20:51:38
    ORA-19715: invalid format b for generated name
    ORA-27302: failure occurred at: slgpnEdited by: hrishy on Sep 13, 2010 8:26 AM

    hrishy wrote:
    Allright your trick configure controlfile autobackup on does the trick but i am cluless why it worksWhy clueless? That's a documented and a perfectly normal behavior!
    http://download.oracle.com/docs/cd/E11882_01/backup.112/e10642/rcmconfb.htm#BRADV89408
    HTH
    Aman....

  • Using SET SCAN OFF on PRO*C

    How can I implement the SQL Plus command SET SCAN OFF (or SET DEFINE OFF) on my PRO*C code? Thanks a lot.

    It is entirely likely that I'm missing something, but why would you need to? Those commands are directly related to the behavior of SQL*Plus not the SQL engine in particular.

Maybe you are looking for