天空之城竹笛f调演奏:DBA的工作列表上写了些什么?
来源:百度文库 编辑:偶看新闻 时间:2024/05/04 18:40:08
DBA的工作列表上写了些什么?
数据库管理员(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: 40Array6 >
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. 装库:
不带参数
$ 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 40Array6) 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
二) 物理备份与恢复
1. 冷备份与热备份
冷备份
在数据库关闭状态与进行。将所有的数据文件、重演日志文件及控制文件拷贝到磁盘。空闲的时间再将备份移到磁带上。
(1)可通过:SVRMGR> select * from v$logfile;
select * from v$dbfile;
select * from v$control.file;
这些语句来了解数据文件、重演日志文件及控制文件的相应位置及名称。
(2)利用$cp 命令来拷贝:
例:$cp /u01/u02/pz_ts.ora /dbfile_b/
热备份
数据库必须工作在“ARCHIVELOG”方式下
可利用SVRMGR> archive log list 语句来查归档日志状态
若在“NOARCHIVELOG”方式下,进行转换
SVRMGR> connect internal
SVRMGR> shutdown immediate ---关闭数据库---
SVRMGR> startup mount ---为暂停日志方式转换准备数据库---
SVRMGR> alter database archivelog; ---转换---
SVRMGR> alter database open; ---打开数据库---
拷贝
1> 将一个表空间置为备份方式
SVRMGR> alter tablespace pzts begin backup;
2> 拷贝
SVRMGR>$cp /u01/u02/pz_ts.ora /dbfile_b/
3> 取消该表备份方式
SVRMGR>alter tablespace pzts end backup;
利用以上3步,将所有表空间下的数据文件进行备份
4> 拷贝控制文件
5> 拷贝归档重演日志
2. 恢复
磁盘出现故障,数据库自行关闭。
(1) 将驻留在磁盘上的备份拷贝到其他磁盘或磁带上
(2) 执行
SVRMGR> connect internal
SVRMGR> startup mount
SVRMGR> alter database open;
会出现错误信息,提示需要恢复
(3) 执行
SVRMGR> recover database
根据提示,自动恢复
(4) 执行
SVRMGR>alter database open
恢复完成,数据库打开。
数据库管理员(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: 40Array6 >
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. 装库:
不带参数
$ 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 40Array6) 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
二) 物理备份与恢复
1. 冷备份与热备份
冷备份
在数据库关闭状态与进行。将所有的数据文件、重演日志文件及控制文件拷贝到磁盘。空闲的时间再将备份移到磁带上。
(1)可通过:SVRMGR> select * from v$logfile;
select * from v$dbfile;
select * from v$control.file;
这些语句来了解数据文件、重演日志文件及控制文件的相应位置及名称。
(2)利用$cp 命令来拷贝:
例:$cp /u01/u02/pz_ts.ora /dbfile_b/
热备份
数据库必须工作在“ARCHIVELOG”方式下
可利用SVRMGR> archive log list 语句来查归档日志状态
若在“NOARCHIVELOG”方式下,进行转换
SVRMGR> connect internal
SVRMGR> shutdown immediate ---关闭数据库---
SVRMGR> startup mount ---为暂停日志方式转换准备数据库---
SVRMGR> alter database archivelog; ---转换---
SVRMGR> alter database open; ---打开数据库---
拷贝
1> 将一个表空间置为备份方式
SVRMGR> alter tablespace pzts begin backup;
2> 拷贝
SVRMGR>$cp /u01/u02/pz_ts.ora /dbfile_b/
3> 取消该表备份方式
SVRMGR>alter tablespace pzts end backup;
利用以上3步,将所有表空间下的数据文件进行备份
4> 拷贝控制文件
5> 拷贝归档重演日志
2. 恢复
磁盘出现故障,数据库自行关闭。
(1) 将驻留在磁盘上的备份拷贝到其他磁盘或磁带上
(2) 执行
SVRMGR> connect internal
SVRMGR> startup mount
SVRMGR> alter database open;
会出现错误信息,提示需要恢复
(3) 执行
SVRMGR> recover database
根据提示,自动恢复
(4) 执行
SVRMGR>alter database open
恢复完成,数据库打开。
dba在那里好找工作
DBA(数据库管理员)的主要工作是?
请问在职的DBA,在公司里DBA通常负责什么任务?
纸条上写了什么?
各位大哥,谁能告诉我oracle dba的工资大概都在什么水平
写一篇道歉信,关于工作上的原则问题惹恼了领导。
考取DBA的条件?比如学历....
如何做一名 sql server 的DBA
哪里有dba成长的故事呢?
一个DBA的月薪大概多少
msn 列表上的问题
快过年了,给客户的贺卡上该写些什么。
刚刚毕业的,准备参加工作了,到了公司应该注意写什么?
高分求救我网页上的地址栏怎么都没有了,上面写着脱机工作怎么回事
祭坛上的碑文上写了什么啊?仙剑1的
卡夫卡的 地堡 写了些什么?
工作快一年了,要写总结了,我该写什么呢?
项目上让我代管出纳工作,我是搞技术的,应该注意些什么.谢了
我在银行工作,工作一年了,想换个工作,怎么写自己的简历?
莫扎特共写了多少钢琴作品?麻烦列表
我的提问列表上丢了一个最近提的问题???
谁知道可以看到止水的遗书?还有,佐助看到的卷轴上写了些什么?
谁知道可以看到止水的遗书?还有,佐助看到的卷轴上写了些什么?
QQ列表上好友的顺序是按什么排列的?