Delete Temporary Table Automatically When DB Connection Closed?
Jan 4, 2011
I'm working on a java program connected to a Oracle 9i db. I'm inexperienced about Oracle specific capabilities. The experienced Oracle users
I would like to know if there's a way to create a temporary table so that:
- the table will be deleted automatically when a specific db connection closes (obligatory)
- the table is visible for just one specific connection (optional)
What I would like to do is:
1 - Get the result set for query A.
1a - process the results
1b - store the results in a performance friendly way ( I thought about a temp table)
2 - Run query B over result set A.
3 - Run query C over result set A.
X - The stored result set A has to be removed before/when the program ends (ideally when the db connection closes).
The problem isn't how to do this in java. The problem is to do it in a way so that the table will be automatically removed when the db connection used to create it will be closed so that's unimportant if the java program crashes or ends normally.
View 7 Replies
ADVERTISEMENT
May 22, 2012
One user complained that, his session is closing automatically when his session exceeds exactly 01 hour 1 minute.
default profile is assigned for this user. I checked the idle_time value of this default profile. it is UNLIMITED only. What else I need to check to find out is there any timeout parameter has been set or not?
View 6 Replies
View Related
Dec 6, 2010
i have create database link with msaccess2000 its working fine in forms 6i i am trying to upload data by using forms 6i while compiling form is automatically closed my code is this
begin
insert into baba1
(select *
from baba1@access_db
where dte between to_date(:block3.fdate,'dd-mon-yyyy')
and to_date(:block3.ldate,'dd-mon-yyyy')
[code]....
View 8 Replies
View Related
Aug 8, 2012
My DB Version: 10.2.0
OS : Solaris
I have 2 Database installed on the server one with the name of orcl and one with the name of mz50. When i am trying to connect from client side using toad to orcl i am able to connect to that db successfully but when i try to connect to mz50 DB i getting above mentioned error.
I check the tnsnames file as well as listener file and when i am trying to do tnsping both DB reply
My tnsname file is
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = blade0)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
[code]....
View 15 Replies
View Related
Mar 5, 2010
I Installed Oracle forms 10g after which I Installed Oracle Database Express Edition.
I have added the following entry in tnsnames
XEXDB=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=8080))
(CONNECT_DATA=
(SERVICE_NAME=XEXDB)
)
)
When I am trying to connect Forms with the Database am getting the below error:ORA - 12537: TNS connection closed
I need to make any changes to sqlnet.ora
View 10 Replies
View Related
Jan 29, 2013
I am gettting error message databse connection closed itried
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
[code]...
View 10 Replies
View Related
Apr 26, 2010
I have Multi-threaded application using pro*c to connect to oracle.
I am using the following piece of code to create a connection to oracle database and preserver the context of created connection.
struct sqlca * tempSqlca = new sqlca;
struct sqlca & sqlca = * tempSqlca;
EXEC SQL BEGIN DECLARE SECTION;
SQL_CONTEXT localContext;
[code].....
I am using the following piece of code to close the connection to the oracle database, I am using the context created in the previous step and passing it to the below code(connection.context)to release the connection.
if (connection.context == 0 || connection.ca == 0)
return true;
// Multithreading: get the communication area of the context
struct sqlca & sqlca = *(connection.ca);
EXEC SQL BEGIN DECLARE SECTION;
[code].....
When the above code is executed there is no exception thrown but the connection is not getting close. I am using the V$SESSION system views to monitor the connection created.
I there anything I am missing in my code for the connection closing to fail.
View 1 Replies
View Related
Jul 23, 2013
I am trying to create a job that will execute a shell script on a remote server (Server B) when an existing job, on the local server (Server A), completes.
I have spent the last couple of days combing through Metalink, Oracle Documentation, AskTom, and Google. I know this is a relatively "new" feature/ability - released with 11.2 - but this particular error stack is no where to be found. I have attempted to be completely thorough with the information I provided, along with being diligent about masking important configuration information.
While the calling Job is starting the second job, the second job appears to timeout at 60 seconds and the job status is reported as failed with this error stack:
ORA-12537: TNS:connection closed
ORA-06512: at "SYS.DBMS_ISCHED", line 4921
ORA-06512: at "SYS.DBMS_ISCHED", line 6853
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1130
ORA-29261: bad argument
ORA-06512: at "SYS.DBMS_SCHEDULER", line 3975
ORA-06512: at line 1
Configuration information:
Server A and Server B OS Version/Kernal Information:
Oracle Linux Server release 5.8
x86_64
2.6.32-300.24.1.el5uek
Database Version, on all databases, is:
Oracle Database 11g Enterprise Edition
11.2.0.3.0 - 64bit
Remote Scheduler Agent version, on both servers is: 11.2.0.3.1
Here is the listener status on Server B for db2:
serverb $$ lsnrctl status listdb2
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 23-JUL-2013 11:39:27
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=***)))
STATUS of the LISTENER
[code]...
I have configured both servers with remote Scheduler agents and both databases have been configured and registered with the agents.
I have executed the shell script on Server B and it performs as expected.
I have the primary job calling the remote job, and that is performing as expected.
I have tested the connection from DB1 on Server A to DB2 on Server B with this
SQL> set serveroutput on
SQL> DECLARE
2 versionnum VARCHAR2(30);
3 BEGIN
4 versionnum := DBMS_SCHEDULER.GET_AGENT_VERSION('ServerB.someplace.net');
[code]...
and I have tested the connection from DB2 on Server B to DB1 on Server A with this
SQL> set serveroutput on
SQL> DECLARE
2 versionnum VARCHAR2(30);
3 BEGIN
4 versionnum := DBMS_SCHEDULER.GET_AGENT_VERSION('ServerA.someplace.net');
[code]...
View 12 Replies
View Related
Oct 1, 2013
I am getting the error TNS-12537. In the SQLnet.ora file, if no IP Address is listed everything works fine and the listener starts without any issue. But one of the Security requirements we have is, we need to list all the client IP address on the SQLNet.ora file. I checked the Windows Firewall services and it is disabled.
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
M:>tnsping proditg
TNS Ping Utility for 64-bit Windows: Version 11.2.0.3.0 - Production on 01-OCT-
013 10:31:14
Copyright (c) 1997, 2011, Oracle. All rights reserved.
[code].....
View 9 Replies
View Related
Mar 19, 2013
I am facing ora - 12537 TNS connection closed issue while I am trying to login into database.I have installed Oracle database 11g on windows 7 premium OS.
View 13 Replies
View Related
Aug 25, 2010
I'm using Oracle 11. I'm currently having some problem to start my Oracle database after database restore, hence unable to start my SAP application too.
> lsnrctl start
LSNRCTL for HPUX: Version 10.2.0.4.0 - Production on 25-AUG-2010 23:49:20
Copyright © 1991, 2007, Oracle. All rights reserved.
Starting /oracle/PRD/102_64/bin/tnslsnr: please wait...
TNS-12537: TNS:connection closed
TNS-12560: TNS:protocol adapter error
TNS-00507: Connection closed
HPUX Error: 29: Illegal seek
View 3 Replies
View Related
Jan 12, 2011
I am getting below error while tnsping from client
C:Program FilesMicrosoft Visual Studio 9.0VC>tnsping xpcdev
TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 12-JAN-2011 21:35:03
Copyright (c) 1997, 2005, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.6.102)(PORT = 1524))) (C
xpcdev)))
TNS-12537: TNS:connection closed
on server side listener is up also I am able to tnsping without any error.
contents from sqlnet.ora
Quote:NAMES.DIRECTORY_PATH=(TNSNAMES, ONAMES, HOSTNAME)
SQLNET.EXPIRE_TIME= 10i
I am getting below error on listener log file
Quote:12-JAN-2011 10:04:56 * 12546
TNS-12546: TNS:permission denied
TNS-12560: TNS:protocol adapter error
TNS-00516: Permission denied
View 9 Replies
View Related
Feb 25, 2011
Oracle Database: Oracle 11g Version: 11.1.0.6.0
Tool: Oracle SQL developer. Version : 1.1.3
Problem:
After completing debug of procedure from SQL Developer, whenever I try to compile that procedure or execute any query from the SQL worksheet, I get the closed connection error message. However I can debug that procedure for any number of times. Any other activity for that database connection gives closed connection error.
View 2 Replies
View Related
Dec 25, 2011
when a user change or delete any record or row in forms data automatically move to other table because i want to compare old and new record.
View 8 Replies
View Related
Aug 30, 2012
I have a standby database in which I am backing up my database from. I also backup my archivelogs on my primary site as well as the control file. My issue is that I cannot find the correct RMAN command that will allow me to delete the actual backupsets from disk after say 7 days.
I know how to delete automatically the actual archivelog files, but not how to only have 7 days of archivelog backupsets available at any one given time.
View 3 Replies
View Related
Nov 30, 2012
I am trying to delete the backupset using Delete Obsolete command, but i am unable to get the success. As per the oracle Doc after completion of Retention Period oracle automatically deletes the backupset. I have set the retention period of 8 days.
View 7 Replies
View Related
Nov 15, 2011
I am using temporary table.
PROCEDURE Return_Summary(WX IN dbms_sql.varchar2_table,
WX OUT SYS_REFCURSOR) IS
Begin
FOR i IN 1 .. Pi_ WX.count LOOP
/* I need to put this results in a temp table or table object Can I use temp table for this or do we have any other recommended method. The loop might execute max of 10 times and for each run it might return 100-200 records. */
select WX_NM,
WX_NUM
from TAB A, TAB B, TAB C
where A.KEY1 = B.KEY1
and B.KEY1 = C.KEY1
and C.WX = WX(i);
End Loop;
End;
View 5 Replies
View Related
Aug 30, 2013
creating a temporary table.i have this query mentioned below
CREATE TABLE WEBPEN AS (SELECT PNSR_PPO_NO PPO,PNSR_FILE_NO,
DECODE(F_GET_APPLN_NO(PNSR_PK),'1',PNSR_VOL_NO,F_GET_APPLN_NO(PNSR_PK)) APPLN_NO,
PNSR_FULL_NAME NAME,
TO_CHAR(PNSR_DOB,'DD/MM/YYYY') DOB,
TO_CHAR(PNSR_DOR,'DD/MM/YYYY') DOR,
F_GET_ADBK_NAME(PNSR_TO_PENSION) TREASURY,
PNSR_SPOUSE_NAME SPOUSE,
[code]....
This creates a table webpen with around 54107 rows. What i am want is every time run "select * from webpen" it should run the above query and give the result as per the values in main table M_PENSIONER ,M_PEN_DCRG_WITHHELD.
What i want is it should truncate the existing values and insert the value by running the above mentioned query .
View 6 Replies
View Related
Jun 5, 2005
I migrate procedures MS SQL Server to Oracle.In MS SQL SSERVER the use of instructions INSERT with procedure results which are in storage or dynamic instructions EXECUTE in place of VALUES clause is permissible. This construction is similar to INSERT/SELECT but we have to do with EXEC instead of SELECT. The part of EXEC should include exactly one resulted collection about the equivalent types to the types of table columns. In case of the stored procedure, we can pass on proper parameters, use the form of EXEC('string') and even call up wideranging procedures or remote control procedures from different servers. Calling up remote control procedures from different server, which place data in temporary table, and later realizing join with obtainable data, we can construct diffuse joins. For example. I want insert results stored procedures sp_configure, proc_obj in temporary table.
1)INSERT #konfig
exec sp_configure.
2)
CREATE PROCEDURE proc_test
@Object_ID int,
AS
SET XACT_ABORT ON
BEGIN TRAN
CREATE TABLE #testObjects ( Object_ID int NOT NULL )
INSERT
#testObjects
EXEC
proc_obj @Object_ID,3,1
COMMIT TRAN
RETURN(0)
go
how migrate for example code to Oracle?
View 11 Replies
View Related
Feb 20, 2010
What is the best option for GLOBAL TEMPORARY TABLE
1) option create GLOBAL TEMPORARY TABLE with ON COMMIT DELETE ROWS. and wheverever this is used for calculation commit at the end of porcedure.
CREATE GLOBAL TEMPORARY TABLE gtt_test
(
A NUMBER
)ON COMMIT DELETE ROWS;
CREATE OR REPLACE PROCEDURE my_proc ( p_in in number)
as
begin
[Code]....
2) create GLOBAL TEMPORARY TABLE without ON COMMIT DELETE ROWS and wheverever this is used use delete from Temp table /Truncate table and then user it.
CREATE GLOBAL TEMPORARY TABLE gtt_test
(
A NUMBER
);
CREATE OR REPLACE PROCEDURE my_proc ( p_in in number)
[Code]....
View 26 Replies
View Related
Apr 26, 2011
Is there a neat way other than having to reformat the data in a temporary table to do the following,I've got the following content in a table:
CODECustid Type Nb Amount
1 Deposit 2 10000
1 Withdrawal 1 4000
I'd like to show the data in this manner:
CustID Deposit DepositAmount Withdrawal WithdrawalAmount
1 2 10000 1 4000
View 3 Replies
View Related
Mar 12, 2013
I have created global temporary tables to be used in my stored procedure, in order to view reports which i created in JASPER. Since global temporary tables are session based, when multiple users are trying to generate the report, every user is getting inconsistent data.
To make it clear, what i meant is if a user A tries to view a report with some filter criteria and simultaneously user B is trying to generate the same report with another filter criteria, User A is getting User B's report data and User B is getting User A's report data. How can we avoid this problem?
View 1 Replies
View Related
Dec 6, 2011
how to drop global temporary table?
while droping global temporary table we are getting below error
"ORA-14452: attempt to create, alter or drop an index on temporary table already in use"
View 1 Replies
View Related
Jan 7, 2012
i have one table HR.employees
SQL> desc hr.employees
Name Null? Type
----------------------------------------- -------- ----------------------------
EMPLOYEE_ID NOT NULL NUMBER(6)
FIRST_NAME VARCHAR2(20)
LAST_NAME NOT NULL VARCHAR2(25)
EMAIL NOT NULL VARCHAR2(25)
PHONE_NUMBER VARCHAR2(20)
HIRE_DATE NOT NULL DATE
JOB_ID NOT NULL VARCHAR2(10)
SALARY NUMBER(8,2)
COMMISSION_PCT NUMBER(2,2)
MANAGER_ID NUMBER(6)
DEPARTMENT_ID NUMBER(4)
SQL>
in this table i want to temporary disable all constraint in this employees table
View 4 Replies
View Related
Dec 21, 2011
How to allow only "CREATE GLOBAL TEMPORARY TABLE" DDL in a schema. I have to restrict all DDLs performing by a particular schema except GT Table.
View 8 Replies
View Related
Dec 3, 2011
I am using a global temporary table in which place data from a few different queries.
It then select it out into a cursor.
This procedure works fine in PL.SQL Developer and Toad. It doesn't have to be adjusted.
Java has a problem though, as the data is gone when the Java call attempts to acquire it. This is due to session pooling I suppose.
So, my question is somewhat composite.
Is there a setting in Java (JDeveloper) that I could overcome this with? Perhaps a momentary "Hold" on a session?
View 6 Replies
View Related
Mar 13, 2013
create table my_rows
(
my_envvarchar2(100),
anumber(2),
bnumber(2)
)
/
insert into my_rows values ('A', 10, 20);
insert into my_rows values ('A', 10, 20);
insert into my_rows values ('A', 10, 20);
insert into my_rows values ('A', 10, 20);
insert into my_rows values ('A', 10, 20);
insert into my_rows values ('A', 10, 20);
insert into my_rows values ('A', 10, 20);
insert into my_rows values ('A', 10, 20);
[code]....
The first row means that the value 10 represents 40% in the couple (10,20). Meaning if I have 100 rows with the couple (10,20), 40 rows will be marked with the value 10 and 60 will be marked with the value 20. To do this, I used to create a temporary table with the same structure as the my_rows table with a new column "the_value" and I used to update this new column wth a PL/SQL for loop. But I think it is doable in a signle SQL.
View 9 Replies
View Related
Oct 17, 2012
create or replace procedure p_populate_gtt
as
begin
insert into gtt
select last_name,first_name,null from funcdemo where rownum <51;
update gtt set vote=100
where ln ='Tim';
end;
/
gtt is my global temp table. i am updating vote column which is null to 100.But i am not able to update it
View 21 Replies
View Related
Jun 11, 2012
How can i create a temporary table using EXECUTE IMMEDIATE ??
Like:
CREATE GLOBAL TEMPORARY table new_table as (Select * from old_table);
View 11 Replies
View Related
Nov 15, 2011
Can we lock data in global temporary table?
View 4 Replies
View Related