DataPump - expdp.open creates tables in the schema
Hello
I use datapump in Oracle 10 g to archive old main schema to another schema partitions.
I noticed that when dbms_datapump.open is called and a new table is created by dbms_datadpump for internal purposes. This is verified in the oracle documentation
http://docs.Oracle.com/CD/B12037_01/AppDev.101/b10802/d_datpmp.htm#997383
Notes on use
- When the task is created, a master table is created for work under the scheme of the appellant in the default tablespace of the appellant. A handful referring to employment is returned that attaches to the current session to use. Once attached, the handle remains valid until that either explicit or implicit detach occurs. The handle is only valid in the session of the appellant. Other handles can be attached to the same task from another session using the
ATTACH
procedure.
Does anyone know if this table can be removed by a call to dbms_datapump Oracle 'clean', or if it has to be cleaned manually.
can confirm that this is what you do
v_job_handle: = DBMS_DATAPUMP. OPEN('EXPORT', 'TABLE', NULL, v_job_name);
-The parallelism 1 value and add the file
DBMS_DATAPUMP. SET_PARALLEL (v_job_handle, 1);
DBMS_DATAPUMP. ADD_FILE(v_job_handle, v_job_name |) '_' || v_partition. PARTITION_NAME | ".dmp", "PARTITION_DUMPS");
-Apply filters to process only a partition in the table
DBMS_DATAPUMP. METADATA_FILTER(v_job_handle, 'SCHEMA_EXPR', 'IN ("SIS_MAIN")');
DBMS_DATAPUMP. METADATA_FILTER(v_job_handle, 'NAME_EXPR', ' AS "' | t_archive_list (i) |) '''');
DBMS_DATAPUMP. DATA_FILTER(v_job_handle, 'PARTITION_EXPR', ' IN ("' | v_partition.partition_name |)) ')', t_archive_list (i), "SIS_MAIN");
-Use statistics (rather than blocks) to estimate the time.
DBMS_DATAPUMP. SET_PARAMETER(v_job_handle, 'ESTIMATE', 'STATISTICS');
-Start the work. An exception is returned if something is not installed correctly.
DBMS_DATAPUMP. START_JOB(v_job_handle);
-The export job should work now. We loop until its finished
v_percent: = 0;
v_job_state: = "UNDEFINED";
WHILE (v_job_state! = 'DONE') and (v_job_state! = "STOPPED") LOOP
DBMS_DATAPUMP.get_Status (v_job_handle,DBMS_DATAPUMP.ku$_status_job_error + DBMS_DATAPUMP.ku$_status_job_status + DBMS_DATAPUMP.ku$_status_wip,-1, v_job_state, m);
js: = sts.job_status;
-As percentage-complete in this loop changes, displays the new value.
IF js.percent_done! = v_percent THEN
v_percent: = js.percent_done;
END IF;
END LOOP;
-Once the work is finished, view the status before you loose work.
PRC_LOG (f1, t_archive_list (i) |) ': Export complete with status: '. v_job_state);
-DBMS_DATAPUMP. Detach (v_job_handle);
-Use STOP_JOB instead of DETACHING otherwise 'master' table that is created when the OPEN is called is not removed.
DBMS_DATAPUMP. STOP_JOB(v_job_handle, 0, 0);
Tags: Database
Similar Questions
-
Creating table in the schema has with the user B and granting permissions to the user C
Hello, I have a problem fun - we have a large table which requires a batch to make millions of updates, and he needs to finish more quickly. It takes several hours as an update, but a select create table did the same thing in about a minute. Yay! Then we just delete the old table and rename the new table to the former, rebuild all the index and grant select/insert/update/delete permissions to another user who needs access... and there is the problem, Oracle said insufficient privs.
We have A figure, which is the owner of the table, userid B who done all the stuff of application batch and userid C which performs inserts for a process of middleware. None of them are actual users, of course. We want that user B to do the ETG, rename, rebuild and re-grant of the authorisation of the index. But user B apparently cannot grant permissions on objects in the schema A to user C, even if B has created the table and has the role DBA (not ideal, I know)!
What's really crazy is that there is no sense unique user b can grant permissions to user C, which is to:
grant select any table USER c;
grant insert any table USER c;
grant update any table USER c;
Grant delete any table USER c;
It seems really perverse can create tables in diagram A and even grant C privs "whole table" that user B, but may not grant privs specifically on this object in the schema A, even with DBA privs. I must be missing something... right?Yes. By default, the stored procedures are stored procedures from DEFINER rights. If A is the owner of a stored procedure, this stored procedure can do whatever A enjoys the privileges to directly. If A grants B privileges RUN this stored procedure, when B calls the stored procedure, the procedure runs with the privileges.
I agree point stew, however, re-creating objects in Oracle is generally a bad idea and a TRUNCATE with one insert direct-path, possibly combined with the deactivation and the rebuilding of the index would be more appropriate than a DEC. If you're going to stick with this Assignment, however, that really do in a stored procedure owned by A while B has no need to CREATE ANY TABLE.
Justin
-
avoid triggers on all tables in the schema
I need to put a CREATION TIMESTAMP to the timestamp of the database server (not the timestamp of session) in all tables in a schema to create and update. Is to create a trigger on all the tables in the schema a less time consuming way to do?
Similarly, I need to set up columns such as CREATE_USER, LAST_UPDATE_USER.
Thank you in advance.You can easily generate the DDL for adding new columns.
The extent of the filling of the columns, your choice is either to use insertion befire table and triggers to update to fill the columns or the application to provide the necessary information.
Basic trigger logic would be pretty much the same for all tables, then write a little SQL or PL/SQL to generate the code of the trigger should be simple enough.
Depending on your application, such as web based with only one Oracle user, you may need to get the real user through dbms_application_info by the logic of the server-based application.
HTH - Mark D Powell.
Edited by: Mark D Powell 5 May 2010 07:48
-
create table in the remote database
Hi friends,
Is it possible to create a table in a remote with the syntax as database
create table - on the remote database
in select * from tbl - table with user defined data types.
Thank you
Akila Mathon.Remote DDL operations are not allowed.
Create a procedure on the remote database, which will create the table using
execute immediate 'Create table table_1 as select * from table@remote_link ' Example create procedure ddl_remote(str varchar2) as begin execute immediate str ; end ; /
Where remote_link is the database when you call the procedure.
Directly GRANT EXECUTE CREATE TABLE to the user in which the procedure is created.
Call the procedure of your current database.
begin ddl_remote@DB_remote('create table emp as select * from emp@remote_link ') ; end ; /
HTH
SS -
How to delete all TABLEs in the schema SYS that are created from 09:15?
Unfortunately a script created a lot of tables in the diagram (= SYS) and bad Tablespace (= SYSTEM).
How can I delete all TABLES that are created inTablespace = SYSTEM and SCHEMA = SYS (in a DDL command)
respectively for the past 3 hours from 09:15 to 25 Sep 2011?
Alternative: How can I move these tables in another schema (for example ATEST) and Tablespace (USERS)?
Is this possible with Oracle XE or Oracle Enterprise?
PeterYou can use ALTER TABLE... MOVE. It offers a TABLESPACE clause, which allows you to choose a different tablespace as target. Refer to the documentation for your version of the database.
-
How exp/tables in the schema hosted Apex 4.2
Hi all
I created a test and schema + tables hosted apex application:
Oracle APEX 4.2 instance hosted by Oracle, https://apex.oracle.com/pls/apex/f?p=4550:1:0
How I can exp or expdp schema or tables that I created here in it?
Thank you very much
MK
MariaKarpa (MK) wrote:
Do the images of data type and BLOB like (photos, jpeg, pdf), the recorded data can be extracted as well? text or xml?
It would be much faster to try this for yourself, rather than post it here.
Values of BLOB columns can be unloaded as XML, but not in the form of text.
-
querying table inside the schema of the IOM
Hello
I created a table looks in the scheme of the IOM. I want to insert data into this table custom through my scheduled task. As I try to insert data into a table that is located in the schema of the IOM itself, I hope I don't have to make a JDBC connection. Could you get it someone please let me know how can I go about it?
Thank you
PETREAYou can use the statement prepared for her and use tcDataProvider (IOM) to make connections.
-
Creating table in the desired tablespace
Hello
I created the CUZK_BACKUP tablespace:
CREATE the TABLESPACE CUZK_BACKUP DATAFILE ' / oradata/RUIAN/cuzk_backup01.dbf' SIZE 3 G AUTOEXTEND ON NEXT 100 M MAXSIZE 15 G;Now I'm trying to create table in this space of table like this:BEGIN
-zjisti, if jiz existuji tabulky ve schematu centrumadmin (0 - no, 1 - year)
SELECT COUNT (*) in the nCount_aud FROM dba_tables owner WHERE to = 'CENTRUMADMIN' and table_name = "$ _BACKUP2";
SELECT COUNT (*) in the nCount_fga FROM dba_tables owner WHERE = 'CENTRUMADMIN' and table_name = "FGA_LOG$ _BACKUP2";
IF (nCount_aud < = 0)-pokud tabulka neexistuje, vytvor ji partisnovanou po mesici
THEN
v_sql_aud: =' CREATE TABLE CENTRUMADMIN. AUD$ _BACKUP2
TABLESPACE CUZK_BACKUP
storage (initial 500 m next 50 m maxextents unlimited)
PARTITION BY RANGE (NTIMESTAMP #)
INTERVAL (NUMTOYMINTERVAL (1, "MONTHS"))
(
P_2013 PARTITION VALUES LOWER THAN (TO_DATE ("01/01/2014", "DD-MM-YYYY"));
P_2014_01 PARTITION VALUES LOWER THAN (TO_DATE ("02/01/2014", "DD-MM-YYYY"));
P_2014_02 PARTITION VALUES LOWER THAN (TO_DATE ("03/01/2014", "DD-MM-YYYY"));
P_2014_03 PARTITION VALUES LOWER THAN (TO_DATE ("04/01/2014", "DD-MM-YYYY"));
P_2014_04 PARTITION VALUES LOWER THAN (TO_DATE ("05/01/2014", "DD-MM-YYYY"));
P_2014_05 PARTITION VALUES LESS THAN (TO_DATE ("06/01/2014", "DD-MM-YYYY")))
AS select * from SYS. AUD$ where 1 = 2';
EXECUTE IMMEDIATE v_sql_aud;
DBMS_OUTPUT. Put_line ('Vytvorena tabulka CENTRUMADMIN.) AUD$ _BACKUP2.') ;
ON THE OTHER
DBMS_OUTPUT. Put_line (' CENTRUMADMIN Tabulka.) AUD$ _BACKUP2 jiz existuje.') ;
END IF;
Table is created, but not in the CUZK_BACKUP tablespace:
Select table_name, tablespace_name from dba_tables where owner = "CENTRUMADMIN";
TABLE_NAME, TABLESPACE_NAME
------------------------------ ------------------------------
CUZK_SLUZBY OKO_USR_SCD
CUZK_LOG_BEHU OKO_USR_SCD
CUZK_LOG_FAZE OKO_USR_SCD
CUZK_LOG_CHYBY OKO_USR_SCD
AUD$ _BACKUP
AUD$ _BACKUP2
FGA_LOG$ _BACKUP
FGA_LOG$ _BACKUP2
Why there is no tablespace and how to make it work?
Thank you
Honza
For a partitioned table, the actual segments are at the Partition level. If a query DBA_TAB_PARTITIONS and DBA_SEGMENTS.
Hemant K Collette
-
Select all the tables in the schema
Hi, I'm looking for x, y of the tables in a schema, get the error "missing expression," working with oracle 11g.
declare
v_sql varchar2 (4000);
number of v_x;
number of v_y;
number of V_n;
Start
for rec in loop (select table_name as table_name from all_tables where table_name like '% oumou %' ORDER BY 1)
v_sql: = ' select a.idnumber, t.x, t.y, table (sdo_util.getvertices (a.geometry)) t OF ' | Rec.table_name | « a » ;
V_sql EXECUTE IMMEDIATE v_n, v_x, v_y;
dbms_output.put_line(V_n|| v_x || v_y);
end loop;
end;... --only for fetching implizit CURSOR cur1 CURSOR t2 IS SELECT CAST('' AS VARCHAR2(20))idnumber, CAST(0 AS NUMBER) x, CAST(0 AS NUMBER) y FROM dual; rec2 t2%ROWTYPE; ...
To the implicit CURSOR cur1, you can set a variable-FETCH with CUR1% ROWTYPE.
So, I defined an explicit CURSOR t2, bringing me the types for the columns of results:
IDNUMBER (VARCHAR2 (20)), X (NUMBER) and Y (NUMBER)
This T2 of cursor, I can set a % ROWTYPE VARIABLE t2 to fetch the results.Please give points for the solution.
-
get information from inside a trigger of the other tables in the schema even
Addendum:
... Sorry I forgot: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64 bit
*******************
Hello
I'm trying for a few hours to get information from inside a trigger to another table in the same pattern.
My trigger is PSE_BKB. NUM_PHANTOM_BP
I first tried a simple solution...
CREATE OR REPLACE TRIGGER PSE_BKB. NUM_TR_PHANTOM_BP
BEFORE DELETING, INSERTION OR UPDATE
ON PSE_BKB. NUM_PHANTOM_BP
REFERRING AGAIN AS NINE OLD AND OLD
FOR EACH LINE
DECLARE
v_recht NUMBER (1): = 0;
v_recht2 NUMBER (1): = 0;
v_change_mitarbeiter NUMBER (1): = 0;
v_recht_mitarbeiter NUMBER (1): = 0;
v_typ varchar2 (20);
v_obj_key varchar2 (11): = "gugus";
v_ph_key varchar2 (11);
-ph_key varchar2 (11);
v_obj_keys varchar2 (4000): = ', ';
anz_num NUMBER: = 0;
anz_num_tmp NUMBER: = 0;
anz_st_si NUMBER: = 0;
BEGIN
...
Select count (*)
in anz_num
of pse_bkb.num_objekt o
where o.obj_key in
(select distinct (ov.obj_key)
of pse_bkb.num_objekt_verb ov
where ov.phantom_key =: old.phantom_key
)
and o.typ = "NUM";
...
Explanation: my trigger table is PSE_BKB. NUM_PHANTOM_BP.
On the pse_bkb.num_objekt_verb of the table, I have a relationship 1: n to one or several object-key (field named obj_key!) on my referenced key: old.phantom_key. With this obj_key, I want to watch the weather, I have one or more lines in the table type num_objekt "NUM". So the internal selection gives me all the num_objekt_verb obj_key with my: old.phantom_key and with whom I count the number of lines I have on num_objekt with type "NUM".
The problem is that the trigger does not see the table.
I tried many variations.
The latest version I tried was with a cursor inside the trigger definition as in the block of code below.
For debugging purposes, I inserted a RAISE_APPLICATION_ERROR in the inner loop - see below. The v_obj_key variable is never defined, as in all the other variations, I tried-, I still see the predefined "gugus" in the declare section.
It seems that oracle can not read other tables at this point. La: old.phantom_key is defined (in this simple example there would come a return obj_key).
Thanks in advance for your help - and excuse my English.
Trigger code:
CREATE OR REPLACE TRIGGER PSE_BKB. NUM_TR_PHANTOM_BP
BEFORE DELETING, INSERTION OR UPDATE
ON PSE_BKB. NUM_PHANTOM_BP
REFERRING AGAIN AS NINE OLD AND OLD
FOR EACH LINE
DECLARE
v_recht NUMBER (1): = 0;
v_recht2 NUMBER (1): = 0;
v_change_mitarbeiter NUMBER (1): = 0;
v_recht_mitarbeiter NUMBER (1): = 0;
v_typ varchar2 (20);
v_obj_key varchar2 (11): = "gugus";
v_ph_key varchar2 (11);
-ph_key varchar2 (11);
v_obj_keys varchar2 (4000): = ', ';
anz_num NUMBER: = 0;
anz_num_tmp NUMBER: = 0;
anz_st_si NUMBER: = 0;
BEGIN
Start
declare
cursor nums is
Select obj_key
of PSE_BKB.num_objekt_verb
where phantom_key =: old.phantom_key;
Start
for the RC looping nums
v_obj_key: = cr.obj_key;
RAISE_APPLICATION_ERROR (-20099,' AGAIN 9 v_obj_key: ' | v_obj_key |) ': old.phantom_key ' | (: old.phantom_key);
When the exit nums % NOTFOUND;
Select count (*) in the pse_bkb.num_objekt anz_num_tmp where obj_key = v_obj_key and type = "NUM";
anz_num: = anz_num + anz_num_tmp;
end loop;
end;
end;
Published by: user832075 on 14.01.2013 06:18The reason why you get count_n = 0 in tr_c is that there is no line in B with key_c = 17, to the moment you arrive at tr_c. The removal of B has already occurred, and since you're in a single transaction, the application for tr_c:
select count(*) into counter_n from a aa where aa.key_a in (select distinct(bb.key_a) from b bb where bb.key_c = v_ph_key ) and aa.typ = 'n';
'knows' that the row has been deleted then gets a number of 0.
I added a set of instructions dbms_output to show the order in which triggers run, and that's what I get:
SQL> delete from b_vw where key_a = 1 and key_c = 17 ; in trigger b_tr_vw In tr_b in tr_c delete from b_vw where key_a = 1 and key_c = 17 * ERROR at line 1: ORA-20077: Remark: counter_n: 0 counter_s: 0 v_ph_key: 17 old.key_c: 17 new.key_c: ORA-06512: at "OPS$ORACLE.TR_C", line 38 ORA-04088: error during execution of trigger 'OPS$ORACLE.TR_C' ORA-06512: at "OPS$ORACLE.B_TR_VW", line 17 ORA-04088: error during execution of trigger 'OPS$ORACLE.B_TR_VW'
Thus b_tr_vw trigger is triggered first and deletes a B. trigger fires tr_b as part of this statement to remove and check against A, happening apparently so no error is triggered and succeeds the removal of B. Now tr_b_vw takes back control and deletes C. Since the B line which has key_c = 17 already deleted a control for counter_n > 0 and counter_s = 0 fails and raise you the-20002 error. Note that I'm assuming that the error of-20077 you lift is just to see the values and is not intended to be part of your actual code.
Because I have really no idea what you're trying to accomplish here I can't offer a lot of advice that you might want to try entering two tr_c of the tr_b_vw trigger validation queries before deliver you the removal of b and put the counter_n > 0 and counter_s = 0 control under tr_b_vw to decide whether or not you want to remove.
John
-
create table on the production database
Hi expert I want some knowledge in real time
If a user has requested to create a table on the production database where DBA one should contact 1.
form where dba approval for create table.
Thanks and greetings
SanatIt depends on your hierarchy of society. Generally, your immediate boss.
-
Creating tables with the same Structure and with the remote control FOR the parts database
Hello
I have a remote DB connection and a local DB connection in my system
I want to create the same Table and data from my DB remote to Local Connection DB connection.
Please tell me how to do this?CREATE TABLE LOCAL_TABLE AS SELECT * FROM REMOTE_TABLE@TNS_ALIAS;
-
Create table replaces the existing table in mssql
In a program that allows us to update our sites, we use the function 'create an array' of MS SQL to create missing tables in databases.
Thousands of time we used it, if a table already exists with the same name of the table in the create table MS SQL survey command an error.
In fact, MS SQL documentation indicates that only if you include the optional 'replace' command, will be a replaced existing table.
But today, we used this program on a new host, that we are trying, and the create table command actually did replace an existing table with a new table, delete all the records from the old table.
I'm trying to understand what this would allow the settings at the server level.
This is the code we use:
< CFQUERY NAME = "recipe" DATASOURCE = "recipe" dbtype = "ODBC" username = "" #ruser # "password =" #rPASS #">"
Create table recipecats)
RecipecatID int IDENTITY(1, 1) NOT NULL PRIMARY KEY,
recipecatdescription NVARCHAR (50) NULL)
< / cfquery >Are you sure that this is not just to create another table with the same name, but one
different owner?I saw the strangeness (it's probably just weird for me because I am ignorant)
of what is happening), I can READ a table owned by another user without
calling the name of the table with its owner, and when I go to CREATE a table
of the same name, it is actually created as my current user and subsequently when
you ask the name of the full table, I get the results of one, is not new
the former. If I'm right in the name of the table, I can ask both/either. Kind
way similar CF hunting around different scopes when you aren't eligible one
reference to a variable.Also, your code should probably be testing to see if the table exists
before you try to create it anyway. "Just try and catch.
"If it errors" is not considered as 'test' if there is--
Adam -
How to create table of the method
Hello-
Could someone please tell me how can I create an af:table with more than one column of an AppsModule method.
When I have a 1 d table return for example:
public String [] createTable()}
String [] str = new String [1];
return str;
}
I can get as a table and a column is created. But how do I get mutiple columns in a table. I want to write a method that when inserted on jsp page create table with multiple columns.
I use ADF 11 g.
Please suggest.
Greetings-
RohitHello
to do this, you use a matrix, or a list of arrays of objects. The object represents the contents of the line, e.g., person. The Person class then have setter/getter for each property you want to display in a column
Frank
-
Create table in the select statement.
Hello Oracle gurus,
I am creating a table using select * in the other table.
The procedure I am following is as follows: -.
I have a temporary table whose signature is on delete rows commit.
I insert records into this table.
When I select * from temporary_table, perm_table, I get a few lines.
so I try to create a result_table the use of this
CREATE TABLE result_table
AS SELECT * FROM temporary_table, perm_table;
I see the created array, but the number of records in 0. Please can someone explain where the validation is performed while the sequence in this query occurs.
Thank you
Published by: user10696492 on November 10, 2009 08:47Hello
When you perform DDL like CREATE TABLE implicit validation takes place just before and just after the statement.
Concerning
Peter
Maybe you are looking for
-
Re: How to change the Satellite L650-108 screen resolution greater than 1024 x 768
You just bought a new 108 L650, but I cannot fix the upper to 1024 x 768 screen resolution.It should be 1366 x 768. Right-click on the desktop and choosing the resolution of the screen only gives you the opportunity to 800 x 600 or 1024 x 768. I can'
-
HP Pavilion dv6-2106ea: need a new card wifi for Hp pavilion dv6-2106ea
Hi I want to replace my card mini wireless to my HP Pavilion dv6-2106ea. looking for a faster card mordern 2.4 ghz and 5 GHz at the same time supporting. (1) I am new to this so please tell me which cards I can use, they should be better than my curr
-
Images lost during operations cut-and - paste from memory card on my computer
I was moving pictures on my memory card in a folder in "my pictures" using the cut and paste.on my memory card and when I plugged my camera into my computer, the photos were in different files as the memory card has been put in two cameras; a samsung
-
IM connected to a Linksys AM300 Modem and within hours it will drop the connection and get ip address of 169.254.193.178 -J' have flashed and reflashed the modem with the latest firmware, I have reset and reconfigured it 5 times more. -It is not conn