How to move a table to the other schema
Salvation;Imagine that I have a scheme A and I create table in this scheme as a test. Now, I have a different schema, the name is B. I want to spend my A.test table to B.test2
How can I do?
Thank you
If you create a new table in diagram B, the new table must be stored in tablespace default B. Unless you want the new table to be stored in a default tablespace, you need not specify a tablespace during the creation of the new table.
Tags: Database
Similar Questions
-
How to move a table (with the UDT as a column) to a different schema
I have a table that has a column of user-defined type. There is a requirement to an another schema of this table as well as the UDT. I tried to create the table as, the problem is that it uses the DFU of the original schema. Is there a way to do this?
Ex:
User 1:
CREATE TYPE employee_t AS OBJECT
(employee_id NUMBER
, employee_name VARCHAR2 (30)
Number of salary
dept_id NUMBER);
Department of CREATE TABLE
(emp employee_t
, Bishop varchar2 (40)
number of dept_id
(, dept_name varchar2 (30));
In the example above, department table has a column called emp that is UDT.
Now on User2, if I do the following
Create service table in select * from user1.department. Table will be created as follows. In fact I want EMPLOYEE_T also to be moved to User2.
Name Null? Type
----------------------------------------- -------- ----------------------------
EMP USER1. EMPLOYEE_T
BISHOP VARCHAR2 (40)
NUMBER OF DEPT_ID
DEPT_NAME VARCHAR2 (30)
You can use expdp and impdp - but you must include the type explicitly in your dump command, since it isn't included automatically: http://dbaharrison.blogspot.de/2013/05/expdp-of-just-table-and-type-dependents.html.
-
ORA - 12054:while trying to create mview based on table in the other schema
Hi all
I suspect that this problem is all about privileges.show user user is "NAAMA" CREATE TABLE USERS ( user_id NUMBER, user_name VARCHAR2(15 CHAR), user_password VARCHAR2(50 CHAR), CONSTRAINT user_pk PRIMARY KEY (user_id)); TABLE created. --------------------------------------------------------------------- show user user is "TEST" create materialized view log on NAAMA.USERS WITH ROWID create materialized view users_mv build immediate refresh fast on commit with rowid as select user_name , user_password from naama.users; -------------------------------------------------------------------------------------------------------------- ORA-12054: cannot set the ON COMMIT refresh attribute for the materialized view
Please help
Thanks to advanced
NaamaNaamas wrote:
I understand and granted.Then I have a feeling get_name function is more complex than what you posted:
SQL> create user naama 2 identified by naama 3 default tablespace users 4 quota unlimited on users 5 / User created. SQL> grant create session, 2 create table, 3 create procedure, 4 create materialized view 5 to naama 6 / Grant succeeded. SQL> create user test 2 identified by test 3 default tablespace users 4 quota unlimited on users 5 / User created. SQL> grant create session, 2 create table, 3 create materialized view 4 to test 5 / Grant succeeded. SQL> connect naama@orcl/naama Connected. SQL> create table users( 2 user_id NUMBER, 3 user_name VARCHAR2(15 CHAR), 4 user_password VARCHAR2(50 CHAR), 5 CONSTRAINT user_pk PRIMARY KEY(user_id) 6 ) 7 / Table created. SQL> grant select, 2 on commit refresh 3 on users 4 to test 5 / Grant succeeded. SQL> create or replace 2 function get_name( 3 user_name_in IN varchar2 4 ) 5 return varchar2 6 is 7 v_name varchar2(10); 8 begin 9 select 'NAAMA' 10 into v_name 11 from naama.users 12 where rownum = 1; 13 return v_name; 14 end get_name; 15 / Function created. SQL> grant execute 2 on get_name 3 to test 4 / Grant succeeded. SQL> create materialized view log 2 on users 3 with rowid 4 / Materialized view log created. SQL> grant all 2 on mlog$_users 3 to test 4 / Grant succeeded. SQL> connect test@orcl/test Connected. SQL> create materialized view users_mv 2 build immediate 3 refresh fast 4 on commit 5 with rowid 6 as 7 select user_name, 8 user_password, 9 naama.get_name(user_name) first_name 10 from naama.users 11 / naama.get_name(user_name) first_name * ERROR at line 9: ORA-12054: cannot set the ON COMMIT refresh attribute for the materialized view SQL>
Next time you get MV create errors, you can login as the owner of the MV as question:
SQL> @?\rdbms\admin\utlxmv.sql -- run it once per user only, it creates table MV_CAPABILITIES_TABLE Table created.
Now comment ON offending COMMIT and the question:
SQL> begin 2 dbms_mview.explain_mview('create materialized view users_mv 3 build immediate 4 refresh fast 5 -- on commit 6 with rowid 7 as 8 select user_name, 9 user_password, 10 naama.get_name(user_name) first_name 11 from naama.users','xxx'); 12 end; 13 / PL/SQL procedure successfully completed. SQL> SELECT CAPABILITY_NAME, 2 POSSIBLE, 3 RELATED_TEXT 4 RELATED_NUM, 5 MSGNO, 6 MSGTXT 7 FROM MV_CAPABILITIES_TABLE 8 WHERE STATEMENT_ID = 'xxx' 9 ORDER BY SEQ 10 / CAPABILITY_NAME P RELATED_NUM MSGNO MSGTXT ------------------------------ - ------------------------------ ---------- -------------------------------------------------- PCT N REFRESH_COMPLETE Y REFRESH_FAST N REWRITE N PCT_TABLE N this PL/SQL function cannot be 2066 Oracle error: see RELATED_NUM and RELATED_TEXT for supported for query rewrite details PCT_TABLE N NAAMA.USERS 2068 relation is not a partitioned table REFRESH_FAST_AFTER_INSERT N 2083 mv references PL/SQL function that maintains state REFRESH_FAST_AFTER_ONETAB_DML N 2146 see the reason why REFRESH_FAST_AFTER_INSERT is di sabled REFRESH_FAST_AFTER_ANY_DML N 2161 see the reason why REFRESH_FAST_AFTER_ONETAB_DML i s disabled REFRESH_FAST_PCT N 2157 PCT is not possible on any of the detail tables in the materialized view REWRITE_FULL_TEXT_MATCH N this PL/SQL function cannot be 2066 Oracle error: see RELATED_NUM and RELATED_TEXT for supported for query rewrite details REWRITE_FULL_TEXT_MATCH N 2159 query rewrite is disabled on the materialized view REWRITE_PARTIAL_TEXT_MATCH N 2031 materialized view cannot support any type of query rewrite REWRITE_PARTIAL_TEXT_MATCH N 2159 query rewrite is disabled on the materialized view REWRITE_GENERAL N 2031 materialized view cannot support any type of query rewrite REWRITE_GENERAL N 2159 query rewrite is disabled on the materialized view REWRITE_PCT N 2158 general rewrite is not possible or PCT is not poss ible on any of the detail tables PCT_TABLE_REWRITE N this PL/SQL function cannot be 2066 Oracle error: see RELATED_NUM and RELATED_TEXT for supported for query rewrite details PCT_TABLE_REWRITE N NAAMA.USERS 2068 relation is not a partitioned table 19 rows selected. SQL>
As you can see REFRESH_FAST_AFTER_INSERT is not possible (POSSIBLE = N) and the reason is "mv reference function of PL/SQL that maintains state. Now the question is whether your function is deterministic (always returns a value even if the same parameters are passed). If it's really, use:
SQL> create user naama 2 identified by naama 3 default tablespace users 4 quota unlimited on users 5 / User created. SQL> grant create session, 2 create table, 3 create procedure, 4 create materialized view 5 to naama 6 / Grant succeeded. SQL> create user test 2 identified by test 3 default tablespace users 4 quota unlimited on users 5 / User created. SQL> grant create session, 2 create table, 3 create materialized view 4 to test 5 / Grant succeeded. SQL> connect naama@orcl/naama Connected. SQL> create table users( 2 user_id NUMBER, 3 user_name VARCHAR2(15 CHAR), 4 user_password VARCHAR2(50 CHAR), 5 CONSTRAINT user_pk PRIMARY KEY(user_id) 6 ) 7 / Table created. SQL> grant select, 2 on commit refresh 3 on users 4 to test 5 / Grant succeeded. SQL> create or replace 2 function get_name( 3 user_name_in IN varchar2 4 ) 5 return varchar2 6 deterministic 7 is 8 v_name varchar2(10); 9 begin 10 select 'NAAMA' 11 into v_name 12 from naama.users 13 where rownum = 1; 14 return v_name; 15 end get_name; 16 / Function created. SQL> grant execute 2 on get_name 3 to test 4 / Grant succeeded. SQL> create materialized view log 2 on users 3 with rowid 4 / Materialized view log created. SQL> grant all 2 on mlog$_users 3 to test 4 / Grant succeeded. SQL> connect test@orcl/test Connected. SQL> create materialized view users_mv 2 build immediate 3 refresh fast 4 on commit 5 with rowid 6 as 7 select user_name, 8 user_password, 9 naama.get_name(user_name) first_name 10 from naama.users 11 / Materialized view created. SQL>
However, keep in mind, Oracle approves completely you declaring function as deterministic. If, in fact, your function is not deterministic (and most likely is not) MV will produce erroneous results.
SY.
-
How to access the table in the other schema?
Hi all
any body can help me on how to access table to another scheme to another scheme?Use the db link
-
Hi all
Problem: Build a VI to display a string in the table of the lights. Each letter must be posted in a separate table and letters must move from one table to the other in the direction from left to right.
I did program mentioned above but it does not work. Can you tell me what is the problem?
There is no error is indicated in the program. If someone knows about it please try to find solutions and help me out of this problem.
I have attached my program with this message.
Thank you in advance!
(1) FOR loops are your friend here. You can make a slight restructuring using loops, and then you will have less mess to deal with, the inner loop through tunnels of autoindexing to make it even simpler.
(2) I would only treat the numeric values of the characters. So go terminal of control of the chain, the capital letters and byte array to before the outer loop. You can use a size of Board over there to tell how many times the outer loop to iterate.
(3) the Index table is extensible. So you only need over the index of the first, and it will increment itself, as it develops.
(4) you need to finish the lookup table (table 3D)
-
Change the system drive
I'll try to explain my situation better than I can.
My situation is that when I used to have XP installed, I had installed the only drive I had back then which is now the drive D, for a long time, so I have Windows Vista Home Premium 32-bit, Windows 7 Home Premium 32 bit installed on two different discs, Vista is installed on drive C and 7 is installed on drive E , but I don't have XP that I had managed to get rid of it.
My problem is that the drive on which Windows XP to reside has always left this disc marked as system in the disk management window, and I was wondering how to do that one of the other readers who has Vista or 7 that the new system?
I already managed to change the startup disk from drive where Vista is installed to, it's just that I need to change the disk that is marked as system to another drive, such as D drive begins to show signs that it comes at the end of his life and I would like to move the startup folder as well as the other files needed to start on the other.
I assume that you installed Windows XP 1, then Vista, 7 (these 2 OS not in order)?
And Vista and 7 was by all means upgrade installation?
Since originally, that you have installed Windows XP on drive D, it should be marked as 'system' and retains so the tag 'system '.
The volume of the 'system' should be identified as the first primary partition active. It may or may not have the files it contains.
The fact that the system considers "system drive" does not mean that there are files that it contains.
Now, you want to delete the existing volume and create a new volume. Needs to be done outside the facility.
When you start the cd or DVD to start the installation list us readers, if you remove the volume the volume drive letter is already booked, so you get the next available drive letter, do not re-use the deleted volume drive letter.If he removed during installation and then recreated as a new volume (formatting does not remove the volume, you need to delete the volume and recreate it)
-[Posted by Darrell Gorter [MSFT] in another forum.]
Try to format the XP partition and change the drive letter.
-
How to move my taskbar to the side down
How to move my taskbar to the side down
Hello
Right-click on the taskbar and make sure lock the taskbar don't are NOT checked.
On the left, click on an empty area, and then drag to the bottom.
I hope this helps.
Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle="">-><- mark="" twain="" said="" it="">->
-
How can I import tables from a different schema in the relational model... to add these tables in the existing relational/logic model? PLSS help
Notes; I already have a schema ready relational/logic model... and I need to add more tables to this relational/logic model
can I import the same way like I did before?
But even if I do the same how can I add it in the template? as the logic model has been designed...
Help, please...
Thank you
To view the diagram of logic model in Bachman notation, you right-click on a blank area of the diagram and select the rating > Bachman Notation.
David
-
Hello
Can someone share me information about common cause of failure of the Mirage server in clustered environment.
And how customers will be switched to the other server in a cluster to continue their operations from the server failed.
Kind regards
C Bathesha
In general, Mirage servers are not lacking. It is very rare (and not, for example, to problems of storage or endpoitns, which are more common).
May raise problems of overload, memory or hardware malfunction too little.
After that you make server standard troubleshooting (the etc system event log), you must file a Service request by VMware.
-
need a script to create multiple tables as the other columns in tables
I need script to create multiple tables as the other columns of tables respectively.
lets consider I want to create tables from table1... table99 like tablex1... .tablex99 columns (without data) respectively (i.e table1 as tablex1, table99 as tablex99).declare cursor c is select object_name from all_objects where object_type='TABLE'; begin for i in c loop execute immediate 'create table '||i.object_name||'_x as select * from '||i.object_name||' where 1=2'; end loop; end; use can use this and put your user names accordingly. If you get any error please post the error.
-
How to find a table, using the name of the column in the database schema
Dear all,
Please help me on
using the name of the column, how to find a table name in the database schema.
Thanks in advanceHello
You can query the data dictionary views all_tab_columns and user_tab_columns.
For example, to find the tables in the scott schema have called deptno columns:SELECT table_name FROM all_tab_columns WHERE owner = 'SCOTT' AND column_name = 'DEPTNO';
Remember that anything inside quotes is case-sensitive.
The all_tab_columns view has one row for each column in each table (or view) that you have the privileges to use.
The user_tab_columns view is a subset of all_tab_columns, containing only your own tables (and views). -
The sys user can not see tables belonging to the other schema
Hello
We have a database used to store the metadata of the soa suite, yesterday, we asked to grant select on certain tables of the prodsoa_bam schema, but we found this sys cannot see the tables of prodsoa_bam.
If we question dba_tables we can list the tables of prodsoa_bam, but if we execute a query on the tables that we get an ORA-00942 error.
Someone suggested a work around?
Kind regards.
try using double quotes. It seems that your table name is case-sensitive (which I do like):
SELECT COUNT (*) FROM PRODSOA_ORABAM. SysIterPrivilege ';
-
How can find data in a colum prj_no in all the table of the same schema
Hi all
I find the list of tables with data that has prj_no = "Axis_11" for all tables in the same schema.
Thank you
NrPNR wrote:
I find the list of tables with data that has prj_no = "Axis_11" for all tables in the same schema.1. find the tables with a column of PRJ_NO name. You can find it in USER_TAB_COLUMNS
2 write a query to read the data in each table, using the UNION/UNION ALL operators to merge the results for each table -
How to find the same column name in different tables in the same schema
Hello
I find the 'ename' column name in different tables in the same schema.
Thank you
NrHello
Try this query
Select column_name, table_name from user_tab_columns where column_name = 'ENAME ';
Award points and end the debate, if your question is answered or mark if she was...
Kind regards
Lacouture.
-
Create the form on table in the different schema
Hi all
in APEX I am logged in as long as user APEX_USER and the table, I'm trying to access the site with the creation on Table Wizard form belongs to the user. I have granted all privileges on a given user APEX_USER table, the wizard allows me to choose this table in the list, but when I press the next button, I get the following error message:
You do not have access to the schema that you import. Import failed.
Contact your administrator for the application.
Seems to me that something similar had been already discussed here, but still no response.
V4.1 assistants when you use a different schema
Please, what are the rights must have my APEX_USER to be able to create forms tables belonging to someone else?
Thank you very much
Pavel
Edit: I did the same thing on my laptop (APEX 4.2.6.00.03) here and it works as expected. This error I get to work with APEX 4.2.3.00.08 (of course you should not necessarily be the cause, very likely, I don't have all of the necessary privileges) :-).
Hi Mike,.
Thanks again for your response. If the schema was not related to my workspace, I would yet be able to choose the other schema of the selection list.
In fact, there seems to be a bug in the link in my message original (for example it is still not fixed in version 4.2.3), but fortunately I was able to find a workaround - I created a view with the same name and the same structure as the original table, and then I was able to generate the form with the wizard , finally I gave up the display and modification of processes page manually. So the solution is I have to force the DBA APEX upgraded to the current version :-).
Best regards
Pavel
Maybe you are looking for
-
Windows Update_80072EFE
Remember - this is a public forum if you ever post any private information such as mail or phoneI Ideas: You have problems with programs Error messages Recent changes to your computer What you have already tried to solve the problem
-
Automatic updates fail every day. Code 646.
Window 7 automatic updates successfully for more than 12 months. Updates fail every day spent 2 months. What have I done?
-
Bar search companion explore is empty
Original title: Research Assistant The Explorer search companion bar is empty, except for the small dog down. How can I access the fields to enter my search options? Thank you Tinie
-
Impossible to use some of the keyboard in Windows Vista.
Original title: pc Vista can't use part of keyboad Vista from my pc cannot use ms IME keyboad.and some too.
-
I just install Windows 7 to a friend on a Dell Vostro 220 and there were two High Definition Audio devices in Device Manager. When I installed the Realtek HD driver, one became Realtek High Definition Audio, but the other remained as high definition