千万火急求救,高分赠送,怎样备份oracle数据库所有对象(包括表,存储过程,函数,触发器…)

时间:2022-12-09 13:53:14
其中表里的数据我不要,如果不可以做这样的备份,
是否有办法导出这些对象的脚本,我说的是批量导出,而不是一个一个导,因为有好几百个对象,
各位高手,请不吝指教!!

13 个解决方案

#1


磁带机可能要保险一些。在Unix环境下有相关的Backup/Restore工具。
若要增量备份,应研究一下Oracle的数据库管理工具。

#2


开始-运行-CMD-exp system/manager@表名

#3


简单办法,用 oracle 提供的 exp 程序,该程序可命令行执行,参数如下:

Export: Release 8.1.6.0.0 - Production on Wed Nov 6 11:45:38 2002

(c) Copyright 1999 Oracle Corporation.  All rights reserved.



You can let Export prompt you for parameters by entering the EXP
command followed by your username/password:

     Example: EXP SCOTT/TIGER

Or, you can control how Export runs by entering the EXP command followed
by various arguments. To specify parameters, you use keywords:

     Format:  EXP KEYWORD=value or KEYWORD=(value1,value2,...,valueN)
     Example: EXP SCOTT/TIGER GRANTS=Y TABLES=(EMP,DEPT,MGR)
               or TABLES=(T1:P1,T1:P2), if T1 is partitioned table

USERID must be the first parameter on the command line.

Keyword  Description (Default)        Keyword      Description (Default)
--------------------------------------------------------------------------
USERID   username/password            FULL         export entire file (N)
BUFFER   size of data buffer          OWNER        list of owner usernames
FILE     output files (EXPDAT.DMP)    TABLES       list of table names
COMPRESS import into one extent (Y)   RECORDLENGTH length of IO record
GRANTS   export grants (Y)            INCTYPE      incremental export type
INDEXES  export indexes (Y)           RECORD       track incr. export (Y)
ROWS     export data rows (Y)         PARFILE      parameter filename
CONSTRAINTS export constraints (Y)    CONSISTENT   cross-table consistency
LOG      log file of screen output    STATISTICS   analyze objects (ESTIMATE)
DIRECT   direct path (N)              TRIGGERS     export triggers (Y)
FEEDBACK display progress every x rows (0)
FILESIZE maximum size of each dump file
QUERY    select clause used to export a subset of a table

The following keywords only apply to transportable tablespaces
TRANSPORT_TABLESPACE export transportable tablespace metadata (N)
TABLESPACES list of tablespaces to transport

Export terminated successfully without warnings.

#4


具体你要怎么倒只要设置其中参数即可,例如你不要数据只需:ROWS=N

#5


使用export导出,具体的参数你需要找相关文档看一看,肯定可以实现你的目的。

#6


用PL/SQL Developer 工具用菜单就可以把你需要的对象一次倒出成脚本

#7


可可兄,PL/SQL Developer 工具菜单里只有export tables,其他怎么办???

#8


exp test/test@sun FILE=test.dmp COMPRESS=Y GRANTS=Y INDEXES=Y ROWS=N LOG=test.txt TRIGGERS=Y

#9


上述语句中,@sun是服务名,如果直接在数据库服务器上,可不要。
test.txt 是你本次倒出时的日志。

#10


就用exp就可以解决问题了,设置rows=n
不会导出数据,也可以导出你需要的其它对象

#11


PL/SQL Developer /Tools/Export User Objects
不懂再来问

#12


使用export就可以
不导出数据
exp user/pass@server file=demo.dmp row=n log=demo.log feedback=100
.....
可以查看exp help=y

#13


谢谢,我决定每人都给分,虽然你们不是为了取分。

#1


磁带机可能要保险一些。在Unix环境下有相关的Backup/Restore工具。
若要增量备份,应研究一下Oracle的数据库管理工具。

#2


开始-运行-CMD-exp system/manager@表名

#3


简单办法,用 oracle 提供的 exp 程序,该程序可命令行执行,参数如下:

Export: Release 8.1.6.0.0 - Production on Wed Nov 6 11:45:38 2002

(c) Copyright 1999 Oracle Corporation.  All rights reserved.



You can let Export prompt you for parameters by entering the EXP
command followed by your username/password:

     Example: EXP SCOTT/TIGER

Or, you can control how Export runs by entering the EXP command followed
by various arguments. To specify parameters, you use keywords:

     Format:  EXP KEYWORD=value or KEYWORD=(value1,value2,...,valueN)
     Example: EXP SCOTT/TIGER GRANTS=Y TABLES=(EMP,DEPT,MGR)
               or TABLES=(T1:P1,T1:P2), if T1 is partitioned table

USERID must be the first parameter on the command line.

Keyword  Description (Default)        Keyword      Description (Default)
--------------------------------------------------------------------------
USERID   username/password            FULL         export entire file (N)
BUFFER   size of data buffer          OWNER        list of owner usernames
FILE     output files (EXPDAT.DMP)    TABLES       list of table names
COMPRESS import into one extent (Y)   RECORDLENGTH length of IO record
GRANTS   export grants (Y)            INCTYPE      incremental export type
INDEXES  export indexes (Y)           RECORD       track incr. export (Y)
ROWS     export data rows (Y)         PARFILE      parameter filename
CONSTRAINTS export constraints (Y)    CONSISTENT   cross-table consistency
LOG      log file of screen output    STATISTICS   analyze objects (ESTIMATE)
DIRECT   direct path (N)              TRIGGERS     export triggers (Y)
FEEDBACK display progress every x rows (0)
FILESIZE maximum size of each dump file
QUERY    select clause used to export a subset of a table

The following keywords only apply to transportable tablespaces
TRANSPORT_TABLESPACE export transportable tablespace metadata (N)
TABLESPACES list of tablespaces to transport

Export terminated successfully without warnings.

#4


具体你要怎么倒只要设置其中参数即可,例如你不要数据只需:ROWS=N

#5


使用export导出,具体的参数你需要找相关文档看一看,肯定可以实现你的目的。

#6


用PL/SQL Developer 工具用菜单就可以把你需要的对象一次倒出成脚本

#7


可可兄,PL/SQL Developer 工具菜单里只有export tables,其他怎么办???

#8


exp test/test@sun FILE=test.dmp COMPRESS=Y GRANTS=Y INDEXES=Y ROWS=N LOG=test.txt TRIGGERS=Y

#9


上述语句中,@sun是服务名,如果直接在数据库服务器上,可不要。
test.txt 是你本次倒出时的日志。

#10


就用exp就可以解决问题了,设置rows=n
不会导出数据,也可以导出你需要的其它对象

#11


PL/SQL Developer /Tools/Export User Objects
不懂再来问

#12


使用export就可以
不导出数据
exp user/pass@server file=demo.dmp row=n log=demo.log feedback=100
.....
可以查看exp help=y

#13


谢谢,我决定每人都给分,虽然你们不是为了取分。