How to find which create the table?
Let's say I have a user named IMSDBA, and many users have IMSDBA privilege account.They can log on using that account and do some operations under this scheme.
And someday, someone has created a table under the scheme. So I wonder if it is possible to know who actually created this table?
PS: Each user who can log in as IMSDBA has corresponding Emplyee ID and address related to specific PC.
Any ideas would be highly appreciated :-)
Thanks in advance!
Published by: PhoenixBai on September 17, 2009 10:40
Now, if you are using Oracle audit to audit things like CREATE TABLE for IMSDBA, SYS. AUD$ seize among other things, the USERHOST and TERMINAL. Assuming you're only worried about the direct connections, not of three applications at several levels, this should give you the information you need determine which machine was used and, therefore, that the user. In hindsight, if your database is in ARCHIVELOG mode and you have logs archived in time of creating the table, you can use LogMiner to get this information as well.
Of course, standard safety advice would be that each user has a separate Oracle account that they use to simplify the task of checking who did what.
Justin
Tags: Database
Similar Questions
-
How to find duplicates in the table
I have a table with 3 columns
name of the table - used
empcode firstname lastname
XYZ 123 pk
yzz 456 pk
101 kkk jk
ALTER TABLE employee
ADD (CONSTRAINT PRIMARY KEY employee_PK
(empcode, firstname, lastname))
all the three columns are as key to porimary, we are migrating the data, there are problems with the data as the cobination of all three, resulting in duplicate, in the last column is supposed to be duplicates but first two columns will not have the duplicate and a complete line of the table (combination have no duplicates)
a query need to find duplicates to validate the whole lines(B-)
select empcode,firstname,lastname,count(*) from employee group by empcode,firstname,lastname having count(*)>1;
-
How to find which user have the Channel Manager
Hello
How to find which user are responsible for R12 Channel Manager.
And how to invite the partner already in the list of my partners.
Please answer me as soon as possible
Thank you
VivekHow to find which user are responsible for R12 Channel Manager.
You can run 'The responsibility one users' simultaneous program or run the script in (how to find Out who the responsibility has been granted to A specific user? [ID] 304687.1).
Please answer me as soon as possible
For the responses of the ASAP, please log an SR.
Thank you
Hussein -
Could not commit: ORA-00928: lack of creating the table SELECT keyword
Hello guys.
I tried to create the table with web interface on oracle 11g.
I just follow this path on interface: schema-> table-> create-> standard (lot organized)-> SQl select on (set using the)->
and I just use these scripts to create the table:
CREATE TABLE suppliers
(the number (10) of supplier_id not null,)
supplier_name varchar2 (50) not null,
Contact_Name varchar2 (50)
);
but this error occurred: failed to commit: ORA-00928: lack of SELECT key word!
Please lock on this picture for more information: http://s17.postimg.org/kgoumzmvz/attachment.jpg
could you help me please?
and I could not find any manual for working with the web interface in oracle 11g.
Please give me somesources to start.
Thank you.1003778 wrote:
Thank you sybrand_b
but I already read this document.
Unfortunately, there is nothing on the creation of table with sql scripts in this document!and I really don't understand how to create table with SQL commands! My question has not yet been answered.
you please give me little details about it?
for example, how can create table using this sql command:CREATE TABLE suppliers
(the number (10) of supplier_id not null,)
supplier_name varchar2 (50) not null,
Contact_Name varchar2 (50)
);Thank you.
Edited by: 1003778 may 3, 2013 11:43
When you got to the CREATE TABLE screen, you have selected "set using the--> SQL.
Did you notice in the window that appears, just above this entry field is this text: "enter a SQL * select * statement below.» ' + This query results will be used to fill the table with Canada.* + "(underlining)
And hip, just to the left of this field is this text: «CREATE TABLE AS»He tries to build a ' CREATE TABLE AS SELECT... ». Creates a table with the same structure as the table in which you SELECT and fills with the results of this SELECT '. With your entry, you create a CREATE TABLE AS CREATE TABLE to read statement...
If you want to create your tables with a simple CREATE TABLE command, go to sqlplus and do it. You want to have a graphical interface to help build a simple CREATE table, when you get to the CREATE TABLE page, just to stay there with the default "use Define-> column specification." If you want, after completing "build" your table specification here, you will have a "Show sql" option to show you the actual sql statement that will be executed to create your table.
-
How to add icons in the table?
Hello
I'm new to ADF, I created the table with the collection Panel, now want to add icons for operations as shown in the image below for
new, update, delete. ?
Any body please tell me how to do?
Kind regards
Peyrot
Add the toolbar button is the first step, and then you can change the "Icon" property of the button.like this
and find the icon you want.
PS: you best choice a .png image.
-
create the table in SELECT (question)
Hello
In regards to create the table as subquery, I read that:
The data type of column definitions and the NOT NULL constraint are passed to the new table. Note that only the explicit NOT NULL constraint is inherited. The PRIMARY KEY column will not function NOT NULL column null. Any other rule of constraint is not passed to the new table. However, you can add constraints in the column definition.
Can someone explain to me how to do this? Or, how we need to specify the constraints (and also the default values for columns, because it is possible) for the columns in the column definition?
In addition, I do not understand this: the PRIMARY KEY column will not function NOT NULL column zero.
Can someone give me some small examples regarding these?
For example, it generates an error:
Thank you!create table test1 (a, b, c default sysdate) as select 1, 'b' from dual
Edited by: Roger22 the 01.09.2011 11:37Hello
When you set a primary key consists of a unique constraint and a constraint not null, but they are both implicit with the primary key. When you create the table because it will copy only the explicitly declared NOT NULL constraints so it isn't look upward than the implicit NOT NULL primary key.
SQL> create table dt_pk 2 ( id number primary key, 3 col1 number not null, 4 col2 number 5 ) 6 / Table created. SQL> desc dt_pk Name Null? Type ----------------------------------------- -------- ---------------------------- ID NOT NULL NUMBER COL1 NOT NULL NUMBER COL2 NUMBER SQL> create table dt_pk2 as select * from dt_pk; Table created. SQL> desc dt_pk2; Name Null? Type ----------------------------------------- -------- ---------------------------- ID NUMBER COL1 NOT NULL NUMBER COL2 NUMBER SQL> select constraint_name,constraint_type from user_constraints where table_name='DT_PK' 2 / CONSTRAINT_NAME C ------------------------------ - SYS_C006935772 C SYS_C006935773 P SQL> select constraint_name,constraint_type from user_constraints where table_name='DT_PK2' 2 / CONSTRAINT_NAME C ------------------------------ - SYS_C006935774 C
However, a primary key can reuse existing constraints and indexes instead of declaring new. For example, we can explicitly declare a constraint not null on the column id and then create a primary key. This means that we will now inherit the constraint not null in the ETG, as it has been explicitly declared and is a constraint separate in there own right that has been 'borrowed' by the pk constraint.
SQL> create table dt_pk3 (id number not null, col1 number not null, col2 number); Table created. SQL> alter table dt_pk3 add constraint dt_pk3_pk primary key (id); Table altered. SQL> select constraint_name,constraint_type from user_constraints where table_name='DT_PK3' 2 / CONSTRAINT_NAME C ------------------------------ - SYS_C006935775 C SYS_C006935776 C DT_PK3_PK P SQL> create table dt_pk4 as select * from dt_pk3; Table created. SQL> desc dt_pk3; Name Null? Type ----------------------------------------- -------- ---------------------------- ID NOT NULL NUMBER COL1 NOT NULL NUMBER COL2 NUMBER SQL> desc dt_pk4; Name Null? Type ----------------------------------------- -------- ---------------------------- ID NOT NULL NUMBER COL1 NOT NULL NUMBER COL2 NUMBER
Regarding the definition of the default values, you must always specify the column in the select, but doing so means follow you the semantics of a default in a standard INSERT statement, i.e. you specified the column, you must provide a value, in which case even if the value is null, the default value will not be used. However, the new inserted rows where the column with the default value is not specified will revert to the default.
SQL> create table test1 (a, b, c default sysdate) 2 as 3 select 1, 'b' from dual 4 / create table test1 (a, b, c default sysdate) * ERROR at line 1: ORA-01730: invalid number of column names specified SQL> create table test1 (a, b, c default sysdate) 2 as 3 select 1, 'b', null c from dual 4 / select 1, 'b', null c from dual * ERROR at line 3: ORA-01723: zero-length columns are not allowed SQL> create table test1 (a, b, c default sysdate) 2 as 3 select 1, 'b', cast(null as date) c from dual 4 / Table created. SQL> select * from test1; A B C ---------- - --------- 1 b SQL> insert into test1(a,b) values(2,'b'); 1 row created. SQL> select * from test1; A B C ---------- - --------- 1 b 2 b 01-SEP-11
To create a constraint, you must list all columns without the data types and constraints list online.
SQL> create table dt_cons (id number, col1 number, col2 number, constraint chk2 check(col2 IS NULL or col2>10)) 2 as select * from dt_pk3 3 / create table dt_cons (id number, col1 number, col2 number, constraint chk2 check(col2 IS NULL or col2>10)) * ERROR at line 1: ORA-01773: may not specify column datatypes in this CREATE TABLE SQL> create table dt_cons (constraint chk2 check(col2 IS NULL or col2>10)) 2 as select * from dt_pk3 3 / create table dt_cons (constraint chk2 check(col2 IS NULL or col2>10)) * ERROR at line 1: ORA-00904: : invalid identifier SQL> create table dt_cons (col2 constraint chk2 check(col2 IS NULL or col2>10)) 2 as select * from dt_pk3 3 / create table dt_cons (col2 constraint chk2 check(col2 IS NULL or col2>10)) * ERROR at line 1: ORA-01730: invalid number of column names specified SQL> create table dt_cons (id,col1,col2 constraint chk2 check(col2 IS NULL or col2>10)) 2 as select * from dt_pk3 3 / Table created. SQL> desc dt_cons Name Null? Type ----------------------------------------- -------- ---------------------------- ID NOT NULL NUMBER COL1 NOT NULL NUMBER COL2 NUMBER SQL> insert into dt_cons values(2,2,2); insert into dt_cons values(2,2,2) * ERROR at line 1: ORA-02290: check constraint (JJACOB_APP.CHK2) violated SQL> insert into dt_cons values(2,2,10); insert into dt_cons values(2,2,10) * ERROR at line 1: ORA-02290: check constraint (JJACOB_APP.CHK2) violated SQL> insert into dt_cons values(2,2,11); 1 row created. SQL> insert into dt_cons values(2,2,null); 1 row created. SQL>
HTH
David
-
Creating the table and get the invalid identifier
Thank you so much Ed (and all those who responded) to my previous post!, you all be extremely useful.
In fact, I have another question... Can I repost a new thread or continue on this one?
Here's my problem.
create the table DonationEvent
('ID' NUMBER (1,1) Not Null,)
"EventNumber" NUMBER (1,1) Not Null,
'Type' char (30) Not Null,
"OrganizerName' char (30) Not Null,
'Location' char (30) Not Null,
'Date' NUMBER (10.1) Not Null,
'Time' char (30) Null,
"DonationTotal" NUMBER (10.1) Not Null,
Primary Key (ID),
);
Getting ORA-00904: invalid identifier
Also I use Express Edition 10g, how can I get a view of context to see the line where error occurs?Cushgod wrote:
I always get invalid identifiers... Your focus is so useful! My teacher is not useful. At his table did not work it would be copy and paste that work and say that he didn't had the time to debug it... I can't even say what my mistake is on in the Express edition...What do you use to write/test your sql? That's why I asked sqplus. This is the basic sql shell. In the examples I showed you I had by the sql in a text (doit.sql) file, shot to the top of sqlplus, connect to the base, execute "doit.sql".
You're my only hope! Thank you very much in advance, I learn a little which makes me question why my teach would even use "" eventid NUMBER (1,1) not null "" after your explanation. " It's not supposed to have a decimal number to a primary key event IDS... anyway thanks in advance.
create the table DONATIONEVENT
(eventid NUMBER (5) Not Null,)
eventnumber NUMBER (9) Not Null,
EventType VARCHAR2 (30) Not Null,
OrganizerName VARCHAR2 (30) Not Null,
location VARCHAR2 (30) not Null,
EventDate DATE Not Null,
duration VARCHAR2 (30) Null,
donationtotal NUMBER (10.2) Not Null,Primary Key (ID),
);
If I use a DATE instaed (4) no setting, I get "' missing right parenthesis"... once again. I counted my bracket and the match 10 (and 10)
See below.DATE is right. Where did you get the idea of DATE (4)?
The documentation site (tahiti.oracle.com) Oracle seems to be down at the moment, but you really, * really *, * REALLY * need to get there and take the reference SQL and SQL * reference manuals more.
create the table DONATIONEVENT
(eventid NUMBER (5) Not Null,)
eventnumber NUMBER (9) Not Null,
EventType VARCHAR2 (30) Not Null,
OrganizerName VARCHAR2 (30) Not Null,
location VARCHAR2 (30) not Null,
EventDate DATE (4) Not Null,
duration VARCHAR2 (30) Null,
donationtotal NUMBER (10.2) Not Null,Primary Key (ID),
);
-
How to find out what the police are actually using Firefox?
How to find out what the police are actually using Firefox?
Inspect the element don't say what substitute fonts.Firefox 24 ESR has the tab fonts in the Inspector, which shouldn't be a problem.
-
How to find which mailbox I dragged by mistake an email to?
How to find which mailbox I dragged by mistake an email to?
If you are inferring an operation track drag and drop activity, I don't think there is one. You should be able to get it, however, if you know the subject, content or sender.
-
create the table, otherwise there is?
I need to run a script that includes create table and insert some in this table, but it fails after the second run because the table exists.
Is it possible to have a command like.., create the table, otherwise it is..., which does not give me of the errors after the second run?
CREATE TABLE BREND
(
ID VARCHAR2 (10) PRIMARY KEY NOT NULL,
NAME VARCHAR2 (100) NOT NULL
);
INSERT IN BREND (ID, NAME) VALUES ('1 ', 'o2');
CREATE TABLE USER_BREND
(
ACTIVATE THE 'USER_ID' NUMBER (19.0) NOT NULL,
ACTIVATE THE "BREND_ID" VARCHAR2 (10) NOT NULL,
'USER_BREND_PK' CONSTRAINT PRIMARY KEY ('USER_ID', 'BREND_ID'),
"USER_BREND_USER_FK' FOREIGN KEY ('USER_ID') CONSTRAINT
ACTIVATE THE REFERENCE 'USER' ('ID') ON DELETE CASCADE,
"USER_BREND_BREND_FK' FOREIGN KEY ('BREND_ID') CONSTRAINT
SELECT REFERENCES "BREND' ('ID') ON DELETE CASCADE
);
COMMENT ON THE COLUMN "USER_BREND." ' ' User_id ' IS "associated Foreign key for the user;
COMMENT ON THE COLUMN "USER_BREND." "BREND_ID" IS "foreign key for the associated brend ';
INSERT INTO 'USER_BREND' (SELECT ID as USER_ID, '1' user BREND_ID')
Hello
Try the code below, I placed an exception for no data found:
DECLARE v_emp int:=0; BEGIN SELECT count(*) into v_emp FROM dba_tables where table_name = 'BREND' and owner ='ME'; EXCEPTION WHEN NO_DATA_FOUND then EXECUTE IMMEDIATE 'create table BREND ( ID VARCHAR2(10) PRIMARY KEY NOT NULL, NAME VARCHAR2(100) NOT NULL)'; END; /
Kind regards.
-
Generate the DDL to create the table in the database
Hi all
I want to create the new fact and Stadium as being under the statement:
(1) in the designer, access the models > Oracle BI Applications (folder) > (model) Oracle BI Applications > done (sub-model) step, right click on the WC_SAMPLE_FS data store and select duplicate the selection.
2) double-click the new data store, and then rename it. Name and resource name must match the name of the actual table. Alias can be the same or greater value easy to use.
(3) in the sub-tab of the columns, add all columns.
(4) repeat the same steps to create the fact Table by copying the data store WC_SAMPLE_F under the submodel of "facts".
(5) for the fact table, define the type of OLAP to "fact Table.
(6) generate the DDL to create the table in the database.
In step 6, I don't know where and how to generate the DDL to create the database table. Please help me. If you have another tutorial with screenshot, please share with me. Thank you.
Kind regards
Cong
Hi Cong,
Please see section 6.3 DDL generation of scripts in this link:
Working with the Designer of the common Format - 11g Release 1 (11.1.1)
I hope this helps.
Thank you!
Saran.
-
Create the Table as and hybrid columnar Compression
I'm looking to connect to tables help to create the table as I had a question about columnar Compression hybrid. For the test, I found that the uncompressed daata will be approximately 10 to and compressed data will be around 1 TB. I anticipate compress the table when the table to create as an instruction and wanted to know in what order Oracle forge do compression, that is, the table will be created then Oracle will compress the data or will the compressed table that the table will be created. The motivation behind the question is to see how much storage I need to complete the operation.
Thank youIf you are using
create table xxx compress for query high what to choose...While the data will be compressed before insertion, so in your case, it will use about 1 TB of disk space
-
Creating the table with time stamp
I need to create the table with the data inside buffer
Can you help me pls
If it works today,
create the table test_04NOV2010 in select * from product where product_code = '101'
If executed tmrw,
create the table test_05NOV2010 in select * from product where product_code = '101'
can is it you pls let me know how to use it in PL SQLdeclare v_date varchar2(25); v_sql varchar2(20); begin select to_char(sysdate,'DDMONYYYY') into v_date from dual; v_sql := ' create table ' ||TEST||'_'||'v_date'|| ' as ' ' select * from Product where product_code = '101' EXECUTE IMMEDIATE v_sql; end;
Can you help me pls
Thank you very muchdeclare v_date varchar2(25); v_sql varchar2(2000); --Noted this. this was also small. begin select to_char(sysdate,'DDMONYYYY') into v_date from dual; v_sql := ' create table TEST_'||v_date|| ' as select * from Product where product_code = ''101'''; EXECUTE IMMEDIATE v_sql; end;
You can use the Q operator also.
DECLARE v_date varchar2(25); v_sql varchar2(2000); BEGIN select to_char(sysdate,'DDMONYYYY') into v_date from dual; v_sql := ' create table TEST_'||v_date|| Q'[ as select * from Product where product_code = '101']'; EXECUTE IMMEDIATE v_sql; END;
Published by: mohamed on November 4, 2010 05:32
-
How to find out if the new menus or responsibilities have been added to the system
Dear Sir
Please let me know how to find out if the menus or the responsibilities have been added to the system.
OUL5 x 64
EBS r12 12.0.6
Thanks-TomIt is a unique work, or you should always know when a new menu/responsibility is added?
If it is a time of employment, then you can write a query on the 2 tables (fnd_menus_tl and fnd_responsibility_tl)Select * from fnd_menus_tl where creation_date > sysdate - 7
Select * from fnd_responsibility_tl where creation_date > sysdate - 7
If you need to do every time, then you can write an alert.
Go to a responsibility to Alert Manager > alerts > set
Process = system administration
name = my Menu new alert
Click event
Check the insert box, clear the check box update
application = application object library
Table = fnd_menus_tl (or fnd_responsibility_tl)
Select = Select responsibility_name in & output1 fnd_responsibility_tl where rowid =: rowid
or, select user_menu_name in & output1 fnd_menus_tl where rowid =: rowid
Save
define an action
attribute to the set of scripts
make sure click the alert details and enter installation detailsHope that answers your question
Sandeep Gandhi
Independent consultant
513-325-9026. -
Trying to create the table using Clause any Union with Select multiple stmts
The motion seeks to get the substring of the value to for example.
If the value is * ASA 2 * then so do ASA
where as if the value is * 1.5 TST * it sholud come as TST as wise for others too.
I am trying to execute stmt SQL written but in error as below:
* ' ORA-00998 must appoint this expression with the alias column 00998.00000 - must appoint this expression with the column alias. "
CREATE TABLE TEST_CARE AS
(
SELECT row_id, old_care_lvl, SUBSTR(old_care_lvl,3), len test_care_lvl FROM
WHERE LENGTH (old_care_lvl) = 5
UNION ALL
SELECT row_id, old_care_lvl, SUBSTR(old_care_lvl,3), len test_care_lvl FROM
WHERE LENGTH (old_care_lvl) = 7
UNION ALL
SELECT row_id, old_care_lvl, SUBSTR(old_care_lvl,3), len test_care_lvl FROM
WHERE LENGTH (old_care_lvl) = 14
UNION ALL
Row_id SELECT, old_care_lvl, SUBSTR (old_care_lvl, 3), LEN test_care_lvl
WHERE LENGTH = 7 AND old_care_lvl (old_care_lvl) = "Regular."
);
I want to create the table using the above given the multiple selection by using the Union ALL clause, but trying to create run query error like "ORA-00998 must appoint this expression with the alias column 00998.00000 - must appoint this expression with the column alias.
Please guide me how to approach to solve this problem.
Thanks in advance.Try this->
CREATE TABLE TEST_CARE AS select * from ( SELECT row_id, old_care_lvl,SUBSTR(old_care_lvl,3), len FROM test_care_lvl WHERE LENGTH(old_care_lvl) =5 UNION ALL SELECT row_id, old_care_lvl,SUBSTR(old_care_lvl,3), len FROM test_care_lvl WHERE LENGTH(old_care_lvl) =7 UNION ALL SELECT row_id, old_care_lvl,SUBSTR(old_care_lvl,3), len FROM test_care_lvl WHERE LENGTH(old_care_lvl) =14 UNION ALL SELECT row_id, old_care_lvl,SUBSTR(old_care_lvl,3),LEN FROM test_care_lvl WHERE LENGTH(old_care_lvl) =7 AND old_care_lvl ='Regular' );
N.B.: Not tested...
Kind regards.
LOULOU.
Maybe you are looking for
-
does not open to the home page
Recently when I opened my firefox browser, whenever it does not open the home page. Instead, it opens to the last page I was on until I closed out of the browser. I tried to reinstall firefox, and that has not changed anything. I use windows 7.
-
Your current settings of Firefox might make it difficult to use connection Notifications.
I get this in facebook, when I tried 2 activate Login Notifications and im having trouble with the chat, I have 2 update the GET pg 2 the answer when I post a cat
-
Windows difender is corrupt. does not
Windows Defender does not work on my pc with vista. I am unable to turn on because it shows the error by clicking turn on. is it necessary to activate for the bases of security of microsoft (anti virus) to work? Help, please
-
BlackBerry Smartphones Yahoo Calendar
How can I sync my Yahoo calendar? In addition, can I get my phone calendar to synchronize to Yahoo?
-
Smartphones blackBerry HOW to SEE MY GLOBAL ADDRESS BOOK
I have a Blackberry 8310. I turned on the filter in my address book to see the addresses in one of my many categories. Now, I can't escape the sight of my address book filter to see the global address book. What I would do. Thanks for the suggestions