使用sys as sysdba权限进行EXP/IMP与其它用户稍有不同,详细内容如下(摘自metalink)

Applies to: 

Oracle Server - Enterprise Edition - Version: 8.1.7.0 to 10.2.0.0
Oracle Server - Personal Edition - Version: 8.1.7.0 to 10.2.0.0
Oracle Server - Standard Edition - Version: 8.1.7.0 to 10.2.0.0
Information in this document applies to any platform. Goal This document demonstrates how to connect AS SYSDBA when starting an export or import. Incorrect usage of single or double quotes can result in errors such as: LRM-: invalid positional parameter value 'as'
EXP-: failed to process parameters, type 'EXP HELP=Y' for help
EXP-: Export terminated unsuccessfully Or: LRM-: invalid positional parameter value 'sysdba' Or: LRM-: Message not found; No message file for product=ORACORE, facility=LRM Solution SYSDBA is used internally in the Oracle database and has specialized functions. Its behavior is not the same as for generalized users. For example, the SYS user cannot do a transaction level consisent read (read-only transaction). Queries by SYS will return changes made during the transaction even if SYS has set the transaction to be READ ONLY. Therefore export parameters like CONSISTENT, OBJECT_CONSISTENT, FLASHBACK_SCN, and FLASHBACK_TIME cannot be used.
Starting with Oracle10g, the export shows a warning that the export is not consistent when the export is started with CONSISTENT=Y and connects to the database with the user SYS (or as SYSDBA): EXP-: parameter CONSISTENT is not supported for this user Note that Oracle automatically provides read consistency to a query so that all the data that the query sees comes from a single point in time (statement-level read consistency). For export this means that the export of table data is consistent. However, if a table contains nested tables, the outer table and each inner table are exported as separate transactions. And if a table is partitioned, each partition is exported as a separate transaction. If a nested table or a partitioned table was updated during the export, the data that is exported while connected as the SYS schema could be inconsistent. Typically, there is no need to invoke Export or Import as SYSDBA, except in the following situations:
- at the request of Oracle technical support;
- when exporting a transportable tablespace set with the old-style export utility (Oracle9i and Oracle8i);
- when importing a transportable tablespace set with the old-style import utility (Oracle10g, Oracle9i, and Oracle8i). The examples below are based on:
- the export of table emp, owned by the demo schema scott.
- schema SYS with the password: change_on_install.
- alias 'instance' that is specified in the tnsnames.ora file and used for a connect to the database. To invoke Export or Import as SYSDBA, use the following syntax (this syntax is similar when invoking import and the syntax has not changed with the new Oracle10g Export DataPump and Import DataPump utilities): . Command line.
Enclose the connect string with a single quote character: Windows:
exp 'sys/change_on_install@instance as sysdba' tables=scott.emp Unix (you need to 'escape' the single quote):
exp \'sys/change_on_install@instance as sysdba\' tables=scott.emp VMS (use [double_quote][single_quote]...[single_quote][double_quote]):
exp "'sys/change_on_install@instance as sysdba'" tables=scott.emp Note that this VMS syntax is also a valid syntax on Unix and on Windows. . Interactive
Do not specify any connect string on the command line, so you will be prompted to enter it. E.g.: % exp tables=scott.emp Export: Release 10.1.0.2. - Production on Fri Jun ::
Copyright (c) , , Oracle. All rights reserved. Username: sys/change_on_install@instance as sysdba Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2. - 64bit Production
... etc. . Parameter file.
You can also specify the username in the parameter file. In this situation, you have to enclose the connect string with a double quote character. However, to prevent possible security breaches we advice you to stop using the USERID parameter in a parameter file. Contents of file exp.par: USERID="sys/change_on_install@instance as sysdba"
TABLES=scott.emp Run export with: exp parfile=exp.par Remarks: . If you have setup operating system authentication, it is not necessary to specify the SYS schema name, and password. E.g: exp "'/@instance as sysdba'" tables=scott.emp . In addition, if you have set the environment variable TWO_TASK (on Unix) or LOCAL (on Windows) or on the server where the database is installed you have set ORACLE_HOME and ORACLE_SID, it is not necessary to specify the @instance. E.g: exp "'/ as sysdba'" tables=scott.emp . The export parameters FLASHBACK_SCN and FLASHBACK_TIME cannot be used if the user that invoked the export is connected AS SYSDBA. . Known issues:
Bug "EXPORT FAILED WITH ORA-1031 WHEN LOGIN AS SYSDBA" (not a public bug; fixed in 8.1.7.3 and higher)
Bug "ORA-1925 OCCURS WHEN IMPORTING AS SYS ACCOUNT"
Bug "EXP DID NOT RAISE ERROR WHEN SYSDBA EXPORTS WITH CONSISTENT=Y" (not a public bug; fixed in Oracle10g and higher) References Bug - Ora- Occurs When Importing As Sys Account
Note 112269.1 - How to set Unix env. variable TWO_TASK and Windows NT counterpart, LOCAL
Note 130332.1 - Export / Import Connecting "AS SYSDBA" Fails with LRM- and EXP-
Note 204334.1 - Parameters FLASHBACK_SCN And FLASHBACK_TIME: Point In Time Export
Note 228482.1 - Schema's CTXSYS, MDSYS and ORDSYS are Not Exported
Note 277606.1 - How to Prevent EXP- or EXP- Warning (Data in Table xxx is Protected) During Export

####expdp

expdp \' / as sysdba \' directory=DATA_PUMP_DIR dumpfile=tpsp20121126.dmp logfile=tpsp20121126.log tables= scott.emp,scott.dept

