What is dbowner.sql file?

what is dbowner.sql file?

I saw your another question too...What is your db? There is some slight difference between oracle and sql server installations. based on that your database rights have to be granted. dbowner creates the db only.

Similar Messages

  • Error after executing dbowner.sql file

    I'm installing People Soft and I'm on the step for executing sql files
    I'm trying to execute dbowner.sql that is content of it
    set echo on
    spool dbowner.log
    GRANT DBA TO PS IDENTIFIED BY PS;
    CONNECT PS/PS;
    CREATE TABLE PSDBOWNER (DBNAME VARCHAR2(8) NOT NULL, OWNERID VARCHAR2(8) NOT NULL ) TABLESPACE PSDEFAULT;
    CREATE UNIQUE INDEX PS_PSDBOWNER ON PSDBOWNER (DBNAME) TABLESPACE PSDEFAULT;
    CREATE PUBLIC SYNONYM PSDBOWNER FOR PSDBOWNER;
    CONNECT system/manager;
    REVOKE DBA FROM PS;
    ALTER USER PS QUOTA UNLIMITED ON PSDEFAULT;
    spool off
    after execution i received this
    SQL>
    SQL> GRANT DBA TO PS IDENTIFIED BY PS;
    Grant succeeded.
    SQL> CONNECT PS/PS;
    Error accessing PRODUCT_USER_PROFILE
    Warning: Product user profile information not loaded!
    You may need to run PUPBLD.SQL as SYSTEM
    Connected.
    SQL> CREATE TABLE PSDBOWNER (DBNAME VARCHAR2(8) NOT NULL, OWNERID VARCHAR2(8) NOT NULL ) TABLESPACE PSDEFAULT;
    Table created.
    SQL> CREATE UNIQUE INDEX PS_PSDBOWNER ON PSDBOWNER (DBNAME) TABLESPACE PSDEFAULT;
    Index created.
    SQL> CREATE PUBLIC SYNONYM PSDBOWNER FOR PSDBOWNER;
    Synonym created.
    SQL> CONNECT system/manager;
    Connected.
    SQL> REVOKE DBA FROM PS;
    Revoke succeeded.
    SQL> ALTER USER PS QUOTA UNLIMITED ON PSDEFAULT;
    User altered.
    SQL>
    SQL> spool off
    could you help me?
    If you need more info write me

    >
    SQL> CONNECT PS/PS;
    Error accessing PRODUCT_USER_PROFILE
    Warning: Product user profile information not loaded!
    You may need to run PUPBLD.SQL as SYSTEM
    >
    script PUPBLD.SQL runs from psadmin.sql, but this is run after the dbowner.sql
    +@%ORACLE_HOME%\sqlplus\admin\pupbld+
    You can try running this script (PUPBLD.SQL) manually, but I never saw this going wrong. Something has gone wrong, which will most likely give more errors later on.
    Did you run the scripts in the correct order with the correct user:
    createdb10.sql - as sysdba
    utlspace.sql - as sysdba
    dbowner.sql - as sysdba
    XXddl.sql - as sysdba
    psroles.sql - as system
    psadmin.sql - as system
    connect.sql - as system
    Regards,
    Hakan
    Added psroles.sql thanks to bandar
    Edited by: Hakan Biroglu on Aug 21, 2012 8:26 AM

  • Andrew - one more doubt in the donsample.sql file,it is urgent

    Andrew,
    I believe you can answer this ,i hope i am not trying too much on your patience.Thanks .I am connected to the oracle server.In that i execute a procedure which i believe is executing on the oracle server.i supply arguments to it .The arguement is a file on my local directory .The error code follows:-
    I have problem running a oracle procedure which uses a xml parser built on java libraries.When i executed this procedure the following error came:-
    SQL> execute domsample('\oraclexdk\xdk\demo\plsql\parser','family.xml','error.txt');
    BEGIN domsample('\oraclexdk\xdk\demo\plsql\parser','family.xml','error.txt'); END;
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.SecurityException: relative pathnames are not
    allowed(\oraclexdk\xdk\demo\plsql\parser)
    ORA-06512: at "SYS.XMLPARSERCOVER", line 0
    ORA-06512: at "SYS.XMLPARSER", line 144
    ORA-06512: at "IWADM.DOMSAMPLE", line 77
    ORA-06512: at line 1
    Do you know something about this .ie. classpath variables or something like that.if you want the domsample arguement syntax for further clarifications ,i am enclosing this in the following lines.The setbasedir(p,dir) prompts for a parser object and a complete directory path.what i give here is the path on my local directory and i think this creates the error.
    How do i rectify this error.is it on my(client) side or the server side.If it on the oracle server side or my side can you tell me what went wrong.The parser and the dom package everything else is working fine.It is really urgent ,andrew.This is holding up all the work.The arguement syntax help says on 'dir' that this is a pointer to external file system .I have a confusion that whether this refers to external file system of the server or the client.if so form the server how to route it to the client directory or should i have a space on the server, upload this file and execute the domsample.sql file.Can you clear this concept for me.
    'dir' - must point to a valid directory on the external file system
    and should be specified as a complete path name
    'inpfile' - must point to the file located under 'dir', containing the
    XML document to be parsed
    'errfile' - must point to a file you wish to use to record errors; this
    file will be created under 'dir'
    I know i might be bugging you ,but your answers are really great.Thanks.
    regards
    gopal

    I seem to have this error with both windows and unix directory space.Please help me with debugging this .I am really struck with it.The error occurs at the same line when executed with the file on the unix server.
    SQL> execute domsample('/user/sb8066/','family.xml','error.txt');
    BEGIN domsample('/user/sb8066/','family.xml','error.txt'); END;
    ERROR at line 1:
    ORA-20100: Error occurred while parsing: Permission denied
    ORA-06512: at "SYS.XMLPARSER", line 22
    ORA-06512: at "SYS.XMLPARSER", line 69
    ORA-06512: at "IWADM.DOMSAMPLE", line 63
    ORA-06512: at line 1
    I won't clutter the forum.just to get your attention,i hope you can help me solving this problem,please can you see this thread,because in future i will be using this only to contact you.Thanks for the continued help.The windows space idea was not used.Many configurations had to be changed.Can you note what is peculiar at line 22 ,line 69.line 63 of domsample reads is just an 'end-if';I will expecting your answer as soon as possible.
    regards
    gopal

  • Error while executing the .sql file

    Hello,
    Every time when i execute the below plsql it's keep throwing the error message as show in below output, this happens even when i manually create the trigger before executing the .sql file of all the below statements, can you please correct me what i am doing wrong here. Thank you.
    DROP TABLE FCSDWH.REF_DATA_MASTER;
    CREATE TABLE FCSDWH.REF_DATA_MASTER
    REF_DATA_MASTER_ID                      NUMBER PRIMARY KEY,
    DESCRIPTION                                     VARCHAR2(255 CHAR),
    CREATE_ID                                       VARCHAR2(10 CHAR),
    CREATE_DT                                       DATE,
    LST_UPD_ID                                      VARCHAR2(10 CHAR),
    LST_UPD_DT                                      DATE,
    ACT_STRT_DT                                     DATE,
    ACT_END_DT                                      DATE
    TABLESPACE FCSDWH
    STORAGE(INITIAL 50K);
    DROP SEQUENCE FCSDWH.REF_DATA_MASTER_SEQ;
    CREATE SEQUENCE FCSDWH.REF_DATA_MASTER_SEQ START WITH 1 INCREMENT BY 1;
    DROP TRIGGER "FCSDWH.REF_DATA_MASTER_TRG";
    CREATE OR REPLACE TRIGGER FCSDWH.REF_DATA_MASTER_TRG
    BEFORE INSERT ON FCSDWH.REF_DATA_MASTER
    FOR EACH ROW
    BEGIN
    SELECT FCSDWH.REF_DATA_MASTER_SEQ.NEXTVAL INTO :NEW.REF_DATA_MASTER_ID FROM DUAL;
    END;
    /Output:
    SQL> @/home/smadala/REF_DATA_MASTER.SQL
    Table dropped.
    Table created.
    Sequence dropped.
    Sequence created.
    DROP TRIGGER "FCSDWH.REF_DATA_MASTER_TRG"
    ERROR at line 1:
    ORA-04080: trigger 'FCSDWH.REF_DATA_MASTER_TRG' does not exist
    Trigger created.
    SQL>

    The trigger is "attached" to the table so when you drop the table the trigger goes as well.
    John

  • Generating a SQL file from DB

    Hi,
    Fairly new to Oracle, after manually creating my tables in Oracle, how can i generate an SQL file that could be used in loading another DB (like MS-SQL Server does).
    Also if anyone can walk me thru geting SQL Plus 8.0 i have the username, password, but could not figure out what the Host String is.

    Folashade,
    You can use SQL*LOADER to load a delimited file into Oracle database. For more info on SQL*LOADER, please refer to SQL*LOADER manual which is posted online on this site.
    For the second question, you need to look in your tnsnames.ora file to see what the host string is. What tool did you use to create your tnsnames.ora file?
    A typical tnsnames.ora file looks as follows:
    host_string.WORLD =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = xxx.x.xxx.xx)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = db_name)
    Here in this example, your host string is host_string.
    Regards,
    John

  • 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();

  • Shell script for calling an sql file

    Hello, I would need your help in creating a ksh file. We have two ksh files. One for deletion the eim table and the other one is for running the eim job.
    Ksh file for running the eim job is okay. But the ksh file running the delete sql is not. We were thinking that we may have some sort of mistake in the syntax could have caused the problem we experiencing now. Need your expertise to check it. Please?
    Here’s the syntax we have.
    #!/bin/sh
    sqlplus -s <user>/<pwd>@dbname << EOF
    @<folder-path>/sqlrun.sql
    EXIT
    ENDSQL
    EXIT
    When we run it against putty, nothing seems to happen as in no error message appears at all. It prove that the sql file did not execute in TOAD.
    We tried the other way around, by putting the /dev/nu// as show below.
    sqlplus -s <user>/<password>@DBNAME > /dev/null <<ENDOFSQL
    still nothing happen.
    Regards

    user10070712 wrote:
    Hello, I would need your help in creating a ksh file. We have two ksh files. One for deletion the eim table and the other one is for running the eim job.
    Ksh file for running the eim job is okay. But the ksh file running the delete sql is not. We were thinking that we may have some sort of mistake in the syntax could have caused the problem we experiencing now. Need your expertise to check it. Please?What does this have to do with APEX, which is the topic of this forum?
    What is "eim"? Why have you chosen to post this here?

  • How to execute a  .sql file from a batch file

    Hi all
    I've to take backup of a database weekly twice on every wednesday & Friday @ 5pm IST. I've written a hot backup script, which works every well.
    now i want to automate the script. ie i want this script to run on wednesday & friday @ 5pm without any human interfearance ie with out actually any1 executing this script.
    i created a batch file prod.bak with the following lines
    @echo off
    set oracle_sid=testdb
    set oracle_home=d:\oracle\ora92
    sqlplus /nolog
    connect sys as sysdba/oracletest@testdb
    this batch file when eexecuted connects me to sql prompt.
    Now i want to execute my backup script bkp.sql automatically when it is connected to sql prompt.
    (i tried with these lines in the above batch file...
    call bkp.sql---it just opens the bkp.sql file in notepad & displays the script
    start bkp.sql---same as call
    connect / as sysdba/pwd@[email protected] --- does not work simply remains a the sql prompt.
    At 17:00 /Every:w,f "d:\bkp.sql"---does not work simply remains at the sql promt.)
    Can any1 let me know what should i write in the batch file that will execute the bkp.sql file automatically after it gets connected to sql prompt. M using oracle 9i.
    I'll manage he time through windows utility of scheduling task.. Let me know how to execute the .sql file from a batch file.
    Thanks
    Tripti

    Try
    sqlplus "sys/oracletest as sysdba" @bpk.sql
    Working locally, and having set the ORACLE_SID, you don't need to specify the SqlNet alias (@testdb).
    Remember to put an exit at the end of the bpk.sql script.

  • How to execute .sql file in Stored Procedure?

    Hi,
    I have an urgent requirement, where i have to execute .sql file form Stored Procedure.
    This .sql file will have set of update statement. I need to pass value to this update statement.
    Kindly please help me.
    Regards,
    Irfan

    This is required as part of Data Migration where  i have to do 100 of table's update. Each time update table will defer, so its better to have in separate script file (.sql). Can u paste some sample/syntax to exceute .sql file from stored procedure. I am new to this PL/SQL.
    How have you determined that it's "better" to have seperate scripts?  I assume you mean the table name will "differ" (and not "defer" - I assume that's just because English isn't your first language? no problem - I think I understand what you're asking).
    So what I think you're asking is that you have dynamic table names but each table needs to be updated in the same way?
    Question: Why do you have tables with different names that all need the same process doing to them?
    Assuming it's a valid requirement (and 99% of the time doing dynamic coding implies it's not).... you could use dynamic code, rather than 'scripts'...
    e.g.
    create procedure update_table(tbl_name varchar2) is
    begin
      execute immediate 'update '||tbl_name||' set lastupdate = null';
    end;
    As you haven't bothered to provide a database version, any example code/data or explanation of what you're actually doing, you're not going to get any detailed answer.  Please do take the time to read the FAQ and post appropriate details so people can help you.

  • SQL file will not open in SSMS on double-click (or jump list)

    Hello, all.
    I am running SQL Server Management Studio 2008 on a Windows 7 Enterprise machine here at work.  I am not sure when this started happening, but now, for some reason, when I double-click on a SQL file in Explorer, or from the jump list for SSMS (which
    I have pinned to my Windows 7 task bar), SSMS will open, but will not load the file in question, nor will it bring up a logon screen to connect to a DB.  I tried unassociating the .SQL extension and then re-associating it using "Open With" and it worked
    the first time (from the Open With), but then immediately reverted back to its old behavior.  Very annoying.
    For now I just open SSMS first (which pops up a logon screen and things proceed normally), but that kind of defeats the purpose of having a jump list or a file association.  Has anybody run into this before and can anybody suggest a fix or what's
    wrong?
    Thanks in advance for any wisdom anyone can provide. 

    Hi Mike,
    I can provide solution if you can tell me the registry value(HKEY_CLASSES_ROOT\sqlwb.sql.9.0\Shell\Open\Command). I believe there is an extra %1 which is causing this.
    Balmukund Lakhani | Please mark solved if I've answered your question, vote for it as helpful to help other user's find a solution quicker
    This posting is provided "AS IS" with no warranties, and confers no rights.
    My Blog: http://blogs.msdn.com/blakhani
    Team Blog: http://blogs.msdn.com/sqlserverfaq
    Let me see if I can get my IT guys to temporarily grant me registry access.  As I said above, it's locked down, but maybe if I ask
    reeeeally nicely :-)  I will keep you posted.  Thanks!
    EDIT: The IT gods have smiled on me.  The value for the key above is "C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\ssms.exe" /dde
    Not sure if that helps, but there you go.  Thanks! 
    Mike Loux
    Certified Practicing Geek
    mike dot loux at gmail dot com
    Replying to myself in case in-place edits don't trigger a "somebody updated this thread" email.  :-)
    Mike Loux
    Certified Practicing Geek
    mike dot loux at gmail dot com
    Hey Mike,
    Actually edit didnot trigger the email :)
    Change that to
    "C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\ssms.exe" %1 /dde
    (add %1 and that should fix this forever)
    Balmukund Lakhani | Please mark solved if I've answered your question, vote for it as helpful to help other user's find a solution quicker
    This posting is provided "AS IS" with no warranties, and confers no rights.
    My Blog: http://blogs.msdn.com/blakhani
    Team Blog: http://blogs.msdn.com/sqlserverfaq

  • Help with creating a sql file that will capture any database table changes.

    We are in the process of creating DROP/Create tables, and using exp/imp data into the tables (the data is in flat files).
    Our client is bit curious to work with. They do the alterations to their database (change the layout, change the datatype, drops tables) without our knowing. This has created a hell lot of issues with us.
    Is there a way that we can create a sql script which can capture any table changes on the database, so that when the client trys to execute imp batch file, the sql file should first check to see if any changes are made. If made, then it should stop execution and give an error message.
    Any help/suggestions would be highly appreciable.
    Thanks,

    Just to clarify...
    1. DDL commands are like CREATE, DROP, ALTER. (These are different than DML commands - INSERT, UPDATE, DELETE).
    2. The DDL trigger is created at the database level, not on each table. You only need one DDL trigger.
    3. You can choose the DDL commands for which you want the trigger to fire (probably, you'll want CREATE, DROP, ALTER, at a minimum).
    4. The DDL trigger only fires when one of these DDL commands is run.
    Whether you have 50 tables or 50,000 tables is not significant to performance in this context.
    What's signficant is how often you'll be executing the DDL commands on which the trigger is set to fire and whether the DDL commands execute in acceptable time with the trigger in place.

  • Running .sql file or insert statements

    I have a large .sql file compiled from SQL developer from a SQL Server database. Whatever I do, I cannot get the rows to be permanently committed to the oracle db. I tried copying the text directly from the file and running it as a script on the Oracle server which seemed to work but the rows did not actually commit, they weren't available in the program and when I restarted the SQL Developer program they disappeared.
    I also tried using SQL Plus and received the same results. I even tried copying just a single insert statement in with no success.
    A second problem I have is when copying the entire file over, somewhere around line 500 it starts asking for substation variables, which I have no idea what they are or why it's asking for them.
    Thanks for any help :)

    Daft question, but have you got "commit" in your script?
    Also, you'll need to "set define off" at the beginning of your script - & is the default prompt for SQLPLUS to ask for a variable, so if you're trying to insert "You & Me", it'll prompt you for a value for Me, unless you've got set define off.

  • 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.

  • Executing .sql file in oracle using php

    Hello friends
    I am converting the oracle form into web application.
    My requirement is to execute a .sql file when i click on a button in the html form.
    What i need to do is when the user click on the button then the sql+ window shoudl open up and a file located on the server should get executed.
    Please note i have to do this in php. If any other alternative is there for this requirement then that also is welcomed.
    Any help would be appreciated.
    Thanks
    Vinod

    The thing is i am using
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE 10.2.0.1.0 Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    I am connecting to the DATABASE using
    the below php code
    =========================
    <?php
    if (!ini_get('display_errors')) {
    ini_set('display_errors', 1);
    PutEnv("ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/");
    PutEnv("LD_LIBRARY_PATH=-Wl,-rpath,/usr/lib/oracle/xe/app/oracle/product/10.2.0/server//lib -L/usr/lib/oracle/xe/app/oracle/product/10.2.0/server//lib -lclntsh");
    $dbstr ="(DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = XXX.XXX.XXX.XXX)(PORT = XXXX))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = XE)
    if(!@($conn = oci_connect('SYSTEM','passwordString',$dbstr)))
         print_r(ocierror());
    else
    echo "connected succesfully";
    exit;
    ?>
    ========================
    I am able to connect the database and ececute query and fetch the results.
    Now one file will be present in some directory on the server let say abc.sql
    Now i need to execute that file and display the output to the user by means of php code.
    So please provide me the detailed step on how to get this done.
    Thanks

  • Problem when importing a SQL file into Forms

    Hello friends at www.oracle.com ,
    I have a Forms program which has to open a SQL external file, read each SQL instruction into a variable, execute it and read the next one, as in the example (for illustration purposes) below.
    create table ...
    insert into log_table ...
    delete from table ...
    So, whenever Forms finds the slash, it will execute the instruction via FORMS_DDL built-in.
    The problem is that we have a SQL instruction that can't be executed via Forms. The reasons:
    - It is a SQL that creates a package body
    - The SQL that creates the package code is very big (more than 32 kb), and this leads to the problem below
    - The 32 kb SQL code is sent to a Forms variable, and a FORMS_DDL should execute it, but FORMS_DDL has a limitation: the maximum that FORMS_DDL can read is 32 kb
    - I can't find a way for me to break the package code into two or more codes because I cannot alter a package to add procedures or functions
    Could you please tell me what should I do? If the text above is not clear, please ask me more details.
    Best regards,

    Hello Francois,
    Why don't you run your SQL file with Sql*Plus ?sincere thanks for your answer.
    Your idea would be the ideal solution, but the package needs to be created via Forms only, for maintenance purposes. A Forms program needs to handle everything that comes from this SQL external file.
    Another way could be creating the package inside Forms, but the idea is to send all SQL instructions to an external file, for the same reason as above (that is, maintenance).
    Best regards,

Maybe you are looking for

  • No Iphone or Ipod showing up on Itunes

    For some reason when I connect my Iphone or Ipod to my computer, Itunes doesnt automatically pop up.  Then I have to bring Itunes up manually.  My phone or my Ipod isnt showing up at all as being connected.  I have followed all the suggestions and is

  • Should the "Unapproved" category be tidy?

    Hello all, I have done a fair amount of searching for an answer similar to my question but I haven't found something that quite fits what I'm looking for. In advance, I apologize if this is a re-post. I just recently took over responsibility of a WSU

  • Please Help-Removing Apps from Launchpad -OS X- Lion

    I recently downloaded Adobe Master Suite cs5, it became corrupt and i deleted the majority of the installed apps, however I cannot delete the rest of the apps from launch pad, and I cannot find the root files/folders in finder.The apps also appear as

  • Canceled opening the page

    Hi, there, I added a Flash animation to a web page, and instead of showing it, I get this Canceled opening the page error (that, or it just shows this big blank space) in all of the browsers I've tried (IE, Firefox, Safari, Chrome, Opera). Adobe says

  • I am getting a message that "the i-tunes library file cannot be saved. an unknown error has occurred." what can i do?

    i am getting a message that "the i-tunes library file cannot be saved. an unknown error has occurred." what can i do?