RMAN 创建恢复目录,启动RMAN,使用target参数连接目标数据库,并使用catalog参数连接恢复目录数据库。然后在RMAN中执行create c
1、恢复目录数据库配置建议:
表空间 大小需求
SYSTEM 90MB
TEMP 5MB
UNDO 5MB
RECOVERY_CATALOG_SCHEMA 每个主城的数据库15MB
ONLINE REDO LOGS 每个联机重做日志文件1MB
2、创建用户
create tablespace ctlg datafile '$Oracle_BASE/oradata/$ORACLE_SID/ctlg.dbf' size 100M autoextend on next 10M maxsize 2G;
create user ctlg identified by ctlg default tablespace ctlg temporary tablespace temp;
grant connect,resource,recovery_catalog_owner to ctlg;
注:恢复目录用户账户在某种程度上也算是一个特许的数据库账户,尽可能像保护系统用户那样保护好这个账户。
3、创建恢复目录Schema对象
启动RMAN,使用target参数连接目标数据库,并使用catalog参数连接恢复目录数据库。然后在RMAN中执行create catalog命令,此时可以选择使用tablespace参数来定义在其中创建RMAN的Schema对象的表空间。
[oracle@zhs10g ~]$ rman target='BACKUP/BACKUP@UTF10G' catalog=ctlg/ctlg@bcatalog
Recovery Manager: Release 10.2.0.4.0 - Production on Tue Aug 21 17:41:24 2012
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: UTF10G (DBID=1585746538)
connected to recovery catalog database
RMAN> create catalog tablespace ctlg;
recovery catalog created
RMAN>
4、在恢复目录中主城数据库
使用RMAN,同时连接目标数据库和恢复目录,然后在恢复目录中注册数据库:
rman target='BACKUP/BACKUP@UTF10G' catalog=ctlg/ctlg@bcatalog
register database;
当连接目标数据库时,可以在RMAN中执行report schema命令来验证注册数据库是否成功:
RMAN> report schema;
Report of database schema
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 500 SYSTEM YES /soft/oracle/oradata/utf10g/system01.dbf
2 235 UNDOTBS1 YES /soft/oracle/oradata/utf10g/undotbs01.dbf
3 480 SYSAUX NO /soft/oracle/oradata/utf10g/sysaux01.dbf
4 5 USERS NO /soft/oracle/oradata/utf10g/users01.dbf
5 100 STRMADMIN NO /soft/oracle/oradata/utf10g/strmadmin01.dbf
6 100 SRCB NO /soft/oracle/oradata/utf10g/srcb01.dbf
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 29 TEMP 32767 /soft/oracle/oradata/utf10g/temp01.dbf
5、删除恢复目录
如果不需要使用恢复目录了,则可以删除恢复目录模式。注意:删除恢复目录模式前应该考虑备份恢复目录数据库。
删除命令为:
RMAN> drop catalog;
recovery catalog owner is CTLG
enter DROP CATALOG command again to confirm catalog removal
RMAN> drop catalog;
recovery catalog dropped
注:该命令需要执行两次,第一次是让你确认的。
6、在恢复目录中天剑RMAN备份
如果已经在没有恢复目录的情况下执行了RMAN备份,并且希望以后将这些备份信息添加至恢复目录,则可以使用catalog命令。该命令可以讲数据文件副本、备份集片、归档日志备份、甚至整个备份目录天剑到恢复目录中,如:
RMAN> catalog datafilecopy '/backup/rman/system01.dbf';
RMAN> catalog archivelog '/backup/rman/log_database_1.arc','/backup/rman/log_database_2.arc';
RMAN> catalog backuppiece '/backup/rman/backup_0808.bkp';
RMAN> catalog start with '/backup/rman/database/';
注:要谨慎使用catalog start with命令。必须在目录路径结尾加上斜杠。如果使用/backup/rman/database,则Oracle将遍历:/backup/rman/database中所有可能的database目录组合。这可能包括如下目录:/backup/rman/database、/backup/rman/database-123,或者/backup/rman/database-xx等等。使用斜杠后缀则表示只要找/backup/rman/database/。
注:在window中为反斜杠\
7、在恢复目录中取消数据库注册
同样是使用RMAN根据登录目标数据库和Catalog数据库,,然后执行如下命令,需要回答yes:
[oracle@zhs10g ~]$ rman target='BACKUP/BACKUP@UTF10G' catalog=ctlg/ctlg@bcatalog
RMAN> unregister database;
database name is "UTF10G" and DBID is 1585746538
Do you really want to unregister the database (enter YES or NO)? yes
database unregistered from the recovery catalog
如果目标数据库已经删除,并且希望从恢复目录中彻底删除该数据库,则在大多数情况下只需要知道希望取消注册的数据库的名称。如,希望取消注册utf10g数据库,则可以在连接到恢复目录中执行如下命令:
[oracle@zhs10g ~]$ rman catalog=ctlg/ctlg@bcatalog
Recovery Manager: Release 10.2.0.4.0 - Production on Fri Aug 24 01:58:16 2012
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to recovery catalog database
RMAN> unregister database utf10g;
database name is "utf10g" and DBID is 1585746538
Do you really want to unregister the database (enter YES or NO)? yes
database unregistered from the recovery catalog
RMAN>
如果恢复目录中有多个已相同名称注册的数据库时,就需要知道希望取消注册的数据库的DBID。然后在run代码块中运行unregister database命令,同时使用set dbid命令。如:
run
{
set dbid 1585746538;
unregister database UTF10G NOPROMPT;
}

