<?xml version="1.0" encoding="UTF-8" ?>
<feed xml:lang="ja" xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0">
  <title type="text">Oracleのいろいろまとめ</title>
  <subtitle type="html">自分がOracleを使っている中で発生したエラーを中心に対処法を紹介していきます。</subtitle>
  <link rel="self" type="application/atom+xml" href="https://mrchildren.iga-log.com/atom"/>
  <link rel="alternate" type="text/html" href="https://mrchildren.iga-log.com/"/>
  <updated>2013-03-12T15:58:14+09:00</updated>
  <author><name>No Name Ninja</name></author>
  <generator uri="//www.ninja.co.jp/blog/" version="0.9">忍者ブログ</generator>
  <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" />
  <entry>
    <id>mrchildren.iga-log.com://entry/3</id>
    <link rel="alternate" type="text/html" href="https://mrchildren.iga-log.com/%E6%9C%AA%E9%81%B8%E6%8A%9E/ora-00001%20%E4%B8%80%E6%84%8F%E5%88%B6%E7%B4%84%E3%81%AB%E5%8F%8D%E3%81%97%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99" />
    <published>2013-03-14T18:38:08+09:00</published> 
    <updated>2013-03-14T18:38:08+09:00</updated> 
    <category term="未選択" label="未選択" />
    <title>ORA-00001 一意制約に反しています</title>
    <content mode="escaped" type="text/html" xml:lang="utf-8"> 
      <![CDATA[今日は基本中の基本を紹介。<br />
ORA-00001は一意制約違反です。<br />
INSERTやUPDATEによって、キーとなっている項目と同じデータが２件以上になってしまう場合のエラーです。<br />
対処方法としてはそういうデータが発生しないように回避して下さい。<br />
]]> 
    </content>
    <author>
            <name>No Name Ninja</name>
        </author>
  </entry>
  <entry>
    <id>mrchildren.iga-log.com://entry/2</id>
    <link rel="alternate" type="text/html" href="https://mrchildren.iga-log.com/%E6%9C%AA%E9%81%B8%E6%8A%9E/%E3%82%BB%E3%83%83%E3%82%B7%E3%83%A7%E3%83%B3%E6%95%B0%E3%81%A8%E3%83%97%E3%83%AD%E3%82%BB%E3%82%B9%E6%95%B0" />
    <published>2013-03-13T22:33:54+09:00</published> 
    <updated>2013-03-13T22:33:54+09:00</updated> 
    <category term="未選択" label="未選択" />
    <title>セッション数とプロセス数</title>
    <content mode="escaped" type="text/html" xml:lang="utf-8"> 
      <![CDATA[TNS-12500 TNS:リスナーが専用サーバ・プロセスの起動 に失敗しました。<br />
<br />
上記のエラーが出た場合は、プロセス数かセッション数が最大に達したと考えてよい。<br />
対処方法を記していきます。<br />
<br />
まず、以下のSQLでOracleの最大セッション数と最大プロセス数を知る。<br />
<br />
SQL>select name, type, value from V$SYSTEM_PARAMETER where name = 'processes' or name='sessions'<br />
<br />
で、SQLplusにログインし、以下のコマンド<br />
<br />
alter system set processes = xxx scope=spfile;<br />
alter system set sessions = xxx scope=spfile;<br />
<br />
※この値は動的には変わらないので、設定後はOracleの再起動をする必要があります。<br />
<br />
]]> 
    </content>
    <author>
            <name>No Name Ninja</name>
        </author>
  </entry>
  <entry>
    <id>mrchildren.iga-log.com://entry/1</id>
    <link rel="alternate" type="text/html" href="https://mrchildren.iga-log.com/%E6%9C%AA%E9%81%B8%E6%8A%9E/%E3%82%A8%E3%82%AF%E3%82%B9%E3%83%9D%E3%83%BC%E3%83%88%E3%81%A7%E3%83%86%E3%83%BC%E3%83%96%E3%83%AB%E3%81%8C%E6%8A%9C%E3%81%91%E3%82%8B" />
    <published>2013-03-13T10:09:10+09:00</published> 
    <updated>2013-03-13T10:09:10+09:00</updated> 
    <category term="未選択" label="未選択" />
    <title>エクスポートでテーブルが抜ける</title>
    <content mode="escaped" type="text/html" xml:lang="utf-8"> 
      <![CDATA[Oracle11gでexpを行うとテーブルが抜けていた。<br />
<br />
なんでも、何かデータが一度でも入っていないテーブルは抜き出せないとの事。<br />
<br />
Oracle11g以降は今後、データ移行はData Pumpになるみたいです。<br />
<br />
従来のexp/impは廃止されているわけでなく、 <br />
下位バージョンのデータ移行用のために残されます。 <br />
<br />
試してみたところ、<br />
expdpとimpdpを使ってデータ移行を行うと1/3くらいの時間で移行できるようになりました。<br />
<br />
それでは、エクスポートとインポートの手順を紹介します。<br />
<br />
★全体モード<br />
expdp ＜ユーザ名＞/＜パスワード＞ FULL=Y dumpfile=＜出力ファイル名＞<br />
impdp ＜ユーザ名＞/＜パスワード＞ FULL=Y dumpfile=＜出力ファイル名＞<br />
<br />
★スキーマモード<br />
expdp ＜ユーザ名＞/＜パスワード＞ SCHEMAS=＜スキーマ名＞,＜スキーマ名＞・・・ dumpfile=＜出力ファイル名＞<br />
impdp ＜ユーザ名＞/＜パスワード＞ SCHEMAS=＜スキーマ名＞,＜スキーマ名＞・・・ dumpfile=＜出力ファイル名＞<br />
<br />
★表領域モード<br />
expdp ＜ユーザ名＞/＜パスワード＞ TABLESPACES=＜表領域名＞,＜表領域名＞・・・ dumpfile=＜出力ファイル名＞<br />
impdp ＜ユーザ名＞/＜パスワード＞ TABLESPACES=＜表領域名＞,＜表領域名＞・・・ dumpfile=＜出力ファイル名＞<br />
<br />
★表モード<br />
expdp ＜ユーザ名＞/＜パスワード＞ tables=＜テーブル名＞,＜テーブル名＞・・・ file=＜出力ファイル名＞<br />
impdp ＜ユーザ名＞/＜パスワード＞ tables=＜テーブル名＞,＜テーブル名＞・・・ file=＜出力ファイル名＞<br />
<br />
■主なオプション<br />
★logfile オプション<br />
ログファイルを出力する場合：「 logfile = scott_expdp.log 」のようにオプションを追加する。<br />
ログを明示的に指定しない場合：「 export.log 」 がディレクトリオブジェクトのパスに出力される。<br />
<br />
★content オプション<br />
定義のみをエクスポート：「 content=metadata_only 」<br />
データのみをエクスポート：「 content=data_only 」<br />
※ オプションを指定しない場合、デフォルトの「 content=all 」となる。<br />
<br />
★estimate_only オプション<br />
ディスク領域見積もりだけ行う(エクスポートは行わない)：「 estimate_only=y 」<br />
<br />
★exclude オプション<br />
特定のオブジェクトだけを除外可能。<br />
emp テーブルのみ除外： 「 exclude=TABLE:\”LIKE \’EMP%\’\” 」<br />
インデックスのみ全て除外： 「 exclude=INDEX 」<br />
<br />
★tables オプション<br />
emp テーブルのみ： 「 tables=scott.emp 」<br />
テーブル名指定時でもスキーマ名は必須]]> 
    </content>
    <author>
            <name>No Name Ninja</name>
        </author>
  </entry>
</feed>