RE: Dynamic SQL Results to Export Dataset
Dynamic SQL Results to Export Dataset
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
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
> 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
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
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
Re: [Toad for Oracle - Discussion Forum] new user
RE: Object Compare Link Option not working
RE: Object Compare Link Option not working
RE: Which index local or global to choose for attached scenario
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
Search youtube. there are several videos about it.
Re: [Toad for Oracle - Discussion Forum] new user
RE: Dynamic SQL Results to Export Dataset
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
RE: Dynamic SQL Results to Export Dataset
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
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
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
RE: new user
Stop receiving emails on this subject.
Or Unsubscribe from Toad for Oracle Forum notifications altogether.
Toad for Oracle - Discussion Forum