用惯了微软和Mysql数据库,第一次用Oracle数据库开发,在公司共享数据库,但是想回家开发,不知道如何能够备份数据库,主要是字段中有Blob 类型的数据,用PLSQL Developer备份的不能恢复,我想Oracle作为全球性的数据库,一定有图形化的备份界面吧以下是我的情况,Oracle数据库装在公司的服务器上,我有管理员的登录账号,能够远程登录查看数据库,用MyEclipse也能查看,但是不知道如何全部备份,我请教一下各位,问下看有没有图形化的备份界面,能够远程完全备份Oracle数据库的,在这里先谢过了,我的邮件是[email protected],请也发一份答案到我的邮箱里面
rem date:11.09.2008
rem desc:backup all database datafile in archive--connect database
--connect internal/password;
connect / as sysdba;--archive
alter system archive log current;
--startalter tablespace system begin backup;
host xcopy F:\oracle\oradata\oradb\system01.dbf f:\bak2/H/R;
alter tablespace system end backup;alter tablespace cwmlite begin backup;
host xcopy F:\oracle\oradata\oradb\cwmlite01.dbf f:\bak2/H/R;
alter tablespace cwmlite end backup;alter tablespace users begin backup;
host xcopy F:\oracle\oradata\oradb\users01.dbf f:\bak2/H/R;
alter tablespace users end backup;alter tablespace tools begin backup;
host xcopy F:\oracle\oradata\oradb\tools01.dbf f:\bak2/H/R;
alter tablespace tools end backup;alter tablespace indx begin backup;
host xcopy F:\oracle\oradata\oradb\indx01.dbf f:\bak2/H/R;
alter tablespace indx end backup;alter tablespace example begin backup;
host xcopy F:\oracle\oradata\oradb\example01.dbf f:\bak2/H/R;
alter tablespace example end backup;alter tablespace ts_test begin backup;
host xcopy F:\oracle\oradata\oradb\test01.dbf f:\bak2/H/R;
alter tablespace ts_test end backup;
--end--bak control file
--binary
alter database backup controlfile to 'f:\bak2\controlbinbak.000';
--ascii
alter database backup controlfile to trace;alter system archive log current;
导出用expdp
expdp system directory=data_pump_dir dumpfile=myfile.dmp logfile=myfile.log schemas=用户1,用户2,..,用户n找到myfile.dmp文件,在导出时显示的日志记录中最后几行会出现myfile.dmp的文件路径,copy出来.
导入,注意要把myfile.dmp文件copy到data_pump_dir目录对象指定的路径下,data_pump_dir路径这样找sqlplus / as sysba
SQL>SELECT directory_path from dba_directories where directory_name='DATA_PUMP_DIR';开始导入impdp system directory=data_pump_dir dumpfile=myfile.dmp logfile=aa.log remap_schema=用户1:用户1,用户2:用户2,..,用户n:用户n
exp cdfs/7226631 file='/oradata/cdfs.dmp' full=y1.在生产机器上把数据导出
exp cdfs/7226631 file='/oradata/cdfs.dmp' owner=cdfs 2.在备份机器上建立相关用户,表空间,赋予相应权限
用oem建立相关的用户,表空间,做赋予权限工作
如果是全库,要给用户赋予
exp_full_database
import_full_database
这样,用户在做全库备份还原的时候才不会出错。3.在备份机器上做import操作
imp userid=cdfsxt/cdfsxt@cdcz02 fromuser=cdfsxt touser=cdfsxt file='/oradata/cdfsxt.dmp'
全库备份的话,敲这个命令
imp userid=cdfsxt/cdfsxt@cdcz02 full=y file='/oradata/cdfsxt.dmp'4.exp/IMP,以及在9i下用SYS用户来执行exp/IMP时,都需要使用SYSDBA才可。我们可以使用下面方式连入exp/IMP:exp "'sys/sys as sysdba'" file=1.dmp tables=gototop.t rows=n
exp "'sys/oracle as sysdba'" file='/home/oracle/bakup.dmp' full=y