Quantcast
Channel: Toad for Oracle Forum - Recent Threads
Viewing all 4385 articles
Browse latest View live

RE: Dynamic SQL Results to Export Dataset

$
0
0
Could you possibly create a function that returns the dynamic SQL string that you then retrieve into a text file to manipulate?  I like John's view idea (we do that in a number of our scripts), but it sounds like you can't get the results of the dynamic sql to be exactly what you want. . .

What kind of cleanup is it that you need to run using your DOS script? 


Dynamic SQL Results to Export Dataset

$
0
0

I suspect this info is out there somewhere, but I'm afraid I'm just not finding it.  What I am trying to do is the following:

1) Run a script using dynamic SQL to generate another SQL script

2) I then run a DOS script to do a little cleanup on the generated script

3) Execute the generated script.  But here I want the output to be exported to an Excel file.  I'm not seeing how to pass the generated script into the export dataset task.  Or is there another method I should be using?

Can anyone point me in the right direction?

Thanks,

Steve

RE: ORA-01031 occurs when connecting to Oracle 12c with Toad 11.6

$
0
0

I'm using TOAD 12.10.0.30 and get the same error when connecting to Oracle 11.2.0.4-Databases. But what i've found out:

If I'm trying to connect to a RAC-database with 2 instances, i'll get the ORA-1031 while connecting. And i don't see other users in Schema-browser. In the spool-SQL there is the only Select on user$:

-- Timestamp: 15:14:30.484
SELECT u.NAME
FROM sys.USER$ u
WHERE u.TYPE# = 1
ORDER BY 1;
Error: ORA-01031: Nicht ausreichende Berechtigungen

But when i'm connecting a single-instance database, the error won't show up (even if there is one in spool sql)! And there is another select on user$ (select null instead of u.name) and a second select on dba_users, which wasn't there on the other database:

----------------------------------
-- Session: xxxx
-- Timestamp: 15:17:51.225
SELECT null
FROM SYS.USER$
WHERE 0=1
Error: ORA-00942: Tabelle oder View nicht vorhanden


----------------------------------
-- Session: xxxxx
-- Timestamp: 15:17:51.271
Select username
from sys.DBA_USERS
order by username;

----------------------------------

(even there is another error - ora-00942 instead of ora-1031). There must be a difference if there are more than one instance. If i should test something else, just let me know.

Regards,

Gerd

RE: ORA-01031 occurs when connecting to Oracle 12c with Toad 11.6

$
0
0

>  If I should test something else, just let me know.

Yes.   Please post the entire Spool SQL output (from before you log on until the error pops up in Toad) so I can get some context around what's happening.  

Also, and perhaps more importantly, please post the "create user" DDL along with whatever grants your user has, so that I can reproduce this problem.   I just tried it on a two-node rac and it worked OK for me, so there must be something about your user that is causing Toad to try that query.

If you don't want to post these things to the forum, you can email them to me:  john.dorlon@quest.com

Thanks.

-John

RE: ORA-01031 occurs when connecting to Oracle 12c with Toad 11.6

$
0
0

Ok, I think this should be fixed for the next beta - 12.11.0.18.   Those of you who had a problem in Toad 12.10, please try this beta when it comes out (hopefully this week) and let me know if the problem is fixed or not. 

Thank you.

ORA-01031 occurs when connecting to Oracle 12c with Toad 11.6

$
0
0

I am having an issue when I attempt to login via Toad(version 11.6) using the system account, to a newly created 12c database. When I enter my credentials and attempt to connect, I receive the error ORA-01031: insufficient privileges. When I click ok, it still seems to log me on to the database, but I receive the error anytime that I try to browse within Schema browser. It doesn't seem to affect my ability to execute queries in Toad as I've yet to get the error this way.

This only happens when I am using Toad and using this account. I can connect using this Toad client while using the sys account without any issue.

I am able to connect using the system account without error using other methods on the same machine: SQL Developer, SQLPlus, and also Toad version 10 through a citrix app. All of these methods allow me to connect and browse the database without any type of error. So I know that there isn't a connection issue between my machine and the database, but it seems maybe related to this version of Toad.

new user

$
0
0
how to setup toad for the first time user

Re: [Toad for Oracle - Discussion Forum] new user

$
0
0
Hi:

Thanks for your message.  I will be out of the office for vacation, returning Tuesday, January 3, 2017.  I will be checking mail periodically.   Please forward a message to cisdba@interact.ccsd.net if you need immediate assistance.
Have a Merry Christmas and Happy New Year!
Tony

RE: Object Compare Link Option not working

$
0
0
Hello John,
I appreciate your attention to this issue.
Real life scenario 1:
A developer makes a code change in development and validates that it is working.
When Approved, the developer makes a targeted deployment to production. To do this they copy their new code into the code already in production. Unfortunately,  they added their new code 20 lines above or below where they had it in development. Everything works as expected. The developer thinks everything is fine. Technically it is fine.
6 months later, another change is made to the same package/procedure/function, except this time a scheduled deployment is done. During the deployment the functions  are compared, but because the code blocks are in a different sequence, time is spent sorting through the differences.
The real issue is the ability to do a targeted deployment, currently unavoidable.
Attached are 2 functions demonstrating the issue.
Actually, Not bad if the code block was only 12 lines long.
Real life scenario 2:
Code to correct replication issues between 4 databases needs updated in all 4 databases.
This is a targeted fix every time in each database needed to synchronize the data.
The Procedures (6 in each database) range from 6000 to 9000+ lines each. They all deal with inserting updating or deleting records. Although the table names  are different so each section should be separated, all of the tables contain one of the following 3 key fields: Person_NBR, ORG_NBR or ISN. This used to causes the match to split the comparison. When I tested it yesterday, the new matching algorithm seems  to be doing a much better comparison than in the previous versions I used to use.
Real life scenario 3:
I have not tested this with the new matching algorithm.
I have a package with several procedures in it and I need to do a special 1 time 1off process.
So I copy a couple of procedures, in the same package. I give the new procedures a new name and make a couple of small changes in the code.
Then when I compare the package, it matches my new 1off procedure to the old original procedure.
Previously I would then link the two old original procedures together and verify that I didn’t accidentally update the original procedure.
Thank you for your assistance.
Sincerely,
Dan Peterson

