Run sql with via bash script...

How to run the below sql of the bash. get the below error.

If sqlplus "/ as sysdba" < < EOF > status.log

fixed lines 200

Comment by col for a60

Col ACTION_TIME to a30

version col to a20

COMMENT by col to a30

Col BUNDLE_SERIES to a13

Select * FROM (SELECT d.name "DB_NAME", r.ACTION_TIME, r.ACTION, r.VERSION, r.ID, r.COMMENTS, r.BUNDLE_SERIES, row_number() over (order by r.ACTION_TIME desc): the nurse OF ")

registry\\$ r history,.

v\\$ d database) WHERE the rn < = 3;

"exit";

EXPRESSIONS OF FOLKLORE

$ cat status.log

registry\ r,

*

ERROR on line 2:

ORA-00911: invalid character

Try changing

registry\\$ r history,.

v\\$ d database) WHERE the rn<=>

TO

registry\$ r history,.

v$ database d) WHERE the rn<=>

just a backslash ().

Tags: Database

Similar Questions

  • How to create an app with automator to execute a bash script?

    I want to create an application like Ds store Remover but it will remove the directories instead of a single file. So I was wondering how can I do to do this, I have a bash script that the code is below, I just need to know what to do. To get the app ask root password and allow the user to select the directory they want these directories.

    sudo rm - rf ".» Thrashes.

    sudo rm - rf ".» Spotlight-V100.

    sudo rm - rf ".» Trash ".

    sudo rm - rf ".» DS_Store '.

    Hello D3ATH2020,

    You must run a 'do shell script' and add 'with administrator privileges. See this technical note from Apple: https://developer.apple.com/library/mac/technotes/tn2065/_index.html

    However, I strongly do not try what you are doing. There are better ways to manage the. DS_Store files. You don't want to remove these other directories. I mean, really, you want to do.

  • can the run/run .sql script in another application?

    Hello..

    I have a problem to run my .sql script (for example: @c:\Users\test.sql) in my netbeans application. There is no problem when I want to run/run my sql query (for example: "select * from...").

    But when I want to run my script, no presentation of the result. my script content my query to export to the csv file.

    script: @c:\Users\test.sql

    in the script:

    coil c:\Users\test.csv;

    ' Select ' ' ' | LOT_NUMBER | « «, » » || DEVICENUMBER | « «, » » || DEVICENAME | « «, » » || STEP_NAME | « «, » » || INSERT_DATE | « «, » » || STATUS | « «, » » || DISPOSEDBY | « «, » » || ACCEPTBY | « «, » » || AVAILABLE | « «, » » || GENDISPOSITION | » » »

    of RF_LOT_ON_HOLD_LIST;

    spool off;

    Thank you.

    bunch

    Yes, we know what talking about your question.

    a .sql script is just a plain text file containing everything you want.  The code in it can be a pure SQL statements, it may contain of the PL/SQL code, and it can also include SQL * more specific orders (keep in mind SQL * more is a tool, not a language, so that these commands are specific to this tool and other tools which can also interpret the same commands).

    Not quite sure how your question relates to this blog, as this blog is showing the code that gets the data in JSON format in a jqGrid (jQuery grid?) and then exports the data in an Excel file.

    What you're trying to do is to take a series of SQL * Plus and SQL statements in a text file and generate a CSV file from them.

    As already mentioned, SPOOL is a SQL * more order, specific to SQL * more command line tool.  The database itself has no idea what "spool" means, while passing to the database somehow does not work.  I also doubt that netbeans knows what that means, either.

    So, in short, how you try to do, not you cannot.

  • Running SQL scripts on different databases

    Hello!

    At my work we have many databases on a server. I have to make a request so that users can run the application on a selected database SQL scripts.

    So my question may be separated into 2 sections:

    1 - is possible to let users SQL scripts run directly from the application?

    I think a database to create a page that displays the list of all the SQL scripts, that we want to use, and when you click on a specific script name in the list, it asks something like "Where the database you want to run the script?", and then, as confirmed by the user, it would show results running the script on a different page.

    is 2 - possible to let users choose what database to run these scripts?

    Any information would be helpful, I'm at the beginning of the project and am not sure at all about how to proceed, or if it is at all possible.

    Thank you!

    Fallen_Kaede wrote:

    Thanks for the quick response. I confirm that we are talking about databases on a server.

    The request is to "debug" to other databases. For example, be run scripts to the locks on the list, to show the different indexes on a table, etc. to help diagnose problems.

    It looks like the 'users' are DBA who should use OEM/Grid Control to do so.

    1 - is possible to let users SQL scripts run directly from the application?

    Lol the only way to run scripts in the APEX is the use of the SQL Scripts for SQL workshop component.

    The key word in your question is 'application '. SQL * more and Developer SQL are applications that allow users to run SQL scripts on the desktop. Scripts SQL is an APEX integrated application that allows developers to run SQL scripts on the web. However, there is no documented way supported for end users to run SQL scripts in a custom of APEX application that you created. Therefore, rethink your approach. Rather than create an application APEX runs scripts, you must convert the scripts in PL/SQL, APEX packages, pages, components and applications leverage features of the APEX and reports, graphics and interactivity (e.g. exploration links; timed refreshes etc.). This will give you a user experience improved, beyond what is possible using static SQL scripts.

    is 2 - possible to let users choose what database to run these scripts?

    The APEX applications would exist on an instance of the APEX in a database and access other databases using the database links (which can have a performance impact). It would be possible to create a LOV based on the view of the USER_DB_LINKS dictionary and use in a selection set to a global page list to provide a control to set the current context of the database. Region data sources will have to be generated dynamically in the packages of PL/SQL use the links from relevant database based on this value LOV.

  • Run SQL through batch file, with parameters

    Hi all

    I run SQL through Batch files before, but I am a little confused with the execution of the sql with parameters. For example, if I have a named sql file:
    insert.sql
    
    Insert into TableA
     select * from TableB
     where service_dt >= '&&x_start_dt' and service_dt <= '&&x_end_dt';
    I can run this problem normally, but including the substitution variables, as in the batch (.bat) file called Execute_insert.cmd is a bit annoying... I played a little with it and cannot operate.

    Any help would be appreciated.

    Thank you
    Ed

    Change your insert.sql to something more like:

    Insert into TableA
     select * from TableB
     where service_dt >= TO_DATE('&1', 'format mask') and
           service_dt <= TO_DATE('&2', 'format mask');
    

    Then, would you call it:

    sqlplus user/password @insert.sql 01-oct-2012 31-oct-2012
    

    John

  • Run SQL failed with the authentication failure

    Hi all, I have access to a large grid control to manage my small group of data, I'm not super user, I am only a dba user access to databases in mi cluster. Then, when I try to run SQL using "execute SQL" link I get a message that says "LOG: Local Authentication failed...". PAM attempt authentication... "WFP has failed with the error: authentication failure.

    But, when I use the 'SQL Worksheet' link to run the same SQL that works very well, is not possible to run SQL using the other link? What's wrong? Thanks in advance.

    You have not set up the setting with agent PAM, please follow the notes 422073.1 and check.

  • Kindly help me with an example script!

    Hello

    My agency asked me to implement the RMAN backups for some windows based Oracle databases. Please help me with the help of the sample in the form of scripts will be maintained for an incremental backup.

    Every Monday I will level 0 and level 1 followed on Sunday. What is the format of the script to run. Is the below script ok?

    Level 0:

    =======

    Run {}

    allocate channels d1 type disc FORMAT 'D:\rman_backups\Weekly14OCT_%T_L0_%d-%s_%p.db ';

    allocate channels d2 type disc FORMAT 'D:\rman_backups\Weekly14OCT_%T_L0_%d-%s_%p.db ';

    Backup current Controlfile;

    SQL 'alter system archive log current';

    format of backup incremental level 0 tag filesperset Weekly_Full_database 5 'D:\rman_backups\Weekly14OCT_%T_L0_%d-%s_%p.db"database archivelog all delete all entries;

    output channel d1;

    output channel d2;

    }

    Level 1:

    =======

    Run {}

    allocate channels d1 type disc FORMAT 'D:\rman_backups\Weekly_%T_L1_%d-%s_%p.db ';

    allocate channels d2 type disc FORMAT 'D:\rman_backups\Weekly_%T_L1_%d-%s_%p.db ';

    Backup current Controlfile;

    backup incremental level 1 cumulative Daily_Cumulative_Backup filesperset 5 format tag "D:\rman_backups\Daily_%T_CUMUL_%d-%s_%p.db".

    Database PLUS ARCHIVELOG;

    SQL 'alter system archive log current';

    format of incremental backup level 1 tag Daily_Differential_Backup filesperset 5 'D:\rman_backups\Daily_%T_INCR_%d-%s_%p.db' to database MORE ARCHIVELOG;

    output channel d1;

    output channel d2;

    }

    Thanks in advance.

    I forgot to mention this: you must save the controlfile * after * the database, archivelog backups. In this way the backup controlfile captures information on database backups and archivelog.

    Hemant K Collette

  • Get and Set of dynamic Type via the Script output

    I am running vRO 6.0.1. I built a dynamic type to Veeam. I can see the items in the inventory and can select them as attributes in workflows. I'm looking to get the dynamic Type via a script object and set it as a variable in the script output, but its does not work. I created the dynamic type using the type dynamic plug-in generator v2.

    I have 'Veeam' namespace with types:

    VeeamHost

    jobFolder

    job

    I put an output with the 'DynamicTypes:Veeam.job' type attribute and the name jobOut

    My script is just:

    jobOut = Server.findForType ('DynamicTypes:Veeam.job' '29714267-f517-4f76-a621-902b3e789772/urn:veeam:Job:26eddcda-ea52-469b-b4c9-0b80fec098ae');

    System.log ("Job found:" + jobOut "'); 

    After the execution of the jobOut variable is empty. In the newspapers, I see:

    Found job: DynamicWrapper (Instance): [DynamicTypesDynamicObject]-[class com.vmware.o11n.plugin.dynamictypes.model.DynamicObject] - VALUE: dynobj: [__ns:Veeam __id:29714267-f517-4f76-a621-902b3e789772/urn:veeam:Job:26eddcda-ea52-469b-b4c9-0b80fec098ae __tp:DynamicTypes:Veeam.job]

    Does anyone have an idea of how complete the release of DynamicTypes:Veeam.job with the actual work of veeam I got via the script?

    Could check you what happens if you replace the line

    jobOut = Server.findForType("DynamicTypes:Veeam.job","29714267-f517-4f76-a621-902b3e789772/urn:veeam:Job:26eddcda-ea52-469b-b4c9-0b80fec098ae");

    with

    jobOut is DynamicTypesManager.getObject ("Veeam", "task", "29714267-f517-4f76-a621-902b3e789772/urn:veeam:Job:26eddcda-ea52-469b-b4c9-0b80fec098ae");.

  • MathScript instability with large Matlab scripts? (Labview 8.5.1)

    Hello

    I the student of LabView 8.5.1 version and experiences a lot of instability when you use Mathscript in Labview (the Mathscript block or the Mathscript window), but only when it comes to the larger scripts. The Matlab script is about 250 lines long and 16 KB of size and in this framework, are seven large paintings (six 14 x 8, built at the beginning and a 1000 x 9 which is built in a loop for, so increases with each iteration until 1000 lines). I find that whenever I have modify the script in the Mathscript node or the Mathscript window will freeze and hang for at least 10 minutes, sometimes totally crashing Labview Labview. As I wrote the script in Matlab, I'll have to debug in Labview and know what commands in Matlab do not work in Mathscript/Labview, so it's obviously pretty infuriating to have the program regularly hang for 10 minutes at a time.

    The computer I use is a desktop Packard Bell 5 year with 768 MB of Ram (less 32 MB integrated graphics card), running XP Pro. The processor is an Intel Celeron 2.6 GHz. I appreciate this isn't the best specced machine ever, but at the time it was all I could afford!

    Is this common suspended a little problem with Labview and Mathscript file ".m" large, or is manipulation - this purely down to my old computer?

    Thank you much for the help.

    Hello

    The delay that you experience is a problem with the big scripts in MathScript.  The delay increases exponentially with the length of the script.  For this reason, we recommend disaggregation great scripts and files ".m" in rooms separated by about 40 lines.  On faster computers, you can find the acceptable period for up to 100 lines.

    Grant M.
    Staff software engineer | LabVIEW Math & Signal Processing | National Instruments

  • Java will not add/remove programs uninstall. When running java get error (java script false) when trying to uninstall get error message (error application of transformations

    When running java get error (java script false) when trying to uninstall get error message (error application of transformations. Went to sunmicro systems, but can not find help. Also having problems with script errors. I'm debugging the scripts not controlled. Using windows xp IE8.

    I think I need some type of uninstaller or need assistance.

    TYVM

    Connie Pitre

    E-mail address is removed from the privacy *.

    Hello

    Try the methods provided below and check if the problem persists.

    Method 1:

    Try the steps in the link below of the Java Support to solve the problem with the error application transforms during the uninstalling of Java.

    Error application of transformations

    http://Java.com/en/download/help/error_applying_transforms.XML

    Method 2:

    To fix problems with the Script in Internet Explorer error click the link below.

    How to resolve script errors in Internet Explorer on Windows computers

    http://support.Microsoft.com/kb/308260

  • We want to use WinRM to our company to increase efficiency with the written scripts b admins.

    Hello

    We want to use WinRM to our company to increase efficiency with the written scripts b admins.

    But to avoid savage execution of multiple scripts, our security departments require 2 requirements:

    The fitting should be accepted only one server and only when encrypted (so be need a filter on the customers for this)

    And each running script must be connected

    So far I could not find a method to get this time. So, is there a way to do this?

    Best regards

    Original title: WinRM security

    This issue is beyond the scope of this site and must be placed on Technet or MSDN

    http://social.technet.Microsoft.com/forums/en-us/home

    http://social.msdn.Microsoft.com/forums/en-us/home

  • run cmd as administrator by script

    When I'm on cmd as a user I want to run cmd as administrator with command at the command prompt.
    is there any command for this?

    not in a click! I know that!

    with the command script on command prompt!

    You can use this VBScript file:

    '------------------------------------
    "Start a raised Console session
    ' 19.2.2012 FNL
    '------------------------------------
    sComSpec = CreateObject ("WScript.Shell"). ExpandEnvironmentStrings ("%comspec%")
    Set oShell = CreateObject
    oShell.ShellExecute sComSpec, "cmd.exe", "runas", 1
  • will not appear sql statemnt in shell script

    Hello

    I have a shell script with an unfavourable sql she calls another script where I connect to dabase.

    In the journal of the script, I see the sql statement and I wish that that do not show me anything. How I make these?

    Thank you

    Hello

    2650697 wrote:

    Hello

    I have a shell script with an unfavourable sql she calls another script where I connect to dabase.

    In the journal of the script, I see the sql statement and I wish that that do not show me anything. How I make these?

    Thank you

    Your postal code.  It is very difficult to tell what you're doing wrong without knowing what you are doing.

    You can have SQL statements directly in your shell script.  They must be in a script by themselves, said fubar.sql, and shell script must contain

    @fubar

    instead of real SQL statements.

  • Try to run a SQL statement through the window of OEM 12 c run SQL.  Statement fails

    All,

    I have a 11g database.  When it is initially installed, I installed it in $ORACLE_BASE = / orabin/app/oracle/product and $ORACLE_HOME = $ORACLE_BASE/11gDB_R2.  This is the version 11.2.0.1 to give birth to 11.2.0.3.

    Recently, I installed 11.2.0.4 in $ORACLE_BASE/11.2.0.4.  Then, I upgraded my database at 11.2.0.4.  Everything works fine.

    All my scripts on the linux host logon changed to point my environment at $ORACLE_BASE/11.2.0.4 House and my $PATH when I connect to the linux host is: /orabin/app/oracle/product/11.2.0.4/bin:/orabin/app/oracle/product/11.2.0.4/OPatch:/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/oracle/bin

    On my OEM Console, the database appears as 11.2.0.4 and me can manage very well.

    However, when I try to use the window of the OEM Console to execute SQL to execute any type of SQL statement, it fails.

    The failure error is:

    Could not launch/orabin/app/oracle/product/11gDB_R2/bin/sqlplus-s/nolog: no such file or directory

    It would be a mistake since the 11gDB_R2 directory tree (the 11.2.0.3 software) has been removed from the host, now that the database is set to level and working as 11.2.0.4.

    I wonder if somewhere in the OEM software, there is always a pointer to the old ORACLE_HOME?  I can't find anything in the .bashrc or other shell scripts that are executed when a Shell session on the host computer which were still the reference to the old directory of 11gDB_R2 so I'm a bit puzzled.

    I have 8 guests, and all have been improved in the same way at 11.2.0.4.  For some databases, the OEM window run SQL is executing the SQL code.

    Someone has some ideas on this?

    Go to the Configuration of the analysis of the database (when you set the password) and update of the Oracle home.   Also do this for all targets listener on this host as well.

  • How to select multiple layers in photoshop via a script

    Is there a way to select multiple Photoshop layers via a script without using the listener script? I am

    looking everywhere in the API, but I'm not able to find anything. Maybe im just not true, please help!

    Select more than one layer requires the action handler code. the DOM can not do and is slower anyway. If you use scriptlistener works, here's what you should go with.

Maybe you are looking for

  • Can you get the screen is on-air on the classic to display on a second screen?

    OK long shot and I think that I I already know the answer is no, but here's what I want to do: I will be installing an iPod interface to my OEM car stereo, with control of load and playback via the car stereo/CD changer port. -No info on track return

  • iPad 2 with wifi

    Currently, the sound on my iPad2 does more when I watch any kind of video, still works but when I FaceTime or listen to music. Anyone know what is happening with it?

  • Series 500-700z HP Envy: AMD Stream Quick license missing information

    Hello Monday or Tuesday, I installed the first major upgrade for Windows 10 - now version 1150.  After downloading and installing, whenever I start my computer, I get the same error message. Quickflow AMD error: license information for using this sof

  • iMessage activation - it generates SMS to00447786205094

    Hello While the national roaming in Delhi, India, I was accused cool SMS for SMS sent to 00447786205094.  To the best of my knowledge, I had not sent SMS to the number. When I checked with my Airtel service provider, they responded to me with the mes

  • Limit of 4 GB of RAM in the test memory on the Satellite A100

    HelloI just installed 4 GB of ram. The BIOS (update) shoes 4gigs in bios setting, but the memory test will pass to 3071 MBI checked the single two Rams - the check goes to the 2 GB all in both cases... So where is the 1 GB of ram spent?Toshiba SAIS,