Exporting a schema on Linux Oracle XE using expdp

Hi,
Basically, I would like to take everything (including the APEX app) that's in the HR schema and copy into another schema. I want to experiment with APEX and don't want to mess around with the original. I'm running Oracle XE on Fedora 5 BTW.
Here's what I did:
CREATE OR REPLACE DIRECTORY backup_dir AS '/usr/lib/oracle/xe/app/oracle/admin/XE/';
GRANT READ ON DIRECTORY backup_dir TO hr;
But I can never get the expdp application to execute... (I'm new to linux btw)
The path to the expdp binary is:
/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin
I then try to execute this comment in a terminal command line:
./expdp hr/hr SCHEMAS=hr DIRECTORY=backup_dir DUMPFILE=sch ema.dmp LOGFILE=schema.log;
I get this message:
UDE-00013: Message 13 not found; No message file for product=RDBMS, facility=UDE
UDE-00019: You may need to set ORACLE_HOME to your Oracle software directory
Eric

Problem solved (almost) thanks!
This export does not export the APEX application, I have to go into the APEX admin and export the application and then import it but everything else exported and imported fine.
Here is the detailed solution:
Create Backup Directory for Oracle:
CREATE OR REPLACE DIRECTORY backup_dir AS '/usr/lib/oracle/xe/app/oracle/admin/XE/';
Grant permissions to users:
GRANT READ ON DIRECTORY backup_dir TO hr;
Location of binaries on Linux:
/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin
To Export, cd to the binaries and execute in a linux terminal:
./expdp hr/hr@XE SCHEMAS=HR DIRECTORY=backup_dir DUMPFILE=schema.dmp LOGFILE=schema.log;
Your export file will now be located at backup_dir '/usr/lib/oracle/xe/app/oracle/admin/XE/'
To import, place the file in your backup_dir '/usr/lib/oracle/xe/app/oracle/admin/XE/' (If it's on the same computer you don't need to do anything since the file is already there) and then:
impdp NewSchema/NewSchema@XE REMAP_SCHEMA=hr:NewSchema directory=backup_dir dumpfile=schema.dmp logfile=schema.log
Thanks for your help!
Eric

Similar Messages

  • Export of public synonym in oracle

    Hi All,
    I am trying to export the database dump in oracle 10g using expdp command.But when I am trying to import that file i found that public synonym are missing.
    Can anyone help me its very urgent.
    expdp system/oracle directory=export dumpfile=<<x.dmp>> logfile=<<y.log>> schemas=ww_admin
    TIA,
    Ravi

    Hi,
    You can write a script to spool the list of public synonyms.
    set feedback off
    set trimspool on
    set pagesize 1000
    set linesize 1000
    set heading off
    spool public_synonyms.txt
    select      'create public synonym ' || table_name || ' for ' || table_owner || '.' || table_name || ';'
    from      dba_synonyms
    where
         owner='PUBLIC' and table_owner not in ('SYS', 'SYSTEM')
    order by
         table_owner;
    spool off
    exit
    Hope it helps.
    Regards,
    Z.K.

  • How to use EXPDP to create the dumpfile in shared network drive.

    Hi,
    I have Oracle 11g ( 11.2.0.3 ) DB server in SUSE Linux machine.
    I want to export a schema of 300 GB size using EXPDP utility. Thing is I dont have enough space to hold the EXPDP dumpfile in the same server.
    Hence I would like to know is there any way where I can create the dumpfile on to some other mapped drive from the Linux server.
    This is quite urgent, please some one help me.
    Regards
    Suresh

    Hi Suresh,
    It it's windows you want to map to linux take a look at samba to do that:
    http://www.linux-noob.com/forums/index.php?/topic/1404-how-to-mount-a-windows-share-with-smbmount/
    I've not actually exported directly to a samba mount but i assume it will work......
    the other alternative (if you have an 11.2.0.3 db on the windows server also) is to use this approach
    http://dbaharrison.blogspot.de/2013/05/expdp-creating-file-on-my-local-machine.html
    Cheers,
    Harry

  • DB2 to Oracle conversion using SQL Developer Migration Wizard - different schemas

    I am performing a conversion between DB2  to Oracle 11 XE, using the SQL Developer Migration Wizard. Specifically I am trying to migrate the DB2User schema over to Oracle.
    Using the migration wizard, when I pick the Oracle target connection to be the same schema ( DB2User schema ) the migration is successful and all data is converted.
    However if I pick a different Oracle target connection ( say OracleUser ) , I run into issues.
    Firstly , the table schema is not created. When I check the project output directory, the .out file has the following errors:
       CREATE USER DB2User IDENTIFIED BY DB2User DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP
            SQL Error: ORA-01031: insufficient privileges
            01031. 00000 -  "insufficient privileges"
        connect DB2User/DB2User
        Error report:
        Connection Failed
        Commit
        Connection created by CONNECT script command disconnected
    I worked around this by manually executing the .sql in the project output directory using the OracleUser id  in the new DB.
    Then I continue with the migration wizard and perform the Move Data step.
    Now - the message appears as succuessful, however, when I review the Migrationlog.xml file, i see errors as follows:
    <level>SEVERE</level>
      <class>oracle.dbtools.migration.workbench.core.logging.MigrationLogUtil</class>
      <message>Failed to disable constraints: Data Move</message>
      <key>DataMove.DISABLE_CONSTRAINTS_FAILED</key>
      <catalog>&lt;null&gt;</catalog>
      <param>Data Move</param>
      <param>oracle.dbtools.migration.workbench.core.logging.LogInfo@753f827a</param>
      <exception>
        <message>java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist</message>
      <level>WARNING</level>
      <class>oracle.dbtools.migration.datamove.online.TriggerHandler</class>
      <message>ORA-01031: insufficient privileges
    </message>
    I think what is happening is that the wizard is attempting to perform the 'move data' process using the DB2User id.
    How do I tell the wizard that the target schema is different than my source schema.
    My requirement is that I need to be able to migrate the DB2User schema to different schemas in the same Oracle database
    ( since we will have multiple test environments under the same database ) .
    Thanks in advance .
    K.

    Perhaps the following from the SQL Developer documentation is helpful for you:
    Command-Line Interface for Migration
    As an alternative to using the SQL Developer graphical interface for migration operations, you can use the migration batch file (Windows) or shell script (Linux) on the operating system command line. These files are located in the sqldeveloper\sqldeveloper\bin folder or sqldeveloper/sqldeveloper/bin directory under the location where you installed SQL Developer.
    migration.bat or migration.sh accepts these commands: capture, convert, datamove, delcaptured, delconn, delconverted, driver, generate, guide, help, idmap, info, init, lscaptured, lsconn, lsconverted, mkconn, qm, runsql, and scan. For information about the syntax and options, start by running migration without any parameters at the system command prompt. For example:
    C:\Program Files\sqldeveloper\sqldeveloper\bin>migration
    You can use the -help option for information about one or more actions. For the most detailed information, including some examples, use the -help=guide option. For example:
    C:\Program Files\sqldeveloper\sqldeveloper\bin>migration -help=guide
    Regards
    Wolfgang

  • Exporting a Schema

    I would like to export a schema from our Oracle 9i Db (AIX) to an Oracle 10g Db (Windows) but not export the associated data.
    So all I want on the 10g Db is tables/indexes/etc structures but no data, I have seen reference to the ROWS=N .. So could I use the following command
    exp userid=system/manager file=my_db.dmp log=my_db.log rows=N owner=<schema i want to export>

    I did the followig but got the following error message with my AIX system ?
    exp userid=username/password file=/doc/dump.dmp rows=N owner=<schema i want to export>
    ksh: 0403-057 Syntax error: `newline or ;' is not expected.

  • How to export selected columns in a table using expdp of oracle10g

    Hi all..
    I have a table with 10 columns and i want to export only 4 columns(selected columns) data using expdp
    Pl. tell me if we can do this and if yes what is the syntax.
    Thanks..
    Sekhar

    That's not possible, you could use QUERY to specify where clause but not columns in select clause,
    for example,
    QUERY=employees:'"WHERE department_id > 10 AND salary > 10000"'
    you could use
    create table2export as select c1,c2,c3,c4 from tableof10columns;and export the temp table.

  • Using expdp to do a schema export is taking extremely long time

    I am using expdp in schema mode to export a 300 gigbyte database.
    The job status report 99% complete after about 2 hours .
    But now the job has been running 30 hours and is not finish.
    I can see that it is exporting the domain indexes and had been exporting
    the last index for the last 5 hours. Something is not working because I
    looked at the table the index is using and it has no data. So, why is it taking
    so long to export an index that has no data?
    Can someone tell if there is a way to bypass exporting indexes and a easy way
    to recreate the indexes if you do?
    I am using oracle 11g and expdp utility.

    I checked the log file and there are no errors in the file.
    There are no ORA- xxxx error messages.
    The last line in the log file is as follows:
    "Processing object type schema_export/table/index/domain_index/index "
    I just checked the export job run this morning and it is still on the same
    index object "A685_IX1" . This is a spatial index. It has been sitting at
    this same object according to the job status for at least 24 hours.

  • Unable to export the schema by the name OPS$BDIT  using expdp

    Hi,
    oracle - BDMSD> expdp directory=EXPORT_BACKUP_DIR schemas=OPS$BDIT dumpfile=test.dmp logfile=test.log
    Export: Release 10.2.0.4.0 - 64bit Production on Monday, 30 January, 2012 10:08:27
    Copyright (c) 2003, 2007, Oracle. All rights reserved.
    Username: / as sysdba
    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    ORA-39001: invalid argument value
    ORA-39170: Schema expression 'OPS' does not correspond to any schemas.
    Thanks

    user12266475 wrote:
    Hi,
    oracle - BDMSD> expdp directory=EXPORT_BACKUP_DIR schemas=OPS$BDIT dumpfile=test.dmp logfile=test.log
    Export: Release 10.2.0.4.0 - 64bit Production on Monday, 30 January, 2012 10:08:27
    Copyright (c) 2003, 2007, Oracle. All rights reserved.
    Username: / as sysdba
    Pl post OS details. You should not use "/ as SYSDBA" to execute expdp - see the first "Note" here - http://docs.oracle.com/cd/B19306_01/server.102/b14215/dp_export.htm#sthref57 - use SYSTEM instead.
    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    ORA-39001: invalid argument value
    ORA-39170: Schema expression 'OPS' does not correspond to any schemas.
    ThanksFor special characters like $, it is best to create a parameter file and use quotes or escape characters, rather than provide the parameters on the command line.
    Exporting a schema which contains a dot in the name with EXPDP fails with ORA-39001, ORA-39170 [ID 388763.1]
    HTH
    Srini

  • Is it possible to export tables from diffrent schema using expdp?

    Hi,
    We can export tables from different schema using exp. Ex: exp user/pass file=sample.dmp log=sample.log tables=scott.dept,system.sales ...But
    Is it possible in expdp?
    Thanks in advance ..
    Thanks,

    Hi,
    you have to use "schemas=user1,user2 include=table:"in('table1,table2')" use parfileexpdp scott/tiger@db10g schemas=SCOTT include=TABLE:"IN ('EMP', 'DEPT')" directory=TEST_DIR dumpfile=SCOTT.dmp logfile=expdpSCOTT.log{quote}
    I am not able to perform it using parfile also.Using parfile it shows "UDE-00010: multiple job modes requested, schema and tables."
    When trying the below, i get error
    {code}
    bash-3.00$ expdp directory=EXP_DUMP dumpfile=test.dmp logfile=test.log SCHEMAS=(\'MM\',\'MMM\') include=TABLE:\"IN\(\'EA_EET_TMP\',\'WS_DT\'\)\"
    Export: Release 10.2.0.4.0 - 64bit Production on Friday, 15 October, 2010 18:34:32
    Copyright (c) 2003, 2007, Oracle. All rights reserved.
    Username: / as sysdba
    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    Starting "SYS"."SYS_EXPORT_SCHEMA_01": /******** AS SYSDBA directory=EXP_DUMP dumpfile=test.dmp logfile=test.log SCHEMAS=('MM','MMM') include=TABLE:"IN('EA_EET_TMP','WS_DT')"
    Estimate in progress using BLOCKS method...
    Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
    Total estimation using BLOCKS method: 0 KB
    Processing object type SCHEMA_EXPORT/TABLE/TABLE
    Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
    Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
    Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
    Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
    . . exported "MM"."EA_EET_TMP" 0 KB 0 rows
    ORA-39165: Schema MMM was not found.
    Master table "SYS"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
    Dump file set for SYS.SYS_EXPORT_SCHEMA_01 is:
    /export/home/nucleus/dump/test.dmp
    Job "SYS"."SYS_EXPORT_SCHEMA_01" completed with 1 error(s) at 18:35:19
    {code}
    When checking expdp help=y shows :-
    {code}TABLES Identifies a list of tables to export - one schema only.{code}
    As per few testing,tables from different schemas are not possible to export using expdp in a single command.
    Anand

  • Error while exporting a schema using data pump

    Hi all,
    I have 11.1.0.7 database and am using expdp to export a schema. The schema is quite huge and has roughly about 4 GB of data. When i export using the following command,
    expdp owb_exp_v1/welcome directory=dmpdir dumpfile=owb_exp_v1.dmp
    i get the following error after running for around 1 hour.
    ORA-39126: Worker unexpected fatal error in KUPW$WORKER.UNLOAD_METADATA [TABLESPACE_QUOTA:"OWB_EXP_V1"]
    ORA-22813: operand value exceeds system limits
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
    ORA-06512: at "SYS.KUPW$WORKER", line 7839
    ----- PL/SQL Call Stack -----
    object line object
    handle number name
    4A974B9C 18237 package body SYS.KUPW$WORKER
    4A974B9C 7866 package body SYS.KUPW$WORKER
    4A974B9C 2744 package body SYS.KUPW$WORKER
    4A974B9C 8504 package body SYS.KUPW$WORKER
    4A961BF0 1 anonymous block
    4A9DAA4C 1575 package body SYS.DBMS_SQL
    4A974B9C 8342 package body SYS.KUPW$WORKER
    4A974B9C 1545 package body SYS.KUPW$WORKER
    4A8CD200 2 anonymous block
    Job "SYS"."SYS_EXPORT_SCHEMA_01" stopped due to fatal error at 14:01:23
    This owb_exp_v1 user has dba privileges. I am not sure what is causing this error. I have tried running it almost thrice but in vain. I also tried increasing the sort_area_size parameter. Even then, i get this error.
    Kindly help.
    Thanks,
    Vidhya

    Hi,
    Can you let us know what the last object type it was working on? It would be the line in the log file that looks like:
    Processing object type SCHEMA_EXPORT/...
    Thanks
    Dean

  • Using dbms_datapump package to export the schema with the schema name as pa

    Hi,
    I am using the pl/sql block to export schema using dbms_datapump package,Now I want to pass the scheme name as the parameter to the procedure and get the .dmp and .log files with the schema name included.
    CREATE OR REPLACE PROCEDURE export
    IS
    h1 number;
    begin
    h1 := dbms_datapump.open (operation => 'EXPORT', job_mode => 'SCHEMA', job_name => 'export1', version => 'COMPATIBLE');
    dbms_datapump.set_parallel(handle => h1, degree => 1);
    dbms_datapump.add_file(handle => h1, filename => 'EXPDAT.LOG', directory => 'DATA_PUMP_DIR', filetype => 3);
    dbms_datapump.set_parameter(handle => h1, name => 'KEEP_MASTER', value => 0);
    dbms_datapump.metadata_filter(handle => h1, name => 'SCHEMA_EXPR', value => 'IN(''CHECKOUT'')');
    dbms_datapump.set_parameter(handle => h1, name => 'ESTIMATE', value => 'BLOCKS');
    dbms_datapump.add_file(handle => h1, filename => 'EXPDAT%U' || to_char(sysdate,'dd-mm-yyyy') || '.DMP', directory => 'DATA_PUMP_DIR', filetype => 1);
    dbms_datapump.set_parameter(handle => h1, name => 'INCLUDE_METADATA', value => 1);
    dbms_datapump.set_parameter(handle => h1, name => 'DATA_ACCESS_METHOD', value => 'AUTOMATIC');
    dbms_datapump.start_job(handle => h1, skip_current => 0, abort_step => 0);
    dbms_datapump.detach (handle => h1);
    exception
    when others then
    raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
    end;
    Thank you in advanced
    Sri

    user12062360 wrote:
    Hi,
    I am using the pl/sql block to export schema using dbms_datapump package,Now I want to pass the scheme name as the parameter to the procedure and get the .dmp and .log files with the schema name included.
    OK, please proceed to do so
    >
    CREATE OR REPLACE PROCEDURE export
    IS
    h1 number;
    begin
    h1 := dbms_datapump.open (operation => 'EXPORT', job_mode => 'SCHEMA', job_name => 'export1', version => 'COMPATIBLE');
    dbms_datapump.set_parallel(handle => h1, degree => 1);
    dbms_datapump.add_file(handle => h1, filename => 'EXPDAT.LOG', directory => 'DATA_PUMP_DIR', filetype => 3);
    dbms_datapump.set_parameter(handle => h1, name => 'KEEP_MASTER', value => 0);
    dbms_datapump.metadata_filter(handle => h1, name => 'SCHEMA_EXPR', value => 'IN(''CHECKOUT'')');
    dbms_datapump.set_parameter(handle => h1, name => 'ESTIMATE', value => 'BLOCKS');
    dbms_datapump.add_file(handle => h1, filename => 'EXPDAT%U' || to_char(sysdate,'dd-mm-yyyy') || '.DMP', directory => 'DATA_PUMP_DIR', filetype => 1);
    dbms_datapump.set_parameter(handle => h1, name => 'INCLUDE_METADATA', value => 1);
    dbms_datapump.set_parameter(handle => h1, name => 'DATA_ACCESS_METHOD', value => 'AUTOMATIC');
    dbms_datapump.start_job(handle => h1, skip_current => 0, abort_step => 0);
    dbms_datapump.detach (handle => h1);
    exception
    when others then
    raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
    end;
    EXCEPTION handler is a bug waiting to happen.
    eliminate it entirely

  • Particular Tigger exclude using DBMS_DATAPUMP export in SCHEMA mode, how?

    Hi,
    Is it possible to specify exclude filter for particular object type and name (TRIGGER, name = TRG_CHECK)
    when DBMS_DATAPUMP export in SCHEMA mode is used?
    If yes, how? (I could not find any examples).
    Thanks.

    Hi,
    Yes, it 's possbile
    Go for "DBMS_DATAPUMP.metadata_filter"
    tr it I did not checked
    Where you can use name expression at table mode as NAME_EXPR as '!=''DEPT'''
    or
    dbms_datapump.metadata_filter(vhandle,’EXCLUDE_PATH_LIST’,”’TRIGGER”,”GRANT”’);
    DBMS_DATAPUMP.metadata_filter( handle => l_dp_handle,
    name => 'NAME_EXPR',
    value => 'NOT IN (''TRIG_NAME')',
    object_type => 'TRIGGER');
    - Pavan Kumar N

  • Can i use App schema from another Oracle database.

    Hi everyone,
    can i use application schema from another Oracle database and how can we do this. the reason is that current database where apex is installed is get very slow because of the size of database and application usage.
    Regards,
    Kashif.

    user10485983 wrote:
    Please update your forum profile with a real handle instead of "user10485983".
    can i use application schema from another Oracle database and how can we do this. the reason is that current database where apex is installed is get very slow because of the size of database and application usage.
    You can (using database links), but this will generally result in even poorer performance (unless by "another Oracle database" you mean using RAC?)
    It sounds more like you either need to upgrade your systems, or refactor your applications to have a smaller performance footprint.

  • Linux + Oracle vs WCF service

    I'm having a problem between Linux /Oracle calling a WCF service.
    My client uses Oracle/Linux to send/receive data to my service, but it's using iso-8859-1 encoding, wich is not accepted by WCF (utf standard).
    I've found some solutions for this problem, but all involves DLLs installation and Windows, what is not possible with Linux.
    Unfortunately i don't know nothing about Oracle, and i don't know if it's possible to my client encode the data before sending/receiving to me.
    I'd appreciate some help.
    Thanks!

    The linux client can continue sending the data as it pleases (i.e., in iso-8859-1), and the encoder, used on the server only, would be able to read it. The encoder then can decide how to encode the response back to the client (UTF-8 or iso-8859-1 again).
    If you want the response to be in iso-8859-1 as well you may also need something like a message inspector to update the content-type header with the appropriate charset.
    Update: example with the custom encoder using ISO-8859-1
    public class StackOverflow_7033442 {     [ServiceContract] public interface ITest {         [OperationContract] string Echo(string text); } public class Service : ITest {         public string Echo(string text)         {             return text;         } } public static void Test() {         string baseAddress = "http://" + Environment.MachineName + ":8000/Service";         ServiceHost host = new ServiceHost(typeof(Service), new Uri(baseAddress));         CustomBinding binding = new CustomBinding(             new CustomTextMessageBindingElement("iso-8859-1", "text/xml", MessageVersion.Soap11),             new HttpTransportBindingElement());         host.AddServiceEndpoint(typeof(ITest), binding, "");         host.Open();         Console.WriteLine("Host opened");          string request = @"<?xml version=""1.0"" encoding=""iso-8859-1""?> <s:Envelope xmlns:s=""http://schemas.xmlsoap.org/soap/envelope/"">   <s:Body>     <Echo xmlns=""http://tempuri.org/"">       <text>Hello áéíóú</text>     </Echo>   </s:Body> </s:Envelope>";         HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(baseAddress);         req.Method = "POST";         req.ContentType = "text/xml; charset=iso-8859-1";         req.Headers["SOAPAction"] = "http://tempuri.org/ITest/Echo"; Stream reqStream = req.GetRequestStream(); Encoding encoding = Encoding.GetEncoding("iso-8859-1"); byte[] reqBytes = encoding.GetBytes(request); reqStream.Write(reqBytes, 0, reqBytes.Length); reqStream.Close(); HttpWebResponse resp = (HttpWebResponse)req.GetResponse(); Console.WriteLine("HTTP/{0} {1} {2}", resp.ProtocolVersion, (int)resp.StatusCode, resp.StatusDescription); foreach (var header in resp.Headers.AllKeys) {             Console.WriteLine("{0}: {1}", header, resp.Headers[header]); } if (resp.ContentLength > 0) { Console.WriteLine(new StreamReader(resp.GetResponseStream(), encoding).ReadToEnd()); } Console.Write("Press ENTER to close the host"); Console.ReadLine(); host.Close(); } #region Custom Text Message Encoder sample, verbatim public class CustomTextMessageEncoder : MessageEncoder { private CustomTextMessageEncoderFactory factory; private XmlWriterSettings writerSettings; private string contentType; public CustomTextMessageEncoder(CustomTextMessageEncoderFactory factory) { this.factory = factory; this.writerSettings = new XmlWriterSettings(); this.writerSettings.Encoding = Encoding.GetEncoding(factory.CharSet); this.contentType = string.Format("{0}; charset={1}", this.factory.MediaType, this.writerSettings.Encoding.HeaderName); } public override string ContentType { get { return this.contentType; } } public override string MediaType { get { return factory.MediaType; } } public override MessageVersion MessageVersion { get { return this.factory.MessageVersion; } } public override Message ReadMessage(ArraySegment<byte> buffer, BufferManager bufferManager, string contentType) { byte[] msgContents = new byte[buffer.Count]; Array.Copy(buffer.Array, buffer.Offset, msgContents, 0, msgContents.Length); bufferManager.ReturnBuffer(buffer.Array); MemoryStream stream = new MemoryStream(msgContents); return ReadMessage(stream, int.MaxValue); } public override Message ReadMessage(Stream stream, int maxSizeOfHeaders, string contentType) { XmlReader reader = XmlReader.Create(stream); return Message.CreateMessage(reader, maxSizeOfHeaders, this.MessageVersion); } public override ArraySegment<byte> WriteMessage(Message message, int maxMessageSize, BufferManager bufferManager, int messageOffset) { MemoryStream stream = new MemoryStream(); XmlWriter writer = XmlWriter.Create(stream, this.writerSettings); message.WriteMessage(writer); writer.Close(); byte[] messageBytes = stream.GetBuffer(); int messageLength = (int)stream.Position; stream.Close(); int totalLength = messageLength + messageOffset; byte[] totalBytes = bufferManager.TakeBuffer(totalLength); Array.Copy(messageBytes, 0, totalBytes, messageOffset, messageLength); ArraySegment<byte> byteArray = new ArraySegment<byte>(totalBytes, messageOffset, messageLength); return byteArray; } public override void WriteMessage(Message message, Stream stream) { XmlWriter writer = XmlWriter.Create(stream, this.writerSettings); message.WriteMessage(writer); writer.Close(); } } public class CustomTextMessageEncoderFactory : MessageEncoderFactory { private MessageEncoder encoder; private MessageVersion version; private string mediaType; private string charSet; internal CustomTextMessageEncoderFactory(string mediaType, string charSet, MessageVersion version) { this.version = version; this.mediaType = mediaType; this.charSet = charSet; this.encoder = new CustomTextMessageEncoder(this); } public override MessageEncoder Encoder { get { return this.encoder; } } public override MessageVersion MessageVersion { get { return this.version; } } internal string MediaType { get { return this.mediaType; } } internal string CharSet { get { return this.charSet; } } } public class CustomTextMessageBindingElement : MessageEncodingBindingElement, IWsdlExportExtension { private MessageVersion msgVersion; private string mediaType; private string encoding; private XmlDictionaryReaderQuotas readerQuotas; CustomTextMessageBindingElement(CustomTextMessageBindingElement binding) : this(binding.Encoding, binding.MediaType, binding.MessageVersion) { this.readerQuotas = new XmlDictionaryReaderQuotas(); binding.ReaderQuotas.CopyTo(this.readerQuotas); } public CustomTextMessageBindingElement(string encoding, string mediaType, MessageVersion msgVersion) { if (encoding == null) throw new ArgumentNullException("encoding"); if (mediaType == null) throw new ArgumentNullException("mediaType"); if (msgVersion == null) throw new ArgumentNullException("msgVersion"); this.msgVersion = msgVersion; this.mediaType = mediaType; this.encoding = encoding; this.readerQuotas = new XmlDictionaryReaderQuotas(); } public CustomTextMessageBindingElement(string encoding, string mediaType) : this(encoding, mediaType, MessageVersion.Soap11WSAddressing10) { } public CustomTextMessageBindingElement(string encoding) : this(encoding, "text/xml") { } public CustomTextMessageBindingElement() : this("UTF-8") { } public override MessageVersion MessageVersion { get { return this.msgVersion; } set { if (value == null) throw new ArgumentNullException("value"); this.msgVersion = value; } } public string MediaType { get { return this.mediaType; } set { if (value == null) throw new ArgumentNullException("value"); this.mediaType = value; } } public string Encoding { get { return this.encoding; } set { if (value == null) throw new ArgumentNullException("value"); this.encoding = value; } } // This encoder does not enforces any quotas for the unsecure messages. The // quotas are enforced for the secure portions of messages when this encoder // is used in a binding that is configured with security. public XmlDictionaryReaderQuotas ReaderQuotas { get { return this.readerQuotas; } } #region IMessageEncodingBindingElement Members public override MessageEncoderFactory CreateMessageEncoderFactory() { return new CustomTextMessageEncoderFactory(this.MediaType, this.Encoding, this.MessageVersion); } #endregion public override BindingElement Clone() { return new CustomTextMessageBindingElement(this); } public override IChannelFactory<TChannel> BuildChannelFactory<TChannel>(BindingContext context) { if (context == null) throw new ArgumentNullException("context"); context.BindingParameters.Add(this); return context.BuildInnerChannelFactory<TChannel>(); } public override bool CanBuildChannelFactory<TChannel>(BindingContext context) { if (context == null) throw new ArgumentNullException("context"); return context.CanBuildInnerChannelFactory<TChannel>(); } public override IChannelListener<TChannel> BuildChannelListener<TChannel>(BindingContext context) { if (context == null) throw new ArgumentNullException("context"); context.BindingParameters.Add(this); return context.BuildInnerChannelListener<TChannel>(); } public override bool CanBuildChannelListener<TChannel>(BindingContext context) { if (context == null) throw new ArgumentNullException("context"); context.BindingParameters.Add(this); return context.CanBuildInnerChannelListener<TChannel>(); } public override T GetProperty<T>(BindingContext context) { if (typeof(T) == typeof(XmlDictionaryReaderQuotas)) { return (T)(object)this.readerQuotas; } else { return base.GetProperty<T>(context); } } #region IWsdlExportExtension Members void IWsdlExportExtension.ExportContract(WsdlExporter exporter, WsdlContractConversionContext context) { } void IWsdlExportExtension.ExportEndpoint(WsdlExporter exporter, WsdlEndpointConversionContext context) { // The MessageEncodingBindingElement is responsible for ensuring that the WSDL has the correct // SOAP version. We can delegate to the WCF implementation of TextMessageEncodingBindingElement for this. TextMessageEncodingBindingElement mebe = new TextMessageEncodingBindingElement(); mebe.MessageVersion = this.msgVersion; ((IWsdlExportExtension)mebe).ExportEndpoint(exporter, context); } #endregion } #endregion }

  • What is the easiest way to export all tables data from Oracle to MS SQL Server?

    Hello MS,
    I would like to export all tables from Oracle 11.2 to MS SQL Server 2012 R1.
    Using the tool "Microsoft SQL Server Migration Assistant v6.0 for Oracle" did not work for me because there are too many warnings and errors regarding the schema creation (MS cannot know it because they are not the schema designer). My idea is
    to leave/skip the schema creation to the application designer/supplier and instead concentrate on the Oracle data export and MS SQL data import.
    What is the easiest way to export all tables data from Oracle to MS SQL Server quickly?
    Is it:
    - the „MS SQL Import and Export Data“ Tool
    - the “MS SQL Integration Services” Tool
    - not Oracle dump *.dmp format because it is a propritery binary format
    - flat file *.csv (delimited format)
    Thanks!

    Hi lingodingo,
    If you want to directly export all tables from Oracle database to SQL Server, I suggest you use SQL Server Import and Export Wizard. Because you just need to follow the wizard with GUI, this is the easiest way.
    If you want to make some modification for the tables‘ data before loading to SQL Server, I suggest you use SQL Server Integration Services package. For more details, please refer to the following similar thread:
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/38b2bed2-9d4e-48d4-a33f-1d9eed1c062d/flat-file-to-sql-server?forum=sqldatamining
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

Maybe you are looking for

  • R&R Backups on Vista x64 cannot be restored on Windows 7 x64 with R&R 4.x?

    Hello - Have created a full backup with R&R on Vista x64 prior to clean installing Win 7 x64. Have installed the new version of R&R for Win 7. Plugged in my external usb drive containing the backup, but R&R refuses to see it. Any suggestions? Thanks,

  • Removing personalization deleted data from PO_REQ_DISTRIBUTIONS

    In R12, We tried remove personalization using Functional administrator responsibility done on Checkout distribution page and successfully removed so. We executed a test transaction to ensure that it works fine. the transaction was completed successfu

  • Cannot generate AWR/ADDM reports in Oracle 10g

    Hi, We are running 10.2.0.3.0 and troublshooted the performance problem for some queries. But when tried to run AWR/ADDM reports from OEM and got the following messages: Insufficient Data in Interval. For displaying data on this page, two historical

  • Get new line

    hi.... i have this program which is a simple instant messaging window....however....i can not edit to code so that the second message comes on the second line in the editorPane and so on....it prints each string on top of each other... can someone pl

  • Actionscript for Gallery thumb rollovers (newbie)

    I have a client that I am working with who wants the main middle of the home page to be a Flash animation. It can be seen here: Soriano Artworks The trouble I run into is that he wants the animation to stop when you roll-over the paintings (that pop