Server Administration :: Undo Info Of Insert Statement

Jun 24, 2012

If we insert a row in a database table then the new row stays at database buffer cache in SGA (until commit), right?. The target table is not affected (before commit). The new row is saved after commit.

I saw a concepts at Sybex oracle 10g oca book (Page 406) as follows:

" INSERT statements use little space in an undo segment; only the pointer to the new row is stored in the undo tablespace. To undo an INSERT statement, the pointer locates the new row and deletes it from the table if the transaction is rolled back. "

My question is If the row is not saved at table before commit, if we issue rollback then how oracle delete from table? I think the new row is deleted from database buffer cache in SGA.

View 2 Replies


ADVERTISEMENT

Server Administration :: Record Audit Info About Sql Statement Run By User

Jul 19, 2012

I am trying to record audit info about sql statement run by user (only one audit entry per specific type of operation such as create table, or insert table). Such as if a user create three tables, but database record only one entry of create table type per session.

I am giving you all the statement I issued...

SQL> create user saimon identified by abc1;

User created.

SQL> grant connect, resource to saimon;

Grant succeeded.

SQL> audit table, insert table by saimon by session;

Audit succeeded.

SQL> show parameter audit

NAME TYPE VALUE
-------------------- ----------- -------------
audit_file_dest string /u01/app/oracle/admin/orcl/adum
audit_sys_operations boolean FALSE
audit_syslog_level string
audit_trail string DBSQL>

[oracle@DBTEST ~]$ sqlplus saimon/abc1

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jul 19 21:45:09 2012

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

SQL>

SQL> create table TB1 (id number, name varchar2(20));

Table created.

SQL> create table TB3 (id number, name varchar2(20));

Table created.

SQL> select USERNAME, TERMINAL, OS_USERNAME, USERHOST, ACTION, action_name, OBJ_NAMe
2 from user_audit_trail;

USERNAME TERMINAL OS_USERNAM USERHOST ACTION ACTION_NAME OBJ_NAME
---------- ---------- ---------- ----------------- ----------------------- ----------
SAIMON pts/4 oracle DBTEST 1 CREATE TABLE TB3
SAIMON pts/4 oracle DBTEST 1 CREATE TABLE TB1
conn / as sysdba

Now my question is I have enabled statement auditing for session not by access. So only one audit entry should have been recorded for two table creation. Why database is recording every create statement?

SQL> show user
USER is "SYS"

SQL> SELECT audit_option, failure, success, user_name
2 FROM dba_stmt_audit_opts;

AUDIT_OPTION FAILURE SUCCESS USER_NAME
----------------------------------- ---------- ---------- ------------------------------
TABLE BY SESSION BY SESSION SAIMON
INSERT TABLE BY SESSION BY SESSION SAIMON

View 2 Replies View Related

Server Administration :: Sizing Undo Tablespace And Setting Undo-retention?

Jan 30, 2004

regarding sizing undo tablespace and undo_retention parameter.we have to implement the database in production system with 40 users but how much space should be allocated to undo tablespace is there any propotions related to virtual memory and the
parameter.i have gone thru oracle doc's and some related sites.its an ERP aplications that contains 20 modules .I am an new one to this dba level

View 8 Replies View Related

Server Administration :: Cannot Find SQL Plan For Insert Statement

Dec 27, 2011

I can not find the sql plan for insert statement,why?

Select sql_text From v$sql a
Where a.SQL_ID = '0yungrk19a277';
-------------------------------
INSERT INTO OS_USERBILL_ACTV_READ_MON_DT
(MONTHNO, MAILCODE, OPERTYPE, PROVCODE, AREACODE, DAY_TOTALCOUNT, TOTALCOUNT,
CREATETIME, MODIFYTIME, SENDER_TYPE, SENDER_DOMAIN)
VALUES
(:B9 , :B1 , :B2 , :B3 , :B4 , :B5 , :B6 , SYSDATE, SYSDATE, :B7 , :B8 )
[code]....

View 4 Replies View Related

Server Utilities :: Insert Data Without Writing Insert Statement In Oracle?

May 15, 2010

how to insert data in oracle table without writing insert statement in oracle 9i or above. i am not going to write insert all, merge, sqlloder and import data.

View 2 Replies View Related

Server Administration :: Roll Of Undo In Recovery?

Aug 4, 2011

what is the role of undo cache or undo tablespace in recovery?

View 3 Replies View Related

Server Administration :: How To Undo Tablespace Size

Feb 7, 2011