本篇文章给大家带来了关于mysql的相关知识,其中主要介绍了关于索引优化器工作原理的相关内容,其中包括了MySQL Server的组成,MySQL优化器选择索引额原理以及SQL成本分析,最后通过 select 查询总结整个查询过程,下面一起来看一下,希望对大家有帮助。

sybase是基于客户/服务器体系结构的数据库,是一个开放的、高性能的、可编程的数据库,可使用事件驱动的触发器、多线索化等来提高性能。

数据库系统由4个部分构成:1、数据库,是指长期存储在计算机内的,有组织,可共享的数据的集合;2、硬件,是指构成计算机系统的各种物理设备,包括存储所需的外部设备;3、软件,包括操作系统、数据库管理系统及应用程序;4、人员,包括系统分析员和数据库设计人员、应用程序员(负责编写使用数据库的应用程序)、最终用户(利用接口或查询语言访问数据库)、数据库管理员(负责数据库的总体信息控制)。

visual foxpro数据库文件是管理数据库对象的系统文件。在VFP中,用户数据是存放在“.DBF”表文件中;VFP的数据库文件(“.DBC”)中不存放用户数据,它只起将属于某一数据库的 数据库表与视图、连接、存储过程等关联起来的作用。

microsoft sql server是Microsoft公司推出的关系型数据库管理系统,是一个全面的数据库平台,使用集成的商业智能(BI)工具提供了企业级的数据管理,具有使用方便可伸缩性好与相关软件集成程度高等优点。SQL Server数据库引擎为关系型数据和结构化数据提供了更安全可靠的存储功能,使用户可以构建和管理用于业务的高可用和高性能的数据应用程序。

结构层次是“数据库→数据表→记录→字段”;字段构成记录,记录构成数据表,数据表构成了数据库。数据库是一个完整的数据的记录的整体,一个数据库包含0到N个表,一个表包含0到N个字段,记录是表中的行。

数据库的“完整性”是指数据的正确性和相容性。完整性是指数据库中数据在逻辑上的一致性、正确性、有效性和相容性。完整性对于数据库系统的重要性:1、数据库完整性约束能够防止合法用户使用数据库时向数据库中添加不合语义的数据;2、合理的数据库完整性设计,能够同时兼顾数据库的完整性和系统的效能;3、完善的数据库完整性有助于尽早发现应用软件的错误。

mysql查询为什么会慢,关于这个问题,在实际开发经常会遇到,而面试中,也是个高频题。遇到这种问题,我们一般也会想到是因为索引。那除开索引之外,还有哪些因素会导致数据库查询变慢呢?


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Mac version
God-level code editing software (SublimeText3)

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Notepad++7.3.1
Easy-to-use and free code editor

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.
