导出(exp) & 导入(imp) 
    利用Export可将数据从数据库中提取出来,就是将select的结果存到一个FS二进制文件上
    利用Import则可将提取出来的数据送回到Oracle数据库中去。 
    要读写数据文件内数据,所以数据库必须open
    不能备份活跃频繁数据 
    exp满足select的所有特性 比如权限或读一致性
    imp满足insert的所有特性 比如主键或空间不足

Oracle支持三种方式基本类型的输出: 
1.表方式(T方式),将指定表的数据导出。 
2.用户方式(U方式),将指定用户的所有对象及数据导出。 
3.全库方式(Full方式),数据库中的所有对象导出。

数据导入(Import)的过程是数据导出(Export)的逆过程,
分别将数据文件导入数据库和将数据库数据导出到数据文件。

交互模式导出exp表

[oracle@dba ~]$ exp

Export: Release 10.2.0.1.0 - Production on Mon Apr 4 16:58:41 2011

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Username: scott
Password:

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Enter array fetch buffer size: 4096 >

Export file: expdat.dmp > scott_tab_emp.dmp

(2)U(sers), or (3)T(ables): (2)U > T

Export table data (yes/no): yes >

Compress extents (yes/no): yes >

Export done in AL32UTF8 character set and AL16UTF16 NCHAR character set

About to export specified tables via Conventional Path ...

Table(T) or Partition(T:P) to be exported: (RETURN to quit) > emp

. . exporting table                            EMP         14 rows exported

Table(T) or Partition(T:P) to be exported: (RETURN to quit) > dept

. . exporting table                           DEPT          4 rows exported

Table(T) or Partition(T:P) to be exported: (RETURN to quit) >  回车退出

Export terminated successfully with warnings.
[oracle@dba ~]$

查看备份文件
[oracle@dba ~]$ ll -thr scott_tab_emp.dmp 
-rw-r--r-- 1 oracle oinstall 24K 04-04 17:00 scott_tab_emp.dmp
[oracle@dba ~]$ file scott_tab_emp.dmp 
scott_tab_emp.dmp: DBase 3 data file (1380929624 records)
[oracle@dba ~]$ strings scott_tab_emp.dmp

导出的文件是二进制文件 如果要经历FTP传输 一定要使用binary传输模式传 如果使用ASCII模式传输会损坏文件
    windows cmd里的ftp 默认是ascii传输模式

linux   lftp ftp等工具默认基本都是binary模式
    修改方法

C:\>ftp
    ftp> status
    Not connected.
    Type: ascii; Verbose: On ; Bell: Off ; Prompting: On ; Globbing: On
    Debugging: Off ; Hash mark printing: Off .
    ftp>
    ftp> help
    Commands may be abbreviated.

!               delete
    ?               debug
    append          dir
    ascii           disconnect
    bell            get
    binary          glob
    bye             hash
    cd              help
    close           lcd
    ftp>

[oracle@dba ~]$ ftp 127.0.0.1
    Connected to 127.0.0.1 (127.0.0.1).
    220 (vsFTPd 2.0.5)
    Name (127.0.0.1:oracle): 
    331 Please specify the password.
    Password:
    230 Login successful.
    Remote system type is UNIX.
    Using binary mode to transfer files.
    ftp> status
    Connected to 127.0.0.1.
    No proxy connection.
    Mode: stream; Type: binary; Form: non-print; Structure: file
    Verbose: on; Bell: off; Prompting: on; Globbing: on
    Store unique: off; Receive unique: off
    Case: off; CR stripping: on
    Ntrans: off
    Nmap: off
    Hash mark printing: off; Use of PORT cmds: on
    Tick counter printing: off
    ftp>

[oracle@dba ~]$ lftp oracle@127.0.0.1
    口令: 
    lftp oracle@127.0.0.1:~> help get
    用法: get [OPTS] <rfile> [-o <lfile>]
    Retrieve remote file <rfile> and store it to local file <lfile>.
    .........
     -a  use ascii mode (binary is the default)
    .........
    lftp oracle@127.0.0.1:~> help put
    用法: put [OPTS] <lfile> [-o <rfile>]
    Upload <lfile> with remote name <rfile>.
    .........
     -a  use ascii mode (binary is the default)
    .........
    lftp oracle@127.0.0.1:~>

