欢迎您访问我爱IT技术网,今天小编为你分享的电脑教程是通过网络精心收集筛选的最优节选:“【oracle还原备份】Oracle数据库还原和备份向导文件制作-电脑软件--电脑-游戏-数码”,请注意:文中所谈及的内容不代表本站的真正观点,也请不要相信各种联系方式。下面是关于网络上【oracle还原备份】Oracle数据库还原和备份向导文件制作-电脑软件--电脑-游戏-数码的整理详细信息
操作前的准备
首先我们要查看下我们的电脑“环境变量”:“Path”和“PATHEXT”,保证imp命令和exp命令在cmd DOS界面中可以正常使用。
1、“Path”环境变量:作用是告诉系统当遇到无法识别的命令时自动去Path所列出的目录中寻找相应文件(程序);
2、“PATHEXT”环境变量:作用是告诉系统当遇到无法识别的命令时自动补全PATHEXT中所列的后缀名并寻找相应的文件(程序);
查看和编辑环境变量的步骤详情请见当前方法步骤配的图片,总共5张图片;
win7:右键点击【计算机】——>【高级系统设置】——>【高级】——>【环境变量】
xp:右键【我的电脑】——>【高级】——>【环境变量】
“Path”环境变量只要写到你oracle安装路径下的BIN文件夹即可;“PATHEXT”环境变量要看看是否已经有“.EXE;”或者“.exe”即可,如果没有请添加“.EXE;”





我们先来看下制作完成的界面:黑色的DOS界面,大家只要根据该向导就可以导出我们oracle数据库的备份了!

首先创建一个txt文本文档,将下面的代码拷贝进去,然后把后缀名改为".bak"的就可以了!这样一个简单的oracle数据库导出向导就这样的完成了!
代码:
@echo offtitle ORACLE数据库备份和还原向导
cls
echo.
echo Welcome to use the ORACLE database backup and restore wizard
echo to backup and restore the ORACLE database echo.
echo Author:伊夏诺^&紫色年华 --- 2014/02/27
echo.
echo Operational preparation:
echo 使用前请大家确认一下系统环境变量"Path"中没有自己安装的目录的BIN路径,
echo 还有环境变量"PATHEXT"中已经配置了".EXE;"或".exe;"
echo.
echo==STEP 1==Choose the kind operation
echo 1) exp: export oracle data backup;
echo 2) imp: import the oracle database backup;
echo 3) exit: The end of the;
echo.
:op
set /p operation=Your operation option: if "%operation%"=="exp" goto export
if "%operation%"=="imp" goto import
if "%operation%"=="exit" goto end
if not "%operation%"=="exp" (
if not "%operation%"=="imp" (
if not "%operation%"=="exit" (
echo Wrong, there is no "%operation%" options! Please "imp" from the "exp" options, options, options in the "exit" select your operating options! echo.
goto op
)
)
)
@REM export oracle data backup
:export
echo You select the export operation, please continue to export conditions according to the guide configuration; We will provide better service for you!
REM :reSetExp
echo.
echo==STEP 2==Configure the account
set /p username=UserName:
set /p password=Password:
echo.
echo==STEP 3==Configuration to export the database backup file storage path
set /p file=Storage Path:
echo.
echo==STEP 4==Choose export data range
echo A) Export the entire database
echo B) All the table space which belongs to user
echo C) Export to specify the tablespace
set /p scope=Export data range:
if "%scope%"=="A" goto full
if "%scope%"=="B" goto owner
if "%scope%"=="C" goto tablespace
:full
echo.
echo==STEP 5==Configure the database name
set /p database=Database:
exp %username%^/%password%@%database% file=%file% full=y
echo.
echo Export to complete!
echo Backup file storage path: %file%
pause
goto end
:owner
echo.
exp %username%^/%password% file=%file% owner=%username%
echo Export to complete!
echo Backup file storage path: %file%
pause
goto end
:tablespace
echo.
echo==STEP 5==Configure the database name and tablespaces
set /p database=Database:
set /p tablespace=Tablespace:
exp %username%^/%password%@%database% file=%file% tablespaces=%tablespace%
echo Export to complete!
echo Backup file storage path: %file%
pause
goto end
@REM import the oracle database backup
:import
echo You chose the import operation, please continue to import conditions
according to the guide configuration; We will provide better service for you!
:reSetImp
echo.
echo==STEP 2==Configure the account
set /p username=UserName:
set /p password=Password:
echo.
echo==STEP 3==Configure the database name
set /p database=Database:
echo.
echo==STEP 4==Configuration to import the database backup file storage path
set /p file=Storage Path:
echo.
echo==STEP 5==Choose import data range
echo 1) full: Import the entire database
echo 2) part: Import, part of the data in the database can not be used at present
set /p scope=Import data range:
imp %username%^/%password%^@%database% file=%file% full=y
pause
goto end
@REM The end of the
:end
echo The upcoming wizard...
exit
下面是最终的文件:

用户类似问题:
问题1:怎样用 oraclesqldeveloper 备份还原数据库
1 导出存储过程,触发器,序列等所有用户对象。(备份) 在PL/SQL Developer的菜单Tools(工具) => Export User Objects(导出用户对象)中出来一个对话框界面 建议红色框住部分都不选,这样执行这个sql 时,就根据当前你的登录账户来进行创建。 ... >>详细
问题2:如何还原oracle数据库的备份文件
一、 导出/导入(export/import) ---- 利用export可将数据从数据库中提取出来,利用import则可将提取出来的数据送回oracle数据库中去。 ---- 1. 简单导出数据(export)和导入数据(import) ---- oracle支持三种类型的输出: ---- (1)表方式... >>详细
问题3:怎么完全备份ORACLE数据库,并在另一台电脑上恢复。
Oracle10G数据库中,数据库文件的备份与恢复可以有很多的方式来实现,这里介绍一种基于用户管理的备份与恢复。基于用户管理的备份是指使用OS命令来备份数据库物理文件。 备份数据库 数据库一致性备份:关闭数据库以后备份数据库物理文件,这时数... >>详细
问题4:oracle数据库的备份与恢复问题
可以采用以下方法Oracle数据导入导出imp/exp就相当于oracle数据还原与备份。exp命令可以把数据从远程数据库服务器导出到本地的dmp文件,imp命令可以把dmp文件从本地导入到远处的数据库服务器中。 利用这个功能可以构建两个相同的数据库,一个用... >>详细
问题5:Oracle如何用一个数据库的备份对另一个数据库进行...
照你说B应该是临时备用库,你可以先将B的数据导出为文件,然后拷贝到A中导入。 可用用sqlldr或数据泵实现。 >>详细
- 评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
-
