History of Table Alterations
Hi ,
How can I find the table alteration made in the database tables?
Is there is any system defined tables are there to store these history informations?
Thanks
Jobin .SP
In what version?
Obviously it can be found in the redo logs using DBMS_LOGMNR. It can also be found in 11gR1 if you implement FLASHBACK ARCHIVE.
But generically speaking the answer is no ... this information is not tracked in some data dictionary table.
If you want to wrap your own auditing you can use DDL EVENT TRIGGERS
http://www.psoug.org/reference/ddl_trigger.html
Similar Messages
-
Display statistics history of tables and indexes
hi,
in display statistics history of tables and indexes i can see only one year old table history, how we can check the table history for more than one year?
Thanks,
NithinWelcome to SDN,
Please search on help.sap.com or SDN before you post your query to avoid duplicate thread.
I think below link will clear your doubt. help.sap.com/saphelp_nw70ehp1/helpdata/en/a6/8c933bf687e85de10000000a11402f/frameset.htm -
How do I create a History enabled table via the HANA Script. I went through the development guide and do not find any mention of a parameter to enable History ? Is this functionality available via the SQL Console Only ?
How do I create a History enabled table via the HANA Script. I went through the development guide and do not find any mention of a parameter to enable History ? Is this functionality available via the SQL Console Only ?
-
Customer payment history - KNB4 table
Hello everybody,
I am facing the followig situation in a production system of one of my clients:
- the report S_ALR_87012177 (reading the table KNB4) outputs an amount (let's say x) as payments for a certain customer
- report FBL5N shows a different amount (let's say y, bigger then x)
We checked and the mark "Indicator: Record Payment History" was not unmarked for that customer.
Do you have some suggestions to look for the difference?
Thank you,
oanaDear,
Check whether some of the payments posted with posting keys other than 05. Because posting keys 05,06,08 and 15,16,18 are related to payment if posting keys used were different than these then difference may occur.
Moreover, If you select the indicato Record Payment History in the customer master after the payment is posted then system will not update the old data.
Regards,
Chintan Joshi -
NEED ALTER TABLE ALTER COLUMN FOR DATE FORMAT
Need something like this :
ALTER TABLE ABC
ALTER COLUMN DATE1 AS (DD/MM/YYYY)
need to appear in this format (29/03/2014) in the table.
also needs to be recorded in DB in that format.changed system date format, works. Thanks!
You should always store values as dates itself in date/datetime related field in SQLServer
The formatting can very easily be done in your front end (presentation layer) using format function
Even in T-SQL you can use CONVERT or FORMAT functions to get the date values in the format you want
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page
I don't follow you? Anyway, Olaf Helper's answer was the solution.
SQL Server has a data type called DATETIME. To correctly query dates, it is easier to use this as it allows the SQL engine to do all the calculations for you, also the canonical format for dates in any database language is YYYY-MM-DD, this ensures correctly
tiered dates that are stored in the right order. The way you store data and the way you display it should be kept as two seperate entities. This is the ISO standard and has been thoroughly investigated ...alot to say the least. This is where the term "front-end"
and "back-end" developers come from, and also the distinction between server-side and client-side scripting.
To cut a long story short, take the advice of the multiple professionals here, and follow standards otherwise you'll find yourself stuck, or worse, your legacy code will make someone tear their hair out. -
Hello
I am trying to find out which table in SQL the buffer history (ST02) data is stored?
Please let me know.
Thank you
KenHi dude!
Clas Hortien's advise is simply great, as it will be useful not just to guess the tables you need right now but also in the future.
Just to help you in case you are not familiar with ST05: when you are reading the trace, you can summarize times in order to get it simpler and in a easier format to read (not just chronologic): go to the menu "Trace list" and select "Summarize Trace by SQL Statement (Shift+F8)". Under the column "Obj. name" there are the names of the tables read.
Cheers!!
--Jesú -
Hi ,
I m writin a bex report using datasourse 0CRM_SALES_ACT_1 for activity.
Report consist of Case management involves created date of case and last changed date .
but i m unable to find the last changed date.
CAn any CRM*BW expert comment of this or may be tables which contains history log .Hi,
you could have a look at Workspace Manager. It is one of the option for which it was intented.
See http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28396/toc.htm
Herald ten Dam
htendam.wordpress.com -
Alter Table Add column not null default value
I want to add two columns to a table with not null and default as 0 for both columns
Can i write the whole in one statement or do i have to split statement
I tried this, but didn't work
alter table DWSODS01.DWT00301_ORD_DTL_OMS add (
COMB_ORD_FLG NUMBER(5,0) default 0 not null,
COMB_ORD_NO NUMBER(12,0)
default 0 not null);
How can i modify the code?user10390682 wrote:
I tried this, but didn't workSince you are specifying default values, it should work (regardless if table DWSODS01.DWT00301_ORD_DTL_OMS is empty or not):
SQL> select count(*) from emp1
2 /
COUNT(*)
14
SQL> alter table emp1 add (
2 COMB_ORD_FLG NUMBER(5,0) default 0 not null,
3 COMB_ORD_NO NUMBER(12,0)
4 default 0 not null);
Table altered.
SQL> desc emp1
Name Null? Type
EMPNO NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER(2)
COMB_ORD_FLG NOT NULL NUMBER(5)
COMB_ORD_NO NOT NULL NUMBER(12)
SQL> What error are you getting?
SY. -
Alter table tablename drop column col
I tried to drop a column from a table created by sys user. Being a sys user I am unable to drop the column. Please explain.
SQL> alter table test move tablespace users;
Table altered.
SQL> alter table test drop column two;
alter table test drop column two
ERROR at line 1:
ORA-12988: cannot drop column from table owned by SYS
Here two is the column name.
Regards
Vijay KumarHello Gasparotto
It is amazing to me. Being a sys user I created a table and then I tried to alter the table by dropping a column but it is giving me error as I have already stated. Please explain over this issue.
Regards
Vijay Kumar -
Hi All,
when i run this script i get an error because of BEFUPD trigger on this table
alter table gt_contract add (gf_isAtype char(1) default 'N' constraint GC_contAtype check (gf_isAtype in ('Y','N')))
i am running the same script for some other table also by ust changin the table and constraint name and it's working fine. Both tables have BEFUPD trigger and works FOR EACH ROW
the error msg is
ERROR at line 1:
ORA-20001: Error :Assigning new values to New RecordORA-06508: PL/SQL: could
not find program unit being called
ORA-06512: at "CIQDE3.ST_CONTRACT_BEFUPD", line 345
ORA-04088: error during execution of trigger 'CIQDE3.ST_CONTRACT_BEFUPD'
Plz suggestDEFAULT 'N' clause causes execution of BEFORE UPDATE trigger.
ORA-20001 is the user-defined exception probably raised in
the exception section of your trigger code using raise_application_error procedure.
You should analyze the trigger code and find the place the error occures.
Try to comment your exception section in the trigger to find where error is
raised.
Rgds. -
What is the version of grant alter table, drop table to user in Oracle 10g?
Hi,
Oracle support "grant alter table and drop table" before, but I get the "invalid privilege" error in Oracle 10g. Oracle 10g have the "DROP ANY TABLE" and "Alter any table". Is these two means can drop and alter tables belonging to other users? How do I grant the total control (CRUD) of tables in the owner's schema to the owner in Oracle10g?
Thanks,
JiangCREATE TABLE privilege grants complete control on owner's tables :
SYS@db102 SQL> create user test01 identified by test01;
User created.
SYS@db102 SQL> grant create session, create table to test01;
Grant succeeded.
SYS@db102 SQL> alter user test01 quota unlimited on users;
User altered.
SYS@db102 SQL> conn test01/test01
Connected.
TEST01@db102 SQL> create table test(a number);
Table created.
TEST01@db102 SQL> alter table test add(b varchar2(100));
Table altered.
TEST01@db102 SQL> drop table test purge;
Table dropped.
TEST01@db102 SQL> -
Multiple Alter Table Statements in one batch
Hi Team,
We have in one of our upcoming release two columns being added to a table that has over 20 million records and 14 indexes.
We needed to add two columns to the table both not null (bit). Because it was taking a while to add the columns, we thought that putting these two alter statements in one batch would speed up the operation significantly but to my surprise it did not.
Conclusion from my test: individual alter statements or batch alter statements take the same time
Here are me test and results - table Order1 and Order2 are exactly the same structure and data.
Test case 1:
===================
ALTER TABLE Order1
ADD OR_N BIT DEFAULT 0 NOT NULL
go
ALTER TABLE AccountTradeConfirmation_Alter1
ADD OR_S BIT DEFAULT 0 NOT NULL
Go
Elapsed Time: 2 hrs
Mar 18 2015 5:56PM
(1 row affected)
Non-clustered index (index id = 3) is being rebuilt.
Non-clustered index (index id = 4) is being rebuilt.
Non-clustered index (index id = 5) is being rebuilt.
Non-clustered index (index id = 6) is being rebuilt.
Non-clustered index (index id = 7) is being rebuilt.
Non-clustered index (index id = 8) is being rebuilt.
Non-clustered index (index id = 9) is being rebuilt.
Non-clustered index (index id = 10) is being rebuilt.
Non-clustered index (index id = 11) is being rebuilt.
Non-clustered index (index id = 12) is being rebuilt.
Non-clustered index (index id = 13) is being rebuilt.
Non-clustered index (index id = 14) is being rebuilt.
(21777920 rows affected)
Non-clustered index (index id = 3) is being rebuilt.
Non-clustered index (index id = 4) is being rebuilt.
Non-clustered index (index id = 5) is being rebuilt.
Non-clustered index (index id = 6) is being rebuilt.
Non-clustered index (index id = 7) is being rebuilt.
Non-clustered index (index id = 8) is being rebuilt.
Non-clustered index (index id = 9) is being rebuilt.
Non-clustered index (index id = 10) is being rebuilt.
Non-clustered index (index id = 11) is being rebuilt.
Non-clustered index (index id = 12) is being rebuilt.
Non-clustered index (index id = 13) is being rebuilt.
Non-clustered index (index id = 14) is being rebuilt.
(21777920 rows affected)
Mar 18 2015 7:52PM
Test case 2:
===================
ALTER TABLE Order2
ADD OR_N BIT DEFAULT 0 NOT NULL, OR_S BIT DEFAULT 0 NOT NULL
go
2 hrs elapsed time
Mar 20 2015 11:10AM
(1 row affected)
Non-clustered index (index id = 3) is being rebuilt.
Non-clustered index (index id = 4) is being rebuilt.
Non-clustered index (index id = 5) is being rebuilt.
Non-clustered index (index id = 6) is being rebuilt.
Non-clustered index (index id = 7) is being rebuilt.
Non-clustered index (index id = 8) is being rebuilt.
Non-clustered index (index id = 9) is being rebuilt.
Non-clustered index (index id = 10) is being rebuilt.
Non-clustered index (index id = 11) is being rebuilt.
Non-clustered index (index id = 12) is being rebuilt.
Non-clustered index (index id = 13) is being rebuilt.
Non-clustered index (index id = 14) is being rebuilt.
(21777920 rows affected)
Mar 20 2015 1:12PMHi Kiran,
I have read your response a few times and I was not able to understand your angle. I assume based on the results of my test that Sybase does the following in processing the alter statements
ALTER TABLE Order2
ADD OR_N BIT DEFAULT 0 NOT NULL, OR_S BIT DEFAULT 0 NOT NULL
go
process alter ADD OR_N BIT
-- > make copy of table
---> alter original table
--> put data back in
process alterOR_S BIT
-- > make copy of table
---> alter original table
--> put data back in
rebuild index
my expectation was that it would make a copy of the table only once and process the two alter statements. Also when doing the alter separately (test1) it rebuilt the index twice, however using the batch the index was rebuilt once (at least only one message displayed).
Regards. -
How to alter or add foreign key constr to table having child rows or data
Hi,
I have a table by name DEPT in which the column DEPTNO is a primary key column and have data in it for all the columns . Now I have a EMP table where in the column DEPTNO is not having any constraint including foreign key constraint too. Now i have data in the EMP table for all the columns . now i would like to add the foreign key constraint to DEPTNO column in the EMP table referencing the DEPTNO column in the DEPT table. Both the table do not have any null values .
I need to add the foreign key without deleting the data in the EMP table.
Please advice.
Regards,
VineshHi,
I need to add the foreign key without deleting the data in the EMP table.Foreign key constraint can have only those values which are present in the primary key of the parent table or null.
When your tables are populated with values and then you are adding the constraint then,
the parent table data is only present in child table or null values.
Example
SQL> create table emp_bkp as select * from emp;
Table created.
SQL> create table dept_bkp as select * from dept;
Table created.
SQL> alter table dept_bkp
2 add constraint pk_deptno primary key(deptno);
Table altered.
SQL> select distinct deptno from emp_bkp;
DEPTNO
30
20
40
10
SQL> select deptno from dept_bkp;
DEPTNO
10
20
30
40
55
SQL> alter table emp_bkp
2 add constraint fk_deptno_bkp foreign key(deptno)
3 references dept_bkp(deptno);
Table altered.
SQL> alter table emp_bkp
2 drop constraint fk_deptno_bkp;
Table altered.
SQL> insert into emp_bkp(empno,ename,deptno) values(142,'Fenny',90);
1 row created.
SQL> alter table emp_bkp
2 add constraint fk_deptno_bkp foreign key(deptno)
3 references dept_bkp(deptno);
add constraint fk_deptno_bkp foreign key(deptno)
ERROR at line 2:
ORA-02298: cannot validate (SCOTT.FK_DEPTNO_BKP) - parent keys not found
SQL> update emp_bkp
2 set deptno=null
3 where empno=142;
1 row updated.
SQL> alter table emp_bkp
2 add constraint fk_deptno_bkp foreign key(deptno)
3 references dept_bkp(deptno);
Table altered.
SQL> insert into dept_bkp (deptno,dname)values(90,'IT');
1 row created.
SQL> update emp_bkp
2 set deptno=90
3 where empno=142;
1 row updated.Twinkle -
Alter table reaching the max number of char 4000, CLOB? NCLOB?
I have a column is a table defined as a VARCHAR2(4000)
I try to alter the table
alter table sybaapc
MODIFY SYBAAPC_EXTRACURRICULAR VARCHAR2(5000)but it give me this error
ORA-00910: specified length too long for its datatype
I want the users to be able to enter more information on that column.
It seems that 4000 is the max we are in Oracle 10g
can I changed to CLOB or nclob, we already have data in that table?
What are the implications of changing it to clob or nclob,Thats becuase the maximum character length for a table column is 4000.
Alternatively you can:
SQL> create table test_1 (col1 VARCHAR2(4000))
2 /
Table created.
SQL> insert into test_1 values(RPAD('*',4000,'*'));
1 row created.
SQL> commit;
Commit complete.
SQL> alter table test_1 modify (col1 clob);
alter table test_1 modify (col1 clob)
ERROR at line 1:
ORA-22858: invalid alteration of datatype
SQL> alter table test_1 add(col2 clob);
Table altered.
SQL> update test_1 set col2 = col1;
1 row updated.
SQL> commit;
Commit complete.
SQL> alter table test_1 drop column col1;
Table altered.
SQL> alter table test_1 rename column col2 to col1;
Table altered.
SQL> desc test_1
Name Null? Type
COL1 CLOB
SQL>
SQL> select * from test_1;
COL1
SQL> Edited by: AP on Aug 24, 2010 7:41 AM -
Replicating DDL, but only for ALTER TABLE/CREATE TABLE
We're looking to use Streams to replicate our database, for Warehouse use. We're not looking to use any ETL, but rather copy the table structures & data over identically as they appear in the source database. We'll add indexes in a custom step. Otherwise, though, we don't need TRIGGERs, PROCs, VIEWs etc.
Is this possible in Streams? Probably asking if it's possible is the wrong question ... Is this something that is normally done, or does it bring with it a significant amount of complexity, plus some extra things to note (like, "..don't forget TRUNCATE also...")
Thanks,
ChuckSorry to bump this one ...
So, if our intent is to copy over all tables in a specified list of shemas, in their current form, and then we wanted to capture:
INSERTs
UPDATEs
DELETEs
TRUNCATE TABLE
ALTER TABLE (but excluding anything related to CONSTRAINTS)
(... I'm thinking that's all we'd need to keep a copy of the main db in the warehouse, without a DBA having to "retouch" the warehouse to keep it in sync ...)
Would that be considered a complicated configuration? The ALTER TABLE piece sounds picky enough, that it could be a headache ... but I'm thinking the Oracle reps were being pushy about the amount effort needed to set this environment up.
--=Chuck
Maybe you are looking for
-
Tried to set up Family Sharing for wife and two kids. Disaster. Everyone is locked out for 364 days. How can I disable Family Sharing? I do not want my purchased content locked up in some Apple beta test.
-
How would I create a Summary Chart for the Current Year Using a Count by Month?
Post Author: MarkS CA Forum: Charts and Graphs I have a data set of 3 date fields. I would like to create a summary counting all of the occurrances of each of these dates per month, similar to using a SumProduct() command in excel. For example, my d
-
Mapping Help for replacing source value
Mapping Help for replacing source value Posted: Mar 14, 2006 1:06 AM Reply Hi all, I am unable to do transform the source value to required target value, From Source ADDRESS_TYPE = 'HOME' should be replaced with 03 to target field ANSSA, and 'MAI
-
AME encoding old dynamic link clips
I've run into this issue a couple times, and it's caused some embarrassment for me with clients. I start with a title card in AE and add it to my Premiere timeline via dynamic link. My client will ask me to change the font in the title card. So I go
-
Hi folks, I have read through some threads about SCSI but can't find anything I can use for my problem. I don't even know what kind of card I have --I'm technically challenged and don't get the inner working of a computer (this includes the system, I