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

RE: Explain plan bug

$
0
0

The problem went away when you removed the line feed, but in doing so, you also removed the highlight on the word SELECT.     Doesn't the problem also go away when you just remove the highlight and try again?


RE: TOAD disallows white space in my type declarations

$
0
0

This is fixed for 12.10. In 12.9 you need to disable the "Treat blank line as statement terminator" option on the Execute/Compile page in Options.

Michael

TOAD disallows white space in my type declarations

$
0
0

Hi there,

Types are code like anything else and white space is nice.  Is there a reason Toad 12.9.0.71 no longer allows empty newlines in a type declaration?  is this a setting I need to turn off somewhere? Running it as "execute as script" gets around the issue.

Thanks,

Paul

CREATE OR REPLACE TYPE echo_swagger_typ FORCE
AUTHID CURRENT_USER
AS OBJECT (
swagger_id VARCHAR2(255 Char)
,echo_module VARCHAR2(255 Char)
,swagger_version VARCHAR2(255 Char)
,info_version VARCHAR2(255 Char)
,info_title VARCHAR2(255 Char)
,info_description VARCHAR2(255 Char)
,swagger_host VARCHAR2(255 Char)
,swagger_base_path VARCHAR2(255 Char)
,schemes_https VARCHAR2(5 Char)
,consumes_json VARCHAR2(5 Char)
,consumes_xml VARCHAR2(5 Char)
,produces_json VARCHAR2(5 Char)
,produces_xml VARCHAR2(5 Char)

-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
,CONSTRUCTOR FUNCTION echo_swagger_typ
RETURN SELF AS RESULT

-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
,MEMBER FUNCTION toJSON(
p_pretty_print IN NUMBER DEFAULT NULL
) RETURN CLOB

);
/

RE: Rollback remaining time?

$
0
0

I don't know of any "time remaining" query, but you can do this query repeatedly to watch the progress

SELECT t.USED_UBLK, s.username, s.machine, s.program
FROM   V$TRANSACTION t, v$session s
where  t.addr = s.taddr;

The first column's value will approach zero as the rollback progresses.   The row will disappear when the transaction is complete. 

RE: Rollback remaining time?

$
0
0

Oh, you might be able to find the rollback in v$Session_longops.      You could use this query:

Select decode(sl.totalwork, 0, 0, round(100 * sl.sofar/sl.totalwork, 2)) "Percent",
       sl.message "Message",
       sl.start_time,
       sl.elapsed_seconds,
       sl.time_remaining,
       s.username, s.machine, s.program
from   v$Session_longops sl, v$session s
where  sl.sid = s.sid
and    sl.serial# = s.serial#
and    (sl.totalwork > sl.sofar)
ORDER BY s.SID;

To see this in Toad, you can go to the Session Browser, find the session you are interested in, and then click the "Long Ops" tab.   I don't know that all rollbacks appear here but I just did a quick test and it did.

Rollback remaining time?

$
0
0
Let's say we have a session that is ACTIVE and it is rolling back 10 million rows.
What SQL query would indicate the remaining time needed to complete this roll back?

RE: "Rollback" changes to a data table

$
0
0

Did you re-execute your select query?   It doesn't automatically update the grid when you do a rollback.

"Rollback" changes to a data table

$
0
0

Group,

I attempted to merge some data to a very large data table.  Unfortunately it didn't update it as I thought it would.  Is it possible to rollback the table to it's original information before the merge?

I have clicked "Session" and chosen the "Rollback" Icon, but that doesn't seem to have done anything.  

In advance, thanks for the help.

Don


RE: TOAD disallows white space in my type declarations

$
0
0

Thanks!

I must say opening up a type declaration that has been around forever and seeing nothing but red exclamations everywhere is a little disturbing.

Cheers,

Paul

RE: "Rollback" changes to a data table

$
0
0

John,  Thanks for the response.

I did not try to merge this via a SQL script.  I was moving data from an Excel spreadsheet and attempted the "Merge" via the "Import / Import Data Table" option.  It failed miserably.  I'm thinking now I should have moved the data into an independent table and then attempted the merge. 

If there is a way to roll this back, I'm all ears as the original was a large table that took me about 20 hours to input the data.  I understand though if there is not a way.  This was a learning error on my part.

Thanks again for your help.

Don

RE: "Rollback" changes to a data table

$
0
0

There is a setting in import table data which controls the commit interval (never, every N records, once at the end).   If you chose anything besides "never", then a rollback won't help you.   Rollback only rolls back to the last commit or rollback. 

Oracle does have a "flashback table" command which may or may not be an option for you, depending on how the database is configured.     You can read about that here:   http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_9012.htm

If you're interested, I'd like to try to help you understand what went wrong with your import/merge operation.     If you want to try to work up a small example, I'll be happy to help you figure out what went wrong.   Feel free to email me directly:  john.dorlon@software.dell.com.

RE: error when opening session browser

$
0
0

Sorry John for late reply, I could not able to get the solution

I am using toad in my client VDI(Virtual Desktop Infrastructure). 

