转 : 如何用sys as sysdba权限连接数据库进行EXP/IMP
- 使用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的更多相关文章
- oracle中scott/tiger、sys、SYSDBA、system都是什么用
scott 是个演示用户,是让你学习ORACLE用的 SYSDBA 不是用户,可以认为是个权限,超级权限详细点说吧 超级用户分两种 SYSDBA和SYSOPTSYSOPT 后面3 ...
- 【转载】为什么任何随便输入的账号使用SYSDBA权限都能登陆oracle
其实简单点就是检查一下你的机器有没有一个ora_dba用户组,而且你登陆os的用户是否在这个组里,有的话问题的原因就找到了,下面是转的高手的介绍 本文环境配置:Oracle10gR2,Windows ...
- MSSQL 2012 拒绝了对对象 'extended_properties' (数据库 'mssqlsystemresource',架构 'sys')的 SELECT 权限
查看数据库的表的时候报如下错误: MSSQL 拒绝了对对象 ) 解决方法: 在数据库里相应的用户权限中,把db_denydatareader的复选框的勾去掉.db_denydatareader是拒绝访 ...
- 拒绝了对对象 'sp_OACreate' (数据库 'mssqlsystemresource',架构 'sys')的 EXECUTE 权限。
执行一个存储过程, 由于里面使用到了一些 --创建对象 EXEC sp_OACreate 'VBScript.RegExp', @objRegex OUT --设置属性 EXEC sp_OASe ...
- 关于IMP由拥有DBA权限的用户EXP数据时,数据存放表空间的几种情况(IMP-00013) -1
关于IMP由拥有DBA权限的用户EXP数据时,数据存放表空间的几种情况(IMP-00013) -1 ORACLE公司来培训BIEE,带了一个DEMO的DMP文件,其导出用户DBO具有DBA权限,缺省表 ...
- plsql developer 使用sys用户登录,报ORA-01031权限不足,解决sys(dba权限用户)远程登录报错。
数据库服务器架设在机器A上,此时我在机器B上进行远程连接,使用sys账号远程登录时报ORA-01031:insufficient privileges 或 ORA-01017: invalid use ...
- sqlplus sys as sysdba
Enter user-name:sys Enter password:password as sysdba --以sys用户登陆的话 必须要加上 as sysdba 子句
- Linux 操作系统的权限为什么是1,2,4 而不是 1,2,3?如何用二进制来做权限管理
1.二进制做权限的优点 大家都知道,在Linux操作系统中,x - 可执行权限,w - 可写权限 , r - 可读权限.其权限值分别是1,2,4,但是有没有想过为什么是1,2,4 而不是 1,2,3 ...
- python中如何用sys.excepthook来对全局异常进行捕获、显示及输出到error日志中
使用sys.excepthook函数进行全局异常的获取. 1. 使用MessageDialog实现异常显示: 2. 使用logger把捕获的异常信息输出到日志中: 步骤:定义异常处理函数, 并使用该函 ...
随机推荐
- wamp,phpserver,xampp环境冲突
这几天在使用laravel5.2时 执行:php artisan migrate [PDOException] could not find driver 分析可能是以下情况造成 1 php.ini配 ...
- c#.net 获取时间日期年月日时分秒格式
今天写代码发现两个比较不错的分享下:1.DateTime.ParseExact很多时候我们获取的时间是数字形式表示的,好比20140127134015.927856,通过这个方法DateTime.Pa ...
- hdu_5831_Rikka with Parenthesis II(模拟)
题目链接:hdu_5831_Rikka with Parenthesis II 题意: 给你一些括号的排列,必须交换一次,能不能将全部的括号匹配 题解: 模拟一下括号的匹配就行了,注意要特判只有一对括 ...
- bullet_01
#include <btBulletDynamicsCommon.h> #include <osgViewer/Viewer> #include <map> #in ...
- yii框架中关于控制器中filter过滤器和外部action的使用
在yii框架中,控制器的过滤器分为执行前和执行后,这里举例是在执行控制器前的过滤. 需要在components/文件夹下定义公共的TestAction.php文件,并且实现run()方法.这个acti ...
- 判断手机电脑微信 js
if ((navigator.userAgent.match(/(MicroMessenger)/i))) { //微信浏览器 //location.href=""; } else ...
- NOIP2013-普及组复赛-第一题-计数问题
题目描述 Description 试计算在区间 1 到 n 的所有整数中,数字 x(0 ≤ x ≤ 9)共出现了多少次?例如,在 1到 11 中,即在 1.2.3.4.5.6.7.8.9.10.11 ...
- Notepad++ V6.9.0 中文绿色便携版
软件名称: Notepad++软件语言: 简体中文授权方式: 免费软件运行环境: Win 32位/64位软件大小: 3.4MB图片预览: 软件简介:Notepad中文版是一款非常有特色的编辑器,是开源 ...
- PHP ServerPush (推送) 技术
用来代替ajax的请求 转自:http://blog.163.com/bailin_li/blog/static/17449017920124811524364/ 需求: 我想做个会员站内通知的功能. ...
- cookie和session的区别(搜狐笔试考到的一个题目)
一.cookie机制和session机制的区别***************************************************************************** ...