频道直达:新闻 - 组网 - 安全 - 服务器 - 存储 - 系统 - 应用 - 开发 - 数据库 - 前沿 - 技术人 - 培训 - 求职 - 读书 - 教程 - 专题 - 产品 - 案例 - 技术圈 - 博客 - BBS
51CTO.COM_中国领先的IT技术网站
找资料:

DBA的工作列表上写了些什么(1)

作者: 佚名 出处:51CTO.com 2007-09-21 12:56    砖    好    评论   进入论坛
阅读提示:本文介绍了数据库管理员(DBA)的主要工作,包括启动和关闭数据库、备份与恢复等,供大家参考!

一、启动和关闭数据库

一)启动数据库

$ svrmgrl
SVRMGR> connect internal (实例启动)
SVRMGR> startup

二)关闭数据库

$ svrmgrl
SVRMGR> connect internal
SVRMGR> shutdown [immediate/abort]

immediate:正在访问数据库的会话被完全终止、资源有序释放后才关闭数据库。

abort:会话立即中止,数据库立即关闭。

二、备份与恢复

一)逻辑备份与恢复(即卸库与装库)

1、卸库:export

不带参数:

$ cd $ORACLE_HOME/bin
$ exp
Username: cwadmin
Password:
Connected to: Oracle8 Enterprise Edition Release 8.0.4.0.0 - Production
PL/SQL Release 8.0.4.0.0 - Production
Enter array fetch buffer size: 4096 >
Export file: expdat.dmp >pzexdat.dmp
(1) E(ntire database), (2)U(sers), or (3)T(ables): (2)U >1
Export grants (yes/no): yes >y
Export table data (yes/no): yes >y
Compress extents (yes/no): yes >y

export工作开始自动进行最终出现:

Export terminated successfully without warnings.

带参数,可选参数如下(可用exp help=y 得到):

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 file (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)
FEEDBACK display progress every x rows (0)
POINT_IN_TIME_RECOVER Tablespace Point-in-time Recovery (N)
RECOVERY_TABLESPACES List of tablespace names to recover
VOLSIZE number of bytes to write to each tape volume

例:$exp userid=cwadmin/cwadmin tables=‘(sys_cwxx,sys_menu)’ file=pzexport.dmp

2、装库

1)不带参数

$ cd $ORACLE_HOME/bin
$ imp
Username: cwadmin
Password:
Connected to: Oracle8 Enterprise Edition Release 8.0.4.0.0 - Production
PL/SQL Release 8.0.4.0.0 - Production
Import file: expdat.dmp >pzexdat.dmp
Enter insert buffer size (minimum is 4096) 30720> 10240
Export file created by EXPORT:V08.00.04 via conventional path
List contents of import file only (yes/no): no >
Ignore create error due to object existence (yes/no): no >y
Import grants (yes/no):yes >y
Import table data (yes/no):yes >y
Import entire export file (yes/no):no >y

import 工作开始自动进行最终出现:

Import terminated successfully with warnings.

带参数,可选参数如下(可用imp help=y 得到):

Keyword Description (Default) Keyword Description (Default)
USERID username/password FULL import entire file (N)
BUFFER size of data buffer FROMUSER list of owner usernames
FILE input file (EXPDAT.DMP) TOUSER list of usernames
SHOW just list file contents (N) TABLES
list of table names
IGNORE ignore create errors (N) RECORDLENGTH length of IO record
GRANTS import grants (Y) INCTYPE incremental import type
INDEXES import indexes (Y) COMMIT commit array insert (N)
ROWS import data rows (Y) PARFILE parameter filename
LOG log file of screen output
DESTROY overwrite tablespace data file (N)
INDEXFILE write table/index info to specified file
CHARSET character set of export file (NLS_LANG)
POINT_IN_TIME_RECOVER Tablespace Point-in-time Recovery (N)
SKIP_UNUSABLE_INDEXES skip maintenance of unusable indexes (N)
ANALYZE execute ANALYZE statements in dump file (Y)
FEEDBACK display progress every x rows(0)
VOLSIZE number of bytes in file on each volume of a file on tape

例:$imp userid=cwadmin/cwadmin tables=‘(sys_dwxx, sys_menu)’ file=pzexdat.dmp


共2页: 1 [2] 下一页
【内容导航】
关于 DBA  工作  列表
专题
访问控制列表(ACL)介绍
Sun以10亿美元并购开源数据库厂商MySQL
甲骨文Oracle 11g正式发布
Oracle数据库开发之PL/SQL基础应用
Oracle数据库开发基础教程
我也说两句

匿名发表

(如果看不清请点击图片进行更换)


中 国 领 先 的 IT 技 术 网 站 ·
技 术 成 就 梦 想
·SQL Server入门到精通 (查看120205次)
·SQL Server 2008/2005全解 (查看100798次)
·Oracle数据库开发指南 (查看48189次)
·MySQL数据库备份 (查看46621次)
·Oracle SQL 内置函数大全 (查看44460次)
订阅技术快讯
电子杂志下载
名称:SQL Server数据库管理精品黄皮书
简介:书中文章经过精挑细选,便于用户能根据自己的实际工作和学习,快速在本书寻找到相关资料。内容涵盖了SQL Server的安装与升级、语句查询、数据备份和恢复、自动化任务、数据同步、数据字典、安全和预防、性能和优化、集群等各方面应用信息,以及DBA管理人员在数据库管理工作中
名称:2007路由技术大全
简介:《2007路由技术大全》由51CTO.com网站特别策划制作,该书包括路由器技术、路由器产品、路由器配置、安全设置、路由器故障处理、路由器密码恢复,以及广大网友在实践使用中的心得经验和技巧文章,内容注重实用性,适用于初学者入门,也适合多年从业者提高,是一本实践和理论完
名称:网络安全精品应用黄皮书
简介:《2007精品网络安全黄皮书》包括了9个大类24个小类, 800余篇文章,内容包含了熊猫烧香病毒、DDOS攻击、ARP病等热点问题的介绍及解决方案。从病毒查杀、防范、系统、数据等各方面的安全设置到黑客技术的了解、防范,涉及到了安全应用的全部领域, 由浅至深内容全面。