impdp \' / as sysdba \'  directory=DATA_PUMP_DIR dumpfile=tpsp20121126.dmp logfile=imptpsp20121126.log remap_schema=SCOTT:SCOTT1

转 : 如何用sys as sysdba权限连接数据库进行EXP/IMP的更多相关文章

  1. oracle中scott/tiger、sys、SYSDBA、system都是什么用

    scott 是个演示用户,是让你学习ORACLE用的 SYSDBA 不是用户,可以认为是个权限,超级权限详细点说吧            超级用户分两种 SYSDBA和SYSOPTSYSOPT 后面3 ...

  2. 【转载】为什么任何随便输入的账号使用SYSDBA权限都能登陆oracle

    其实简单点就是检查一下你的机器有没有一个ora_dba用户组,而且你登陆os的用户是否在这个组里,有的话问题的原因就找到了,下面是转的高手的介绍 本文环境配置:Oracle10gR2,Windows ...

  3. MSSQL 2012 拒绝了对对象 'extended_properties' (数据库 'mssqlsystemresource',架构 'sys')的 SELECT 权限

    查看数据库的表的时候报如下错误: MSSQL 拒绝了对对象 ) 解决方法: 在数据库里相应的用户权限中,把db_denydatareader的复选框的勾去掉.db_denydatareader是拒绝访 ...

  4. 拒绝了对对象 'sp_OACreate' (数据库 'mssqlsystemresource',架构 'sys')的 EXECUTE 权限。

    执行一个存储过程, 由于里面使用到了一些 --创建对象  EXEC sp_OACreate 'VBScript.RegExp', @objRegex OUT  --设置属性  EXEC sp_OASe ...

  5. 关于IMP由拥有DBA权限的用户EXP数据时,数据存放表空间的几种情况(IMP-00013) -1

    关于IMP由拥有DBA权限的用户EXP数据时,数据存放表空间的几种情况(IMP-00013) -1 ORACLE公司来培训BIEE,带了一个DEMO的DMP文件,其导出用户DBO具有DBA权限,缺省表 ...

  6. plsql developer 使用sys用户登录,报ORA-01031权限不足,解决sys(dba权限用户)远程登录报错。

    数据库服务器架设在机器A上,此时我在机器B上进行远程连接,使用sys账号远程登录时报ORA-01031:insufficient privileges 或 ORA-01017: invalid use ...

  7. sqlplus sys as sysdba

    Enter user-name:sys Enter password:password as sysdba --以sys用户登陆的话 必须要加上 as sysdba 子句

  8. Linux 操作系统的权限为什么是1,2,4 而不是 1,2,3?如何用二进制来做权限管理

    1.二进制做权限的优点 大家都知道,在Linux操作系统中,x - 可执行权限,w - 可写权限 , r - 可读权限.其权限值分别是1,2,4,但是有没有想过为什么是1,2,4 而不是 1,2,3 ...

  9. python中如何用sys.excepthook来对全局异常进行捕获、显示及输出到error日志中

    使用sys.excepthook函数进行全局异常的获取. 1. 使用MessageDialog实现异常显示: 2. 使用logger把捕获的异常信息输出到日志中: 步骤:定义异常处理函数, 并使用该函 ...

随机推荐

  1. HDU2124 Repair the Wall(贪心)

    Problem Description Long time ago , Kitty lived in a small village. The air was fresh and the scener ...

  2. html中的a标签的target属性的四个值的区别?

    target属性规定了在何处打开超链接的文档. 如果在一个 <a> 标签内包含一个 target 属性,浏览器将会载入和显示用这个标签的 href 属性命名的.名称与这个目标吻合的框架或者 ...

  3. Mac 命令行中进入带有空格的文件夹

    http://blog.sina.com.cn/s/blog_5e8392b10100jkvg.html 今天在公司用mac的时候,有个文件夹的名字有空格,怎么都进不去,在网上一查原来不能直接cd 文 ...

  4. iOS 计算两个坐标之间的距离

    //第一个坐标 CLLocation *before=[[CLLocation alloc] initWithLatitude:29.553968 longitude:106.538872]; //第 ...

  5. drupal中安装CKEditor文本编辑器,并配置图片上传功能

    一.下载: 1.CKEditor模块 2.IMCE模块 二.安装       1.复制: 下载完上面两个模块之后,解压,将解压后整个文件夹,复制粘贴,放到 sites\all\modules下面,个人 ...

  6. Quartz(任务调度)- job串行避免死锁

    参照:http://blog.csdn.net/haitaofeiyang/article/details/50737644 quartz框架中防止任务并行可以有两种方案:   1.如果是通过Meth ...

  7. python paramiko模拟ssh登录,实现sftp上传或者下载文件

    Python Paramiko模块的安装与使用详解 paramiko是短链接,不是持续链接,只能执行你设定的shell命令,可以加分号执行两次命令. http://www.111cn.net/phpe ...

  8. js 手动轮播和自动轮播

    $(function(){ //默认值 $("#carousel1").css("background-color","#FFF"); // ...

  9. javaWeb知识的回顾

    16年7月毕业,现在工作也有3个多月了.一直是在做一些增删改查,技术上没有太大的突破,自己总结下原因,还是原理理解的不够透彻,地基没打好就盖不成高楼. 在51cto上找到了佟刚老师的视频,快进游览一遍 ...

  10. Python logging模块使用记录

    1.简单的将日志打印到屏幕 import logging logging.debug('This is debug message') logging.info('This is info messa ...