As the undo segments are used in round robin fashion, Is it possible that with varying load (concurrent users, size and number of transactions), the size of Undo tablespace on a particular day is less than the Undo tablespace size few days back, by any chance?

As a basic understanding I know that Undo is preserved for read consistency and transaction, instance recovery So if there are lot of transaction on a database on 05 Feb and before that, but there aren't any transactions on 6,7,8,9, then on 10th Feb can we see the Undo tablespace size is less than that of 05 Feb?

In the following case when data belonging to table is not required for any queries, transactions, even then the undo size is not restored upon dropping the table.

As such for large operations and batch processes shall we keep undo tablespace with files as 'Autoextend' with 'Maxsize' as 'Unlimited'?

SQL> select b.tablespace_name, Total_Kbytes_Available/1024 Tot_Mbytes_Available,
Kbytes_alloc/1024 Mbytes_allocated, kbytes_free/1024 Mbytes_Free_from_allocated,
((Kbytes_alloc - kbytes_free)*100/ Total_Kbytes_Available) Pctused
2 from ( select sum(bytes)/1024 Kbytes_free,
3 tablespace_name
4 from sys.dba_free_space

[code]....

View 12 Replies View Related

Server Administration :: UNDO In Parameter File?

Dec 9, 2011

I have a question ragarding undo tablespace. I want to ask that why only undo tablespace information we need to specify in parameter file. We do not specify any other tablespace information. Not even for temporary tablespace. Then why we need to give undo tablespace name while instance is creating.

View 5 Replies View Related

Server Administration :: Undo Tablespace Which Has Autoextend On Feature

May 18, 2011

you have an undo tablespace which has autoextend on feature.after a timegap your undo tablespace presently is 100GB

here as a DBA what you will do?

View 3 Replies View Related

Server Administration :: How Oracle Implements Undo Management

Jul 31, 2010

I have been reading various articles about the undo management. This basic concept of undo management is simple but how oracle implements it is bit harder for me to grasp.

What i have read and understood is that whenever a DML(Update, Delete, Insert) statement is issued by a user, the data is fetched from datafile to database buffer cache and at the same time a copy of the original data is saved in undo segment. Now if other users requests the same data, they are presented with the unchanged copy in the undo segment.

Now I have the following questions:
1) In case of Insert statement, what data is saved in undo segment. Is it the complete data in the table to which we want to insert the new row?
2)When the user issues DML statement, there are three copies of the same data, one in Memory (which is changed and not the same as original data), second in Undo segment (Which is unchanged copy of original data) and third in datafile file ( which is original data). What is the difference in the data in undo segment and data in datafile at this stage. Why are the other users presented with the data from undo segment rather than original data from the datafile to maintain read consistency.
3)When the user issues rollback, the changes made to the copy of data in memory are undone.The copies of data in memory and undo segment are now same?. What happens to the before change copy in undo segment. Is it still there or deleted.

View 5 Replies View Related

Server Administration :: Query On Redo And Undo Basic Concept

Nov 17, 2010

understanding a redo/undo concept . Refer following data

create table t(n number);
insert into t values(10);
commit;

now I update as following

update t set n=20;

As per my understanding the before image i.e. n=10 is stored in undo (to be used for rollback, transaction recovery and even in instance recover but not in media recovery) and after image n=20 is stored in redo (to be used for various recovery purposes including media recovery in case of consistent backup).

So it is redo logs for rolling forward and undo for rolling back making transaction, db consistent . If my above understanding is true then what is meant by the term 'redo required for undo'?

Also, if there are 2 database db1 and db2 connected using database link where we are populating t1 table in db1 using t2 table in db2 using db link where redo and undo will be updated db1 or db2?

View 9 Replies View Related

Server Administration :: Undo Tablespace 100 Percent Full With Offline Extended?

Jul 26, 2010

i'm facing a problem while i'm inserting millions of record from table to table that undo tablespace reach 100% full and execution aborted. , how can free the undo tablespace ??? many of extendes are offline. will it flush automatically ??? or what i should do

View 4 Replies View Related

SQL & PL/SQL :: Insert Into Statement Doesn't Insert All Rows Return By Select Statement?

Jan 12, 2011

If i inserted the values in table it gets inserting very few rows only.I dont know y it is?

View 15 Replies View Related

SQL & PL/SQL :: Member Procedure Insert With Subtype Info?

Mar 2, 2012

Im trying to generate a member procedure that allows the user to manual enter the required information via substitution variables. The manual INSERT INTO statements work but I cant seem to get it to work within a procedure.

