• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5031
  • Last Modified:

how to import ddl scripts into schema

Hi,

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
0
gudii9
Asked:
gudii9
  • 3
  • 2
2 Solutions
 
sonicefuCommented:
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.
0
 
gudii9Author Commented:
Is there a a option to import entire .sql script file from its location to create table structure etc. Please advise
0
 
sonicefuCommented:
yes, click at open in toad or sqldeveloper and select the .sql file and then execute it
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
FayyazCommented:
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
0
 
gudii9Author Commented:
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 9.7.2.5 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.


ToadOption.bmp
ToadOption2.bmp
0
 
gudii9Author Commented:
thank you very much. I appreciate your help.
0

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now