in .sql file i have 90 laksh insertion statements, file even not opening in text editor. While running it is getting very slow and after it is stuck. can anyone provide solution steps.
Run the file as a script instead of loading the file into the IDE. For example:
#C:\directory\your_file.sql
It may also help to run set feedback off; first, to suppress some of the output. If SQL Developer is still slow, try using SQL*Plus instead.
As Justin pointed out, there are better options for loading large amounts of data into Oracle. But if this is a just a one-time process, then it's probably not worth switching methods.
Related
I am learning shell scripting and I'm experiencing an odd issue.
When I attempt to connect to a Teradata database using BTEQ I am able to log in and run the query, but with each step (IE .LOGON, .QUIT, .EXIT, etc...) the screen shows information about the database and displays the name of the 2 files I have in my home directory.
I've highlighted a command (.LOGOFF) in green to demonstrate and I've highlighted the names of the files in yellow. Every thing else is additional information that I don't want either. I only want the results of the query.
Here is the script that I'm using. (Be gentle, it's my first script outside of the manuals.)
I've done a few dozen searches, but I can't find anything dealing with the issue I am experiencing. Thank you for any help you can offer.
I want to redeploy a package with sqlplus like that:
echo exit| sqlplus user/passwd#db #package.sql
I wonder if it would be possible to diff #package.sql with the existing package in db(if exists at all).
I'm using power shell for that.
Many thanks in advance!
I don't know whether you can do it using Power Shell. I'd
install Notepad++
then install its "Compare" plugin
use SQL Developer to easily access current package specification/body
copy/paste it into Notepad++
load package.sql into another Notepad++'s tab
compare both tabs
you'd see which lines are equal, which exist in one tab and not in another (and vice versa) - everything
If you want to do it "automatically" while running package.sql ... then
I have no idea how to do it,
might cost more than what I suggested ("cost" because you'd have to develop a program which would do that, and that takes time and effort), unless there's already some tool which lets you do it (but I don't know anything about it)
I was having some trouble bulk-loading records to go faster than what cursor.executemany would allow. I hoped the bulk operations documented with regular MonetDB here might work, so I tried an export as a test. e.g. cursor.execute("COPY SELECT * FROM foo INTO '/file/path.csv'"). This doesn't raise an error unless the file already exists, but the resulting file is always 0 bytes. I tried the same with file STDOUT and it prints nothing.
Are these COPY commands meant to work on the embedded version?
Note: This is my first use of anything related to MonetDB. As a fan of SQLite and a not-super-impressed user of Amazon Redshift, this seemed like a neat project. Not sure if MonetDB/e is the same as MonetDBLite - the former seems more active lately?
Exporting data through a COPY INTO command should be possible in MonetDB/e, yes.
However, this feature is not working currently. I was able to reproduce your problem, i.e. the COPY INTO creates the file where the data should be exported to, but doesn't write the data. This does not happen with regular MonetDB.
Our team is notified of this issue, and we're looking into it. Thanks for the heads up!
PS: Regarding your doubt about MonetDB/e vs MonetDBLite: our team no long develops and maintains MonetDBLite. Both are embedded databases that use MonetDB as the core engine, but MonetDBLite is deprecated. After having learnt some do's and don'ts with MonetDBLite, our team is developing our next generation of embedded databases.
So for your embedded database needs, you should follow what's coming out of our MonetDB/e projects.
I've created a test for it at: https://github.com/MonetDBSolutions/monetdbe-examples/blob/CI/C/copy_into.c
Also filed a bug report over on GitHub: https://github.com/MonetDB/MonetDB/issues/7058
We're currently looking into this issue.
I'm not a PL/SQL developer but my current task at work needs me to go through a lot of them. I'm trying to learn it quick but oracle documentation seems tedious. So asking this question.
In one of the .sql script I seen,
installer.sql
##pkgstringinteger.h
##pkgstringinteger.sql
##load_policy.sql
so what does this ## do?
I know on sqlplus prompt if we have to execute any .sql file then we put # at the start. e.g.
SQL>#load_policy.sql
But was wondering what would putting it twice would do? I tried to google but it was difficult to get answer to this peculiar question.
Thanks
##foo.sql does the same thing as #foo.sql (executes the commands in that file), but looks for the file in the same directory as the calling file.
For development within our Oracle 11g database we use Toad for Oracle and Git (in TeamCoding).
One of our development rules is to use the Toad Autoformatter to have a persistent "code appearance". Since we want to change this rule set (towards less line usage), every file would be entirely in the changelog when switching from old to new formatting, making it impossible to see the actual change diff.
Also db objects would only switch to new formatting when being changed.
Is there a way to apply the Toad Formatting rules to all objects (in the database via Toad or maybe in the Git directory)? Then we could make a minor Version which only switches all objects from old to new formatting. :)
Thanks in advance!
ps: manually doing this would be possible ofc, but could take some time since we have a lot of objects in the database :D
Facing the same problem, I could not find a complete massive way; the best thing I can do is:
go to Schema Browser
select all the objects
do "Create script"; in "Script options" panel you'll find the format option, so you can download formatted code.
compile all the objects to save formatted code on DB
In this way you neeed to navigate a bit through the browser, but I hope this can help anyway.
(tested on Toad 12.1.0.22)