Oracle命令--导出表结构和表数据
备份
命令详解
exp full=y file=/opt/oracle/dbbackup/imapdb/20120416/201204016.dmp log=/opt/oracle/dbbackup/imapdb/20120416/20120416.log exp: 备份命令字
:数据库⽤户名/数据库密码@数据库实例名
full=y: 全量备份
file=/opt/oracle/dbbackup/imapdb/20120416/201204016.dmp : 备份的⽬的⽂件
oracle数据库表结构怎么看
log=/opt/oracle/dbbackup/imapdb/20120416/20120416.log :备份过程中的⽇志
oracle数据库恢复:
删除数据库表和表空间:
登录oracle数据库:sqlplus -L -S
drop tablespace IMAP_DB including contents and datafiles cascade constraints; //IMAP_DB为oracle表名称
commit; //提交数据库操作
恢复oracle数据库:
imp full=y file=/opt/oracle/dbbackup/imapdb/20120416/201204016.dmp DESTROY=y
log=/opt/oracle/dbbackup/imapdb/20120416/20120416.log
补充:sybase数据库备份和恢复
登录sybase数据库:isql -S$DB_SRV_NAME -U$DB_USER -P$DB_PWD
备份sybase数据库:dump database alarmdb to "/export/dbBackup/alarmdb_dump"
go
alarmdb为数据库实例名,/export/dbBackup/alarmdb_dump为备份路径和⽂件名.
恢复sybase数据库:load database alarmdb from "/export/dbBackup/alarmdb_dump"
go
alarmdb为数据库实例名,/export/dbBackup/alarmdb_dump为备份路径和⽂件名.
⽰例
:~> exp full=y file=/opt/oracle/dbbackup/imapdb/20120416/201204016.dmp log=/opt/oracle/dbbackup/imapdb/20120416/20120416.log Export: Release 11.1.0.6.0 - Production on Tue Apr 17 14:54:42 2012
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing option
Export done in ZHS16GBK character set and UTF8 NCHAR character set
About to export the entire database ...
. exporting tablespace definitions
. exporting profiles
. exporting user definitions
. exporting roles
. exporting resource costs
. exporting rollback segment definitions
. exporting database links
. exporting sequence numbers
. exporting directory aliases
. exporting context namespaces
. exporting foreign function library names
.
exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions
. exporting system procedural objects and actions
常见错误
数据库⽤户名或密码错
:~> exp full=y file=/opt/oracle/dbbackup/imapdb/20120416/201204016.dmp log=/opt/oracle/dbbackup/imapdb/20120416/20120416.log Export: Release 11.1.0.6.0 - Production on Tue Apr 17 14:59:12 2012
Copyright (c) 1982, 2007, Oracle. All rights reserved.
EXP-00056: ORACLE error 1017 encountered
ORA-01017: invalid username/password; logon denied
Username:
命令名字写错
:~> export full=y file=/opt/oracle/dbbackup/imapdb/20120416/201204016.dmp log=/opt/oracle/dbbackup/imapdb/20120416/20120416.log -bash: export: : not a valid identifier
:~>
[ 编辑本段 ]  [ 回⽬录 ]恢复
[ 编辑本段 ]  [ 回⽬录 ]相关命令
[ 编辑本段 ]  [ 回⽬录 ]帮助:
:~> exp help=y
:~> imp help=y

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。