how to import ddl scripts into schema

Posted on 2009-02-13
Last Modified: 2013-12-18

I have newly created schema/user and granted all privileges to it.  I would like to import DDL scripts to create table structure, indexes, triggers etc. How can import the DDL script using Toad or SqlDeveloper. When I use Sql Plus fot that purpose it  always saying cannot open the file when i give like
@ C:\Users\user_xyz\abc.sql

Any ideas, suggestions, links, syntax highly appreciated. Thanks in advance
Question by:gudii9
    LVL 13

    Accepted Solution

    1) connect to the schema in which you want to execute DDL script in toad or sqldeveloper, and then open abc.sql  and click at execute script button (or menu).

    2) is this file available at C:\ check it and then try @C:\Users\user_xyz\abc.sql
    check the file name and extension also.
    LVL 7

    Author Comment

    Is there a a option to import entire .sql script file from its location to create table structure etc. Please advise
    LVL 13

    Expert Comment

    yes, click at open in toad or sqldeveloper and select the .sql file and then execute it
    LVL 7

    Assisted Solution

    I would recommed SQL* plus.  you can use drag and drop option to run the SQL. Just open the sql plus window (remember it is not SQL* plus for windows i.e. sqlplusw.exe rather it is sqlplus.exe --- you can open the command window from run option and then type sqlplus). open the folder, where your sql script is. go to sql prompt and put @ sign and come back to the folder where the script is, just drag the script and drop at your SQL* plus window and press enter.
    hope this help
    LVL 7

    Author Comment

    in sqlloader there is button at top which says 'execute as script ' apart from 'execute' which is running entire  ddl sql script ( ddl sql script generated from toad  client  tool version using option Database--->Export--->Generate Schema Script....on other note when i revisited toad tool today to same schema with all same settings, after 1 day  i cannot see that option now any more ) which consist of like 10 sequences and then 10 tables and then10 triggers etc. ( does after each and every sequence, table,trigger do I need to keep delimitter like'/ '...i tried with or without both ways...toad did not generate sql ddl script with '/' in between) I was able to create corresponding structure from  sql ddl script successfully in sql loader by using 'execute script' button. In toad  I created new schema, granted  all privileges and tried to run the  sql ddl script to generate structure. But i do not see button like 'execute script' there. When i copy paste or open the script file from file---->open file.... and execute saying invalid character ora 0091. When take only part of script generating only first sequence not all. Can you please advise on how can I regenerate entire ddl schema script  file and how can i run using Toad entire generated ddl script. Thanks in advance. Any screenshots, syntax, step by step procedure is appreciated.

    LVL 7

    Author Closing Comment

    thank you very much. I appreciate your help.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
    Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
    Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
    This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now