Here is the code for the type, table andstandard insert:

CREATE TYPE toy_typ AS OBJECT
(toy_id NUMBER ( 5),
toy_name VARCHAR2 (20),
toy_cost NUMBER ( 4),

[code]...

the procedure complies but i get a warning error. When i also try to execute the code with either set values or substitutions i get either not enough or to many values error.

View 39 Replies View Related

Server Utilities :: Privileges Error - Executing INSERT Statement For Table

Jul 9, 2013

I am using OWB to load a table which write sql loader command. When running the load i am getting below error.

SQL*Loader-643: error executing INSERT statement for table "STG_EWORK"."STG_ISF_LUCC"

I am unable to guess which privileges is missing.

My control file as below

OPTIONS (SKIP=2,BINDSIZE=50000,ERRORS=0,ROWS=200,READSIZE=65536)
LOAD DATA
CHARACTERSET WE8MSWIN1252
INFILE '\devora003.dev.tfl.localPDWPDW_SourceISF_LUCC_Loadfile.csv'
CONCATENATE 1
INTO TABLE "STG_EWORK"."STG_ISF_LUCC"

[code]....

View 4 Replies View Related

Retrieve Info From Multiple Databases / Insert Into Central Database Via Database LINKS

Jun 10, 2013

I am trying to retrieve info from multiple DBs and insert into a central DB via DB LINKS.The links are retrieved via a cursor.

However I keep coming up against 'PL/SQL: ORA-00942: table or view does not exist'..how to handle db_links using a cursor in a pl/sql block? The code is as follows:

DECLARE
db_link_rec VARCHAR2(30);
CURSOR db_link_cur IS
SELECT DB_LINK
from MESSAGING_PROD_LIST;
BEGIN
OPEN db_link_cur;
LOOP
FETCH db_link_cur INTO db_link_rec;
EXIT when db_link_cur%NOTFOUND;
[code]....

View 1 Replies View Related

SQL & PL/SQL :: How To Insert Single Quote In Insert Statement

Feb 24, 2012

INSERT INTO LKP_ASSET_LOCATION (LOCATION) VALUES ('AMERICA'S CUP VILLAGE')

View 2 Replies View Related

Server Administration :: How To Run ADDM Report For Particular SQL Statement

Apr 22, 2013

We are not using enterprise manager. Now, i want to generate ADDM report for the particular SQL stmt. How can i do that?

View 2 Replies View Related

Server Administration :: Oracle Hints In SQL Statement

Sep 30, 2011

What is the use of using Hints within SQL statements w.r.t query tuning? How to know which hint to use when?

View 1 Replies View Related

Undo Segments In Undo Table Space

Nov 29, 2012

Can we find out no of undo segments in undo Table space ? If so , how to find? what's their max limit ?

View 9 Replies View Related

Server Administration :: Can Select Statement Generates Redo

Dec 7, 2011

Whenever any transaction happen in database redo has generated for this transaction. Do select statement treat as a transaction as it doesn't modify any thing in database. And If select statement should not be a transaction, there should not be any redo generation for select statement.

So is select statement generate redo? If yes then Why ?

View 1 Replies View Related

Server Administration :: Insert User ID Automatically In Table?

May 7, 2010

I have a table with table_ID, date_created, user_id.

I have sequence, and a BEFORE INSERT trigger, which uses the seq to increment the table_ID by 1, everytime the webpage is saved.

ques:
(1).If i have date_creted defaulted to sysdate in the table, do I need to have it in the trigger?
-- Update create_date field to current system date
:NEW.DATE_CREATED := sysdate;

(2).How can I insert the user_id in the table, each time user SAVE the page ? web page procedure is getting the user info at the beginning. can i add it in the trigger

DECLARE
v_username varchar2(10);
BEGIN

[Code]....

View 1 Replies View Related

Server Administration :: Unable To See / Insert Chinese Characters In Oracle Database

Jun 14, 2013

We are getting problem with the Chinese character set. My current character set is as follows.

PARAMETER VALUE
---------------------------------------------------------------- ----------------------------------------------------------------
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
[code]....

My column description for the table product is as follows.

PART_NBRVARCHAR2 (30 Byte)
PART_DESCNVARCHAR2 (2000)

when trying to insert Chinese character using the insert command below

insert into product(part_nbr,part_desc,cust_name) values('322341',unistr('功'),'test');

I am getting the value when selecting the same record using the select command

select a.part_nbr,a.part_desc,a.cust_name from product a where a.part_nbr='322341'322341¿test

When I running this command on TOAD

select a.rowid,a.part_nbr,a.part_desc,a.cust_name from product a where a.part_nbr='322341'

and manually editing/inserting '功' character in output from select command above. After that I am able to get the same Chinese character when I am running select next time.

View 7 Replies View Related

Server Utilities :: Added A Datafile In Undo Tablespace

Apr 28, 2011

When I am importing, I get these errors

IMP-00019: row rejected due to ORACLE error 1
IMP-00003: ORACLE error 1 encountered
ORA-00001: unique constraint (XXXXXXXXXXXXXXXX) violated
Column 1 2
Column 2 OFFLINE
[code]....

I added a datafile in undo tablespace (its an ASM database). I doubt that since I added the datafile to undo tablespace, I am getting this error.

View -1 Replies View Related

SQL & PL/SQL :: Insert Statement?

May 13, 2011

I have one query i have create one table T1 in this table i have this three colm (EMPNO,ENAME,HIREDATE) and i have to insert raw from this two table T2 and T3 in T2 table colms are (EMPNO,SAL) and T3 table colm are (EMPNO,MGRID) so which query i have to run

View 4 Replies View Related

SQL & PL/SQL :: Null In Insert Statement?

Jul 5, 2010

I wanted to print 'null' when the column value is null. Actually, i am doing something like this

select empno||','||''''||ename||'''''||','||comm||','||sal from emp

It gives the following output for example
7369,'pointers',,200
If I use the above values to form a insert statement it throws
an error. As 'comm' value is not there.

I wish to get something like
7369,'pointers','',200
or
7369,'pointers',null,200
from the above select query

note I dint copy paste the query exactly from my sql*plus session as I am away from my oracle machine

View 14 Replies View Related

SQL & PL/SQL :: Using Subquery In Insert Statement

Jun 5, 2010

I read in a book that you can't use subquery in an insert statement . E.g:

1)insert into dates (date_col) values (select sysdate fom dual) but when i tried using subquery like this:

2)insert into regions values ((select max(region_id)+1 from regions), 'Oce');

