ORACLE 如何用sys用户exp整个数据库

来源:百度知道 编辑:UC知道 时间:2024/06/09 07:30:42
我用批处理+计划任务备份oracle数据库,是用sys(注意不是system)用户备份所有其他用户的表空间,系统是Win2003,以前oracle9i的时候是好用的,升级到了10g就不好用了,批处理写的是exp "sys/password@orcl" full=y file=D:\bakoracle\data\ORACLE_DB_BACKUP%date:~0,20%.dmp

提示信息:
EXP-00056: 遇到 ORACLE 错误 28009
ORA-28009: connection to sys should be as sysdba or sysoper
用户名:
已经尝试过用 as sysdba的方法,但加到哪里都报错,提示AS参数无效或者userid不允许多个值之类的东西,请大虾帮帮忙,帮我写一句好用的出来,多谢多谢
回nw5452:对的,是为了备份,因为sys能导出所有用户的表,其他的信息就无所谓了,反正空间足够不是问题,您给的办法不是也用的system用户么,我只想用sys用户,能给我解决么?
回tingfeng85:这个在9i的时候确实是可以的,但是10g不行,我已经试过很多次了

这样吧,在cmd中输入 exp根据提示做吧,那样是可以输入【sys/password@orcl as sysdba】的。

测试log:
C:\Documents and Settings\admin>exp

Export: Release 10.1.0.2.0 - Production on 星期四 8月 6 07:42:28 2009

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

Username: sys/oracle@ora1 as sysdba full='Y'

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

---
以上,希望对你有所帮助。

exp 'sys/change_on_install@instance as sysdba' tables=scott.emp

看看这个对不。

如果是10g的话,建议使用数据泵
expdp system/password dumpfile=file_name.dmp full=y log=expdp.log
不过我有疑问的是,你做全库导出的是为了备份吗?
一般情况下,只要expdp出来应用用户或schema即可。导出很多system表空间的一些信息感觉没什么用的

exp "sys/password@orcl AS SYSDBA"这样写是可以的

没有Connection权限,你给他权限就可以了