1. In C:\<windows username>\Application Data\Quest Software\ -- I cannot able to see any details related to toad as my toad for oracle folder is on desktop and in this folder if I go into clientfiles\userfiles\  , I didn't find GUISettings folder. In userfiles folder I can see only TOAD_SESSBROWFILTERS.INI, even after deleting this file, i can't able to open session browser in toad.

2. Schema names and connectivity related details are present in C:\oracle\ora102 and there are many sub folders here, could not able to get what need to be modified.

RE: error when opening session browser

$
0
0

To make sure you are looking in the right place, from Toad's main menu, go to View -> Toad Options.   In the left hand side of the options window, click "General".  On the right, in the "Application Data Directory" box, click "Open folder".   You should see GUISettings in that folder.     Close Toad before you delete/rename the folder.

RE: Need a help on writing a query to fetch the POs created in last one day

$
0
0

There are a couple of ways to do it:


select *
from po_headers_all
where creation_date between TO_DATE('20-Sep-2016 00:00:00', 'DD-Mon-YYYY HH24:MI:SS')
and TO_DATE('20-Sep-2016 23:59:59', 'DD-Mon-YYYY HH24:MI:SS');


-- or --


select *
from po_headers_all
where trunc(creation_date) = TO_DATE('20-Sep-2016', 'DD-Mon-YYYY');


-- or, if you really care about yesterday, whatever that is ---


select *
from po_headers_all
where trunc(creation_date) = trunc(sysdate - 1);

RE: error when opening session browser

$
0
0

Thank you John.. I can able to open session browser now. :)


error when opening session browser

$
0
0

Hi,

I am getting "Stream read error" with below exception details when tried to open session browser in Toad

Exception:

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

  2.1

Date          : Wed, 14 Sep 2016 02:38:04 -0400

  2.2

Address       : 0043B1B1

  2.3

Module Name   : Toad.exe - (Toad for Oracle)

  2.4

Module Version: 10.1.1.8

  2.5

Type          : EReadError

  2.6

Message       : Stream read error.

  2.7

ID            : 14F3

  2.8

Count         : 1

  2.9

Status        : New

  2.10

Note         :

can you please suggest me the steps to resolve this issue.

Thanks,

Vijay

RE: Need a help on writing a query to fetch the POs created in last one day

$
0
0

Hi John,

Actually I said just for understanding as yesterday. So I need query by using 'SYSDATE', not by directly entering the date.
Actually I tried. I got as below. Can you please look on to this and validate. Or else, let me know if there is any other simple way.

SELECT *
FROM     PO_HEADERS_ALL poh
WHERE poh.last_update_date BETWEEN TO_DATE(TO_CHAR(SYSDATE-1,'DD-MM-YYYY')|| ' 00:00:00', 'DD-MM-YYYY HH24:MI:SS')
                                                         AND            TO_DATE(TO_CHAR(SYSDATE-1,'DD-MM-YYYY')|| ' 23:59:59', 'DD-MM-YYYY HH24:MI:SS')



RE: Need a help on writing a query to fetch the POs created in last one day

$
0
0

Hi Srivathsava,

As with many things Oracle, there's a big "it depends".  It depends on the answers to questions like:

What is the data type of the LAST_UPDATE_DATE column?
Is the LAST_UPDATE_DATE column indexed?
Is this an ad-hoc one-shot query, on-demand, or scheduled?
How big is the table?
How many rows are expected to be returned?
What does the explain plan say about these queries?

...and many more.  The answers to these are something that youwill have to use to decide which query of John's to use.  Or, assumingindexing and other factors are OK, I might use something like:

SELECT *
FROM PO_HEADERS_ALL poh
WHERE poh.last_update_date BETWEEN TRUNC(SYSDATE)-1 AND TRUNC(SYSDATE)-1/24/60/60;

Also, since this isn't really a question about Toad, this forum isn't an ideal place to ask it.  But to be fair, I can't find the SQL forum, either....

GL!

Rich

RE: Need a help on writing a query to fetch the POs created in last one day

$
0
0

In that case, my third example will do what you need.   Yours will work but it seems overly complicated to me.   If all you care about is the date, not the time, then only compare the date and not the time.  

There is one possible benefit to your query over mine - if the LAST_UPDATE_DATE is indexed, then your query will use the index and mine will not.   That is because I put a TRUNC() around LAST_UPDATE_DATE in the where clause.   But if there is no such index, I think mine is better because it's easier to read..

Another way to write your query, which I find easier to read, would be:

SELECT *
FROM     PO_HEADERS_ALL
WHERE last_update_date BETWEEN TRUNC(SYSDATE - 1)
                       AND  TRUNC(SYSDATE) - (1/86400);

86400 is the number of seconds in a day.

When you put TRUNC() around a date, it throws away the time portion (makes it midnight)

RE: Need a help on writing a query to fetch the POs created in last one day

$
0
0

[quote user="John Dorlon"]

Another way to write your query, which I find easier to read, would be:

SELECT *
FROM     PO_HEADERS_ALL
WHERE last_update_date BETWEEN TRUNC(SYSDATE - 1)
                       AND  TRUNC(SYSDATE) - (1/86400);

[/quote]

Great minds think alike, John!  And apparently ours do, too!

Rich

Viewing all 4385 articles
Browse latest View live


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