使用rman的duplicate来创建备库,过程简洁了不少,无需在手动创建备库控制文件。 主库SPFILE *.log_archive_format=
使用rman的duplicate来创建备库,,过程简洁了不少,无需在手动创建备库控制文件。
主库SPFILE
*.log_archive_format='%T%S%r.ARC'
*.DB_UNIQUE_NAME='primary'
*.log_archive_config='DG_CONFIG=(primary,standby)'
*.log_archive_dest_1='location=C:/Oracle/product/10.2.0/oradata/arch VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=primary'
*.log_archive_dest_2='SERVICE=standby arch ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=standby'
*.STANDBY_FILE_MANAGEMENT=AUTO
*.LOG_ARCHIVE_DEST_STATE_1=ENABLE
*.LOG_ARCHIVE_DEST_STATE_2=ENABLE
*.FAL_SERVER='standby'
*.FAL_CLIENT='primary'
备库SPFILE 在主库创建SPFILE给备库 并修改
*.log_archive_format='%T%S%r.ARC'
*.DB_UNIQUE_NAME='standby'
*.log_archive_config='DG_CONFIG=(primary,standby)'
*.log_archive_dest_1='location=C:/oracle/product/10.2.0/oradata/arch VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=standby'
*.log_archive_dest_2='SERVICE=primary arch ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=primary'
*.STANDBY_FILE_MANAGEMENT=AUTO
*.LOG_ARCHIVE_DEST_STATE_1=ENABLE
*.LOG_ARCHIVE_DEST_STATE_2=ENABLE
*.FAL_SERVER='primary'
*.FAL_CLIENT='standby'
配置好TNS 监听能互相TNSPING通
主库操作
修改LOGFILE大小为100M,添加4组备用联机日志
SQL> alter database add logfile group 4 'c:\oracle\product\10.2.0\oradata\orcl\r
edolog04.log' size 50M;
SQL> alter database add logfile group 5 'c:\oracle\product\10.2.0\oradata\orcl\r
edolog05.log' size 50M;
SQL> alter system switch logfile;
SQL> alter database drop logfile group 1;
SQL> alter database drop logfile group 2;
SQL> alter database drop logfile group 3;
SQL> alter database add logfile group 2 'c:\oracle\product\10.2.0\oradata\orcl\r
edolog02.log' size 100M;
SQL> alter database add logfile group 3 'c:\oracle\product\10.2.0\oradata\orcl\r
edolog03.log' size 100M;
SQL> alter database drop logfile group 4;
SQL> select group#,sequence#,status from v$log;
GROUP# SEQUENCE# STATUS
---------- ---------- --------------------------------
1 15 CURRENT
2 0 UNUSED
3 0 UNUSED
5 14 ACTIVE
SQL> alter system switch logfile;
SQL> select group#,sequence#,status from v$log;
GROUP# SEQUENCE# STATUS
---------- ---------- --------------------------------
1 19 INACTIVE
2 20 ACTIVE
3 21 CURRENT
5 18 INACTIVE
SQL> alter database drop logfile group 5;
数据库已更改。
SQL> select group#,sequence#,status from v$log;
GROUP# SEQUENCE# STATUS
---------- ---------- --------------------------------
1 19 INACTIVE
2 20 ACTIVE
3 21 CURRENT
SQL> alter database add standby logfile group 4 'c:\oracle\product\10.2.0\oradat
a\orcl\standbylog04.log' size 50M;
数据库已更改。
SQL> alter database add standby logfile group 5 'c:\oracle\product\10.2.0\oradat
a\orcl\standbylog05.log' size 50M;
数据库已更改。
SQL> alter database add standby logfile group 6 'c:\oracle\product\10.2.0\oradat
a\orcl\standbylog06.log' size 50M;
数据库已更改。
SQL> alter database add standby logfile group 7 'c:\oracle\product\10.2.0\oradat
a\orcl\standbylog07.log' size 50M;
数据库已更改。
-- 添加日志组成员方法
SQL> alter database add logfile member 'c:\oracle\product\10.2.0\oradata\orcl\re
dolog012.log' to group 1;
数据库已更改。
--删除日志组成员方法
SQL> alter database drop logfile member 'c:\oracle\product\10.2.0\oradata\orcl\
redolog012.log';
数据库已更改。
RMAN全备数据库 控制文件 归档日志
RMAN> backup full format 'c:\backup\fullbackup_%d_%T_%s.bak' database include cu
rrent controlfile for standby;
RMAN> sql 'alter system archive log current';
sql 语句: alter system archive log current
RMAN> backup archivelog all format 'c:\backup\archive_%d_%T_%s';
更多详情见请继续阅读下一页的精彩内容:
推荐阅读:
Oracle基础教程之通过RMAN复制数据库
RMAN备份策略制定参考内容
RMAN备份学习笔记
Oracle数据库备份加密 RMAN加密

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

Article discusses strategies for handling large datasets in MySQL, including partitioning, sharding, indexing, and query optimization.

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

The article discusses dropping tables in MySQL using the DROP TABLE statement, emphasizing precautions and risks. It highlights that the action is irreversible without backups, detailing recovery methods and potential production environment hazards.

The article discusses creating indexes on JSON columns in various databases like PostgreSQL, MySQL, and MongoDB to enhance query performance. It explains the syntax and benefits of indexing specific JSON paths, and lists supported database systems.

Article discusses using foreign keys to represent relationships in databases, focusing on best practices, data integrity, and common pitfalls to avoid.

Article discusses securing MySQL against SQL injection and brute-force attacks using prepared statements, input validation, and strong password policies.(159 characters)


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

Dreamweaver CS6
Visual web development tools

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.

SublimeText3 English version
Recommended: Win version, supports code prompts!

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment