<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Neuronworks &#187; restore</title>
	<atom:link href="http://blog.neuronworks.net/tag/restore/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.neuronworks.net</link>
	<description></description>
	<lastBuildDate>Sun, 04 Dec 2011 05:10:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Backup dan Restore Schema Oracle Menggunakan exp dan imp</title>
		<link>http://blog.neuronworks.net/2008/12/31/backup-dan-restore-schema-oracle-menggunakan-exp-dan-imp/</link>
		<comments>http://blog.neuronworks.net/2008/12/31/backup-dan-restore-schema-oracle-menggunakan-exp-dan-imp/#comments</comments>
		<pubDate>Wed, 31 Dec 2008 12:30:51 +0000</pubDate>
		<dc:creator>alam</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[restore]]></category>

		<guid isPermaLink="false">http://blog.neuronworks.net/?p=61</guid>
		<description><![CDATA[Oracle menyediakan perintah untuk membackup schema dan merestore schema hasil backup tersebut. Kedua perintah tersebut yaitu exp untuk membackup schema dan imp untuk merestore schema hasil backup sebelumnya. Kita coba dengan backup terlebih dahulu. Pertama kita buat direktori backup untuk menampung hasil backup schema yang kita lakukan, kemudian kita gunakan direktori tersebut sebagai base direktori]]></description>
			<content:encoded><![CDATA[<p>Oracle menyediakan perintah untuk membackup schema dan merestore schema hasil backup tersebut. Kedua perintah tersebut yaitu <strong>exp</strong> untuk membackup schema dan <strong>imp</strong> untuk merestore schema hasil backup sebelumnya.<br />
Kita coba dengan backup terlebih dahulu. Pertama kita buat direktori backup untuk menampung hasil backup schema yang kita lakukan, kemudian kita gunakan direktori tersebut sebagai base direktori pekerjaan kita:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">oracle<span style="color: #000000; font-weight: bold;">@</span>NeuronServer:~<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> schema-backup
oracle<span style="color: #000000; font-weight: bold;">@</span>NeuronServer:~<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #7a0874; font-weight: bold;">cd</span> schema-backup<span style="color: #000000; font-weight: bold;">/</span>
oracle<span style="color: #000000; font-weight: bold;">@</span>NeuronServer:~<span style="color: #000000; font-weight: bold;">/</span>schema-backup<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>Misalnya kita ingin membackup schema <strong>train</strong> yang memiliki password <strong>train</strong> yang ada di server oracle dengan service id <strong>neuron</strong>, file backup schema-nya kita simpan dengan nama <strong>train.dmp</strong>. Penggunaan perintah <strong>exp</strong>-nya seperti dibawah ini:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">oracle<span style="color: #000000; font-weight: bold;">@</span>NeuronServer:~<span style="color: #000000; font-weight: bold;">/</span>schema-backup<span style="color: #000000; font-weight: bold;">&gt;</span> exp train<span style="color: #000000; font-weight: bold;">/</span>train<span style="color: #000000; font-weight: bold;">@</span>neuron <span style="color: #007800;">file</span>=train.dmp    
&nbsp;
Export: Release 10.2.0.1.0 - Production on Fri Jan <span style="color: #000000;">2</span> <span style="color: #000000;">16</span>:<span style="color: #000000;">17</span>:<span style="color: #000000;">32</span> <span style="color: #000000;">2009</span>
&nbsp;
Copyright <span style="color: #7a0874; font-weight: bold;">&#40;</span>c<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">1982</span>, <span style="color: #000000;">2005</span>, Oracle.  All rights reserved.
&nbsp;
&nbsp;
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Export <span style="color: #000000; font-weight: bold;">done</span> <span style="color: #000000; font-weight: bold;">in</span> US7ASCII character <span style="color: #000000; font-weight: bold;">set</span> and AL16UTF16 NCHAR character <span style="color: #000000; font-weight: bold;">set</span>
server uses WE8ISO8859P1 character <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>possible charset conversion<span style="color: #7a0874; font-weight: bold;">&#41;</span>
. exporting pre-schema procedural objects and actions
. exporting foreign <span style="color: #000000; font-weight: bold;">function</span> library names <span style="color: #000000; font-weight: bold;">for</span> user TRAIN
. exporting PUBLIC <span style="color: #7a0874; font-weight: bold;">type</span> synonyms
. exporting private <span style="color: #7a0874; font-weight: bold;">type</span> synonyms
. exporting object <span style="color: #7a0874; font-weight: bold;">type</span> definitions <span style="color: #000000; font-weight: bold;">for</span> user TRAIN
About to <span style="color: #7a0874; font-weight: bold;">export</span> TRAIN<span style="color: #ff0000;">'s objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export TRAIN'</span>s tables via Conventional Path ...
. . exporting table                          TRAIN          <span style="color: #000000;">2</span> rows exported
. 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 materialized views
. exporting snapshot logs
. exporting job queues
. exporting refresh <span style="color: #c20cb9; font-weight: bold;">groups</span> and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting statistics
Export terminated successfully without warnings.
oracle<span style="color: #000000; font-weight: bold;">@</span>NeuronServer:~<span style="color: #000000; font-weight: bold;">/</span>schema-backup<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>File <strong>train.dmp</strong> tersebut dapat kita gunakan untuk merestore schema tersebut dikemudian hari atau untuk menduplikat schema tersebut ke server yang lain.<br />
Sebagai contoh kita gunakan file tersebut untuk menduplikat schema di mesin yang berbeda tapi memiliki user yang sama yaitu <strong>train</strong>. Penggunaan <strong>imp</strong>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">oracle<span style="color: #000000; font-weight: bold;">@</span>linuxbox:~<span style="color: #000000; font-weight: bold;">&gt;</span> imp train<span style="color: #000000; font-weight: bold;">/</span>train<span style="color: #000000; font-weight: bold;">@</span>xe <span style="color: #007800;">file</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>alam<span style="color: #000000; font-weight: bold;">/</span>train.dmp
&nbsp;
Import: Release 10.2.0.1.0 - Production on Fri Jan <span style="color: #000000;">2</span> <span style="color: #000000;">15</span>:<span style="color: #000000;">43</span>:<span style="color: #000000;">10</span> <span style="color: #000000;">2009</span>
&nbsp;
Copyright <span style="color: #7a0874; font-weight: bold;">&#40;</span>c<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">1982</span>, <span style="color: #000000;">2005</span>, Oracle.  All rights reserved.
&nbsp;
&nbsp;
Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
&nbsp;
Export <span style="color: #c20cb9; font-weight: bold;">file</span> created by EXPORT:V10.02.01 via conventional path
import <span style="color: #000000; font-weight: bold;">done</span> <span style="color: #000000; font-weight: bold;">in</span> US7ASCII character <span style="color: #000000; font-weight: bold;">set</span> and AL16UTF16 NCHAR character <span style="color: #000000; font-weight: bold;">set</span>
import server uses AL32UTF8 character <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>possible charset conversion<span style="color: #7a0874; font-weight: bold;">&#41;</span>
. importing TRAIN<span style="color: #ff0000;">'s objects into TRAIN
. . importing table                        &quot;TRAIN&quot;          2 rows imported
Import terminated successfully without warnings.
oracle@linuxbox:~&gt;</span></pre></div></div>

<p>Pastikan bahwa schema yang dimaksud (<strong>train</strong>) ada di server yang hendak direstore. Perlu diingat bahwa perintah <strong>imp</strong> ini akan menimpa schema yang sudah ada di server, jadi pastikan bahwa anda memang ingin menimpa schema tersebut.</p>
<h3>UPDATE</h3>
<p>Ada banyak opsi-opsi yang dapat kita gunakan dalam menggunakan <strong>exp</strong> dan <strong>imp</strong>. Untuk mengetahui apa saja opsi-opsi yang tersedia jalankan perintah berikut:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">oracle<span style="color: #000000; font-weight: bold;">@</span>NeuronServer:~<span style="color: #000000; font-weight: bold;">&gt;</span> exp <span style="color: #007800;">help</span>=y
&nbsp;
Export: Release 10.2.0.1.0 - Production on Fri Jan <span style="color: #000000;">2</span> <span style="color: #000000;">14</span>:06:04 <span style="color: #000000;">2009</span>
&nbsp;
Copyright <span style="color: #7a0874; font-weight: bold;">&#40;</span>c<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">1982</span>, <span style="color: #000000;">2005</span>, Oracle.  All rights reserved.
&nbsp;
&nbsp;
&nbsp;
You can <span style="color: #7a0874; font-weight: bold;">let</span> Export prompt you <span style="color: #000000; font-weight: bold;">for</span> parameters by entering the EXP
<span style="color: #7a0874; font-weight: bold;">command</span> followed by your username<span style="color: #000000; font-weight: bold;">/</span>password:                     
&nbsp;
     Example: EXP SCOTT<span style="color: #000000; font-weight: bold;">/</span>TIGER
&nbsp;
Or, you can control how Export runs by entering the EXP <span style="color: #7a0874; font-weight: bold;">command</span> followed
by various arguments. To specify parameters, you use keywords:          
&nbsp;
     Format:  EXP <span style="color: #007800;">KEYWORD</span>=value or <span style="color: #007800;">KEYWORD</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span>value1,value2,...,valueN<span style="color: #7a0874; font-weight: bold;">&#41;</span>
     Example: EXP SCOTT<span style="color: #000000; font-weight: bold;">/</span>TIGER <span style="color: #007800;">GRANTS</span>=Y <span style="color: #007800;">TABLES</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span>EMP,DEPT,MGR<span style="color: #7a0874; font-weight: bold;">&#41;</span>         
               or <span style="color: #007800;">TABLES</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span>T1:P1,T1:P2<span style="color: #7a0874; font-weight: bold;">&#41;</span>, <span style="color: #000000; font-weight: bold;">if</span> T1 is partitioned table   
&nbsp;
USERID must be the first parameter on the <span style="color: #7a0874; font-weight: bold;">command</span> line.
&nbsp;
Keyword    Description <span style="color: #7a0874; font-weight: bold;">&#40;</span>Default<span style="color: #7a0874; font-weight: bold;">&#41;</span>      Keyword      Description <span style="color: #7a0874; font-weight: bold;">&#40;</span>Default<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #660033;">--------------------------------------------------------------------------</span>
USERID     username<span style="color: #000000; font-weight: bold;">/</span>password          FULL         <span style="color: #7a0874; font-weight: bold;">export</span> entire <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>N<span style="color: #7a0874; font-weight: bold;">&#41;</span>
BUFFER     <span style="color: #c20cb9; font-weight: bold;">size</span> of data buffer        OWNER        list of owner usernames
FILE       output files <span style="color: #7a0874; font-weight: bold;">&#40;</span>EXPDAT.DMP<span style="color: #7a0874; font-weight: bold;">&#41;</span>  TABLES       list of table names
COMPRESS   import into one extent <span style="color: #7a0874; font-weight: bold;">&#40;</span>Y<span style="color: #7a0874; font-weight: bold;">&#41;</span> RECORDLENGTH length of IO record
GRANTS     <span style="color: #7a0874; font-weight: bold;">export</span> grants <span style="color: #7a0874; font-weight: bold;">&#40;</span>Y<span style="color: #7a0874; font-weight: bold;">&#41;</span>          INCTYPE      incremental <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #7a0874; font-weight: bold;">type</span>
INDEXES    <span style="color: #7a0874; font-weight: bold;">export</span> indexes <span style="color: #7a0874; font-weight: bold;">&#40;</span>Y<span style="color: #7a0874; font-weight: bold;">&#41;</span>         RECORD       track incr. <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>Y<span style="color: #7a0874; font-weight: bold;">&#41;</span>
DIRECT     direct path <span style="color: #7a0874; font-weight: bold;">&#40;</span>N<span style="color: #7a0874; font-weight: bold;">&#41;</span>            TRIGGERS     <span style="color: #7a0874; font-weight: bold;">export</span> triggers <span style="color: #7a0874; font-weight: bold;">&#40;</span>Y<span style="color: #7a0874; font-weight: bold;">&#41;</span>
LOG        log <span style="color: #c20cb9; font-weight: bold;">file</span> of <span style="color: #c20cb9; font-weight: bold;">screen</span> output  STATISTICS   analyze objects <span style="color: #7a0874; font-weight: bold;">&#40;</span>ESTIMATE<span style="color: #7a0874; font-weight: bold;">&#41;</span>
ROWS       <span style="color: #7a0874; font-weight: bold;">export</span> data rows <span style="color: #7a0874; font-weight: bold;">&#40;</span>Y<span style="color: #7a0874; font-weight: bold;">&#41;</span>       PARFILE      parameter filename
CONSISTENT cross-table consistency<span style="color: #7a0874; font-weight: bold;">&#40;</span>N<span style="color: #7a0874; font-weight: bold;">&#41;</span> CONSTRAINTS  <span style="color: #7a0874; font-weight: bold;">export</span> constraints <span style="color: #7a0874; font-weight: bold;">&#40;</span>Y<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
OBJECT_CONSISTENT    transaction <span style="color: #000000; font-weight: bold;">set</span> to <span style="color: #c20cb9; font-weight: bold;">read</span> only during object <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>N<span style="color: #7a0874; font-weight: bold;">&#41;</span>
FEEDBACK             display progress every x rows <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
FILESIZE             maximum <span style="color: #c20cb9; font-weight: bold;">size</span> of each dump <span style="color: #c20cb9; font-weight: bold;">file</span>
FLASHBACK_SCN        SCN used to <span style="color: #000000; font-weight: bold;">set</span> session snapshot back to
FLASHBACK_TIME       <span style="color: #000000; font-weight: bold;">time</span> used to get the SCN closest to the specified <span style="color: #000000; font-weight: bold;">time</span>
QUERY                <span style="color: #000000; font-weight: bold;">select</span> clause used to <span style="color: #7a0874; font-weight: bold;">export</span> a subset of a table
RESUMABLE            <span style="color: #7a0874; font-weight: bold;">suspend</span> when a space related error is encountered<span style="color: #7a0874; font-weight: bold;">&#40;</span>N<span style="color: #7a0874; font-weight: bold;">&#41;</span>
RESUMABLE_NAME       text string used to identify resumable statement
RESUMABLE_TIMEOUT    <span style="color: #7a0874; font-weight: bold;">wait</span> <span style="color: #000000; font-weight: bold;">time</span> <span style="color: #000000; font-weight: bold;">for</span> RESUMABLE
TTS_FULL_CHECK       perform full or partial dependency check <span style="color: #000000; font-weight: bold;">for</span> TTS
VOLSIZE              number of bytes to <span style="color: #c20cb9; font-weight: bold;">write</span> to each tape volume
TABLESPACES          list of tablespaces to <span style="color: #7a0874; font-weight: bold;">export</span>
TRANSPORT_TABLESPACE <span style="color: #7a0874; font-weight: bold;">export</span> transportable tablespace metadata <span style="color: #7a0874; font-weight: bold;">&#40;</span>N<span style="color: #7a0874; font-weight: bold;">&#41;</span>
TEMPLATE             template name <span style="color: #c20cb9; font-weight: bold;">which</span> invokes iAS mode <span style="color: #7a0874; font-weight: bold;">export</span>
&nbsp;
Export terminated successfully without warnings.
oracle<span style="color: #000000; font-weight: bold;">@</span>NeuronServer:~<span style="color: #000000; font-weight: bold;">&gt;</span> imp <span style="color: #007800;">help</span>=y               
&nbsp;
Import: Release 10.2.0.1.0 - Production on Fri Jan <span style="color: #000000;">2</span> <span style="color: #000000;">14</span>:08:<span style="color: #000000;">51</span> <span style="color: #000000;">2009</span>
&nbsp;
Copyright <span style="color: #7a0874; font-weight: bold;">&#40;</span>c<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">1982</span>, <span style="color: #000000;">2005</span>, Oracle.  All rights reserved.
&nbsp;
&nbsp;
&nbsp;
You can <span style="color: #7a0874; font-weight: bold;">let</span> Import prompt you <span style="color: #000000; font-weight: bold;">for</span> parameters by entering the IMP
<span style="color: #7a0874; font-weight: bold;">command</span> followed by your username<span style="color: #000000; font-weight: bold;">/</span>password:                     
&nbsp;
     Example: IMP SCOTT<span style="color: #000000; font-weight: bold;">/</span>TIGER
&nbsp;
Or, you can control how Import runs by entering the IMP <span style="color: #7a0874; font-weight: bold;">command</span> followed
by various arguments. To specify parameters, you use keywords:          
&nbsp;
     Format:  IMP <span style="color: #007800;">KEYWORD</span>=value or <span style="color: #007800;">KEYWORD</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span>value1,value2,...,valueN<span style="color: #7a0874; font-weight: bold;">&#41;</span>
     Example: IMP SCOTT<span style="color: #000000; font-weight: bold;">/</span>TIGER <span style="color: #007800;">IGNORE</span>=Y <span style="color: #007800;">TABLES</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span>EMP,DEPT<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #007800;">FULL</span>=N      
               or <span style="color: #007800;">TABLES</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span>T1:P1,T1:P2<span style="color: #7a0874; font-weight: bold;">&#41;</span>, <span style="color: #000000; font-weight: bold;">if</span> T1 is partitioned table   
&nbsp;
USERID must be the first parameter on the <span style="color: #7a0874; font-weight: bold;">command</span> line.
&nbsp;
Keyword  Description <span style="color: #7a0874; font-weight: bold;">&#40;</span>Default<span style="color: #7a0874; font-weight: bold;">&#41;</span>       Keyword      Description <span style="color: #7a0874; font-weight: bold;">&#40;</span>Default<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #660033;">--------------------------------------------------------------------------</span>
USERID   username<span style="color: #000000; font-weight: bold;">/</span>password           FULL         import entire <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>N<span style="color: #7a0874; font-weight: bold;">&#41;</span>
BUFFER   <span style="color: #c20cb9; font-weight: bold;">size</span> of data buffer         FROMUSER     list of owner usernames
FILE     input files <span style="color: #7a0874; font-weight: bold;">&#40;</span>EXPDAT.DMP<span style="color: #7a0874; font-weight: bold;">&#41;</span>    TOUSER       list of usernames
SHOW     just list <span style="color: #c20cb9; font-weight: bold;">file</span> contents <span style="color: #7a0874; font-weight: bold;">&#40;</span>N<span style="color: #7a0874; font-weight: bold;">&#41;</span> TABLES       list of table names
IGNORE   ignore create errors <span style="color: #7a0874; font-weight: bold;">&#40;</span>N<span style="color: #7a0874; font-weight: bold;">&#41;</span>    RECORDLENGTH length of IO record
GRANTS   import grants <span style="color: #7a0874; font-weight: bold;">&#40;</span>Y<span style="color: #7a0874; font-weight: bold;">&#41;</span>           INCTYPE      incremental import <span style="color: #7a0874; font-weight: bold;">type</span>
INDEXES  import indexes <span style="color: #7a0874; font-weight: bold;">&#40;</span>Y<span style="color: #7a0874; font-weight: bold;">&#41;</span>          COMMIT       commit array insert <span style="color: #7a0874; font-weight: bold;">&#40;</span>N<span style="color: #7a0874; font-weight: bold;">&#41;</span>
ROWS     import data rows <span style="color: #7a0874; font-weight: bold;">&#40;</span>Y<span style="color: #7a0874; font-weight: bold;">&#41;</span>        PARFILE      parameter filename
LOG      log <span style="color: #c20cb9; font-weight: bold;">file</span> of <span style="color: #c20cb9; font-weight: bold;">screen</span> output   CONSTRAINTS  import constraints <span style="color: #7a0874; font-weight: bold;">&#40;</span>Y<span style="color: #7a0874; font-weight: bold;">&#41;</span>
DESTROY                overwrite tablespace data <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>N<span style="color: #7a0874; font-weight: bold;">&#41;</span>
INDEXFILE              <span style="color: #c20cb9; font-weight: bold;">write</span> table<span style="color: #000000; font-weight: bold;">/</span>index info to specified <span style="color: #c20cb9; font-weight: bold;">file</span>
SKIP_UNUSABLE_INDEXES  skip maintenance of unusable indexes <span style="color: #7a0874; font-weight: bold;">&#40;</span>N<span style="color: #7a0874; font-weight: bold;">&#41;</span>
FEEDBACK               display progress every x rows<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
TOID_NOVALIDATE        skip validation of specified <span style="color: #7a0874; font-weight: bold;">type</span> ids
FILESIZE               maximum <span style="color: #c20cb9; font-weight: bold;">size</span> of each dump <span style="color: #c20cb9; font-weight: bold;">file</span>
STATISTICS             import precomputed statistics <span style="color: #7a0874; font-weight: bold;">&#40;</span>always<span style="color: #7a0874; font-weight: bold;">&#41;</span>
RESUMABLE              <span style="color: #7a0874; font-weight: bold;">suspend</span> when a space related error is encountered<span style="color: #7a0874; font-weight: bold;">&#40;</span>N<span style="color: #7a0874; font-weight: bold;">&#41;</span>
RESUMABLE_NAME         text string used to identify resumable statement
RESUMABLE_TIMEOUT      <span style="color: #7a0874; font-weight: bold;">wait</span> <span style="color: #000000; font-weight: bold;">time</span> <span style="color: #000000; font-weight: bold;">for</span> RESUMABLE
COMPILE                compile procedures, packages, and functions <span style="color: #7a0874; font-weight: bold;">&#40;</span>Y<span style="color: #7a0874; font-weight: bold;">&#41;</span>
STREAMS_CONFIGURATION  import streams general metadata <span style="color: #7a0874; font-weight: bold;">&#40;</span>Y<span style="color: #7a0874; font-weight: bold;">&#41;</span>
STREAMS_INSTANTIATION  import streams instantiation metadata <span style="color: #7a0874; font-weight: bold;">&#40;</span>N<span style="color: #7a0874; font-weight: bold;">&#41;</span>
VOLSIZE                number of bytes <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #c20cb9; font-weight: bold;">file</span> on each volume of a <span style="color: #c20cb9; font-weight: bold;">file</span> on tape
&nbsp;
The following keywords only apply to transportable tablespaces
TRANSPORT_TABLESPACE import transportable tablespace metadata <span style="color: #7a0874; font-weight: bold;">&#40;</span>N<span style="color: #7a0874; font-weight: bold;">&#41;</span>
TABLESPACES tablespaces to be transported into database
DATAFILES datafiles to be transported into database
TTS_OWNERS <span style="color: #c20cb9; font-weight: bold;">users</span> that own data <span style="color: #000000; font-weight: bold;">in</span> the transportable tablespace <span style="color: #000000; font-weight: bold;">set</span>
&nbsp;
Import terminated successfully without warnings.
oracle<span style="color: #000000; font-weight: bold;">@</span>NeuronServer:~<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>Sebelumnya kita mengekspor schema yang memiliki dua user yang sama di dua sistem yang berbeda. Bagaimana jika database yang akan mengimpor menggunakan username yang berbeda? Sebagai contoh saya akan mencoba mengimpor schema <strong>train</strong> yang sebelumnya dibackup untuk direstore di server yang ada di mesin yang berbeda, dimana user yang digunakan yaitu <strong>neurondev</strong> dengan password <strong>neurondev</strong> yang ada di service <strong>xe</strong>. Logisnya saya akan menggunakan command dibawah ini:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">oracle<span style="color: #000000; font-weight: bold;">@</span>linuxbox:~<span style="color: #000000; font-weight: bold;">&gt;</span> imp neurondev<span style="color: #000000; font-weight: bold;">/</span>neurondev<span style="color: #000000; font-weight: bold;">@</span>xe <span style="color: #007800;">file</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>alam<span style="color: #000000; font-weight: bold;">/</span>train.dmp
&nbsp;
Import: Release 10.2.0.1.0 - Production on Fri Jan <span style="color: #000000;">2</span> <span style="color: #000000;">13</span>:<span style="color: #000000;">48</span>:<span style="color: #000000;">33</span> <span style="color: #000000;">2009</span>
&nbsp;
Copyright <span style="color: #7a0874; font-weight: bold;">&#40;</span>c<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">1982</span>, <span style="color: #000000;">2005</span>, Oracle.  All rights reserved.
&nbsp;
&nbsp;
Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
&nbsp;
Export <span style="color: #c20cb9; font-weight: bold;">file</span> created by EXPORT:V10.02.01 via conventional path
&nbsp;
Warning: the objects were exported by TRAIN, not by you
&nbsp;
import <span style="color: #000000; font-weight: bold;">done</span> <span style="color: #000000; font-weight: bold;">in</span> US7ASCII character <span style="color: #000000; font-weight: bold;">set</span> and AL16UTF16 NCHAR character <span style="color: #000000; font-weight: bold;">set</span>
import server uses AL32UTF8 character <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>possible charset conversion<span style="color: #7a0874; font-weight: bold;">&#41;</span>
. importing TRAIN<span style="color: #ff0000;">'s objects into NEURONDEV
Import terminated successfully without warnings.
oracle@linuxbox:~&gt;</span></pre></div></div>

<p>Kita tidak bisa mengimpor schema yang dibuat oleh user yang lain yang berbeda dengan yang kita gunakan untuk mengimpor schema tersebut, dalam hal ini backup schema tersebut dimiliki oleh user <strong>train</strong> sedangkan kita menggunakan user <strong>neurondev</strong>. Bagaimana solusinya? Gunakan opsi <strong>fromuser</strong> dan <strong>touser</strong> yang disediakan oleh <strong>imp</strong> seperti ini:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">oracle<span style="color: #000000; font-weight: bold;">@</span>linuxbox:~<span style="color: #000000; font-weight: bold;">&gt;</span> imp neurondev<span style="color: #000000; font-weight: bold;">/</span>neurondev<span style="color: #000000; font-weight: bold;">@</span>xe <span style="color: #007800;">file</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>alam<span style="color: #000000; font-weight: bold;">/</span>train.dmp <span style="color: #007800;">fromuser</span>=train <span style="color: #007800;">touser</span>=neurondev
&nbsp;
Import: Release 10.2.0.1.0 - Production on Fri Jan <span style="color: #000000;">2</span> <span style="color: #000000;">14</span>:<span style="color: #000000;">57</span>:<span style="color: #000000;">59</span> <span style="color: #000000;">2009</span>
&nbsp;
Copyright <span style="color: #7a0874; font-weight: bold;">&#40;</span>c<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">1982</span>, <span style="color: #000000;">2005</span>, Oracle.  All rights reserved.
&nbsp;
&nbsp;
Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
&nbsp;
Export <span style="color: #c20cb9; font-weight: bold;">file</span> created by EXPORT:V10.02.01 via conventional path
&nbsp;
Warning: the objects were exported by TRAIN, not by you
&nbsp;
import <span style="color: #000000; font-weight: bold;">done</span> <span style="color: #000000; font-weight: bold;">in</span> US7ASCII character <span style="color: #000000; font-weight: bold;">set</span> and AL16UTF16 NCHAR character <span style="color: #000000; font-weight: bold;">set</span>
import server uses AL32UTF8 character <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>possible charset conversion<span style="color: #7a0874; font-weight: bold;">&#41;</span>
. . importing table                        <span style="color: #ff0000;">&quot;TRAIN&quot;</span>          <span style="color: #000000;">2</span> rows imported
Import terminated successfully without warnings.
oracle<span style="color: #000000; font-weight: bold;">@</span>linuxbox:~<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>Opsi <strong>fromuser</strong> digunakan untuk memberitahu oracle user awal yang memiliki backup schema tersebut (owner) dan opsi <strong>touser</strong> digunakan untuk menentukan user mana yang akan memiliki schema hasil impor tersebut. Jadi kita isi <strong>train</strong> untuk opsi <strong>fromuser</strong> karena backup schema tersebut dimiliki oleh user <strong>train</strong> dan dibackupnya pun oleh user <strong>train</strong>. Sedangkan opsi <strong>fromuser</strong> kita isi dengan <strong>neurondev</strong> karena user ini yang akan memiliki schema hasil impor tersebut dan juga user yang melakukan proses impornya.<br />
Sekarang mari kita coba mengimpornya menggunakan user yang sama sekali berbeda:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">oracle<span style="color: #000000; font-weight: bold;">@</span>linuxbox:~<span style="color: #000000; font-weight: bold;">&gt;</span> imp admin<span style="color: #000000; font-weight: bold;">/</span>admin<span style="color: #000000; font-weight: bold;">@</span>xe <span style="color: #007800;">file</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>alam<span style="color: #000000; font-weight: bold;">/</span>train.dmp <span style="color: #007800;">fromuser</span>=train <span style="color: #007800;">touser</span>=neurondev
&nbsp;
Import: Release 10.2.0.1.0 - Production on Fri Jan <span style="color: #000000;">2</span> <span style="color: #000000;">15</span>:<span style="color: #000000;">23</span>:<span style="color: #000000;">23</span> <span style="color: #000000;">2009</span>
&nbsp;
Copyright <span style="color: #7a0874; font-weight: bold;">&#40;</span>c<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">1982</span>, <span style="color: #000000;">2005</span>, Oracle.  All rights reserved.
&nbsp;
&nbsp;
Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
&nbsp;
Export <span style="color: #c20cb9; font-weight: bold;">file</span> created by EXPORT:V10.02.01 via conventional path
&nbsp;
Warning: the objects were exported by TRAIN, not by you
&nbsp;
import <span style="color: #000000; font-weight: bold;">done</span> <span style="color: #000000; font-weight: bold;">in</span> US7ASCII character <span style="color: #000000; font-weight: bold;">set</span> and AL16UTF16 NCHAR character <span style="color: #000000; font-weight: bold;">set</span>
import server uses AL32UTF8 character <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>possible charset conversion<span style="color: #7a0874; font-weight: bold;">&#41;</span>
IMP-00007: must be a DBA to import objects to another user<span style="color: #ff0000;">'s account   
IMP-00000: Import terminated unsuccessfully                            
oracle@linuxbox:~&gt;</span></pre></div></div>

<p>Kita membutuhkan user dengan grant DBA jika ingin melakukan hal diatas.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">oracle<span style="color: #000000; font-weight: bold;">@</span>linuxbox:~<span style="color: #000000; font-weight: bold;">&gt;</span> imp system<span style="color: #000000; font-weight: bold;">@</span>xe <span style="color: #007800;">file</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>alam<span style="color: #000000; font-weight: bold;">/</span>train.dmp <span style="color: #007800;">fromuser</span>=train <span style="color: #007800;">touser</span>=neurondev
&nbsp;
Import: Release 10.2.0.1.0 - Production on Fri Jan <span style="color: #000000;">2</span> <span style="color: #000000;">15</span>:<span style="color: #000000;">24</span>:<span style="color: #000000;">55</span> <span style="color: #000000;">2009</span>
&nbsp;
Copyright <span style="color: #7a0874; font-weight: bold;">&#40;</span>c<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">1982</span>, <span style="color: #000000;">2005</span>, Oracle.  All rights reserved.
&nbsp;
Password:
&nbsp;
Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
&nbsp;
Export <span style="color: #c20cb9; font-weight: bold;">file</span> created by EXPORT:V10.02.01 via conventional path
&nbsp;
Warning: the objects were exported by TRAIN, not by you
&nbsp;
import <span style="color: #000000; font-weight: bold;">done</span> <span style="color: #000000; font-weight: bold;">in</span> US7ASCII character <span style="color: #000000; font-weight: bold;">set</span> and AL16UTF16 NCHAR character <span style="color: #000000; font-weight: bold;">set</span>
import server uses AL32UTF8 character <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>possible charset conversion<span style="color: #7a0874; font-weight: bold;">&#41;</span>
. importing TRAIN<span style="color: #ff0000;">'s objects into NEURONDEV
. . importing table                        &quot;TRAIN&quot;          2 rows imported
Import terminated successfully without warnings.
oracle@linuxbox:~&gt;</span></pre></div></div>

<p>Semoga bermanfaat and have a lot of fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.neuronworks.net/2008/12/31/backup-dan-restore-schema-oracle-menggunakan-exp-dan-imp/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

