Export Schema to .SQL file
This has been discussed on the forums before, in thread
Re: How to export an exisitng schema to DDL script?
but that seems to deal with previous versions of Oracle, before the web-only interface. How would this be accomplished in Oracle 10g? I need to export the DDL(and data if possible in the same statement) of one entire schema to a .sql file to be run on an install.
In addition to using DBMS_METADATA, you can try using SQL Developer (same options tools -> Export DDL). This would work for 10g just as well as pre-10g releases.
Only issue with this approach as I have seen it with SQL developer, is it does not put the object creation in proper order (It created a script where index was created before creating a table which of course would fail). This means you will have to edit the script any way for it to work.
Another issue with SQL Developer script is that (if you also want include data in the .sql file) it writes individual insert statements for each row. This again poses a problem if tables and indexes are not created in order before inserting data (especially creating appropriate FK constraints). Also this is going to be very slow option (from performance point if you have tables with millions of rows).
For migrating data from one instance to another I would use export/import or 10g Data pump.
10g DB control or Grid Control do not give you a simple point and click to achieve exporting of schema.
The way I see it is to use some case tools like Oracle Designer or ErWin.
Hope it helps.
Similar Messages
-
Export definitions to sql file
Hi,
One quick question. What tool should I use to export table definitions, procedures, functions to a sql file?
Is there a freeware to do this ?
Thanks,
pesqYou can use dbms_metadata.get_ddl package to get the database objects definations. So, you may need to spool the output in .sql file.
I'm not sure but try out TOAD trail version for this.
Regards,
Sabdar Syed. -
Export creates empty .sql file
When I right-click a table name and click through the export process, the resulting file is named correctly in the correct location but is 0KB. Any thoughts?
Please do not reply. Found suggested procedure in thread and works as described. Thanks anyway.
-
How to export Schema to a cvs file?
I want to know whether or not there is a tool that exports schema to a csv file?
This quetion has been asked a number of times on this forum. As I recall, th efavourite solutions are to use Toad (www.quest.com) or to write a little procedure yourself, using UTL_FILE or spooling from SQL*Plus. This would actually be quite simple to genericise (it's probably what Toad does), but I don't know whether anybody's actually posted some code - try the search facility and find out.
rgds, APC -
Export Oracle Databaes Objects into sql file
Hi Experts,
I searched and could not find anything whether is that possible to dump oracle database into a sql file.
Can some one clarify this?
Thanks,
Dharan VHi,
Still struggling here,
CREATE OR REPLACE DIRECTORY DUMP_DIR AS 'c:\';
GRANT DATAPUMP_EXP_FULL_DATABASE TO SCOTT;
GRANT DATAPUMP_IMP_FULL_DATABASE TO SCOTT;
EXPDP SCOTT@LOCAL-DB directory=DUMP_DIR dumpfile=scott.dmp content=metadata_only Full=Y
password: tiger
C:\Documents and Settings\Dharan>expdp SCOTT@LOCAL-DB directory=DUMP_DI
R dumpfile=scott.dmp content=metadata_only Full=Y
Export: Release 11.1.0.6.0 - Production on Sunday, 31 January, 2010 16:48:42
Copyright (c) 2003, 2007, Oracle. All rights reserved.
Password:
Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Produc
tion
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SCOTT"."SYS_EXPORT_FULL_01": SCOTT/********@LOCAL-DB directo
ry=DUMP_DIR dumpfile=scott.dmp content=metadata_only Full=Y
Processing object type DATABASE_EXPORT/TABLESPACE
Processing object type DATABASE_EXPORT/PROFILE
Processing object type DATABASE_EXPORT/SYS_USER/USER
Processing object type DATABASE_EXPORT/SCHEMA/USER
Processing object type DATABASE_EXPORT/ROLE
Processing object type DATABASE_EXPORT/GRANT/SYSTEM_GRANT/PROC_SYSTEM_GRANT
Processing object type DATABASE_EXPORT/SCHEMA/GRANT/SYSTEM_GRANT
Processing object type DATABASE_EXPORT/SCHEMA/POST_SCHEMA/PROCACT_SCHEMA
Processing object type DATABASE_EXPORT/AUDIT
Master table "SCOTT"."SYS_EXPORT_FULL_01" successfully loaded/unloaded
Dump file set for SCOTT.SYS_EXPORT_FULL_01 is:
C:\SCOTT.DMP
Job "SCOTT"."SYS_EXPORT_FULL_01" successfully completed at 16:51:20But i don't see any scott.dmp in either c:\ [on newly created directory]
OR C:\Documents and Settings\Dharan.
Ok...i Tried similarly the second one now
C:\Documents and Settings\Dharan>impdp SCOTT@LOCAL-DB directory=DUMP_DI
R dumpfile=scott.dmp content=metadata_only Full=Y
Export: Release 11.1.0.6.0 - Production on Sunday, 31 January, 2010 16:48:42
Copyright (c) 2003, 2007, Oracle. All rights reserved.
Password:
Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Produc
tion
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "SCOTT"."SYS_SQL_FILE_FULL_01" successfully loaded/unloaded
Starting "SCOTT"."SYS_SQL_FILE_FULL_01": SCOTT/********@LOCAL-DB dire
tory=DUMP_DIR dumpfile=scott.dmp SQLFILE=SCOTT.sql
Processing object type DATABASE_EXPORT/TABLESPACE
Processing object type DATABASE_EXPORT/PROFILE
Processing object type DATABASE_EXPORT/SYS_USER/USER
Processing object type DATABASE_EXPORT/SCHEMA/USER
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/POST_INSTANCE/PROCDEPOBJ
Processing object type DATABASE_EXPORT/SCHEMA/POST_SCHEMA/PROCOBJ
Processing object type DATABASE_EXPORT/SCHEMA/POST_SCHEMA/PROCACT_SCHEMA
Processing object type DATABASE_EXPORT/AUDIT
Job "SCOTT"."SYS_SQL_FILE_FULL_01" successfully completed at 17:13:35Even now i can't see any .sql file either c:\ [on newly created directory]
OR C:\Documents and Settings\Dharan.
Suggest what am doing wrong here.
Thanks,
Dharan V -
Oracle 9i export error after running catexp.sql file
After running catexp.sql file in oracle 9i 9.2.0.7.0 as system user,it gives the following error while logging
ORA-04020: deadlock detected while trying to lock object SYS.DBMS_STANDARD
please help me.............."catexp.sql" is to be run by SYS AS SYSDBA.
You'd have to cleanup any extra objects that you created in the SYSTEM account.
Why did you think that you needed to run "catexp.sql" ? Are you exporting using 9i exp against a 10g database or against a 9i database ? -
Issue with passing schema name as variable to sql file
Hi,
I have a scenario wherein from SYS a Java process (Process_1) is invoking SQL files and executing the same in SQLPLUS mode.
DB: Oracle 11.2.3.0
Platform: Oracle Linux 5 (64-bit)
Call_1.sql is being invoked by Java which contains the below content:-
ALTER SESSION SET CURRENT_SCHEMA=&&1;
UPDATE <table1> SET <Column1> = &&1;
COMMIT;
@Filename_1.sql
Another process (Process_2) again from SYS user is also accessing Filename_1.sql.
The content of Filename_1.sql is:-
DECLARE
cnt NUMBER := 0;
BEGIN
SELECT COUNT(1) INTO cnt FROM all_tables WHERE table_name = 'TEST' AND owner = '&Schema_name';
IF cnt = 1 THEN
BEGIN
EXECUTE IMMEDIATE 'DROP TABLE TEST';
dbms_output.put_line('Table dropped with success');
END;
END IF;
SELECT COUNT(1) INTO cnt FROM all_tables WHERE table_name = 'TEST' AND owner = '&Schema_name';
IF cnt = 0 THEN
BEGIN
EXECUTE IMMEDIATE 'CREATE TABLE TEST (name VARCHAR2(100) , ID NUMBER)';
dbms_output.put_line('Table created with success');
END;
END IF;
End;
Process_2 uses "&Schema_Name" identifier to populate the owner name in Filename_1.sql. But Process_1 needs to use "&&1" to populate the owner name. This is where I am looking a way to modify Call_1.sql file so that it can accommodate both "&&1" to populate owner name values in Filename_1.sql (with avoiding making any changes to Filename_1.sql).
Any help would be appreciated.
Thanks.Bad day for good code. Have yet to spot any posted today... Sadly, yours is just another ugly hack.
The appropriate method for using SQL*Plus substitution variables (in an automated fashion), is as command line parameters. Not as static/global variables defined by some other script ran prior.
So if a script is, for example, to create a schema, it should look something as follows:
-- usage: create-schema.sql <schema_name>
set verify off
set define on
create user &1 identified by .. default tablespace .. quota ... ;
grant ... to &1;
--eof
If script 1 wants to call it direct then:
-- script 1
@create-schema SCOTT
If script 2 want to call it using an existing variable:
-- script 2
@create-schema &SCHEMA
Please - when hacking in this fashion, make an attempt to understand why the hack is needed and how it works. (and yes, the majority of SQL*Plus scripts fall into the CLI hack category). There's nothing simple, beautiful, or elegant about SQL*Plus scripts and their mainframe roots. -
Compare 2 schemas and get the difference with .sql file.
Hi,
I am using ORACLE DATABASE 11g R2 and ORACLE Linux 5.
I want to perform a very lengthy process and want to make it automated.
I am having a software named as SVN. In which all the developers keep their updated scripts.
We have 2 schema's one is used for developement and when all the development seems good we implement the scripts on the final schema which is used by testing people also.
Now every day we need to check the modifications in the development schema, that we do by observing the updated scripts in the SVN software. Now we get the scripts which are modified.
We will fire this scripts to a sample schema then we will compare the objects in this schema and the same objects in our final schema. If the objects in sample schema is different than the final schema it should give me the
script to create the same type object in the final schema.
Below is a proper example to explain :-
Developement Schema :- 'DEV'
SVN Script Schema :- 'SVNscript'
Main Schema :- 'MAIN'
1) On Monday developers modified/added 4 tables in the development schema names 'DEV' after working for a day they found that the changes are necessary and so checked-in in the SVN software.
2) On tuesday morning we found 4 scripts which has been modified/added in the SVN.
The Scripts were as follows :-
1St table :- An extra column was added.
2nd table :- An index was created on it.
3rd table :- 2 Columns were dropped from it.
4th table :- A new table is added in the schema.
Now taking these 4 scripts i am going to execute it in a sample schema named :- SVNscript
SVNscript schema will have now 4 tables with proper properties(columns,indexes,...). Now this is the final table structure as we want in our 'MAIN' schema .
Coming to MAIN schema which is our most important schema and all the development work is finally posted here.Considering MAIN schema is having around 1000 tables,500 function/procedure/package and many more DB objects.
I want to compare(one way compare) from SVNscript schema --> MAIN schema :- That the objects present in the SVNscripts schema is same or not in the MAIN schema. If its not same then this code should generate a .sql script for me which i should be able to fire on the MAIN schema.
The output .sql scripts should be something like this :-
1st Table :- Alter table add...
2nd Table :- Create index on table...
3rd Table :- Alter table drop...
4th table :- Create table tablename...
I found a link while trying this but it is not the perfect fit to my requirement
http://www.dbspecialists.com/files/scripts/compare_schemas.sql
Please let me know the best code to compare 2 schemas and get a .sql file as output of the difference.
Thanks in advance.Yes I followed the tutorial properly this time. Still i have a few queries :-
1) This is returning me the 'ALTER TABLE...' statement but how to make it more efficient to return all the DDL dependent on the table, Like index,trigger,view...
2) I want to compare objects in a different schema on a different db. I have created an DBLINK but how to use it ... can i use it like
DBMS_METADATA.OPEN('TABLE'," Network_link_name " );Can you please give me some clear about it.
3) I created a table 'TAB1' with which i want to compare a 'TAB1' in other schema.I was not getting how to compare on remote dblink so,I created the same table with the following code in the same schema
CREATE TABLE TAB1_OLD as select * from TAB1@DBLINK where 1=2;Now when i fire the below query to get the alter difference I get the following error :-
SQL> SELECT get_table_alterddl('TAB1','TAB1_old') FROM dual;
SELECT get_table_alterddl('TAB1','TAB1_old') FROM dual
ORA-31603: object "TAB1_old" of type TABLE not found in schema "SVNCHECK"
ORA-06512: at "SYS.DBMS_METADATA", line 5225
ORA-06512: at "SYS.DBMS_METADATA", line 5189
ORA-06512: at "SVNCHECK.GET_TABLE_SXML", line 17
ORA-06512: at "SVNCHECK.COMPARE_TABLE_SXML", line 12
ORA-06512: at "SVNCHECK.GET_TABLE_ALTERXML", line 11
ORA-06512: at "SVNCHECK.GET_TABLE_ALTERDDL", line 11
Can you please guide me why i am getting this error?
I have made sure that TAB1_OLD table has been created and the entries are also present in the data dictionary tables.
SQL> select * from tab1_old;
EMPNO ENAME MGR DEPTNO
----- -------------------- ----- ------The only difference is that this table was created with CREATE TABLE AS SELECT statement ....
Thanks. -
How to export SSIS package to File system in SQL Server 2012
I am accessing SSIS package by connecting to a database engine. I wanted to export the SSIS to file system. How to get it done in sql server 2012? I tried Util utility , i got package not present. Let me know what other options are available to export to
file system?
ManoHi Mano,
After exporting the project stored in a SSISDB catalog to an .ispac file, we can modify the extension .ispac to .zip, then, we can extract the zip file to get the .dtsx package files. Besides, please note that if there are project level connection managers
or parameters, their definition cannot be exported to individual packages.
Regards,
Mike Yin
TechNet Community Support -
How to export MySql queryBrowser to oracle's .sql file
Hi folks:
I was trying to export result set from MySql query browser to Oracle. I could able to do
File->Export Result Set-> Excel format...
What I am trying to get is .sql file so that I can run it as a script in my oracle db. Is there any way we can get .sql file with inserts and delimeters ....?
Did you guys get my question.?
Please throw some light on this....
Could be very appreciable ....
Thanks
Sudhir NaiduAs already pointed out the implementation is bad.
You should have:
USERS ( ID )
GROUPS ( ID )
USER_GROUPS( USER_ID,GROUP_ID )The reason for not using the CSV list is that not only is it hard to write efficient SQL against denormalised structures, but it is very difficult to constrain your data properly.
But anyhow, Oracle 10g has a MEMBER OF function. Too bad you're on 9i. You say "new task", is the platform still up for decision?
You could normalise on the fly like this
e.g.
SELECT t.GROUP_ID
,EXTRACTVALUE (csv_to_tab.COLUMN_VALUE, 'user')
user_id
FROM t_user t
,TABLE (XMLSEQUENCE (EXTRACT (XMLTYPE
( '<set><user>'|| REPLACE
(t.users,',','</user><user>' )
|| '</user></set>'), '/set/*'))) csv_to_tab -
Invalid data format on EXPORTING table to SQL-FLAT FILE (Insert type)
Hi there!
Writing from Slovenia/Europe.
Working with ORACLE9i (standard version) on Windows XP with SQL-deloper 1.0.0.015.
FIRST SQL.-DEVELOPER IS GOOD TOOL WITH SOME MINOR ERRORS.
1.) Declare and Insert data EXAMPLE
drop table tst_date;
create table tst_date (fld_date date);
insert into tst_date values (sysdate);
insert into tst_date values (sysdate);
2.) Retriving date with SQLPLUS
SQL> select to_char(fld_date,'DD.MM.YYYY HH24:MI:SS') FROM TST_DATE;
23.10.2006 11:25:23
23.10.2006 11:25:25
As you see TIME DATA IS CORRECT.
When I EXPOPRT data TO SQL-insert type I got this result IN TST_DATE.SQL file:
-- INSERTING into TST_DATE
Insert into "TST_DATE" ("FLD_DATE") values (to_date('2006-10-23','DD.MM.RR'));
Insert into "TST_DATE" ("FLD_DATE") values (to_date('2006-10-23','DD.MM.RR'));
As you seel I lost TIME DATA.
QUESTION!
HOW CAN I SET PROPER DATE FORMAT IN SQL-DEVELOPER BEFORE I EXPORT DATA TO FLAT FILE.
Best regards, Iztok from SLOVENIA
Message was edited by:
DEKUSA DATE-Field, is a DATE-Field and not a
DATE-TIME-Field.
The export-tool identifies a DATE-Field and exports
the data into date-format.This is not true. Oracle DATE fields include a time element.
To the original poster - I believe this is a bug in the current version.
See this thread for possible workarounds Bad Export format --- BUG ???
Message was edited by:
smitjb -
EXP-00008 + ORA-06544 + ORA-06553 + ORA-06508 error while exporting schema
HI,
i am exporting schema defnition from database;
bash-2.05$ exp userid=pin/pin file=pin.dmp log=pin.log owner=pin rows=no
i am getting this error:
Connected to: Oracle8i Enterprise Edition Release 8.1.7.0.0 - 64bit Production
With the Partitioning option
JServer Release 8.1.7.0.0 - 64bit Production
Export done in US7ASCII character set and UTF8 NCHAR character set
server uses UTF8 character set (possible charset conversion)
Note: table data (rows) will not be exported
About to export specified users ...
. exporting pre-schema procedural objects and actions
EXP-00008: ORACLE error 6544 encountered
ORA-06544: PL/SQL: internal error, arguments: [56319], [], [], [], [], [], [], []
ORA-06553: PLS-801: internal error [56319]
ORA-06508: PL/SQL: could not find program unit being called
ORA-06512: at line 1
EXP-00083: The previous problem occurred when calling SYS.DBMS_REPCAT_RGT_EXP.schema_info_exp
. exporting foreign function library names for user PIN
. exporting object type definitions for user PIN
About to export PIN's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export PIN's tables via Conventional Path ...
. . exporting table 109_31OCT2008
. . exporting table 109_gl_juntooct2008
. . exporting table ACCOUNT_BALANCES_BACKUP_T
. . exporting table ACCOUNT_BALANCES_T
. . exporting table ACCOUNT_BALANCES_THRESHOLDS_T
. . exporting table ACCOUNT_BALANCES_T_06NOV01
. . exporting table ACCOUNT_BALANCES_T_31MAR07
. . exporting table ACCOUNT_EXEMPTIONS_T
. . exporting table ACCOUNT_INTERNAL_NOTES_BUF
:. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting referential integrity constraints
. exporting triggers
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting snapshots
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
EXP-00008: ORACLE error 6544 encountered
ORA-06544: PL/SQL: internal error, arguments: [56319], [], [], [], [], [], [], []
ORA-06553: PLS-801: internal error [56319]
ORA-06508: PL/SQL: could not find program unit being called
ORA-06512: at line 1
EXP-00083: The previous problem occurred when calling SYS.DBMS_REPCAT_RGT_EXP.schema_info_exp
. exporting statistics
Export terminated successfully with warnings.
please could any body guide me what is the exact problem.
Thanks
PrakashHi,
bash-2.05$ exp pin/pin file=mypinfile.dmp log=mypinfile.log rows=N
Connected to: Oracle8i Enterprise Edition Release 8.1.7.0.0 - 64bit Production
With the Partitioning option
JServer Release 8.1.7.0.0 - 64bit Production
Export done in US7ASCII character set and UTF8 NCHAR character set
server uses UTF8 character set (possible charset conversion)
Note: table data (rows) will not be exported
About to export specified users ...
. exporting pre-schema procedural objects and actions
EXP-00008: ORACLE error 6544 encountered
ORA-06544: PL/SQL: internal error, arguments: [56319], [], [], [], [], [], [], []
ORA-06553: PLS-801: internal error [56319]
ORA-06508: PL/SQL: could not find program unit being called
ORA-06512: at line 1
EXP-00083: The previous problem occurred when calling SYS.DBMS_REPCAT_RGT_EXP.schema_info_exp
. exporting foreign function library names for user PIN
. exporting object type definitions for user PIN
About to export PIN's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export PIN's tables via Conventional Path ...
. . exporting table 109_31OCT2008
. . exporting table 109_gl_juntooct2008
. . exporting table ACCOUNT_BALANCES_BACKUP_T
. . exporting table ACCOUNT_BALANCES_T
. . exporting table ACCOUNT_BALANCES_THRESHOLDS_T
. . exporting table ACCOUNT_BALANCES_T_06NOV01
.. . exporting table YOU_VRC_TRANS_DETAILS_T
. . exporting table YOU_VRC_TRANS_T
. . exporting table ZONEMAP_DATA_DERIVED_T
. . exporting table ZONEMAP_DATA_RAW_T
. . exporting table ZONEMAP_T
. . exporting table cust_balance19
. . exporting table cust_balance_ason_19June12AM
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting referential integrity constraints
. exporting triggers
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting snapshots
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
EXP-00008: ORACLE error 6544 encountered
ORA-06544: PL/SQL: internal error, arguments: [56319], [], [], [], [], [], [], []
ORA-06553: PLS-801: internal error [56319]
ORA-06508: PL/SQL: could not find program unit being called
ORA-06512: at line 1
EXP-00083: The previous problem occurred when calling SYS.DBMS_REPCAT_RGT_EXP.schema_info_exp
. exporting statistics
Export terminated successfully with warnings.
i think it some problem with SYS.DBMS_REPCAT_RGT_EXP package
SQL> select status, object_type, LAST_DDL_TIME from dba_objects where object_name='DBMS_REPCAT_RGT_EXP';
STATUS OBJECT_TYPE LAST_DDL_
VALID PACKAGE 25-DEC-08
INVALID PACKAGE BODY 02-SEP-01
Thanks
Prakash
T -
How to export schema database XE?
I would like export a schema database (tables, triggers, indexes, sequences) for using this schema in another database XE (in fact an sql file). Generate DDL doesn't work due to constraints and references tables.
Thank for your help.
BobHI,
Here is an example.
----------- EXPORT/IMPORT procedures -----------
From DOS prompt make directory
DOS>md c:\oraclexe\tmp
DOS>cd c:\oraclexe\app\product\10.2.0\server\BIN
DOS>sqlplus SYS/Password AS SYSDBA
It is posible to be SYS/Password@SID AS SYSDBA
SQLPlus>CREATE OR REPLACE DIRECTORY XMLDIR AS 'C:\oraclexe\Tmp';
SQLPlus>GRANT READ, WRITE ON DIRECTORY XMLDIR TO property;
Go back to DOS prompt. There are two files - expdp.exe and impdp.exe in BIN directory.
DOS>expdp SYS/Password AS SYSDBA SCHEMAS=property DIRECTORY=XMLDIR DUMPFILE=property.dmp LOGFILE=property.log
From DOS prompt make directory
DOS>md c:\oraclexe\tmp
DOS>cd c:\oraclexe\app\product\10.2.0\server\BIN
DOS>sqlplus SYS/Password AS SYSDBA
It is posible to be SYS/Password@SID AS SYSDBA
SQLPlus>ALTER SYSTEM SET NLS_LENGTH_SIMANTICS='CHAR' SCOPE=BOTH;
SQLPlus>CREATE OR REPLACE DIRECTORY dmpdir AS 'C:\oraclexe\Tmp';
SQLPlus>GRANT READ, WRITE ON DIRECTORY XMLDIR TO public;
Go back to DOS prompt. There are two files - expdp.exe and impdp.exe in BIN directory.
DOS>impdp SYS/Password AS SYSDBA SCHEMAS=property DIRECTORY=XMLDIR DUMPFILE=property.dmp LOGFILE=property.log
Konstantin -
Data Pump import to a sql file error :ORA-31655 no data or metadata objects
Hello,
I'm using Data Pump to export/import data, one requirement is to import data to a sql file. The OS is window.
I made the follow export :
expdp system/password directory=dpump_dir dumpfile=tablesdump.dmp content=DATA_ONLY tables=user.tablename
and it works, I can see the file TABLESDUMP.DMP in the directory path.
then when I tried to import it to a sql file:
impdp system/password directory=dpump_dir dumpfile=tablesdump.dmp sqlfile=tables_export.sql
the log show :
ORA-31655 no data or metadata objects selected for job
and the sql file is created empty in the directory path.
I'm not DBA, I'm a Java developer , Can you help me?
ThksHi, I added the command line :
expdp system/system directory=dpump_dir dumpfile=tablesdump.dmp content=DATA_ONLY schemas=ko1 tables=KO1QT01 logfile=capture.log
the log in the console screen is (is in Spanish), no log file was cerated in the directory path.
Export: Release 10.2.0.1.0 - Production on Martes, 26 Enero, 2010 12:59:14
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Conectado a: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
UDE-00010: se han solicitado varios modos de trabajo, schema y tables.
(English error)
UDE-00010: multiple job modes requested,schema y tables.
This is why I used tables=user.tablename instead, is this right ?
Thks -
I have Oracle XE in dev machine with objects (tables, sequences, views indexes etc) in a chaluwa schema. We want to test on a mock production machine with Oracle Enterprise Manager 11g (just downloaded it). First how do I use the XE interface (not code like in the link in the previous post) to export these objects.
So far, I used XE's DDL creation utility to generate the code, I tried to run this code on an empty test schema in my dev machine to see if the DDL statements will replicate / reproduce the objects from the chaluwa schema, but I got errors. The DDL statements where not arranged in sequence, a foreign key field been created in a table was referencing a table not yet created. I wouldn't want to start tampering with the DDL code to rearrange it. In XE, I could make a schema by creating a new user, I 'v not been able (at least so far) to do this (create a schema) on the mock production machine running Oracle Enterprise Manager 11g.
so the issues are :
1. need to export the objects from chaluwa schema in the Oracle XE in my dev machine.
2. create a schema on the mock production machine running Oracle Enterprise Manager 11g where I will put the exported objects from step 1.
3. put the objects into the schema created in step two.
Sorry if my questions were stupid, I really need your help. CheersHi,
I have two XE at different machines, one in my office PC(production), and another at my laptop(dev), I use a lot of the datapump utility at XE, and it is great.
And it is very simple to use, and it does have much more options of usage than my simple one, but my one works
In case I would like to export all my data at machine1 to machine 2(and the schema name is chaluwa
1. on machine1
I create a directory by the OS at my machine1, like 'c:\chaluwa_080914'
then I go to the sql command line(sql plus),
sqlplus / as sysdbasql> create or replace directory anyname as 'c:\chaluwa_080914';
sql> directory created.
sql> grant read, write on directory chaluwa_080914 to chaluwa;
sql> grant successed
sql> exit;
--- now you are back to the windows command line again
c:\Document and Settings\peteryzhang> expdp system schemas=chaluwa directory=chaluwa_080914
password: ******
and then they will export all stuffs to the export file, the default name will be export and a log file.
copy the directory(with its data exported) chaluwa to machine2;
2. import the file you just exported to another database
at the machine 2 , copy the chaluwa_080914 to a place, like 'd:\chaluwa_080914'
and then go the sqlplus
connect as sysdba
sql>create user chaluwa identified by password default tablespace USERS(note: better the use the same tablespace as from machine 1).
sql> user created.
sql> grant connect, resource, dba to chaluwa ( that is what I usually use, maybe you not need the dba role, but you need some more proviliges for successfully import the export file, like, it depends, but, let's say, if you don't any right to create triggers, you cannot import triggers to it, it will fail)
sql> success
sql> create or replace directory chaluwa_080914 as 'd:\chaluwa_080914';
sql> directory created.
sql> grant read, write on directory chaluwa_080914 to chaluwa;
sql> success;
sql> exit;
c:\document and settings\hostname>: impdp system schemas=chaluwa directory=chaluwa_080914
and then the password.
and at that, you will be successfully import the schema, and there's only one error, the user is already created, but it is Ok, fine.
if you want to import the file into a different schema, you can do that, and if you need to import the file into a different tablespace, you can do that, there's some options,
you can reference the doc at the*Xe two day DBA guide* and oracle database utilities:
two day DBA
http://download.oracle.com/docs/cd/B25329_01/doc/admin.102/b25107/impexp.htm#BCEEDCIB
Oracle Database Utilities
http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/part_dp.htm#i436481
Peter
Edited by: PeterCN on Sep 15, 2008 10:05 AM
Maybe you are looking for
-
VGA adapter pigtail is manuf. out of spec. - stnd plug cannot engage
The VGA adapter pigtail for our new Macbooks are manufactured out of specification. The nuts on the plug are set back by about 1/16 of an inch too far away for the screws on a standard video cable plug to engage. This setback is caused by the plastic
-
I disabled my iPhone 4 and while doing a restore via iTunes, it is downloading and timing out so the download is not completing. any idea how to get past that? I have tried many times and the same error keeps happening.
-
Encountering with the error Client out of memory in Bex. . .
Hello All, In the Bex report when I run for the 2000 sales organization selection the initial display is coming fine. When I try to drill down to the next levels in the result, I am encountering with the error 'CLENT OUT OF MEMORY'. The report is dis
-
Flash button open a new tab in firefox
Hi guys. I´m new to flash and I did some flash buttons to my website. Problem is, whenever I click the buttons the open up the the other pages of my website but they open them in new tabs or windows. I pasted part of the code below. What Do I need to
-
Impossible to update Solaris 10
Hi, I have difficulties to update Solaris. When using the update manager, I get an error popup, but with a blank message .. not very easy to determine the problem ... and nothing logged in dmesg. When I try smpatch update, or smpatch analyze, I get a