exp权限 oracle,如何用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-00108: invalid positional parameter value 'as'

EXP-00019: failed to process parameters, type 'EXP HELP=Y' for help

EXP-00000: Export terminated unsuccessfully

Or:

LRM-00108: invalid positional parameter value 'sysdba'

Or:

LRM-00108: Message 108 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-00105: 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):

1. 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.

2. 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.0 - Production on Fri Jun 25 07:39:46 2004

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

Username: sys/change_on_install@instance as sysdba

Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit Production

... etc.

3. 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:

1. 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

2. 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

3. The export parameters FLASHBACK_SCN and FLASHBACK_TIME cannot be used if the user that invoked the export is connected AS SYSDBA.

4. Known issues:

Bug 1616035 "EXPORT FAILED WITH ORA-1031 WHEN LOGIN AS SYSDBA" (not a public bug; fixed in 8.1.7.3 and higher)

Bug 2936288 "ORA-1925 OCCURS WHEN IMPORTING AS SYS ACCOUNT"

Bug 2996947 "EXP DID NOT RAISE ERROR WHEN SYSDBA EXPORTS WITH CONSISTENT=Y" (not a public bug; fixed in Oracle10g and higher)

References

Bug 2936288 - Ora-1925 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-00108 and EXP-00019

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-00079 or EXP-00080 Warning (Data in Table xxx is Protected) During Export

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
当使用Win10操作系统运行Oracle SQL*Plus时,遇到"insufficient privileges"或"权限不足"的错误提示时,可能是以下几种原因造成的: 1. 用户权限不足:在连接Oracle数据库时,使用的用户名可能没有足够的权限来执行操作。在Oracle中,sysdba是一个特殊的角色,拥有最高级别的系统权限。因此,确保您正在使用sysdba角色或具有等同权限的用户来连接。 2. 操作系统用户权限不足:在运行SQL*Plus之前,需要确保以管理员权限运行该命令。右键单击SQL*Plus快捷方式,选择“以管理员身份运行”选项来确保获得足够的权限。 3. Oracle安装问题:如果您刚刚安装了Oracle数据库,可能是由于安装过程中出现了错误或配置问题。您可以尝试重新安装Oracle,并确保在安装过程中选择正确的配置选项。 4. TNS名称问题:如果您使用TNS连接字符串来连接Oracle数据库,可能是由于TNS名称不正确造成的。请检查您的tnsnames.ora文件,并确保TNS名称与数据库实例名称匹配。 5. 环境变量问题:请确保在运行SQL*Plus之前,已正确设置ORACLE_HOME和PATH环境变量。这将确保您可以找到并使用正确的Oracle安装路径。 总之,如果遇到"win10 oracle sqlplus / as sysdba 权限不足"的问题,首先检查您使用的用户名和角色是否具有足够的权限。其次,确保您以管理员身份运行SQL*Plus,并且Oracle数据库安装和配置正确。最后,检查TNS名称和环境变量是否设置正确。如果问题仍然存在,建议查看相关的错误日志以获取更多详细信息来解决问题。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值