Home Database Mysql Tutorial Oracle数据库归档模式设置

Oracle数据库归档模式设置

Jun 07, 2016 pm 05:18 PM
o database

在单击节点或本机机器上进行设置 1 sqlgt; archive log list; #查看是否是归档方式 2 sqlgt; alter system set log_ar

在单击节点或本机机器上进行设置

  1 sql> archive log list; #查看是否是归档方式

  2 sql> alter system set log_archive_start=true scope=spfile; #启用自动归档

  sql> alter system set log_archive_dest_1='location=H:archivelogarch1' scope=spfile;

  #设置归档路径1

  sql> alter system set log_archive_dest_2='location=H:archivelogarch2' scope=spfile;

  #设置归档路径2,一般情况下将路径2存放到其它盘中。

  sql> alter system set log_archive_format='arch_%d_%t_%r_%s.log'

  #设置归档日志格式

  3 sql> shutdown immediate;

  4 sql> startup mount; #打开控制文件,不打开数据文件

  5 sql> alter database archivelog; #将数据库切换为归档模式

  6 sql> alter database open; #将数据文件打开

  7 sql> archive log list; #查看此时便处于归档模式

  8 查询以确定数据库位于archivelog模式中且归档进程正在进行

  sql> select log_mode from v$database;

  sql> select archiver from v$instance;

  9 执行一次日志切换

  sql> alter system switch logfile;

  10 此次日志切换将归档写到两个目的地,即第二步的H:archivelogarch1和H:archivelogarch2,,如果希望对此确认,在Oracle环境中运行如下查询:

  sql> select name from v$archived_log;

  然后在操作系统中确认查询所列出的文件

  二 设置非归档方式

  1 sql> archive log list; #查看是否是归档方式

  2 sql> alter system set log_archive_start=false scope=spfile; #禁用自动归档

  3 sql> shutdown immediate;

  4 sql> startup mount; #打开控制文件,不打开数据文件

  5 sql> alter database noarchivelog; #将数据库切换为非归档模式

  6 sql> alter database open; #将数据文件打开

  7 sql> archive log list; #查看此时便处于非归档模式

  三 归档相关命令

  archive log stop;

  archive log start;

  archive log list;

  show parameters;

  show parameters log_archive_start;

  show parameters log_archive_max_process; #归档进程数

  alter system set log_archive_max_process=5; #将归档进程数改为5

  select * from v$bgprocess; #查看后台进程

linux

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Oracle's Role in the Business World Oracle's Role in the Business World Apr 23, 2025 am 12:01 AM

Oracle is not only a database company, but also a leader in cloud computing and ERP systems. 1. Oracle provides comprehensive solutions from database to cloud services and ERP systems. 2. OracleCloud challenges AWS and Azure, providing IaaS, PaaS and SaaS services. 3. Oracle's ERP systems such as E-BusinessSuite and FusionApplications help enterprises optimize operations.

MySQL: An Introduction to the World's Most Popular Database MySQL: An Introduction to the World's Most Popular Database Apr 12, 2025 am 12:18 AM

MySQL is an open source relational database management system, mainly used to store and retrieve data quickly and reliably. Its working principle includes client requests, query resolution, execution of queries and return results. Examples of usage include creating tables, inserting and querying data, and advanced features such as JOIN operations. Common errors involve SQL syntax, data types, and permissions, and optimization suggestions include the use of indexes, optimized queries, and partitioning of tables.

MySQL vs. Other Databases: Comparing the Options MySQL vs. Other Databases: Comparing the Options Apr 15, 2025 am 12:08 AM

MySQL is suitable for web applications and content management systems and is popular for its open source, high performance and ease of use. 1) Compared with PostgreSQL, MySQL performs better in simple queries and high concurrent read operations. 2) Compared with Oracle, MySQL is more popular among small and medium-sized enterprises because of its open source and low cost. 3) Compared with Microsoft SQL Server, MySQL is more suitable for cross-platform applications. 4) Unlike MongoDB, MySQL is more suitable for structured data and transaction processing.

MySQL: A Beginner-Friendly Approach to Data Storage MySQL: A Beginner-Friendly Approach to Data Storage Apr 17, 2025 am 12:21 AM

MySQL is suitable for beginners because it is easy to use and powerful. 1.MySQL is a relational database, and uses SQL for CRUD operations. 2. It is simple to install and requires the root user password to be configured. 3. Use INSERT, UPDATE, DELETE, and SELECT to perform data operations. 4. ORDERBY, WHERE and JOIN can be used for complex queries. 5. Debugging requires checking the syntax and use EXPLAIN to analyze the query. 6. Optimization suggestions include using indexes, choosing the right data type and good programming habits.

Why Use MySQL? Benefits and Advantages Why Use MySQL? Benefits and Advantages Apr 12, 2025 am 12:17 AM

MySQL is chosen for its performance, reliability, ease of use, and community support. 1.MySQL provides efficient data storage and retrieval functions, supporting multiple data types and advanced query operations. 2. Adopt client-server architecture and multiple storage engines to support transaction and query optimization. 3. Easy to use, supports a variety of operating systems and programming languages. 4. Have strong community support and provide rich resources and solutions.

MySQL: Structured Data and Relational Databases MySQL: Structured Data and Relational Databases Apr 18, 2025 am 12:22 AM

MySQL efficiently manages structured data through table structure and SQL query, and implements inter-table relationships through foreign keys. 1. Define the data format and type when creating a table. 2. Use foreign keys to establish relationships between tables. 3. Improve performance through indexing and query optimization. 4. Regularly backup and monitor databases to ensure data security and performance optimization.

Redis: Understanding Its Architecture and Purpose Redis: Understanding Its Architecture and Purpose Apr 26, 2025 am 12:11 AM

Redis is a memory data structure storage system, mainly used as a database, cache and message broker. Its core features include single-threaded model, I/O multiplexing, persistence mechanism, replication and clustering functions. Redis is commonly used in practical applications for caching, session storage, and message queues. It can significantly improve its performance by selecting the right data structure, using pipelines and transactions, and monitoring and tuning.

Which of the top ten currency trading platforms in the world are the latest version of the top ten currency trading platforms Which of the top ten currency trading platforms in the world are the latest version of the top ten currency trading platforms Apr 28, 2025 pm 08:09 PM

The top ten cryptocurrency trading platforms in the world include Binance, OKX, Gate.io, Coinbase, Kraken, Huobi Global, Bitfinex, Bittrex, KuCoin and Poloniex, all of which provide a variety of trading methods and powerful security measures.

See all articles