网站首页
JSP空间
动态资讯
开源项目
技术文档
资源下载
J2EE资源
客户论坛
在线支付
 
  技术文档>>数据库技术>>Oracle技术>>Oracle开发>查看文档  
  详细讲解oracle数据库10g rman的备份过程     
  文章作者:未知  文章来源:赛迪网技术社区  
  查看:119次  录入:管理员--2008-05-07  
 

【赛迪网-it技术报道】1.首先查看一下oracle的数据文件

sql> select name from v$datafile;

name

-------------------------------------

/dev/rora_system

/dev/rora_undo1

/dev/rora_sysaux

/dev/rora_users

/dev/rora_example

2.建立rman所需的表空间,这里采用裸设备“/dev/rora_backup”

sql> create tablespace ora_backup datafile'/dev/rora_backup' size 500m;

tablespace created.

进行查看确认

sql> select name from v$datafile;

name

----------------------------------------

/dev/rora_system

/dev/rora_undo1

/dev/rora_sysaux

/dev/rora_users

/dev/rora_example

/dev/rora_backup

6 rows selected.

已经发现ora_backup表空间

3.建立rman用户以及设定密码和用户表空间

sql> create user rman identified by rman default tablespace ora_backup temporay tablespace temp

2 ;

create user rman identified by rman default tablespace ora_backup temporay tablespace temp

*

error at line 1:

ora-00922: missing or invalid option

在此处出错,原来是temporay打错,继续。

sql> create user rman identified by rman default tablespace ora_backup temporary tablespace temp;

user created.

呵呵,成功

4.给用户授权

sql> grant connect,resource,recovery_catalog_owner to rman

2 ;

grant succeeded.

5.连接到数据库

sql> rman target 'zhirui' catalog rman/rman

sp2-0734: unknown command beginning "rman targe..." - rest of line ignored.

呵呵,又出错了,没退出sql。

sql> exit

disconnected from oracle database 10g enterprise edition release 10.2.0.1.0 - 64bit production

with the partitioning, olap and data mining options

$ rman target 'zhirui'catalog rman/rman

这下应该可以了吧

argument value description

-----------------------------------------------------

target quoted-string connect-string for target database

catalog quoted-string connect-string for recovery catalog

nocatalog none if specified, then no recovery catalog

cmdfile quoted-string name of input command file

log quoted-string name of output message log file

trace quoted-string name of output debugging message log file

append none if specified, log is opened in append mode

debug optional-args activate debugging

msgno none show rman-nnnn prefix for all messages

send quoted-string send a command to the media manager

pipe string building block for pipe names

timeout integer number of seconds to wait for pipe input

checksyntax none check the command file for syntax errors

-----------------------------------------------------------------------------

