SQL & PL/SQL :: Grant Alter Table?

Jul 26, 2011

if a user have alter table gant but could not alter .. what additional grant it need

SQL> alter table HRS_PERS_FIELDS_INC modify(PER0000252 NUMBER(19,3));
alter table HRS_PERS_FIELDS_INC modify(PER0000252 NUMBER(19,3))
*
ERROR at line 1:
ORA-00942: table or view does not exist

View 11 Replies


ADVERTISEMENT

Security :: Difference Between Grant All On Any Table And Grant All On Table_name

Oct 31, 2012

I would like to know what happens when we fire:

grant all on any table to user_name;

and

grant all on table_name to user_name;

Actually I was performing "grant all on table_name to user_name;" to grant the privilege but 1 of my friends suggested "grant all on any table to user_name;"

View 5 Replies View Related

SQL & PL/SQL :: Difference Between Alter Session And Alter System

Jun 19, 2013

What is the difference between alter session and alter system?

View 2 Replies View Related

PL/SQL :: Grant Table Access

Aug 15, 2013

I have a schema TEST1 and it has a view 'TEST_VIEW'. I granted read only permission on the view to TEST2 schema. grant select on TEST_VIEW to TEST2. 

But TEST2 is used  by an application which requires to read view metadata and then sync with application afterwords start reading. Is there any special permission to grant to access metadata of the view / table.

View 4 Replies View Related

SQL & PL/SQL :: Grant Table Permissions To Another User

Jul 11, 2012

I have two user a and b. I have to Grant select update insert Delete Permission to all tables of user b To User a. how can it possible?

View 5 Replies View Related

How To Grant Truncate Any Table To A User

Jan 30, 2013

on 11G R2,

We want to grant truncate any table to a user.

How ?

We should create the following procedure ?

1. Create the procedure to truncate the table.

create or replace procedure truncate_table (
table_name varchar2,
storage_type varchar2)

[Code]....

grant execute on <procedure_name> to <user>Is it for only one table ? If yes how to do that for all tables ? Or the tables of a schema ?

View 6 Replies View Related

SQL & PL/SQL :: DDL Trigger After Alter Table

Jul 22, 2010

I created a DDL trigger which manipulates columns of a table after an "alter table" statement.

For us this was all the time
"alter table XXX add NEW_COL varchar2(20)"
or
"alter table XXX modify NEW_COL varchar2(20)".

Unfortunatly we have now a requirement which statements "alter table XXX drop NEW_COL varchar2(20)".

My trigger works fine - you see no problem directly after statement execution but the table is then in an invalid status.

The connection will be destroyed after you tried to see the data of this table.

Also the export (creating a dump) will not work.

The problem I see is that I the database will do a "modify" on a column which has internal the status "dropped".

How I can get the information what kind of alter table statement will be executed?

Or is there any chance to select only columns from USER_TAB_COLUMNS without the "dropped" flag?

create or replace trigger TRIGGER
after alter
on SCHEMA
declare
vCharSet NLS_DATABASE_PARAMETERS.VALUE%TYPE;
begin
-- Select all columns of a table

select COLUMN_NAME, DATA_TYPE, DATA_LENGTH
from USER_TAB_COLUMNS
where TABLE_NAME = vTABLE_NAME; ...

-- Loop for all columns from our select
...
vSTATEMENT := 'alter table ' || vTABLE_NAME || ' modify ' || VOBJECTREC.COLUMN_NAME || ' ' || VOBJECTREC.DATA_TYPE || '(' || vNEW_DATA_LENGTH || ')';

--For example:

-- alter table XXX modify NEW_COL varchar2(20)

execute immediate vSTATEMENT;

exception
...
end;
/

View 11 Replies View Related

SQL & PL/SQL :: Remote Grant Through Insert Statement Into Sys Table?

Jun 18, 2013

I want to grant a privilege through an insert statement into a sys table.Why do not grant the privilege through the classic way : grant select on t to l_user; ?

Because I want to do it remotely.I am connected to db1.I want to grant select on t2 to u2_b from u2_a.I assume that all DDL are DML. So a grant is equivalent "somewhere" to an insert.I tried to do my requirement locally, and here is the output.

SQL> conn scott/aa
Connecté.
SQL> -- step 1 : try to grant "normally" a select on dept to hr from scott
SQL> grant select on dept to hr;

Autorisation de privilèges (GRANT) acceptée.

SQL>
SQL> conn sys/a as sysdba
Connecté.
SQL> -- step 2 : Then, we connect to sys to see the row inserted in dba_tab_privs
SQL>
SQL> col GRANTEE format A10
SQL> col OWNER format A10

[code]...

Then if I can do it locally, I can do it remotely through a db link.

View 2 Replies View Related

SQL & PL/SQL :: ORA-00942 - Table Or View Does Not Exist Even After GRANT

Apr 22, 2011

The SELECT at the end of this script fails with "ORA-00942: table or view does not exist". I think I added proper permission via GRANT command.

create table mudd_table (
a number,
b varchar2(10)
);
create user mudd_user identified by mudd_user;
grant select, insert, update, delete on mudd_table to mudd_user;
grant create session to mudd_user;
conn mudd_user/mudd_user@quadoracle;
select * from mudd_table;

View 2 Replies View Related

Alter Table Column And Its Contents?

May 4, 2011

I have a table with usernames and passwords. The passwords are stored in plaintext. I would like to issue an ALTER command on the password field to store a hash instead, and then repopulate those fields with an encrypted version of the plaintext passwords that were there before.

I would prefer to do this in a procedure, as I am going to perform it in a test environment first, then eventually in the production environment.

View 2 Replies View Related

SQL & PL/SQL :: Update Column - Add Two 00 After Alter Table

Apr 14, 2012

I have a table PR in that some data is there for instance, My Mr_NO was Char(11) I modify MR_No to Char(13)My Table Structure now is:

MR_No Char(13),
Mr_Date Date

My Previous data is MR_NO=APN00209085

I want to add two 00 after alter the table I want my result data like APN0000209085.I am updating through this command

update PR set Substr(MR_No,4,2)='00'

ERROR at line 1: ORA-00927: missing equal sign

Result I want is APN0000209085

View 13 Replies View Related

SQL & PL/SQL :: Alter Queue Table Column?

Mar 23, 2011

I need to Modify the column(MSGID) data type from RAW to BLOB for a Queue Table, I'm getting the following error.

BANNER
---------------
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE11.2.0.2.0Production

YUV >

YUV > DESC PDA_REPORT_MESSAGE_QTAB
Name Null?Type
----------------------------------------------------- -------- ------------------------------------
Q_NAME VARCHAR2(30)
MSGID NOT NULL RAW(16)

YUV >
YUV >
YUV > ALTER TABLE PDA_REPORT_MESSAGE_QTAB MODIFY (MSGID BLOB);
ALTER TABLE PDA_REPORT_MESSAGE_QTAB MODIFY (MSGID BLOB)
*
ERROR at line 1:
ORA-22858: invalid alteration of datatype

YUV >
YUV >
YUV >
YUV >
YUV > ALTER TABLE PDA_REPORT_MESSAGE_QTAB ADD (MSGID_NEW BLOB);
ALTER TABLE PDA_REPORT_MESSAGE_QTAB ADD (MSGID_NEW BLOB)
*
ERROR at line 1:
ORA-24005: Inappropriate utilities used to perform DDL on AQ table PDADBA.PDA_REPORT_MESSAGE_QTAB
YUV >

View 10 Replies View Related

SQL & PL/SQL :: Grant A User To See All Table Into Another Table

Sep 6, 2011

i need to grant a user to see all table into another table and not to use this option (grant any table)

View 9 Replies View Related

Alter Table Fails - Ran Out Of Undo Space?

Jun 11, 2009

I want to alter a very large table.

ALTER TABLE MYTABLE ADD
(
ENTRY_TSTMP DATE DEFAULT SYSDATE NOT NULL
)

My table is very large and I am getting an error saying I am out of undo space.

The dba says the undo space is as big as the table.

View 1 Replies View Related

SQL & PL/SQL :: ALTER TABLE Causing Procedure To Go INVALID?

Aug 3, 2010

Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
PL/SQL Release 11.1.0.6.0 - Production
"CORE 11.1.0.6.0 Production"

I altered existing table EVENT_SUB - added 3 columns. After that, I noticed all the procedures which had mention of this table name went in INVALID status, even if its simple SELECT, ALTER OR INSERT as shown below..

SELECT * FROM EVENT_SUB

OR
INSERT INTO EVENT_SUB...
OR
ALTER TABLE EVENT_SUB
WHERE....

So I had to recompile all the procedures associated with it. Is there any other ways to achieve this, like a line of code to add in the procedure itself, right after this DDL statements.

Sometimes i use this:
select object_name, object_type from all_objects where owner='TOYCOM' and status='INVALID'
Then, I would simply recompile the invalid objects.

For indexes, i do...

alter index <name> rebuild;

BTW, I did try to preview message, and then click on Create Topic, it gave me error..again.

"A system error has occurred.

View 3 Replies View Related

SQL & PL/SQL :: ORA-01735 / Invalid ALTER TABLE Option ORA-06512

May 12, 2011

I ran the following PL/SQL Code & I am getting the following Error:

Drop table MODIFIEDTABLE
/
Commit
/
create table MODIFIEDTABLE(TABNAMES varchar2(100))
/
DECLARE

[code].....

RESULT:

Table dropped.

Commit complete.

Table created.

DECLARE
*
ERROR at line 1:
ORA-01735: invalid ALTER TABLE option
ORA-06512: at line 12

View 2 Replies View Related

Ora-00904 Error For NDS Dynamic Alter Table Statement

Nov 30, 2011

how to play around with NDS dynamic sql and I'm trying to add a column on the fly.Basically the procedure is trying to take a table name, column name, and eventually a data type and adds it to a table.

It works fine without the bind variable for the column name, accepting the table name on the fly.As soon as it tries to use the column name I get an ORA-00904 invalid identifier exception.

Here is the procedure I'm using

CODEcreate or replace
procedure test(tbl_name varchar2, col_name varchar2) IS
qry varchar2(500);
begin

[code]....

Here is how I'm executing it.

CODEexecute test(tbl_name => 'BB_SHOPPER', col_name => 'MEMEBER');

View 3 Replies View Related

PL/SQL :: Cannot Create Table After Change Schema With ALTER SESSION

Sep 1, 2012

SQL> ALTER SESSION SET CURRENT_SCHEMA = CLA_T3;

Session altered.
SQL> select sys_context('USERENV','SESSION_USER') current_user,
2 sys_context('USERENV','SESSION_SCHEMA') current_schema
3 from dual
4 ;

CURRENT_USER
--------------------------------------------------------------------------------
CURRENT_SCHEMA
--------------------------------------------------------------------------------
CSR_ETL
CLA_T3

SQL> set linesize 300;
SQL> /

CURRENT_USER
----------------------------------------------------------------------------------------------------
CURRENT_SCHEMA
----------------------------------------------------------------------------------------------------
CSR_ETL
CLA_T3

SQL> create table cla_t3.test (r number, b char(2));
create table cla_t3.test (r number, b char(2))
*
ERROR at line 1:
ORA-01031: insufficient privileges

SQL> create table test (r number, b char(2));
create table test (r number, b char(2))
*
ERROR at line 1:
ORA-01031: insufficient privileges

After Setting current schema to 'CLA_T3', I am unable to create table in cla_t3 schema.

View 5 Replies View Related

Alter Index Shrink Space - Table Lock

Oct 18, 2012

alter index test_idx1 shrink space;

I've heard that this statement causes a table lock but cant find any information on this.if it is so, is it a write lock or also a read lock of the table?

View 5 Replies View Related

Exchanging Partition After Doing Alter Table Modify Column Length?

Mar 11, 2011

We have some tables in our database in which for loading data we have the setup in place to do Exchange partition after data load into staging. Today we did changes to column length to one pair of main and staging table. Post that Exchange partition stop working.

View 1 Replies View Related

Forms :: How To Use ALTER TABLE Command To Disable / Enable Constraints

Aug 11, 2010

can you use alter table command to disable/enable constraints in a form if you can how, if you cant why

View 4 Replies View Related

SQL & PL/SQL :: Trigger (Alter Command) And Creating Meta Data Table

Sep 20, 2011

i need a trigger with alter commands to alter the table structure,it will be captured in a separate meta data table(META)

CREATE OR REPLACE TRIGGER meta_alter AFTER Alter ON SCHEMA
BEGIN
update meta set column_name=:new where table_name=ora_dict_obj_name column_name=:old;
END;
/

Meta table contains Table name and column name..i attached the table data in atext file

View 39 Replies View Related

SQL & PL/SQL :: Alter Table To Create Partition On Non-partition Table?

Jun 19, 2012

Can i alter the table to create partition on non partition table, i have tried and could not create it. Do we have some other means to do it as this is the live table and cannot drop them else will lose the data.

View 1 Replies View Related

SQL & PL/SQL :: Import Data From Csv To Temp Then Alter Data As It Goes Into Another Table?

May 30, 2012

I need to import some data from .csv files. There is one file each day, so I want them to be automatically imported into the DB. This is the format it comes in:

