SQL & PL/SQL :: How To Copy Tables From One User To Another User
Sep 22, 2011how to copy tables from one user to another user using pl/sql
View 18 Replieshow to copy tables from one user to another user using pl/sql
View 18 RepliesWhen a package is called by multiple users each a copy of each user is maintained in UGA and has it's own state.I want that only one copy of package should be maintained for every user.See the below package.
CREATE OR REPLACE PACKAGE MY_PKG IS
LV_MY_VAR NUMBER(10) := 10 ;
END MY_PKG ;
my requirement.
User1 logs in and executes below statements
BEGIN
DBMS_OUTPUT.PUT_LINE( MY_PKG.LV_MY_VAR ) ;
MY_PKG.LV_MY_VAR := 15 ;
DBMS_OUTPUT.PUT_LINE( MY_PKG.LV_MY_VAR ) ;
END ;
User2 logs in and executes below statements:
BEGIN
DBMS_OUTPUT.PUT_LINE( MY_PKG.LV_MY_VAR ) ;
MY_PKG.LV_MY_VAR := 20 ;
DBMS_OUTPUT.PUT_LINE( MY_PKG.LV_MY_VAR ) ;
END ;
in general scenario output will be
10
15
10
20
my requirement
10
15
15 Value changed by User1 is retained.
20
Through sql*plus, how can I copy a user-defined type from other schema to mine?
I've granted the execute object privilege over the user-defined type to my user, so I can use the type.
I know I can manually write and create the type, but I wanna learn (if exist) a statement to copy the user-defined type, something like:
CREATE TABLE x2 AS
(SELECT *
FROM x1);
I'm testing ORACLE DATABASE 11g R2 over Windows O. S.
I am customizing a standard form to allow user to copy values. It works fine when I open the form, query a record and hit copy. But if I copy something to the clipboard from the records before I hit copy button, the form behaves differently and throw errors. Can I do something before the copy procedure work to eliminate this error?
View 3 Replies View Relatedhow to acess tables of another user from the sys user as dba in oracle 8 dont have the password but need to acess the table
View 1 Replies View RelatedThere is a requirement in my database that I want to restrict the user from directly running queries on database from third party tools such as pl/sql developer and toad.
There is a utility in SQL product_user_profile through which this can be done but it is only restricted if you run the query through sql plus. If I want to restrict and (give suppose select,insert) to a user for directly running queries through PL/SQL.
I created an externally authenticated user in database. And can login without password with below syntax.
SQL> connect / @TESTDB
Connected.
SQL> show user;
USER is "SCOTT"
This scott user has a proxy permission to another DBuser PROXY_USER. Previously I used to login using below syntax.
connect scott[proxy_user]/password_for_scott@TESTDB
So now, what syntax should be used for this "ExternallY Authenticated" user to login as a proxy user?
how can i assign permissions to one user to add,delete,edit data and other user should be able to perform all functions or selected functions
View 12 Replies View RelatedI would like to know if 'user creation definition' is exported in user mode export if export is done with DBA role..If it is Not, does it mean we always need to precreate the user before we import the dump created using 'user mode export'?
View 2 Replies View Relatedhow can I insert data into tables on another user. They both are in the same table-space.
View 1 Replies View RelatedI am trying to create a new user who will be able to do a delete from all of the tables that only I MYSELF created. I created my user and granted access but realized I may not have done it right..
is it simply SQL>grant delete on <TABLESPACE> to <new user>; ? or do i need to specify the grant the delete on my tablespace to new user?
Suppose two users (CONNECT and RESOURCE roles) A and B who work on the same project. How can B create synonyms of all tables of A without asking admin to do that? Of course, we assume that these users have the CREATE SYNONYM privilege. My problem is that B does not have access to user_tables of A, so he cannot obtain the list of A's tables to create synonyms.
View 3 Replies View RelatedI have 3 users in one schema. One user is having all the tables, packages,triggers etc and this is the super user.
I want to access all the tables, packages etc without prefix the username in other two users.
is there any syntax to drop all the tables at a time in a user
View 12 Replies View RelatedWe are trying to implement the following security to our database.
As of now, the access rights are same for all the windows users logging into the Oracle application with the same Oracle user Id.
But now, we want to improve our security by granting different levels of rights to the users based on their Network Id even though they use the same Oracle User Id to log into the application.
We are not looking for the users to be identified externally.
(CREATE USER "OPS$ORACLE-BASE.COMTIM_HALL" IDENTIFIED EXTERNALLY;
GRANT CONNECT TO "OPS$ORACLE-BASE.COMTIM_HALL";
)
- we have user id parameter.can we update the parameter(:parameter.p_userid) before firing "WHEN NEW FORM INSTANCE TRIGGER"(when new form instance trigger contain code for tree node), for login another canvas as per user rights?
- i have created a login form in one canvas.
- also tree node Hierarchy form created on another canvas. now we want to login through login screen, after login only those forms should show in tree Hierarchy which users have rights. for this purpose we want to pass the parameter of userid before connecting to tree node form through the following query
SELECT COUNT (*)
INTO v_count
FROM usersinfo
WHERE usersname = :USERBLOCK.usernames AND passwords = :USERBLOCK.passwords ;
[code]...
Every thing is working but when we click on button in login form at that time parameter.p_userid will return null. because above code is define on button click in login screen, i cannot understand where i need to define the above code .
User session has expired. I have to enable user without changing the password of the user.
View 1 Replies View RelatedWe have the database user called c88888 and is locked yesterday. I came to this with the following query.
select * from dba_users where username like 'C88888';
Due to invalid password the user was locked. Can we track who hit the database with the wrong password?
I Created One Trigger as Follows
CREATE OR REPLACE TRIGGER TRIGGER1
BEFORE INSERT
ON table1
FOR EACH ROW
[code]......
Here , I Want To Insert The Data From My User To Test User . In This Situation When I Execute The Above Trigger It Shows The Error PL/SQL: ORA-00942: table or view does not exist
I want to find the history of manipulation the database by filtering the user who created the last tables, what tables are, when he created it etc ..
I'm using oracle XE and the client is toad.
i have to give 74 privileges from different users on different tables to one common user,how can i do this?
View 7 Replies View RelatedI have two users say A and B. I have all the tables,views,indexes, types,procedures,packages etc. User B wants to access all the objects from user A.
View 4 Replies View RelatedI have a strange problem when creating a view in user from another user
I have a user called "Cash_tst"
its syntax creation is
-- Create the user
create user CASH_TST
identified by ""
default tablespace CASH
temporary tablespace TEMP
profile DEFAULT
quota unlimited on cash;
-- Grant/Revoke object privileges
grant connect to CASH_TST;
grant dba to CASH_TST;
grant resource to CASH_TST;
-- Grant/Revoke system privileges
grant create any view to CASH_TST;
grant unlimited tablespace to CASH_TST;
I want to create a view
CREATE VIEW TAMER
AS SELECT *
FROM [b]AROFL[/b].RA_CUSTOMER_TRX_LINES_ALL_BEFO
"AROFL" is another user on the same database
when try to create the view "tamer" i got message of
"insufficent privilege"
although i granted "create any view" to the user "cash_tst"
we are trying ti implement BMC monitoring tool for our oracle 11g2 RAC/solaris10 environment. for the purpose we create a user called bmcuser in OS level, this user connecting database to monitor, this user occupy shared memory as oracle. Explain why this user taking that much shared memory just to connect database using sqlplus.
oracle taking 55% bmcuser taking 44%,
SQL> show parameters memory
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
hi_shared_memory_address integer 0
memory_max_target big integer 3232M
memory_target big integer 3232M
shared_memory_address integer 0
SQL> show parameters sga
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
lock_sga boolean FALSE
pre_page_sga boolean FALSE
sga_max_size big integer 3232M
sga_target big integer 0
PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
6449 bmcuser 47M 44M sleep 23 10 0:57:31 0.2% PatrolAgent/1
[code]........
pga & uga usage sessionwise
SID ORA_USR OS_USR S_PROG S.MACHINE S.PGA_MEM S.PGA_MEM_MAX S.UGA_M S.UGA_M_MAX
252 (null) oracle oracle@racdev1.zakathouse.org (ARC3) racdev1. 31054584 32168696 181056 181056
227 (null) oracle oracle@racdev1.zakathouse.org (ARC2) racdev1. 31054584 32168696 181056 181056
177 (null) oracle oracle@racdev1.zakathouse.org (ARC0) racdev1. 31054584 32168696 181056 181056
576 (null) oracle oracle@racdev1.zakathouse.org (LGWR) racdev1. 16693544 21281064 181056 181056
326 (null) oracle oracle@racdev1.zakathouse.org (LMS0) racdev1. 13753080 13753080 181056 181056
376 (null) oracle oracle@racdev1.zakathouse.org (LMS2) racdev1. 13556472 13556472 181056 181056
[code]........
How to get all the name of tables that a user can select, insert, update or delete?
View 2 Replies View RelatedI need to export a user with all the tables. But I need to export data into only few tables, need to omit the data of few tables.
Ex I dont want to export data of Audit tables with AU prefix.
User A contains tables, views, LOB's, types, procedures, triggers, sequences, indexes, synonyms. User B wants to have read-only privilege on the objects of User A.
I can provide select on privilege on tables and views. How about providing read-only privileges to other objects?
I want to perform something like -
Conn xyz/passwordxyz
grant create procedure to 'xyz';
I want to give permissions to my current user 'xyz' , I am able to give permissions to user using system user but Is there any way to grant permissions to user 'xyz' while I am using 'xyz' user.
I have two databases (say DATABASE 1 with user USER1 with table A and DATABASE2 with user USER1 with table A). I want to select the table A in USER1 DATABASE2 from DATABASE1 USER1.
View 5 Replies View RelatedI have enabled Auditing in my oracle Database but I am not able to see any database for the operations of sys user or any other user in my "SYS.AUD$" and "SYS.FGA_LOG$" tables.
Value for the parameter "AUDIT_TRAIL" is set to "db,extended".
I am working as "SYS" user and I have shutdown and again startup the database but neither there was any information in both the tables nor I can see any files at the destination specified by "AUDIT_FILE_DEST".