both single and double quotes (' or ") are accepted for a quoted-string.

quotes are not required unless the string contains embedded white-space.

rman-00571: ===========================================================

rman-00569: =============== error message stack follows ===============

rman-00571: ===========================================================

rman-00552: syntax error in command line arguments

rman-01009: syntax error: found "rman": expecting one of: "append, at, auxiliary, catalog, cmdfile, clone, checksyntax,"

rman-01007: at line 2 column 1 file: command line arguments

恩?怎么回事?

$ rman

recovery manager: release 10.2.0.1.0 - production on fri may 25 00:37:24 2007

copyright (c) 1982, 2005, oracle. all rights reserved.

rman> connect catalog rman/rman

connected to recovery catalog database

rman> exit

recovery manager complete.

可以连接呀,再来

$ rman target 'zhirui' catalog rman/rman

recovery manager: release 10.2.0.1.0 - production on fri may 25 00:38:13 2007

copyright (c) 1982, 2005, oracle. all rights reserved.

target database password:

connected to target database: zhirui (dbid=1679784276)

connected to recovery catalog database

恩,连接进去了。

6.注册数据库

rman> register database;

rman-00571: ===========================================================

rman-00569: =============== error message stack follows ===============

rman-00571: ===========================================================

rman-03002: failure of register command at 05/25/2007 00:38:55

rman-06428: recovery catalog is not installed

出错,recovery catalog is not installed

rman> register database zhirui;

rman-00571: ===========================================================

rman-00569: =============== error message stack follows ===============

rman-00571: ===========================================================

rman-00558: error encountered while parsing input commands

rman-01009: syntax error: found "identifier": expecting one of: ";"

rman-01008: the bad identifier was: zhirui

rman-01007: at line 1 column 19 file: standard input

rman-00571: ===========================================================

rman-00569: =============== error message stack follows ===============

rman-00571: ===========================================================

rman-00558: error encountered while parsing input commands

rman-01009: syntax error: found ";": expecting one of: "allocate, alter, backup, beginline, blockrecover, catalog, chan"

rman-01007: at line 1 column 25 file: standard input

7.建立catalog表空间到ora_backup

rman> create catalog tablespace ora_backup

recovery catalog created

这下可以注册了吧。

rman> register database;

database registered in recovery catalog

starting full resync of recovery catalog

full resync complete

注册成功

8.尝试备份全库

rman> run {

2> allocate channel dev1 type disk;

3> backup

4> format '/home/oracle/data/db_t%t_s%s_p%p'

5> (database);

6> release channel dev1;

7> }

allocated channel: dev1

channel dev1: sid=159 devtype=disk

starting backup at 25-may-07

channel dev1: starting full datafile backupset

channel dev1: specifying datafile(s) in backupset

input datafile fno=00006 name=/dev/rora_backup

input datafile fno=00001 name=/dev/rora_system

input datafile fno=00003 name=/dev/rora_sysaux

input datafile fno=00005 name=/dev/rora_example

input datafile fno=00002 name=/dev/rora_undo1

input datafile fno=00004 name=/dev/rora_users

channel dev1: starting piece 1 at 25-may-07

至此,成功。

 
 
上一篇: oracle数据库内存参数调优技术的个人总结 (1)    下一篇: 在设计数据库时如何选择正确的数据类型
  相关文档
一个完整的oracle rman备份恢复参考示例 05-29
利用Oracle管理服务器将数据导入导出 04-11
Oracle巧取指定记录以及巧用外关联查询 07-07
教你轻松掌握数据库链路的建立和使用 (1) 05-06
Oracle和MySQL的一些简单命令对比 04-11
杜绝安全隐患被忽视的Oracle安全问题 04-23
详细讲解各种数据库使用jdbc连接的方式 03-28
数据库迁移过程中使用热备份进行分时恢复 (1) 05-14
巧用oracle备份集在测试机上做不完全恢复 06-13
Oracle与FoxPro两数据库的数据转换 05-13
oracle dbms_job:每隔特定时间执行特定任务 08-05
轻松掌握"0racle-07445"错误的解决步骤 03-03
oracle数据库中关于"null"排序的问题 01-25
实例讲解表碎片的具体起因及解决的办法 (1) 02-25
Oracle 数据库集中复制方法逐步精细 05-27
数据变更日志记录表及触发器的自动生成脚本 03-04
讲解数据仓库实施过程所需要考虑的步骤 02-20
怎样获取或记录 oracle 语句的执行时间 11-21
使用_disable_logging即可禁止日志的生成 (1) 05-16
实例解析:用Oracle创建实例的参数需求 09-01
返回首页 | 关于我们 | J网章程 | JSP空间合租 | 客服中心 | 免责声明 | 常见问题 | 参观机房
本站主机空间代理至厦门市华众网络科技有限公司
《中华人民共和国增值电信业务经营许可证》
编号:闽B2-20050079
@2005-2008福建JSP技术网 版权所有 闽ICP备05000928号
厦门(总部):13616026886 福州:0591-87655121
邮箱:admin@fjjsp.com 站长QQ,点击这里给我发消息