This query worked but 1st query didnt.From my assumptions if we try inserting values in table with the subqueries for a particular column as in 1st query , it will throw error but not while inserting values in all columns as in 2nd query.

View 5 Replies View Related

Insert Statement Causing ORA-01858?

Dec 4, 2012

i'm executing a load test using the below statement:

INSERT INTO BPMBI.PPROCINSTANCE SELECT * FROM BPMBI.PPROCINSTANCE_BKP WHERE ROWNUM < 501;
COMMIT;
EXIT;

I've been using the same for a few days without any error while now wehn i try to use the same i get below error:

SQL> insert into pprocinstance select * from pprocinstance_bkp where rownum <= 500;
insert into pprocinstance select * from pprocinstance_bkp where rownum <= 500
*
ERROR at line 1:
ORA-01858: a non-numeric character was found where a numeric was expected.

I've been trying to check what the issue is and when i execute the rownum < 140 works fine while rownum < 150 is showing the same error.

View 6 Replies View Related

Concurrency Wait On Insert Statement?

Feb 19, 2013

I am running Oracle RAC 2 nodes 11g R2 on AIX 7.1

I have a table with unique index, and the application is doing inserts/updates into this table.Suddenly and for about half a minute I faced a high concurrency waits on all the processes running these inserts for one node. I saw this high concurrency wait in the top activity screen of the OEM only on one of the nodes. knowing that the processes doing these inserts are running on both nodes.

All what I have that in this half minute I see high concurrency wait in OEM top activity screen related to this insert statement and when I clicked on the insert I found high "enq: TX - index contention". Again this was only on one node.After this half minute everything went back to normal.What could be the reason and how can I investigate it ?

View 3 Replies View Related

PL/SQL :: Using Sqlerrm Directly On Insert Statement?

Oct 3, 2013

Given below a block of code, this code compiled successfully on one DB but returns error on other.DB version is same. I know sqlerrm can not be used directly but how it compiled successfully on one DB. 

declare
l_procedure_name CONSTANT VARCHAR2(100) := 'copy_device_status_tables';
l_procedure_id CONSTANT INTEGER := 301;

[Code].....

Error report:

ORA-06550: line 12, column 75:
PL/SQL: ORA-00984: column not allowed here
ORA-06550: line 11, column 5:
PL/SQL: SQL Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved