现在想做Oracle数据库的备份和恢复 最后能给个实例代码 能直接运行的
解决方案 »
- 是不是可以通过固定执行计划 强制查询不通过索引
- 求教高手,orcale数据库报错,不能连接
- 如何利用7的客户端连接8
- 通过订单细目表shopcart更新商品表product销售量 SQL如何实现
- oracle安装默认用户都是做什么用的?oracle必须用的用户是哪几个?
- 为什么独立方式启动创建的数据库,在登录到OMS后,为什么没有这个数据库呢???
- 100分!备份问题-如何在用EXP命令导出备份文件时生成“XX当前日期.dmp"的文件?
- 在线求助 在windows下如何安装oracle(七张盘)
- 行合并重排
- .bash_profile 需要每次source
- 求Oracle课程设计,不用太复杂的
- 求一SQL查询语句!
--------物理备份的例子
SQL> set time on;
17:25:16 SQL> select count(*) from tiny.ftest;
COUNT(*)
----------
0
17:26:19 SQL> alter tablespace tiny begin backup;
表空间已更改。
17:26:38 SQL> alter tablespace tiny end backup;
表空间已更改。
17:27:02 SQL> insert into tiny.ftest select rownum from dual where rownum<=1000;
已创建 1 行。
17:27:40 SQL> insert into tiny.ftest select rownum from dual connect by rownum<=1000;
已创建1000行。
17:27:47 SQL> commit;
提交完成。
17:27:52 SQL> select count(*) from tiny.ftest;
COUNT(*)
----------
1001
17:28:16 SQL> select log_mode from v$database;
LOG_MODE
------------------------
ARCHIVELOG
17:29:15 SQL> shutdown immediate;
数据库已经关闭。
已经卸载数据库。
ORACLE 例程已经关闭。
17:29:45 SQL> startup;
ORACLE 例程已经启动。
Total System Global Area 192937984 bytes
Fixed Size 1248044 bytes
Variable Size 138413268 bytes
Database Buffers 50331648 bytes
Redo Buffers 2945024 bytes
数据库装载完毕。
ORA-01157: 无法标识/锁定数据文件 5 - 请参阅 DBWR 跟踪文件
ORA-01110: 数据文件 5: 'E:\ORACLE\PRODUCT\10.2.0\ORADATA\MYORCL\TINY01.DBF'
17:30:33 SQL> shutdown immediate;
ORA-01109: 数据库未打开
已经卸载数据库。
ORACLE 例程已经关闭。
17:30:51 SQL> startup mount;
ORACLE 例程已经启动。
Total System Global Area 192937984 bytes
Fixed Size 1248044 bytes
Variable Size 138413268 bytes
Database Buffers 50331648 bytes
Redo Buffers 2945024 bytes
数据库装载完毕。
17:36:09 SQL> recover datafile 'E:\oracle\product\10.2.0\oradata\myorcl\tiny01.dbf';
完成介质恢复。
17:37:17 SQL> alter database open;
C:\Documents and Settings\Administrator>exp system/123@pda file='c\pda.dmp' ;Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Produc
tion
With the Partitioning, OLAP and Data Mining options
EXP-00028: failed to open c\pda.dmp for write //这个报的什么错啊
Export file: EXPDAT.DMP >
'c\pda.dmp' --->''c:\pda.dmp' '
自己总结下 :Oracle 数据库基本的备份 首先要进入我们系统的【运行】 输入cmd 进入一个命令的cmd.exe程序
备份:exp username/password@database file=path tables=table
例子:exp system/123@pda tables=picture,pic file=d:\123\test1.dmp;恢复:Imp username/password@database file=path tables=table
Imp system/123@pda tables=pic,picture file=d:\123\test1.dmp;简单的备份