Server Administration :: How To Find And Close Open Cursor List Without Restarting
May 28, 2013
In my environment found maximum open cursor exceeds error. So how can I found the open cursor list and how can I close that cursor without restarting. Any SQL commands to close the open cursor.
View 4 Replies
ADVERTISEMENT
Mar 23, 2010
How to Close All open cursors in other session.
NAME TYPE VALUE
------------------------------------ ----------- ---------------
cursor_sharing string EXACT
cursor_space_for_time boolean FALSE
open_cursors integer 500
session_cached_cursors integer 50
Ex. as above we have 500 max cursor
seesion show 499 and now we need to flust all open cursors
View 9 Replies
View Related
Jun 6, 2011
How to find out list of DB_LINKS that uses user account in database ?
View 9 Replies
View Related
Jan 4, 2011
I am using Oracle 11g. After rebooting the server listener and databases are not up and running but ASM is up.
How the listener and databases will be up?
I have entry in /etc/oratab file:
+ASM:/opt/grid/11.2.0/grid:N
IPDCDB2:/opt/oracle/product/11.2.0/db:Y
View 2 Replies
View Related
Aug 8, 2010
I was monitoring a database job to collect statistics, it was scheduled using DBMS_JOBS..I found that it was running during business hours so i got the session ID of the job using;
select sid from dba_jobs_running where job=11;
I then i killed the job using;
select serial# from v$session where sid =232;
alter system kill session '232, 10852';
select sid from dba_jobs_running where job=11;
no rows selected...After some time i again fired the same command
select sid from dba_jobs_running where job=11;
SID
----------
232
and found that the same job is again running..This behavior was repeated again N again. i have attached the spool file for the same...
what could be the reason that the job is starting all over again even after killing the session and what should be done to stop it..I understand that once the database shuts down and if the job is still running then it will restart once the database is up..In this case, Should i remove the job and re submit it again..
View 8 Replies
View Related
Feb 3, 2011
We all know that commit will do the following.
1. Save the Txn Permanently to the database.
2. Release the table locks and
3. Erase the save points.
TABLE NAME:
==========
create table TEST_PREC (NO NUMBER(4,2));
DECLARE
BEGIN
INSERT INTO TEST_PREC VALUES (12.34);
DBMS_OUTPUT.PUT_LINE('the no of records before commit '||SQL%ROWCOUNT);
commit; /* What's happening inside commit */
[code]....
why the SQL%ROWCOUNT is set to zero after commit.
Does the commit, close the implicit cursor?
View 3 Replies
View Related
Sep 21, 2010
I am trying to create the Physical StandBy Database in the same server. Till last 2 Final steps, everything went on well. In the final steps, when I try to open the StandBy Database, it throws the following Error:
*******************************************************
SQL...> alter database open;
alter database open
*
ERROR at line 1:
ORA-01154: database busy. Open, close, mount, and dismount not allowed now
*******************************************************
I tried creating the Physical Standby with the following Steps.
Environment: Oracle Release 10.2.0.1.0 / Windows 2003 Server Enterprise Edition SP2
Primary DB = 'PrimDB'
StandBy DB to be created ='StBy1DB'
In the same Server, location for
PrimDB datafiles='F:oracleproduct10.2.0oradataPrimDBData',
StandBy Datafiles='E:StandBy_DBData'
PrimDB Control Files='F:oracleproduct10.2.0oradataPrimDBControl'
StandBy Control Files= 'E:StandBy_DBControl'
[code]....
Step 1 Create the Oracle Service for StandBy DB "StBy1DB' and Create the Standy DB Password file.
ORADIM -NEW -sid StBy1DB -intpwd passwd -startmode manual
Step 2 Shut down the primary database.
SQL> SHUTDOWN IMMEDIATE;
Step 3 Copy the datafiles to 'E:StandBy_DBData'. (including Temp01.dbf is it Right?)
Step 4 Restart the primary database.
Restart the primary database:
SQL> STARTUP;
Step 5 Create a Control File for the Standby Database (Should this command be given in Mount Status or Open Status?)
From Primary database,
SQL> ALTER DATABASE CREATE STANDBY CONTROLFILE AS 'E:StandBy_DBControlStByControl01.ctl';
Step 6 Prepare the Initialization Parameter File to be Copied to the Standby Database
SQL> CREATE PFILE='E:StandBy_DBPFileinitStBy1DB.ora' FROM SPFILE;
Step 7 Set Initialization Parameters on a Physical Standby Database
db_cache_size=444596224
java_pool_size=4194304
large_pool_size=4194304
shared_pool_size=150994944
streams_pool_size=0
[code]....
Now When I type the following command, it throws an error:
SQL...> alter database open;
alter database open
*
ERROR at line 1:
ORA-01154: database busy. Open, close, mount, and dismount not allowed now
View 2 Replies
View Related
Nov 23, 2011
I want to return ref cursor based on explicit cursors
create table jumbo(id number, name varchar2(20));
insert into jumbo values(1,'jumbo');
create table mumbo(id number, name varchar2(20));
insert into mumbo values(1,'mumbo');
commit;
[Code].....
The above procedure has compilation errors when I am trying to open ref cursor
LINE/COL ERROR
-------- --------------------------------------------------------
20/24 PL/SQL: SQL Statement ignored
20/38 PL/SQL: ORA-00942: table or view does not exist
32/24 PL/SQL: SQL Statement ignored
32/38 PL/SQL: ORA-00942: table or view does not exist
SQL>
View 5 Replies
View Related
Mar 8, 2013
I am using oracle 10gXE just for basic practice but its showing following Errors
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Mar 8 11:46:34 2
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn sys as sysdba
Enter password:
Connected to an idle instance.
SQL>
SQL>
SQL>
SQL> startup;
ORA-01081: cannot start already-running ORACLE - shut it down fir
SQL>
SQL>
SQL>
SQL> select * from dept;
select * from dept
[code]....
View 3 Replies
View Related
Dec 17, 2012
Which command is the right way to open a alert log file of below size.
-rw-r----- 1 oracle asmadmin 28070129 Dec 17 08:06 alert_DEMO.log
I used to open a alert log file using vi editor. Is that a right way to open and view a alert log ?
View 5 Replies
View Related
Apr 5, 2010
I am facing a strange issue on 11gR2 (OEL 5.4) standby readonly with apply database.It's throwing 16000: database open for read-only access during SELECT's .
Here is snapshot of errors.
ORA-00604: error occurred at recursive SQL level 1
ORA-16000: database open for read-only access
SQL> l
1* SELECT t0.airportID, t0.archived, t0.assetTag, t0.bluetoothID, t0.cmBundle, t0.createdDate,
t0.currentProductTaskID, t0.ethernetID, t0.failOrReworkCount, t0.highestCompletedTaskTypeID, t0.lastModDate, t0.lastStationID,
t0.modCount, t0.modelID, t0.oemSerialNumber, t0.orgSerialNumber, t0.pdmVersion, t0.preburnComplete,
t0.productID, t0.reworked, t0.secondaryEthernetID,
t0.serialNumber, t0.shipped, t0.specialBuildTypeID,
[code]....
View 7 Replies
View Related
Apr 26, 2013
My current database MAX OPEN CURSORS VALUE=300.
Applications "A","B","C" using same DB user (USER1) then connect to a database.
Last night I created dedicated DB user (USER2) then application "B" connect to DB using this new user.Starting traffic increase today morning "B" application receiving "ORA-01000: maximum open cursors exceeded" error from DB.When I change current DB user USER2 to USER1, application did not receiving above errors.
I don't understanding what happening in database?
View 5 Replies
View Related
Apr 27, 2011
I am using oracle 10g R2. Some how control file is corrupted and database is not open. and there is no backup of control file. Now i need to open the database without recreating the database.
View 5 Replies
View Related
Jan 12, 2011
I searched the knowledge base here and in other forums and haven't found the answer. There was a similar condition presented earlier, but it turned out the resolution was to run the >shutdown/>startup on the server rather than from a client. Not applicable in my case!
Shutdown and startup called used to work with 9i, now startup fails in 10g. ORACLE_HOME and ORACLE_SID are set and report correct values. What is different in 10g that the script (shown below) now throws a TNS listener error after shutdown?
I successfully upgraded from 9i to 10g (10.2.0.5.0) on Windows Server 2003, 32-bit last weekend. Now our backup_script.bat and oracle_stop_start.sql throw "ORA-12514: TNS:listener does not currently know of service requested in the connect descriptor"
This batch file and sql script predate me and worked with 9i for years. Now the startup command in the oracle_stop_start throws this error after executing shutdown. The backup batch file calls:
sqlplus "system/manager@wind as sysdba" @D:ptcwindchillackupsoracle_stop_start
The entire oracle_stop_start.sql is as follows:
shutdown immediate;
startup open;
quit
What is different in 10g that this now doesn't work? Shutdown works, but it will not startup due to the listener error. I have made the backups work by commenting out the call to sqlplus and I'm getting good backup dumps.
In my virtual image of the server I have found that I can duplicate the error after >shutdown. I have found that if I exit sql*plus and go back in as follows I can get the database instance to restart from the command line:
c:>sqlplus /nolog
sql>connect sys/* as sysdba
sql>startup open wind;
That does start, mount and open the database instance.
Is there a better way to be making sure that everything is stopped before executing the >exp command to create a backup dump? I will look into and test datapump export/import and RMAN for creating the backups, after I get this working again.
why this worked in sql*plus in 9i but not in 10g? Can I make TNS Listener smarter? Change or add variables to the startup command?
View 2 Replies
View Related
Jan 13, 2011
I have a snippet of code
EXCEPTION
WHEN OTHERS THEN
H_Report_Error('sql',Sqlerrm);
end;
And I'm trying to figure out how to catch a error from a loop such as:
OPEN My_cursor FOR SQLCODEBLOCK
LOOP
FETCH a_variable INTO ResultCount;
EXIT
WHEN My_cursor % NOTFOUND ;
BEGIN
--Stuff done
End;
End Loop;
So right now I have a error in the SQLCODEBLOCK, but I can't catch that error. I've tried putting the exception in various places but it wont compile.
View 6 Replies
View Related
Oct 31, 2013
Oracle 11g For a procedure, if I use the hard-code procedure
sp_test( p_rc out sys_refcursor, p_1... p_2 ... ) is begin open p_rc for select * from TEST_TABLE... But now, I want to use the dynamically constructed sql, such as if condition1 then v_sql := ... elsif condition2 then v_sql := ... execute immedite v_sql
How can I return the the cursor p_rc in this case?
View 2 Replies
View Related
Jul 5, 2011
Im trying to install Weblogic/Forms on a Windows 7 x86 machine. Its for the developers to use.But when I run the config.bat and is creating the domain and installing Forms builder and the other stuff the installation hangs at: step restaring admin server started.
Log:
Stopping Derby Server...
Starting AdminServer
Starting the domain ...
DEBUG : Loading the 32 bit dll here
DEBUG : Loading DLL : D:/oracle/middleware/as_1/install/config/StartUtil.dll
DEBUG : Loaded DLL : D:/oracle/middleware/as_1/install/config/StartUtil.dll
View 1 Replies
View Related
Mar 1, 2012
open cp_cursor for 'Select curtailprogramkey from curtailProgram where curtailprogramid like 'l_rec.curtailprogramid%'';
NOTE: l_rec.curtailprogramid is varible. what is wrong in the above statement?
View 2 Replies
View Related
Apr 18, 2013
I would like to mention that I won't be able to give the data,specific information(like query or table names) about the issue as this concerns the privacy of some multinational company(where I work).
We have windows server and we are currently using Oracle 10g.
Issue-
We have a ProC, which has a SQL statement where it is trying to OPEN a cursor. The cursor query is huge and fetches data from 3 tables. 3 tables have 5k, 600k and 1.7 millions records respectively but the 'where' condition in cursor query makes the total count to 3k lines only.
Now the problem is , we have a schedule reboot of the server every Saturday night and the next day(Sunday night) when the program runs it gets stuck in the query --> OPEN <cursor> . We wait for 5 hours but this OPEN cursor query never executes or completes, that means our program gets stuck here.Eventually we have to kill the program.We have tried running it after killing as well but it again gets stuck.
Now the interesting part. On Monday business happens as usual but in the night when we again run this program it runs within minutes. The records in the tables are more or less same. Open cursor does not get stuck at all. It runs every night properly but every Sunday night it gets stuck. note that the program does not run on Saturday nights. So on Sunday night it runs for the first time after server reboot.
So there is something with Open cursor statement(with so much data) after server reboot. What exactly Open cursor does in memory or database.
View 11 Replies
View Related
Jul 27, 2012
I have the following code for a Apex(Application Express) project I am developing.
declare
mail_id varchar2(100);
min_skill_cnt number;
skill_cde varchar2(30);
total_leave number;
toal_emp number;
cursor cur is
select S_EMP_EMAIL
from EMP_SKILLS_INFO where SKILLCODE='MGR' and S_EMP_EMAIL = lower(:APP_USER) ;
cursor minskill is
select skill_code,MINRQMT_AM
from skills_code_info
where skill_code in (select skillcode from emp_skills_info where S_EMP_EMAIL = lower(:APP_USER));
cursor leavecnt(v_skill IN VARCHAR2) is
select count(*) from emp_leave_info
where leave_date = :P24_LEAVE_DATE
and emp_email IN (select S_EMP_EMAIL from EMP_SKILLS_INFO where SKILLCODE = v_skill);
cursor empcnt(v_skills IN VARCHAR2) is
[code]...
Ideally this should send email to managers when a particular skill is running short when employee applies for leave. I am getting error that cursor is already open when I run this code. I am not sure which cursor or where it is picking open cursor command.
View 2 Replies
View Related
Jan 3, 2011
After opening a dynamic cursor, usually fetch hit record into some variables. However, if I do not want to "FETCH INTO " operate Just only skip this record.
DECLARE
TYPE weak_cur_type IS REF CURSOR;
weak_cur_1 weak_cur_type;
weak_cur_2 weak_cur_type;
vs_dsql VARCHAR2(2048);
vd_create_time DATE;
vn_count NUMBER(8);
vn_total_amount NUMBER(13);
[Code]...
View 7 Replies
View Related
Feb 26, 2013
Is it possible to bind collection while opening a ref cursor. Find below the code that I am trying. My goal is to open cursor once using collection variable. Can it be done using DBMS_SQL ?
DECLARE
TYPE typ_emp_rec_in IS RECORD
(
deptno NUMBER,
sal NUMBER
[code]......
View 4 Replies
View Related
Feb 13, 2013
I am trying to find the unix process for one of my application in the database but I am unable to view the same. To simulate, I did the following.
1. My database runs on different server.
2. I invoked "sqlplus" from another unix box to login to the database.
3. I found that the process id (ps -ef |grep sqlplus).
4. When I execute the below mentioned query it does not display the process id that I am looking for. But the osuser, username, program and machine details are correct. How can I know the process details from the database?
SELECT SYS.GV_$SESSION.OSUSER, SYS.GV_$SESSION.USERNAME, SYS.GV_$PROCESS.SPID,
SYS.GV_$SESSION.MACHINE, SYS.GV_$SESSION.PROGRAM,
SYS.GV_$PROCESS.PROGRAM ,SYS.GV_$SESSION.SQL_ID
FROM
SYS.GV_$PROCESS, SYS.GV_$SESSION
WHERE
SYS.GV_$PROCESS.ADDR=SYS.GV_$SESSION.PADDR and SYS.GV_$SESSION.USERNAME='TEST'
and SYS.GV_$SESSION.MACHINE like '%hostname%'
View 3 Replies
View Related
Sep 22, 2010
We performed image copy of production Oracle server (OS and instances) to a backup server. After a few weeks, we try to restore a latest Oracle database backup from production server to backup server. As we know, Oracle instance must be unique on the network.
Even we log on to backup server and bring up the instance, I think that still point to production instance since all init file, TNSNAMES.ora and listener file are still same. If we restore the database, we will end up bring down the production instance and restore on top of productions. How to change instance name on backup server including TNSNAMES, sqlnet, listener files in order for us to restore Oracle database from production to backup server?
View 2 Replies
View Related
May 10, 2013
create or replace package cognos_pk as /* Creates Package Header*/
TYPE project_type IS record( /* A record declaration is used to */
c1 NUMBER /* provide a definition of a record */
); /* that can be used by other variables*/
TYPE project_type1 IS REF CURSOR return project_type; /* Variable declaration */
procedure conosg_sp (result1 out project_type1); /* SP declaration */
end;
[code]....
View 2 Replies
View Related
Dec 14, 2012
We have a table which is already partitioned by list and now we would like to add a subpartition.
Create table Item_mst
(
ccn varchar2(10),
Flag varchar2(1),
Item varchar2(10),
status varchar2(1)
)
[Code]..
Now I could like to alter the above table for adding a new subpartition on each partition on status.
ALTER TABLE Item_mst
MODIFY PARTITION Item_mst_Test
ADD SUBPARTITION Item_mst_Test_A VALUES ('A');
Above alter gives ORA-14253: table is not partitioned by composite range method.
However dropping and recreating the table with subpartitions is working fine.
But Dropping and recreating the table in production is very cumbersome as it has huge data and many indices.
View 3 Replies
View Related
Dec 31, 2010
I have a list box from which the user can select a client's name, I want them to be able to press a button next to the box which will then open another form and display all the client's details. How do I attach a button to a list box? and how can I call another form to open on a specific record?
View 3 Replies
View Related
Apr 13, 2012
I getting a error Ora-06511 when-new-item-instance trigger raised unhandled exception.
below is the coding for the trigger when-new-item-instance : where the cursor is open? how to close it?
if :blk_master.action_status = 'A' then
declare
doc_slno number;
[Code].....
View 3 Replies
View Related
Nov 9, 2011
is there a way to find out which unused columns in oracle?
View 8 Replies
View Related
Mar 9, 2012
how to find a table is updated and when the table is updated.
View 1 Replies
View Related