备份出来的是什么内容  只是对象的元数据 + 用户数据
[oracle@dba exp_dir]$ strings cmd_scott_tab.dmp | grep -i 'CREATE' --color
CREATE TABLE "EMP" ("EMPNO" NUMBER(4, 0), "ENAME" VARCHAR2(10), ....
CREATE UNIQUE INDEX "PK_EMP" ON "EMP" ("EMPNO" )  ....
CREATE TABLE "DEPT" ("DEPTNO" NUMBER(2, 0), "DNAME" VARCHAR2(14), ....
CREATE UNIQUE INDEX "PK_DEPT" ON "DEPT" ("DEPTNO" )  ....

命令模式备份表

[oracle@dba exp_dir]$ exp USERID=SCOTT/seker TABLES=EMP,DEPT FILE=cmd_scott_tab.dmp

Export: Release 10.2.0.1.0 - Production on Mon Apr 4 17:16:22 2011

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Export done in AL32UTF8 character set and AL16UTF16 NCHAR character set

About to export specified tables via Conventional Path ...
. . exporting table                            EMP         14 rows exported
. . exporting table                           DEPT          4 rows exported
Export terminated successfully without warnings.
[oracle@dba exp_dir]$

交互模式备份schema
    
[oracle@dba exp_dir]$ exp

Export: Release 10.2.0.1.0 - Production on Mon Apr 4 17:37:00 2011

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Username: scott
Password:

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Enter array fetch buffer size: 4096 >

Export file: expdat.dmp > schema_scott.dmp

(2)U(sers), or (3)T(ables): (2)U > U

Export grants (yes/no): yes >

Export table data (yes/no): yes >

Compress extents (yes/no): yes >

Export done in AL32UTF8 character set and AL16UTF16 NCHAR character set
...............
Export terminated successfully without warnings.
[oracle@dba exp_dir]$

命令模式备份schema
[oracle@dba exp_dir]$ exp userid=scott/seker file=schema.scott.dmp

.............
Export terminated successfully without warnings.
[oracle@dba exp_dir]$

只导出部分数据

[oracle@dba exp_dir]$ exp userid=scott/seker tables=emp query=\'where deptno=10\' statistics=none file=./emp_deptno_10.dmp log=./emp_deptno_10.log
表上有统计信息的时候会报EXP-0091错误,添加statistics=none即可
Export: Release 10.2.0.1.0 - Production on Mon Apr 4 17:59:29 2011

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Export done in AL32UTF8 character set and AL16UTF16 NCHAR character set

About to export specified tables via Conventional Path ...
. . exporting table                            EMP
.
                                                            3 rows exported
Export terminated successfully without warnings.
[oracle@dba exp_dir]$

只导出表结构
    导出时一定要加COMPRESS=n的选项 否则导入表是原始表的高水位 且没数据
    一个表大小是5M 
    COMPRESS=n 时得到元数据: STORAGE(INITIAL 65536)
    COMPRESS=y(默认) 时得到元数据:STORAGE(INITIAL 5242880) 这样创建的表很大 又没数据
[oracle@dba ~]$ exp scott/seker tables=ob rows=n file=./ob.dmp

[oracle@dba ~]$ exp scott/seker tables=ob rows=n COMPRESS=n file=./ob2.dmp

SQL> select segment_name,sum(bytes)/1024/1024 from user_extents where segment_name='OB' group by segment_name;

SEGMENT_NAME          SUM(BYTES)/1024/1024
------------------------- --------------------
OB                         5

SQL> drop table OB PURGE;

Table dropped.

SQL> !
[oracle@dba ~]$ ls
Desktop  ob2.dmp  ob.dmp
[oracle@dba ~]$ imp userid=scott/seker file=ob.dmp 
[oracle@dba ~]$ exit
SQL> select segment_name,sum(bytes)/1024/1024 from user_extents where segment_name='OB' group by segment_name;

SEGMENT_NAME          SUM(BYTES)/1024/1024
------------------------- --------------------
OB                         5

SQL> !
[oracle@dba ~]$ exit
exit

SQL> drop table ob purge;

Table dropped.

SQL> !
[oracle@dba ~]$ imp userid=scott/seker file=ob2.dmp

SQL> select segment_name,sum(bytes)/1024/1024 from user_extents where segment_name='OB' group by segment_name;

SEGMENT_NAME          SUM(BYTES)/1024/1024
------------------------- --------------------
OB                     .0625

SQL>

使用参数文件

[oracle@dba exp_dir]$ cat exp.txt 
userid=scott/seker
tables=emp
query='where deptno=10'
statistics=none
file=./emp_deptno_10.dmp
buffer=100000
feedback=2
log=./emp_deptno_10.log
[oracle@dba exp_dir]$ exp PARFILE=exp.txt

Export: Release 10.2.0.1.0 - Production on Mon Apr 4 17:59:52 2011

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Export done in AL32UTF8 character set and AL16UTF16 NCHAR character set

About to export specified tables via Conventional Path ...
. . exporting table                            EMP
.
                                                            3 rows exported
Export terminated successfully without warnings.
[oracle@dba exp_dir]$

当query中带有单引号时 用两个引号代替
[oracle@dba exp_dir]$ cat exp.txt 
userid=scott/seker
tables=emp
query='where deptno=10 and ename=''KING'''
statistics=none
file=./emp_deptno_10.dmp
buffer=100000
feedback=2
log=./emp_deptno_10.log
[oracle@dba exp_dir]$

闪回导出(导出历史上某一时间点的数据状态,依赖undo老镜像):
--/home/oracle/exp.txt--
userid=system/oracle
tables=scott.emp
file=/home/oracle/expdept.dmp 
flashback_time="to_timestamp('2011-03-28 15:25:06','yyyy-mm-dd hh24:mi:ss')"
buffer=100000 
feedback=5000 
log=/home/oracle/expdept.log

备份的常用参数
    FEEDBACK             display progress every x rows (0)
    FILESIZE             maximum size of each dump file
    INDEXES             export indexes (Y)
    TRIGGERS              export triggers (Y)
    LOG                 log file of screen output

导入imp

指定表导入
[oracle@dba exp_dir]$ imp userid=scott/seker file=schema.scott.dmp tables=t1 ;

Import: Release 10.2.0.1.0 - Production on Mon Apr 4 18:36:26 2011

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

Export file created by EXPORT:V10.02.01 via conventional path
import done in AL32UTF8 character set and AL16UTF16 NCHAR character set
. importing SCOTT's objects into SCOTT
. importing SCOTT's objects into SCOTT
. . importing table                           "T1"      24672 rows imported
Import terminated successfully without warnings.
[oracle@dba exp_dir]$

导入带有外键约束的表 要连同主键表一起带入 否则建立外键报错 带有trigger的级联表也要这样
[oracle@dba exp_dir]$ imp userid=scott/seker file=schema.scott.dmp tables=emp ;

Import: Release 10.2.0.1.0 - Production on Mon Apr 4 18:36:59 2011

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

Export file created by EXPORT:V10.02.01 via conventional path
import done in AL32UTF8 character set and AL16UTF16 NCHAR character set
. importing SCOTT's objects into SCOTT
. importing SCOTT's objects into SCOTT
. . importing table                          "EMP"         14 rows imported
IMP-00017: following statement failed with ORACLE error 942:
 "ALTER TABLE "EMP" ADD CONSTRAINT "FK_DEPTNO" FOREIGN KEY ("DEPTNO") REFEREN"
 "CES "DEPT" ("DEPTNO") ENABLE NOVALIDATE"
IMP-00003: ORACLE error 942 encountered
ORA-00942: table or view does not exist
About to enable constraints...
IMP-00017: following statement failed with ORACLE error 2430:
 "ALTER TABLE "EMP" ENABLE CONSTRAINT "FK_DEPTNO""
Import terminated successfully with warnings.
[oracle@dba exp_dir]$

SQL> drop table emp purge;

Table dropped.

SQL>

[oracle@dba exp_dir]$ imp userid=scott/seker file=schema.scott.dmp tables=emp,dept ;

Import: Release 10.2.0.1.0 - Production on Mon Apr 4 18:38:09 2011

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

Export file created by EXPORT:V10.02.01 via conventional path
import done in AL32UTF8 character set and AL16UTF16 NCHAR character set
. importing SCOTT's objects into SCOTT
. importing SCOTT's objects into SCOTT
. . importing table                         "DEPT"          4 rows imported
. . importing table                          "EMP"         14 rows imported
About to enable constraints...
Import terminated successfully without warnings.
[oracle@dba exp_dir]$

导入到其他用户
    这样导入到的是system模式中去了
[oracle@dba exp_dir]$ imp userid=system/oracle file=schema.scott.dmp tables=emp,dept ;

Import: Release 10.2.0.1.0 - Production on Mon Apr 4 18:41:30 2011

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

Export file created by EXPORT:V10.02.01 via conventional path

Warning: the objects were exported by SCOTT, not by you

import done in AL32UTF8 character set and AL16UTF16 NCHAR character set
. importing SCOTT's objects into SYSTEM
. importing SCOTT's objects into SYSTEM
. . importing table                         "DEPT"          4 rows imported
. . importing table                          "EMP"         14 rows imported
About to enable constraints...
Import terminated successfully without warnings.
[oracle@dba exp_dir]$

使用touser参数 导入到指定用户  但userid的用户必须有权限 覆盖touser的权限的人才可以这样做
[oracle@dba exp_dir]$ imp userid=system/oracle touser=scott file=schema.scott.dmp tables=emp,dept ;

Import: Release 10.2.0.1.0 - Production on Mon Apr 4 18:42:01 2011

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

Export file created by EXPORT:V10.02.01 via conventional path

Warning: the objects were exported by SCOTT, not by you

import done in AL32UTF8 character set and AL16UTF16 NCHAR character set
. importing SCOTT's objects into SCOTT
. . importing table                         "DEPT"          4 rows imported
. . importing table                          "EMP"         14 rows imported
About to enable constraints...
Import terminated successfully without warnings.
[oracle@dba exp_dir]$

导入时追加数据
    表不能有主键
    正常导入时先建表 表存在就报错
    加ignore=y选项 就是忽略表存在 追加数据

导入到其他用户
SQL> create tablespace ts99 datafile '/u01/oracle/oradata/ora10g/ts99.dbf' size 20M;

Tablespace created.

SQL> create user u99 default tablespace ts99 identified by u99;

User created.

SQL> grant connect,resource to u99;

Grant succeeded.

SQL>

SQL> select owner,SEGMENT_NAME,TABLESPACE_NAME from  dba_extents where SEGMENT_NAME in ('EMP','DEPT');

no rows selected

SQL>

[oracle@dba exp_dir]$ imp userid=system/oracle touser=u99 file=schema.scott.dmp tables=emp,dept ;
导入成功 但存储位置却不是 ts99 这个u99的默认表空间 没达到我们的目的

SQL> select owner,SEGMENT_NAME,TABLESPACE_NAME from  dba_extents where SEGMENT_NAME in ('EMP','DEPT');

OWNER                   SEGMENT_NAME         TABLESPACE_NAME
------------------------------ ------------------------- ---------------
U99                   DEPT             USERS
U99                   EMP             USERS

SQL>

原因是U99用户具备所有表空间不受限的权限 剔除这个权限 只给他默认表空间的权限
删除刚导入的表 重新导入
SQL> revoke UNLIMITED TABLESPACE from u99;

Revoke succeeded.

SQL>

SQL> alter user u99 quota unlimited on ts99;

User altered.

SQL>

[oracle@dba exp_dir]$ imp userid=system/oracle touser=u99 file=schema.scott.dmp tables=emp,dept ;

SQL> select owner,SEGMENT_NAME,TABLESPACE_NAME from  dba_extents where SEGMENT_NAME in ('EMP','DEPT');

OWNER                   SEGMENT_NAME         TABLESPACE_NAME
------------------------------ ------------------------- ---------------
U99                   DEPT             TS99
U99                   EMP             TS99

SQL> 达到目的

导入时追加数据
    表不能有主键
    正常导入时先建表 表存在就报错
    加ignore=y选项 就是忽略表存在 追加数据

导入的常用参数
    SHOW     just list file contents (N)
    COMMIT    commit array insert (N)
    BUFFER   size of data buffer
    很重要的两个参数 大表我们必须限制使用批量提交 以免回滚段小等问题
    commit=y        --降低导入的时候对回滚的压力。
                n -- 每张表数据导入完成后提交;
                y -- buffer满了以后就提交,一定要增大buffer的尺寸。

FULL         import entire file (N)
    indexfile=a.dmp
    
    indexes=N

备份表空间模式
    只是备份表空间中的存储对象 并不备份表空间自身的结构

[oracle@dba exp_dir]$ exp userid=system/oracle tablespaces=ts99 file=./tbs_ts99.dmp log=./tbs_ts99.log

SQL> drop tablespace ts99 including contents and datafiles;

Tablespace dropped.

SQL>

[oracle@dba exp_dir]$ imp userid=system/oracle file=./tbs_ts99.dmp full=y
.........
IMP-00003: ORACLE error 959 encountered
ORA-00959: tablespace 'TS99' does not exist
IMP-00017: following statement failed with ORACLE error 959:
.........

SQL> create tablespace ts99 datafile '/u01/oracle/oradata/ora10g/ts99.dbf' size 20M;

Tablespace created.

SQL>

[oracle@dba exp_dir]$ imp userid=system/oracle file=./tbs_ts99.dmp full=y

Import: Release 10.2.0.1.0 - Production on Tue Apr 5 03:18:47 2011

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

Export file created by EXPORT:V10.02.01 via conventional path
import done in AL32UTF8 character set and AL16UTF16 NCHAR character set
. importing SYSTEM's objects into SYSTEM
. importing U99's objects into U99
. . importing table                         "DEPT"          4 rows imported
. . importing table                          "EMP"         14 rows imported
About to enable constraints...
Import terminated successfully without warnings.
[oracle@dba exp_dir]$

全库模式:
exp parfile=c:\exp.txt
----------------------
userid=system/oracle
full=y                                
filesize=50m                            定义文件大小,切割备份,为将来传输方便。
file=(c:\exp_full_1.dmp,c:\exp_full_2.dmp)    定义各种文件的名字,如果名字不够的话,导出进程会挂起要文件名字。
buffer=10000000
feedback=10000
log=c:\exp_full.log

imp parfile=c:\imp.txt
-----------------------
userid=system/oracle
full=y
filesize=50m
file=(c:\exp_full_1.dmp,c:\exp_full_2.dmp)
buffer=10000000
feedback=10000
log=c:\imp_full.log

表空间传输
从一个数据库中将一个表空间迁移至另一个数据库
    1.将本地表空间设置为只读
    2.导出表空间元数据,将导出文件和表空间包含的数据文件拿到远程
    3.远程库要手动建立和本地同样的用户
    4.导入表空间元数据,并指定原来的datafile
    5.本地和远程表空间都恢复读写 正常使用
    
1.将本地表空间设置为只读
SQL> alter tablespace ts99 read only;

Tablespace altered.

SQL>

2.导出表空间元数据,将导出文件和表空间包含的数据文件拿到远程
[oracle@dba exp_dir]$ exp userid=\''sys/oracle as sysdba'\' tablespaces=ts99 transport_tablespace=y file=./trs_tbs_ts99.dmp

Export: Release 10.2.0.1.0 - Production on Tue Apr 5 03:27:01 2011

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Export done in AL32UTF8 character set and AL16UTF16 NCHAR character set
Note: table data (rows) will not be exported
About to export transportable tablespace metadata...
For tablespace TS99 ...
. exporting cluster definitions
. exporting table definitions
. . exporting table                           DEPT
. . exporting table                            EMP
. exporting referential integrity constraints
. exporting triggers
. end transportable tablespace metadata export
Export terminated successfully without warnings.
[oracle@dba exp_dir]$

SQL> ! cp /u01/oracle/oradata/ora10g/ts99.dbf /u01/oracle/oradata/orcl/

SQL>

3.远程库要手动建立和本地同样的用户
SQL> select file_name,file_id,tablespace_name from dba_data_files;

FILE_NAME                     FILE_ID TABLESPACE_NAME
--------------------------------------------- ---------- ---------------
/u01/oracle/oradata/orcl/users01.dbf               4 USERS
/u01/oracle/oradata/orcl/sysaux01.dbf               3 SYSAUX
/u01/oracle/oradata/orcl/undotbs01.dbf               2 UNDOTBS1
/u01/oracle/oradata/orcl/system01.dbf               1 SYSTEM

SQL> create user u99 identified by u99;

User created.

SQL> grant connect,resource to u99;

Grant succeeded.

SQL>

4.导入表空间元数据,并指定原来的datafile
[oracle@dba exp_dir]$ export ORACLE_SID=newdb
[oracle@dba exp_dir]$ imp userid=\''sys/oracle as sysdba'\' file=./trs_tbs_ts99.dmp tablespaces=ts99 transport_tablespace=y datafiles=\''/u01/oracle/oradata/orcl/ts99.dbf'\'

Import: Release 10.2.0.1.0 - Production on Tue Apr 5 03:36:10 2011

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

Export file created by EXPORT:V10.02.01 via conventional path
About to import transportable tablespace(s) metadata...
import done in AL32UTF8 character set and AL16UTF16 NCHAR character set
. importing SYS's objects into SYS
. importing SYS's objects into SYS
. importing U99's objects into U99
. . importing table                         "DEPT"
. . importing table                          "EMP"
. importing SYS's objects into SYS
Import terminated successfully without warnings.
[oracle@dba exp_dir]$

SQL> select file_name,file_id,tablespace_NAME FROM DBA_DATA_FILES;

FILE_NAME                     FILE_ID TABLESPACE_NAME
--------------------------------------------- ---------- ---------------
/u01/oracle/oradata/newdb/users01.dbf               4 USERS
/u01/oracle/oradata/newdb/sysaux01.dbf               3 SYSAUX
/u01/oracle/oradata/newdb/undotbs01.dbf            2 UNDOTBS1
/u01/oracle/oradata/newdb/system01.dbf               1 SYSTEM
/u01/oracle/oradata/orcl/ts99.dbf               5 TS99

SQL>

5.本地和远程表空间都恢复读写 正常使用
SQL> alter tablespace ts99 read write;

Tablespace altered.

SQL> conn u99/u99
Connected.
SQL> select * from tab;

TNAME                   TABTYPE    CLUSTERID
------------------------------ ------- ----------
DEPT                   TABLE
EMP                   TABLE

SQL>

ORACLE 导出(exp) & 导入(imp)的更多相关文章

  1. oracle的exp和imp命令的使用【转载】

    oracle的exp和imp命令的使用     我们通常要对ORACLE的数据进行导入,导出,在没有expdb,impdb以前(10G以前),我们都是使用exp 导出,imp命令来实现导入.   打开 ...

  2. Oracle 导出、导入某用户所有数据(包括表、视图、存储过程...)

    Oracle 导出.导入某用户所有数据(包括表.视图.存储过程...)前提:在CMD 命令下 导出命令:exp 用户名/密码@数据库 owner=用户名 file=文件存储路径(如:F:\abcd.d ...

  3. oracle使用exp与imp在本地导入导出数据

    导出: exp user/password owner=user file=你要输出的目录以及文件名,后缀为dmpexp IOTMON/iotmon owner=QSMES file=/home/or ...

  4. Oracle使用exp和imp导出、导入数据

    ===========导出============ exp 用户名/密码@服务器(localhost) file=文件路径.dmp owner=(用户名) ===========导入========= ...

  5. (13)oracle导出、导入

        导出 导出分三种 导出表.导出方案(用户).导出数据库 导入导出不需要进入sqlplus,都需要从cmd进到所安装的oracle目录的bin文件夹下 例如:D:\app\Administrat ...

  6. oracle 之 EXP、IMP 使用简介

    注:DOS命令行中执行exp.imp 导出导入ORACLE数据,ORACLE操作者具有相应的权限! 1.1.导出整库或当前用户:关键字:full语法:exp 用户/密码@数据库实例名 file=导出文 ...

  7. oracle 导出,导入表

    导出 exp DZQZ/DZQZ@orcl file=D:/DZQZ.dmp log=D:/DZQZ.log 导入 imp DZQZ/DZQZ@orcl file=D:\电子取证\DZQZ.dmp f ...

  8. Oracle导出和导入

    导出 exp exp 用户名/密码@实例名 file=导出的dmp文件存放路径 l og=导出日志存放路径 exp hr/123456@orcl file= C:\Users\Administrato ...

  9. oracle 的 exp 和imp命令

    数据导出: 1 将数据库TEST完全导出,用户名gdoa 密码123 导出到D:\TEST_BK.dmp中 exp gdoa/123@TEST file=d:\TEST_BK.dmp full=y   ...

随机推荐

  1. sm4加密 解密(oc)

    前几天项目用到sm4加密解密,加密为十六进制字符串,再将十六进制字符串解密.网上百度了下,sm4是密钥长度和加密明文加密密文都为16个字节十六进制数据,网上的sm4 c语言算法很容易搜到,笔者刚开始没 ...

  2. JS中Array详细用法

    1.数组的创建 var name= new Array(); //创建一个数组 name[0]="zhangsan";   //给数组赋值 name[1]="lisi&q ...

  3. C语言PIC32 serial bootloader和C#语言bootloader PC端串口通信程序

    了解更多关于bootloader 的C语言实现,请加我QQ: 1273623966 (验证信息请填 bootloader),欢迎咨询或定制bootloader(在线升级程序). 今天介绍下我新完成的为 ...

  4. 接口与继承ppt作业

    问:为什么子类的构造方法在运行之前,必须调用父类的构造方法?能不能反过来?为什么不能反过来? 答:子类拥有父的成员变量和成员方法,如果不调用,则从父类继承而来的成员变量和成员方法得不到正确的初始化.不 ...

  5. ConnectionString属性尚未初始化

    问题前因:使用动软代码生成的三成模板然后复制到相应的类库 动软生成的 sql帮助类 推荐的是DBsqlhelp 期间引用了:BLl层:Maticsoft.Common.dll DAl层:Maticso ...

  6. oracle 客户端单独配置

    本文目的是在CentOS 5.3上安装Oracle 11.2 instant client来访问远端的Oracle 10.2数据库,笔者测试通过,应该也适用于Redhat Linux 5.x     ...

  7. mxnet安装

    本来不想写这些玩意,但是老是纠缠安装环境,索性自己记一下. 我是在别人的基础上增加的,所以比较全. 裸机开始安装: 1.基本依赖的安装 sudo apt-get update sudo apt-get ...

  8. BootStrap基本控件

    简介 BootStrap是一个用于快速开发web应用程序和网站的前端框架. BootStrap是基于HTML, CSS, JavaScript. BootStrap是由Twitter的Mark Ott ...

  9. html5 绘制图片 drawImage

    要在绘图上下文中绘制图片,可以使用 drawImage 方法.该方法有三种不同的参数: drawImage(image,dx,dy) drawImage(image,dx,dy,dw,dh) d ...

  10. Net分布式系统之四:RabbitMQ消息队列应用

    消息通信组件Net分布式系统的核心中间件之一,应用与系统高并发,各个组件之间解耦的依赖的场景.本框架采用消息队列中间件主要应用于两方面:一是解决部分高并发的业务处理:二是通过消息队列传输系统日志.目前 ...