oracle 10g RAC 添加日志组和成员以及删除日志成员
SQL alter database add logfile thread 1 group5('+data/myrac/onlinelog/myrac1_redolog_group5_01') size 100m; SQL alter database add logfilemember '+data/myrac/onlinelog/myrac1_redolog_group5_02' to group 5; SQL alter database add logfile th
SQL> alter database add logfile thread 1 group5('+data/myrac/onlinelog/myrac1_redolog_group5_01') size 100m;
SQL> alter database add logfile member '+data/myrac/onlinelog/myrac1_redolog_group5_02' to group 5;
SQL> alter database add logfile thread 2 group 6('+data/myrac/onlinelog/myrac1_redolog_group6_01')size 100m;
手误 添加错了名字
先增加成员再说
SQL> alter database add logfile member '+data/myrac/onlinelog/myrac1_redolog_group6_02' to group 6;
SQL> alter database add logfile member '+data/myrac/onlinelog/myrac1_redolog_group6_01' to group 6;
删除不了
SQL> alter database drop logfile member'+DATA/myrac/onlinelog/myrac1_redolog_group6_01';
alter database drop logfile member'+DATA/myrac/onlinelog/myrac1_redolog_group6_01'
*
第 1 行出现错误:
ORA-00362: 要求输入成员以组成组 6 中的有效日志文件
ORA-01517: 日志成员: '+DATA/myrac/onlinelog/myrac1_redolog_group6_01'
日志状态 未使用当中啊!
SQL> select group#,archived,status from v$log;
GROUP# ARC STATUS
---------- --- ----------------
1 NO ACTIVE
2 NO INACTIVE
3 NO CURRENT
4 NO INACTIVE
5 NO CURRENT
6 YES UNUSED
已选择6行。
在节点2 实例2数据库实例上 切换日志
SQL> alter system switch logfile;
??????
SQL> /
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME
---------- ---------- ---------- ---------- ---------- ------------------- ------------- --------------
1 1 87 52428800 1 NO INACTIVE 4427645 25-9月 -12
2 1 86 52428800 1 NO INACTIVE 4356268 25-9月 -12
3 2 43 52428800 1 NO ACTIVE 4402972 25-9月 -12
4 2 42 52428800 1 NO INACTIVE 4206757 24-9月 -12
5 1 88 104857600 2 NO CURRENT 4495802 26-9月 -12
6 2 44 104857600 3 NO CURRENT 4497190 26-9月 -12
已选择6行。
SQL> alter system switch logfile;
??????
SQL> /
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME
---------- ---------- ---------- ---------- ---------- ------------------- ------------- --------------
1 1 87 52428800 1 NO INACTIVE 4427645 25-9月 -12
2 1 86 52428800 1 NO INACTIVE 435626825-9月 -12
3 2 43 52428800 1 NO ACTIVE 4402972 25-9月 -12
4 2 45 52428800 1 NO CURRENT 4497215 26-9月 -12
5 1 88 104857600 2 NO CURRENT 4495802 26-9月 -12
6 2 44 104857600 3 NO ACTIVE 4497190 26-9月 -12
已选择6行。
SQL> alter system switch logfile;
??????
SQL> /
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME
---------- ---------- ---------- ---------- ---------- ------------------- ------------- --------------
1 1 87 52428800 1 NO INACTIVE 4427645 25-9月 -12
2 1 86 52428800 1 NO INACTIVE 4356268 25-9月 -12
3 2 46 52428800 1 NO CURRENT 4497279 26-9月 -12
4 2 45 52428800 1 NO INACTIVE 449721526-9月 -12
5 1 88 104857600 2 NO CURRENT 4495802 26-9月 -12
6 2 44 104857600 3 NO INACTIVE 4497190 26-9月 -12
已选择6行。
SQL> alter database droplogfile member '+DATA/myrac/onlinelog/myrac1_redolog_group6_01';
数据库已更改。
SQL> select group#,member from v$logfile where group#=6;
GROUP# MEMBER
---------- --------------------------------------------------------
6+DATA/myrac/onlinelog/myrac2_redolog_group6_02
6+DATA/myrac/onlinelog/myrac2_redolog_group6_01
已经成功删除了
下面去ASMCMD删除物理文件
ASMCMD> ls
group_1.257.772910379
group_2.258.772910389
group_3.265.772919275
group_4.266.772919281
group_5.268.795028735
group_5.269.795029891
group_6.270.795030293
group_6.271.795030355
group_6.272.795030429
myrac1_redolog_group5_01
myrac1_redolog_group5_02
myrac1_redolog_group6_01
myrac2_redolog_group6_01
myrac2_redolog_group6_02
ls –ls 可以看到 别名关联
ASMCMD> pp
commands:
--------
cd
du
find
help
ls
lsct
lsdg
mkalias
mkdir
pwd
rm
rmalias
ASMCMD> rm myrac1_redolog_group6_01
ASMCMD> ls
group_1.257.772910379
group_2.258.772910389
group_3.265.772919275
group_4.266.772919281
group_5.268.795028735
group_5.269.795029891
group_6.271.795030355
group_6.272.795030429
myrac1_redolog_group5_01
myrac1_redolog_group5_02
myrac2_redolog_group6_01
myrac2_redolog_group6_02
ASMCMD>
下面介绍关于日志一些原则:
原则:删除前必须遵守如下原则,每个实例必须至少有两个日志组;当一个组处于ACTIVE或者CURRENT的状态时不可删除;删除日志组的操作只对数据库进行更改,操作系统的文件尚未删除;当删除时适用DROP LOGFILE GROUP N语句时,此时GROUP N内的所有成员都将被删除。
ALTER DATABASE DROP LOGFILE GROUP N;
删除日志成员的原则:当你删除一个是该组中最后一个成员的时候,你不能删除此成员;当组的转台处于current的状态时,不能删除组成员;在归档模式下,必须得归档之后才能删除;删除日志组成员的操作只对数据库进行更改,操作系统的文件尚未删除
ALTER DATABASE DROP LOGFILE MEMBER '/LOCATION_DUST/REDO0N_N.LOG';

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

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

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

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