RE: Object Compare Link Option not working

$
0
0
Here is the second function to compare to.

RE: Which index local or global to choose for attached scenario

$
0
0

ok noted. thanks. Just let me know which is best among the give below. SQL query when executed given below results.

select pzPVStream from pc_link_attachment where pxLinkedRefTo like 'PEGACOMMBANK-CORR-SWIFT XXP161115-000029!20161115T063801.679 GMT%' 
and pxObjClass ='Link-Attachment' 
order by pzInsKey;

with global index - execution timing 0.42 seconds - cost 257 - cpu cost 18855292
with local index - execution  timing 0.56 seconds - cost 59 - cpu cost 17347198

RE: new user

$
0
0

Search youtube.  there are several videos about it.

Re: [Toad for Oracle - Discussion Forum] new user

$
0
0
Hi:

Thanks for your message.  I will be out of the office for vacation, returning Tuesday, January 3, 2017.  I will be checking mail periodically.   Please forward a message to cisdba@interact.ccsd.net if you need immediate assistance.
Have a Merry Christmas and Happy New Year!
Tony

RE: Dynamic SQL Results to Export Dataset

$
0
0

The first script I run contains a UNION ALL to a number of databases across database links.  So my cleanup script just replaces the last line (UNION ALL) with a semi-colon.  Perhaps you found another way around that issue?

Thanks,

Steve

RE: Dynamic SQL Results to Export Dataset

$
0
0
If you're writing pl/sql or even sql to create it, just append that to the end of your string.  

When I'm doing something like this, I would do something like put the union all at the beginning of the loop code when I'm not on the first record so I don't get an extra one at the end.  Or, if you know you are getting an extra union all at the end of the string, you could trim it by 9 characters to trim it off.  Then you add the semi-colon after the loop.

If you need more help, feel free to post your code and I can look at it.  


RE: Dynamic SQL Results to Export Dataset

$
0
0

Thanks Phyllis.  Your response basically confirms what I was thinking - that I would need to convert my SQL script to PL/SQL.  Here's what I am currently running:

SELECT    'Select database, node "Server", mkid "Master Key ID" from whoami@'
       || HOST
       || ',vw_x$kcbtek@'
       || HOST
       || ',v$encryption_wallet@'
       || HOST
       || CHR (10)
       || ' where ts# = 0 and wrl_type = ''HSM'' and status = ''OPEN'''
       || CHR (10)
       || 'UNION ALL'
  FROM user_db_links;

RE: Dynamic SQL Results to Export Dataset

$
0
0

BTW, there are a couple of views in that code that I built myself - in case you were wondering why you weren't seeing those objects in your database (whoami, ,vw_x$kcbtek).  But you get the idea..

RE: Dynamic SQL Results to Export Dataset

$
0
0

My usual trick for this type of query to create SQL is to use the ROW_NUMBER analytic in a CASE statement to prevent the extra trailing(or leading) text;

SELECT 'Select database, node "Server", mkid "Master Key ID" from whoami@'
|| HOST
|| ',vw_x$kcbtek@'
|| HOST
|| ',v$encryption_wallet@'
|| HOST
|| CHR (10)
|| ' where ts# = 0 and wrl_type = ''HSM'' and status = ''OPEN'''
|| CHR (10)
|| CASE
WHEN row_number() OVER (ORDER BY db_link DESC) != 1 THEN 'UNION ALL'
END
FROM user_db_links
ORDER BY db_link;

RE: Dynamic SQL Results to Export Dataset

$
0
0
I do something similar, but using rownum so I don't have to use the analytic functions.  :-)

SELECT    CASE
             WHEN ROWNUM > 1
             THEN
                'Union all' || CHR(10)
          END
       || 'Select database, node "Server", mkid "Master Key ID" from whoami@'
       || HOST
       || ',vw_x$kcbtek@'
       || HOST
       || ',v$encryption_wallet@'
       || HOST
       || CHR(10)
       || ' where ts# = 0 and wrl_type = ''HSM'' and status = ''OPEN'''
       || CHR(10)
FROM user_db_links;

RE: new user

$
0
0
Thanks, John. I did find some videos and the user guide.


On Thursday, December 22, 2016 5:56 AM, John Dorlon <bounce-jdorlon@toadworld.com> wrote:


Reply by John Dorlon
Search youtube.  there are several videos about it.
To reply, please reply-all to this email.

Stop receiving emails on this subject.
Or Unsubscribe from Toad for Oracle Forum notifications altogether.
Toad for Oracle - Discussion Forum
Flag this post as spam/abuse.


Viewing all 4385 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>