Running all *.sql files in one go

Hi All,
Can anyone help me in running all *.sql files in specific folder in one go??

Go to Form Edit mode, enter the Fields list, press Ctrl+A, then Delete.

Similar Messages

  • Sqlplus script to run all *.sql files returned by snv diff --summarize

    Hi,
    Is there a way to write a sqlplus script which will ask for a directory (or input from an svn diff --summarize) as in input param , then loop recursively through all files returned and run them from within as: @filename.sql ?
    Getting it to work with svn diff would be the icing on the cake.
    Thanks,
    JGP

    Or maybe like this:
    REM Script name: deploy_all.cmd
    REM Parameter 1: Schema name
    @echo off
    set schema=%1
    echo -- Scripts to execute:
    echo set define ~
    echo def target_schema_name=~1
    echo alter session set current_schema=~~target_schema_name;
    for /F "tokens=1* " %%g in ('svn diff -r 14830:head --summarize') do (
      for /F "tokens=1* delims=. " %%k in ("%%h") do (if [%%l] equ [sql] echo @%%k.%%l)
    ) >deploy_all.sql
    type deploy_all.sql
    sqlplus usrid/pw @deploy_all.sql %schema%PS: Even to execute everything from SQLPLUS, you still would need to create a temporary file with the list of commands.
    Something like this:
    alter session set current_schema=&&target_schema_name;
    host "Windoze script w/command to create list of files to execute"
    @created_sql_file.sql

  • Bat file execute all *.sql files in a folder

    Hi all,
    How to write a *.bat file to execute all *.sql files in a folder?
    Because have about 20 *.sql file in a folder. There are used to fix data in my database. The number of *.sql file increases day by day. So I want to write a *.bat file to execute all *.sql file in the folder. Since I just run this *.bat file.
    Mai Thanh Hải.

    user545846 wrote:
    Hi
    I have done this many times. can guide you. :)And did it fail to work all the times you tried it?
    c:\>type test1.sql
    select 1 from dual;
    exit
    c:\>type test2.sql
    select 2 from dual;
    exit
    c:\>sqlplus scott/tiger@testdb @c:\test*.sql
    SQL*Plus: Release 10.2.0.3.0 - Production on Thu Aug 6 12:37:04 2009
    Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SP2-0556: Invalid file name.
    SQL> exit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining optionsWildcards in SQL*Plus filenames don't work. So why do you suggest that?
    Better is to use the DOS command FOR...
    c:\>for %i in (test*.sql) do sqlplus scott/tiger@testdb @%i
    c:\>sqlplus scott/tiger@testdb @test1.sql
    SQL*Plus: Release 10.2.0.3.0 - Production on Thu Aug 6 12:38:06 2009
    Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
             1
             1
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    c:\>sqlplus scott/tiger@testdb @test2.sql
    SQL*Plus: Release 10.2.0.3.0 - Production on Thu Aug 6 12:38:06 2009
    Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
             2
             2
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    c:\>... although even better would be to proceduralise the SQL into packages/procedures on the database and have just a single procedure call do all the work.

  • Is possible search all the files in one folder and get list all with the same extension.??

    Hi,
    I would like to get, if it is possible, do searching in one determinate folder and get all the files with the same extension, For example, Give the *.pou and get all the files on one list of the files in this folder and sub-folders...
    If it is possible i would like to see any example.
    Thanks a lot, Fonsi.

    Hi Dennis,
    I got your advise, I download the openG (i had problems, and downloading directly and install one to one).
    Ok, i got but i have one problem, which i can't solve. I entry the promt  to search and put the directory to save, later i push 'Do it' and it search the files, show the paths and number, then save in the folder and finally show the window , all ok!.
    The problem is with the target path, when i want use the browse, it doesnt run properly. I want select one carpet, and it demands one file, i dont understand why??, i changed the options browse but it didnt work. Also i would like when i put one path if folder doesnt exist, directly create it and save the files, if exist copy it.
    Thanks for all!. I attached the file in lv 7.1
    Attachments:
    buscar3.vi ‏50 KB
    capture.GIF ‏48 KB

  • How do I move all my files from one User Profile (account) into another? I needed to create a new account and want all of my files accessible in the new one.

    How do I move all my files from one User Profile (account) into another?
    I needed to create a new account and want all of my files accessible in the new one.

    ok, what you're learning right now is 101 unix, which is good. Unix is a good thing
    now: the way unix works, and macos (which uses unix underneath) the files and folders work like a hierarchy.
    the start of that tree is /
    so, if you were to do:
    cd /
    (cd means change directory)
    it will bring you at the highest branch of the file system.
    cd /Users
    will bring you to where all the users are.
    to see whats in /Users you can use your friend ls command
    ls means list files/directories
    so:
    cd /Users
    ls -la
    (the -la here means show all (even hidden) and long format (very verbose))  this flag is very optional.
    you will see
    fred
    user2
    for example.
    if you want to see the desktop of user2 you would change directory to it then list the files.
    for example:
    cd /Users/user2/Desktop
    Note that the files and directory are case sensitive, so, desktop is NOT the same as Desktop, or DESKTOP
    ls -la
    you should then be able to see everything in users2 desktop
    you could have done as well the same thing in smaller steps, for example:
    cd /
    cd Users
    cd user2
    cd Desktop
    this is the equivalent of cd /Users/user2/Desktop
    So, for your file, i don't know where it was, but know that if you log in as user2, it will directly put you in
    /Users/user2
    which most likely the file you had created from the other user was in /Users/user1
    if you copied all the files from /Users/original_user to /Users/secondUser
    most likely yes, all your mail, bookmarks etc would be copied over.
    so in your case.
    sudo chown -R seconduser:staff /Users/secondUser
    should work
    Remember that if you start a path with the character /  it means start from the root of the file system, at the highest top you can ever get.
    so
    cd /Users/fred
    is not the same as
    cd Users/fred
    unless you were in / already
    i know it may be confusing at first but it's actually very logical if you play with it.
    to simplify, think of it that / means C:\  on windows
    you can't go any higher than C:\  (in a way)
    if you're unsure which directory you're currently in, you can always type:
    pwd
    it will tell you where you are.
    for example:
    cd /
    pwd
    this shows  /
    cd Users
    pwd
    this now shows /Users
    cd /System/Library
    pwd will show /System/Library
    cd /
    cd /Users
    cd fred
    cd Library
    pwd will show /Users/fred/Library
    unix can look very scary but it's actually vital and very necessary to do tasks sometimes that would take for ever to do via the windows. This is good learning.
    so for the myfile you had created, i can't tell you where it is, at the time you created, if you can do a pwd command you'll know the path,
    ls -la  (this shows all the files where you are)
    if you see myfile in the list
    do a pwd
    whatever is return, the real location of the file would be:
    whatever pwd returned / myfile
    I hope that makes sense.

  • Oracle 9i export error after running catexp.sql file

    After running catexp.sql file in oracle 9i 9.2.0.7.0 as system user,it gives the following error while logging
    ORA-04020: deadlock detected while trying to lock object SYS.DBMS_STANDARD
    please help me..............

    "catexp.sql" is to be run by SYS AS SYSDBA.
    You'd have to cleanup any extra objects that you created in the SYSTEM account.
    Why did you think that you needed to run "catexp.sql" ? Are you exporting using 9i exp against a 10g database or against a 9i database ?

  • How to run the .sql file in sql prompt?

    i want to run the .sql file in sql prompt

    Hi,
    You can navigate to the directory where the .sql files is stored and launch the SQL Prompt.
    After you login, you can run your script like this :
    SQL>@my_script.sql;
    Regards,
    Sandeep

  • TS1315 when trying to download photos  from my digital cameras I keep getting the message that pics can't be downloaded because of an unrecognizable format. It shows that they are all jpeg files. One camera is a Canon, the other a Panasonic.

    when trying to download photos  from my digital cameras I keep getting the message that pics can't be downloaded because of an "unrecognizable format". It shows that they are all jpeg files. One camera is a Canon, the other a Panasonic. I have had these cameras for a few years and have never had a problem downloading.

    I am having the same problem which has happened very infrequently before. Generally it's one photo and happened when my battery died.
    However today I tried to download six photos.
    None would download including several others for a total of 21 that would not download.
    Since I had just installed a new powered hub and added three new external 4T hard drives, I got concerned that it was the hub. Then got really worried that I'd have problems with the data I have been backing up.
    However following this sequence of events, I've determined it's not the hub, but still don't know what is causing the problem.
    (1) Put a fresh battery in the camera - same results
    (1.5) Used a different port in the new hub - same results
    (2) Put the card in the card slot in the back of my iMac - no problems except that one image I knew about last week. The six new images imported.
    (3) Tried again using the cable - still same error
    (4) Changed cables - my husband has the same camera - still same error
    (4) Put the card in his camera with his cable - still same error
    (5) Put the card in a card reader and used the same slot in the new hub - no problems - same one wouldn't import but message that there are no new photos to import.
    (6) Moved the offending one image to the Trash while the card was in the card reader
    (7) Put the card back into my camera and used my cable. iPhoto had no error and displayed the message there are no new photos.
    Conclusion:
    Not the camera
    Not the cable
    Not the hub
    Must remove bad photo from the card
    However, I have not had to do that before. I went through several imports on vacation when there was one bad image and just ignored it each time.
    Any idea why this is happening now?
    Thank you

  • Java API for running entire ".sql" files on a remote DB ( mySQL or Oracle)?

    Hi,
    Would anyone happen to know if there's a java API for executing entire ".sql" files (containing several different SQL commands), on a remote database server ?
    It's enough if the API works with MySQL and/or Oracle.
    Just to demonstrate what i'm looking for:
    Suppose you've created sql file "c:/test.sql" with several script lines:
    -- test.sql:
    insert into TABLE1 values(3,3);
    insert into TABLE1 values(5,5);
    create table TABLE2 (name VARCHER) ENGINE innoDB; -- MYSQL specific
    Then the java API should look something like:
    // Dummy java code:
    String driver="com.mysql.jdbc.Driver";
    String url= "jdbc:mysql://localhost:3306/myDb";
    SomeAPI.executeScriptFile( "c:/test.sql", driver, url);
    Thanks.

    No such a API, but it's easy to parse all sqls in a file, then run those command:
    For instance:
    import java.sql.*;
    import java.util.Properties;
    /* A demo show how to load some sql statements. */
    public class testSQL {
    private final static Object[] getSQLStatements(java.util.Vector v) {
    Object[] statements = new Object[v.size()];
    Object temp;
    for (int i = 0; i < v.size(); i++) {
    temp = v.elementAt(i);
    if (temp instanceof java.util.Vector)
    statements[i] = getSQLStatements( (java.util.Vector) temp);
    else
    statements[i] = temp;
    return statements;
    public final static Object[] getSQLStatements(String sqlFile) throws java.
    io.IOException {
    java.util.Vector v = new java.util.Vector(1000);
    try {
    java.io.BufferedReader br = new java.io.BufferedReader(new java.io.
    FileReader(sqlFile));
    java.util.Vector batchs = new java.util.Vector(10);
    String temp;
    while ( (temp = br.readLine()) != null) {
    temp = temp.trim();
    if (temp.length() == 0)
    continue;
    switch (temp.charAt(0)) {
    case '*':
    case '"':
    case '\'':
    // System.out.println(temp);
    break; //Ignore any line which begin with the above character
    case '#': //Used to begin a new sql statement
    if (batchs.size() > 0) {
    v.addElement(getSQLStatements(batchs));
    batchs.removeAllElements();
    break;
    case 'S':
    case 's':
    case '?':
    if (batchs.size() > 0) {
    v.addElement(getSQLStatements(batchs));
    batchs.removeAllElements();
    v.addElement(temp);
    break;
    case '!': //Use it to get a large number of simple update statements
    if (batchs.size() > 0) {
    v.addElement(getSQLStatements(batchs));
    batchs.removeAllElements();
    String part1 = temp.substring(1);
    String part2 = br.readLine();
    for (int i = -2890; i < 1388; i += 39)
    batchs.addElement(part1 + i + part2);
    for (int i = 1890; i < 2388; i += 53) {
    batchs.addElement(part1 + i + part2);
    batchs.addElement(part1 + i + part2);
    for (int i = 4320; i > 4268; i--) {
    batchs.addElement(part1 + i + part2);
    batchs.addElement(part1 + i + part2);
    for (int i = 9389; i > 7388; i -= 83)
    batchs.addElement(part1 + i + part2);
    v.addElement(getSQLStatements(batchs));
    batchs.removeAllElements();
    break;
    default:
    batchs.addElement(temp);
    break;
    if (batchs.size() > 0) {
    v.addElement(getSQLStatements(batchs));
    batchs.removeAllElements();
    br.close();
    br = null;
    catch (java.io.FileNotFoundException fnfe) {
    v.addElement(sqlFile); //sqlFile is a sql command, not a file Name
    Object[] statements = new Object[v.size()];
    for (int i = 0; i < v.size(); i++)
    statements[i] = v.elementAt(i);
    return statements;
    public static void main(String argv[]) {
    try {
    String url;
    Object[] statements;
    switch (argv.length) {
    case 0: //Use it for the simplest test
    case 1:
    url = "jdbc:dbf:/.";
    if (argv.length == 0) {
    statements = new String[1];
    statements[0] = "select * from test";
    else
    statements = argv;
    break;
    case 2:
    url = argv[0];
    statements = getSQLStatements(argv[1]);
    break;
    default:
    throw new Exception(
    "Syntax Error: java testSQL url sqlfile");
    Class.forName("com.hxtt.sql.dbf.DBFDriver").newInstance();
    //Please see Connecting to the Database section of Chapter 2. Installation in Development Document
    Properties properties = new Properties();
    Connection con = DriverManager.getConnection(url, properties);
    Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
    ResultSet.CONCUR_READ_ONLY);
    //Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
    // stmt.setMaxRows(0);
    stmt.setFetchSize(10);
    final boolean serializeFlag = false;//A test switch to serialize/deserialize the resultSet
    ResultSet rs;
    for (int i = 0; i < statements.length; i++) {
    if (statements[i] instanceof java.lang.String) {
    String temp = (java.lang.String) statements;
    switch (temp.charAt(0)) {
    case 'S':
    case 's':
    case '?':
    System.out.println(temp);
    rs = stmt.executeQuery(temp);
    if (serializeFlag) {
    // serialize the resultSet
    try {
    java.io.FileOutputStream fileOutputStream = new
    java.io.FileOutputStream("testrs.tmp");
    java.io.ObjectOutputStream
    objectOutputStream = new java.io.
    ObjectOutputStream(fileOutputStream);
    objectOutputStream.writeObject(rs);
    objectOutputStream.flush();
    objectOutputStream.close();
    fileOutputStream.close();
    catch (Exception e) {
    System.out.println(e);
    e.printStackTrace();
    System.exit(1);
    rs.close(); //Let the CONCUR_UPDATABLE resultSet release its open files at once.
    rs = null;
    // deserialize the resultSet
    try {
    java.io.FileInputStream fileInputStream = new
    java.io.FileInputStream("testrs.tmp");
    java.io.ObjectInputStream objectInputStream = new
    java.io.ObjectInputStream(
    fileInputStream);
    rs = (ResultSet) objectInputStream.
    readObject();
    objectInputStream.close();
    fileInputStream.close();
    catch (Exception e) {
    System.out.println(e);
    e.printStackTrace();
    System.exit(1);
    ResultSetMetaData resultSetMetaData = rs.
    getMetaData();
    int iNumCols = resultSetMetaData.getColumnCount();
    for (int j = 1; j <= iNumCols; j++) {
    // System.out.println(resultSetMetaData.getColumnName(j));
    /* System.out.println(resultSetMetaData.getColumnType(j));
    System.out.println(resultSetMetaData.getColumnDisplaySize(j));
    System.out.println(resultSetMetaData.getPrecision(j));
    System.out.println(resultSetMetaData.getScale(j));
    System.out.println(resultSetMetaData.
    getColumnLabel(j)
    + " " +
    resultSetMetaData.getColumnTypeName(j));
    Object colval;
    rs.beforeFirst();
    long ncount = 0;
    while (rs.next()) {
    // System.out.print(rs.rowDeleted()+" ");
    ncount++;
    for (int j = 1; j <= iNumCols; j++) {
    colval = rs.getObject(j);
    System.out.print(colval + " ");
    System.out.println();
    rs.close(); //Let the resultSet release its open tables at once.
    rs = null;
    System.out.println(
    "The total row number of resultset: " + ncount);
    System.out.println();
    break;
    default:
    int updateCount = stmt.executeUpdate(temp);
    System.out.println(temp + " : " + updateCount);
    System.out.println();
    else if (statements[i] instanceof java.lang.Object[]) {
    int[] updateCounts;
    Object[] temp = (java.lang.Object[]) statements[i];
    try {
    for (int j = 0; j < temp.length; j++){
    System.out.println( temp[j]);
    stmt.addBatch( (java.lang.String) temp[j]);
    updateCounts = stmt.executeBatch();
    for (int j = 0; j < temp.length; j++)
    System.out.println((j+1)+":"+temp[j]);
    for (int j = 0; j < updateCounts.length; j++)
    System.out.println((j+1)+":" +updateCounts[j]);
    catch (java.sql.BatchUpdateException e) {
    updateCounts = e.getUpdateCounts();
    for (int j = 0; j < updateCounts.length; j++)
    System.out.println((j+1)+":"+updateCounts[j]);
    java.sql.SQLException sqle = e;
    do {
    System.out.println(sqle.getMessage());
    System.out.println("Error Code:" +
    sqle.getErrorCode());
    System.out.println("SQL State:" + sqle.getSQLState());
    sqle.printStackTrace();
    while ( (sqle = sqle.getNextException()) != null);
    catch (java.sql.SQLException sqle) {
    do {
    System.out.println(sqle.getMessage());
    System.out.println("Error Code:" +
    sqle.getErrorCode());
    System.out.println("SQL State:" + sqle.getSQLState());
    sqle.printStackTrace();
    while ( (sqle = sqle.getNextException()) != null);
    stmt.clearBatch();
    System.out.println();
    stmt.close();
    con.close();
    catch (SQLException sqle) {
    do {
    System.out.println(sqle.getMessage());
    System.out.println("Error Code:" + sqle.getErrorCode());
    System.out.println("SQL State:" + sqle.getSQLState());
    sqle.printStackTrace();
    while ( (sqle = sqle.getNextException()) != null);
    catch (Exception e) {
    System.out.println(e.getMessage());
    e.printStackTrace();

  • How to Run a .sql file from simple java class

    How to execute a .sql file consisting of Complex Queries,procedures through simple java class.
    The queries may have different delimiters,queries independant of each other.
    I am able to do with Specific De-limiter.But I need in such a way that there should not be any
    Constraints. Since My .sql may Contain different De-limiters.
    If any one can Suggest Some Solution.
    It will be Great Help.
    regards
    Anil

    Check out ibatis script runner, it' a third party library but quite handy for running sql files...
    m

  • Run Multiple SQL's in one Database and record there counts automatically.

    Hi ,
    I have to run 33 Sql's in three databases seperately and then have to match there counts, manually if i do it takes 3+ hours, is there any way to automate this in Toad i.e all 33 Sql's run in different databases and in the end i get the result count of all of them and then i compare the results.
    The 33 queries are:-
    select count(*),'FND_LOOKUP_VALUES' as TABLE_NAME from FND_LOOKUP_VALUES a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*),'CSF_DEBRIEF_HEADERS' as TABLE_NAME from CSF_DEBRIEF_HEADERS a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*),'CSF_DEBRIEF_LINES' as TABLE_NAME from CSF_DEBRIEF_LINES a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*),'CS_INCIDENTS_AUDIT_B' as TABLE_NAME from CS_INCIDENTS_AUDIT_B a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*),'CS_INCIDENT_LINKS' as TABLE_NAME from CS.CS_INCIDENT_LINKS a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*),'CS_INCIDENT_SEVERITIES_TL' as TABLE_NAME from CS_INCIDENT_SEVERITIES_TL a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*),'CS_INCIDENT_STATUSES_TL' as TABLE_NAME from CS_INCIDENT_STATUSES_TL a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*),'CS_INCIDENT_TYPES_TL' as TABLE_NAME from CS_INCIDENT_TYPES_TL a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*),'CS_INCIDENT_URGENCIES_TL' as TABLE_NAME from CS_INCIDENT_URGENCIES_TL a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*),'CS_INCIDENTS_ALL_B' as TABLE_NAME from CS_INCIDENTS_ALL_B a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*),'CS_HZ_SR_CONTACT_POINTS' as TABLE_NAME from CS_HZ_SR_CONTACT_POINTS a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*),'CS_INCIDENTS_ALL_TL' as TABLE_NAME from CS_INCIDENTS_ALL_TL a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*),'CSI_ITEM_INSTANCES' as TABLE_NAME from CSI_ITEM_INSTANCES a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*),'JTF_RS_GROUPS_B' as TABLE_NAME from JTF_RS_GROUPS_B a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*),'JTF_TASK_REFERENCES_B' as TABLE_NAME from JTF_TASK_REFERENCES_B a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*),'OKC_K_LINES_B' as TABLE_NAME from OKC_K_LINES_B a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*),'OKC_K_ITEMS' as TABLE_NAME from OKC_K_ITEMS a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*),'HZ_RELATIONSHIPS' as TABLE_NAME from HZ_RELATIONSHIPS a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*),'HZ_CONTACT_POINTS' as TABLE_NAME from HZ_CONTACT_POINTS a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*),'HZ_PARTY_SITES' as TABLE_NAME from HZ_PARTY_SITES a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*),'MTL_SYSTEM_ITEMS_TL' as TABLE_NAME from MTL_SYSTEM_ITEMS_TL a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*),'JTF_TASK_ASSIGNMENTS' as TABLE_NAME from JTF_TASK_ASSIGNMENTS a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*),'JTF_TASK_PRIORITIES_TL' as TABLE_NAME from JTF_TASK_PRIORITIES_TL a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*),'JTF_TASK_PRIORITIES_B' as TABLE_NAME from JTF_TASK_PRIORITIES_B a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*),'JTF_TASK_STATUSES_TL' as TABLE_NAME from JTF_TASK_STATUSES_TL a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*),'JTF_TASKS_B' as TABLE_NAME from JTF_TASKS_B a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*),'JTF_OBJECTS_TL' as TABLE_NAME from JTF_OBJECTS_TL a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*),'JTF_TASK_TYPES_TL' as TABLE_NAME from JTF_TASK_TYPES_TL a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*),'JTF_TASK_AUDITS_B' as TABLE_NAME from JTF_TASK_AUDITS_B a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*),'JTF_TASK_ASSIGNMENTS' as TABLE_NAME from JTF_TASK_ASSIGNMENTS a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*),'EMCCS_SRLOG_ADD_AUDIT_COLMS' as TABLE_NAME from EMCCS_SRLOG_ADD_AUDIT_COLMS a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*), 'cs_incident_statuses_b' as TABLE_NAME from cs.cs_incident_statuses_b a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    select count(*), 'jtf_task_statuses_b' as TABLE_NAME from jtf.jtf_task_statuses_b a
    where a.creation_date > to_date('08/06/2010','mm/dd/yyyy')
    and a.creation_date <= to_date('08/07/2010','mm/dd/yyyy');
    Thanks in Advance.

    Hi,
    From TOAD you can connect to three different databases- that is different sessions with different DB's
    make a use of union operator and execute the queries.
    You can see the output in - output window.
    Select the output and right click save to excel sheet.
    Parallely you can run 33 sql in other sessions, do the same process as stated above and save to the same excel sheet but different instance (different sheet of excel)
    Now compare -- its demo for how to utilize the tool.
    Other way around, Create one table with two columns table_name, count.
    execute the select queries with union Operator and directly insert into the table.
    Perform the same above two steps in different databases.
    Now, from one database - create database link to other two dabases and provide select privilege on that table in order to access.
    Now, write a query to compare two tables using dblink.
    HTH
    - Pavan Kumar N
    OCP- Oracle 9i/10g
    http://oracleinternals.blogspot.com

  • Do we need run catbundle.sql file for new databases.

    dear all,
    i have doubt over execution of catbundle.sql or not?
    scenario:
    i have insatlled 10gr2 on rhel5 and applied patchset 4 (10.2.0.5) and applied Oracle® Database Patch 10248542 - 10.2.0.5.2 Patch Set Update
    after this i have create fresh database.
    now,
    in Oracle® Database Patch 10248542 - 10.2.0.5.2 Patch Set Update document it has specified in belwo section
    3.4 Post Installation Instructions for Databases Created or Upgraded after Installation of PSU 10.2.0.5.2 in the Oracle Home
    These instructions are for a database that is created or upgraded after the installation of PSU 10.2.0.5.2.
    You must execute the steps in Section 3.3.2, "Loading Modified SQL Files into the Database" for any new database only if it was created by any of the following methods:
    Using DBCA (Database Configuration Assistant) to select a sample database (General, Data Warehouse, Transaction Processing)
    Using a script that was created by DBCA that creates a database from a sample database
    Cloning a database that was created by either of the two preceding methods, and if the steps in Section 3.3.2, "Loading Modified SQL Files into the Database" were not executed after PSU 10.2.0.5.2 was applied
    Upgraded databases do not require any post-installation steps.
    so do we need to run catbundle here or not.
    since i have created fresh database after applying 10.2.0.5 PSU2 why does it required.
    opatch output:
    [oracle@RG615 ~]$ opatch lsinventory
    Invoking OPatch 10.2.0.5.1
    Oracle Interim Patch Installer version 10.2.0.5.1
    Copyright (c) 2010, Oracle Corporation. All rights reserved.
    Oracle Home : /prd/crm/swbcrmdb/usr/oracle/product/10.2.0/db_1
    Central Inventory : /prd/crm/swbcrmdb/usr/oracle/oraInventory
    from : /etc/oraInst.loc
    OPatch version : 10.2.0.5.1
    OUI version : 10.2.0.5.0
    OUI location : /prd/crm/swbcrmdb/usr/oracle/product/10.2.0/db_1/oui
    Log file location : /prd/crm/swbcrmdb/usr/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2011-05-03_11-41-34AM.log
    Patch history file: /prd/crm/swbcrmdb/usr/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt
    Lsinventory Output file location : /prd/crm/swbcrmdb/usr/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2011-05-03_11-41-34AM.txt
    Installed Top-level Products (2):
    Oracle Database 10g 10.2.0.1.0
    Oracle Database 10g Release 2 Patch Set 4 10.2.0.5.0
    There are 2 products installed in this Oracle Home.
    Interim patches (1) :
    Patch 10248542 : applied on Tue May 03 07:32:29 BST 2011
    Unique Patch ID: 13292123
    Created on 25 Dec 2010, 23:11:24 hrs PST8PDT
    Bugs fixed:
    6402302, 9713537, 8350262, 9949948, 8394351, 10327179, 8546356, 9711859
    9714832, 9952230, 10248542, 8544696, 9963497, 9772888, 8664189, 10249537
    7519406, 9952270, 8277300, 9726739
    OPatch succeeded.

    Pl post the output of view DBA_REGISTRY_HISTORY - see MOS Doc 605795.1 (Introduction To Oracle Database catbundle.sql)
    Was the database created using DBCA or manually using scripts ?
    Srini

  • My time capsule change the time on ALL my files by one hour.

    On the 29th December all the files on my time capsule went out of sync with my mac by one hour. I use it for backup. I have other backups on a Lacie drive and these were all OK but because it went forward in time my syncronise software saw them all as changes and started copying from the time capsule to my iMac. I stopped it and after recovering the damage it had done I proceeded to copy ALL my data back to the time capsule to reset the syncronise error.
    Its been OK since then but this morning it all went wrong again. It started by my backup failing because the network share was not accessable so I went into my backup scripts(chronosync) and reselected the backup drive. I then did a trial sync and lo and behold the whole lot is back out of sync again and this time they have gone back in time.
    Did we enter British summer time in the middle of winter or did the earth tilt on its access and caused the UK to be in The NEtherlands? Or did Apple do something that I cant resolve.
    Anyone else having similar problems? Ive been googling this and thought I had found it by installing Airport Uitlity 5.6 but I cant do that as I have upgraded all my machines to MOuntain Lion and its not compatible. I think on 5.6 you can adjust the time zone setting.
    I need to tell the time capsule which time zone it is in and all shoudl be OK

    Bob
    Thanks for that   - Airport utility 5.6 is now working but I cannot see anything wrong. It possibly went wrong on the 29th December and has just gone back to normal again so I think I will have to let the backup recopy all the files.
    I looked in the logs and found
    No Address for NTP server time.apple.com. and then on Jan 08 at 09:49:38 I got
    Clock synchronized to network time server time.apple.com (adjusted +3597 seconds). (thats my hour!!!)
    Question no is why - could be a DNS problem but why on the 29th and back on the 8th Jan.
    Nothing changed in my network router, maybe something at the ISP.
    Anyway now copying all the data back to the time capsule.
    By the way I have my DNS as my router 192.168.1.1 and 208.67.222.222 - when I look at my router the DNS is 8.8.8.8 and 4.4.4.4 which is what my ISP told me to use. Maybe I should put 8.8.8.8 and 4.4.4.4 in the DNS for the time capsule?

  • Run a sql file from java

    I have a SQL file named myfile.sql which contains something as follows:-Declare
    Begin
    insert into alphaweb values (1);
    end;
    .What I am looking for is a way to execute this through a java code. e.g. something like reading the String from the the file and executing it.
    public static boolean executeScript(File script, Connection conn) {
              boolean success = true;
              success = script.exists();
              if (success) {
                   System.out.println("ES::READING SCRIPT:" + script.getAbsolutePath());
                   StringBuffer buffer = null;
                   try {
                        buffer = readFileAsString("myfile.sql");
                   } catch (IOException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                   }//new StringBuffer();
                   //success = readScript(script, buffer);
                   if (null!=buffer) {
                        try {
                             String creationScript = buffer.toString();
                             Statement st = conn.createStatement();
                             int start = 0;
                             int end = 0;
                             while (end != -1 && start < creationScript.length()) {
                                  end = creationScript.lastIndexOf ('/');
                                  if (end != -1) {
                                       System.out.println(creationScript.substring(start, end));
                                       st.executeUpdate(creationScript.substring(start, end));
                                       start = end + 2; // 2 is the length of "GO"
                             st.close();
                        } catch (Exception e) {
                             success = false;
                             System.out.println(e);
              } else {
                   System.out.println("ES::SCRIPT FILE DOES NOT EXISTS");
                   success = false;
              return success;
         }But it is failing any ideas if it is possible and what am I doing wrong?

    I believe the sample that you provided only has a single statement in it.
    Do the files only contain one block like that?
    If yes then you should be able to process them as a single statement. Just drop the terminator at the end (maybe wrap it in another block statement...)
    If not then your solutions are.
    1. Parse the file yourself.
    2. Use the oracle command line tool and feed it to that.

  • How do I transfer all old files from one Motorola Droid 2 to a replacement?

    My Motorola Droid 2 is being replaced (this will be my 4th one in one year)  and I have information I cannot lose on the original one. Some of it is on the SD card which the new phone will not see, except for the photos.  But some of it is in the old phone's memory & I don't know how to move files from there or which files to move & which to leave,  Can someone help, please?  I have to send the old one back right away.  
    P.
    <Duplicate post closed for crossposting per the Verizon Wireless Terms of Service.  See I need to transfer all old files to my replacement phone.for any replies.>
    Message was edited by: Verizon Moderator

    hello Lawrence1559, firefox does save all your bookmarks, settings and customizations into the so called [[Profiles - Where Firefox stores your bookmarks, passwords and other user data|profile folder]] .
    <br>you can copy the whole profile folder on your win xp computer like this:
    * press the windows-key+R and open: ''%appdata%\''
    * a windows explorer windows will open up with a folder named ''Mozilla'' in it - right-click and copy that folder and paste it onto a usb drive or any other way you can transfer it to your new computer.
    * on the windows 7 pc, repeat the windows-key+R shortcut and open: ''%appdata%\'' again.
    *copy the Mozilla folder from your backup into the %appdata% folder of your new pc.
    *you can now download and install firefox from getfirefox.com and should have the exact same setup as on your prior pc afterwards.

Maybe you are looking for