DSM,LOD,20120524,01,01,9999AMP02,1.1262240,M,0.6397380,M
DSM,LOD,20120524,01,02,9999AMP02,1.1315700,M,0.6450840,M
DSM,LOD,20120524,01,03,9999AMP02,1.1297880,M,0.6450840,M

I want this data to go into TEMP_TABLE. It then needs to reformatted as it goes from temp_table to my_table:

filename,readingID, field1,field2,date,num1,num2,meterid,read1,m1,read2,m2

so filename is the actual name of the .csv file that this row came from. And reading id is date, num1, num2, meterid combined. And the remaining fields coming from temp_table

This is what I have:

procedure import_data()
begin
TEMPFILENAME CHAR(60)='DSM_2010_Husky_Oil_20120525064122_20120525065011.csv';
create table temp_table
(dsm char(3),lod char(3),usage_date date,he char(2),reading char(2),loc_id char(9),mwh number(15,10),eormmwh char(1),mvar number(15,10),eormmvar char(1));

[code]....

, which does not work at all.

View 2 Replies View Related

Grant Permissions On Oracle 11.2.0.3?

Apr 20, 2012

wanted to grant dbms_scheduler permission to the system user in oracle 11.2.0.3,but it is showing insufficient privileges, but my System has Sysdba rights.

SQL> SELECT * FROM v$pwfile_users WHERE sysdba='TRUE';
USERNAME SYSDB SYSOP SYSAS
------------------------------ ----- ----- -----
SYS TRUE TRUE FALSE

[code]....

Revoke succeeded.

SQL> conn system
Enter password:
Connected.

[code]...

while i ran this query
"
SQL> select * from session_privs;"

for system user i have 202 rows of different privileges,but the same query for sysdba has 208 rows...

View 6 Replies View Related

SQL Query To Grant Permission?

Oct 6, 2012

I want sql querys for following scenarios

Owner of the compant wants to create 5 users,3 in following fashion

1) 2 -Must have authority of admin

2) 2- Normal user

3) 1 - User whose password is blocked for 15 days

View 10 Replies View Related

SQL & PL/SQL :: Grant Privilege To Role

Jun 3, 2010

I have a stored procedure which when executed creates a user and grants some roles to the user and also makes certain roles DEFAULT using "alter user"

The issue comes when i execute the procedure.

I have a User who has a role and this role has the "alter user" privilege, for example lets say that the user1 has the role ABC, and role ABC has the "alter user" privilege.

SQL> grant alter user to ABC;
Grant succeeded.
SQL> grant ABC to user1;
Grant succeeded.

Now, when i run the stored procedure as the user1, it gives me an error on a line saying "insufficient privileges", when i check the line, its this line:
alter user user1 DEFAULT ROLE "ROLE1", "ROLE2"

But as far as i know the user1 has the "alter user" privilege

I want to make those two roles ROLE1, ROLE2 DEFAULT because i don't want the other roles ROLE3,ROLE4 to be default, as you know if there are many roles and if we alter user with default for certain roles other roles become DEFAULT=NO.

So i get the error at "alter user" statement though the user has the "alter user" privilege, what do you think might be wrong?

OR is there anyway to grant roles to the user with default=NO option?

View 9 Replies View Related

SQL & PL/SQL :: Grant Privileges Remotely

May 25, 2010

Say we have db1 and db2 two databases installed on two different servers.For internal needs, I have to insert some data from a table t1 on db1 to a table t2 in db2. This can be done by issuing from a user on db1 :

insert into t2@dblink2
select *
from t1;

where dblink2 is a correct database link that points to u2 (the t2 owner for example) on db2.

Now what I want to do is to grant privileges remotely.Is there a way to issue somthing like

execute@dblink2 'grant select on t2 to public';

It would be like u2 has issued the statment...

I don't want to use OS scripts (.sh or .bat).

View 14 Replies View Related

PL/SQL :: How To Grant Privilege In DBA_TAB_PRIVS

Apr 2, 2013

I logged in as system and I just execute below script, however Im getting error "SQL Error: ORA-00942: table or view does not exist 00942. 00000 - "table or view does not exist""

GRANT execute ON UTL_FILE TO USER1;

How to grant privilege on ult_file?

View 5 Replies View Related

SQL & PL/SQL :: Grant Permission Revoke?

Dec 16, 2011

Is there a way to find out who and how was the GRANT permission revoked from user.Why i am asking is , i see a grant permission exist for a user and has been revoked later.

View 13 Replies View Related







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