Hot Topics



To query the Oracle tablespace size, follow the following steps: Determine the tablespace name by running the query: SELECT tablespace_name FROM dba_tablespaces; Query the tablespace size by running the query: SELECT sum(bytes) AS total_size, sum(bytes_free) AS available_space, sum(bytes) - sum(bytes_free) AS used_space FROM dba_data_files WHERE tablespace_

Oracle View Encryption allows you to encrypt data in the view, thereby enhancing the security of sensitive information. The steps include: 1) creating the master encryption key (MEk); 2) creating an encrypted view, specifying the view and MEk to be encrypted; 3) authorizing users to access the encrypted view. How encrypted views work: When a user querys for an encrypted view, Oracle uses MEk to decrypt data, ensuring that only authorized users can access readable data.

Uninstall method for Oracle installation failure: Close Oracle service, delete Oracle program files and registry keys, uninstall Oracle environment variables, and restart the computer. If the uninstall fails, you can uninstall manually using the Oracle Universal Uninstall Tool.

There are three ways to view instance names in Oracle: use the "sqlplus" and "select instance_name from v$instance;" commands on the command line. Use the "show instance_name;" command in SQL*Plus. Check environment variables (ORACLE_SID on Linux) through the operating system's Task Manager, Oracle Enterprise Manager, or through the operating system.

The method to solve the Oracle cursor closure problem includes: explicitly closing the cursor using the CLOSE statement. Declare the cursor in the FOR UPDATE clause so that it automatically closes after the scope is ended. Declare the cursor in the USING clause so that it automatically closes when the associated PL/SQL variable is closed. Use exception handling to ensure that the cursor is closed in any exception situation. Use the connection pool to automatically close the cursor. Disable automatic submission and delay cursor closing.

Deleting all data in Oracle requires the following steps: 1. Establish a connection; 2. Disable foreign key constraints; 3. Delete table data; 4. Submit transactions; 5. Enable foreign key constraints (optional). Be sure to back up the database before execution to prevent data loss.

To create a user in Oracle, follow these steps: Create a new user using the CREATE USER statement. Grant the necessary permissions using the GRANT statement. Optional: Use the RESOURCE statement to set the quota. Configure other options such as default roles and temporary tablespaces.

Oracle Invalid numeric errors may be caused by data type mismatch, numeric overflow, data conversion errors, or data corruption. Troubleshooting steps include checking data types, detecting digital overflows, checking data conversions, checking data corruption, and exploring other possible solutions such as configuring the NLS_NUMERIC_CHARACTERS parameter and enabling data verification logging.
