Oracle 常用配置

多路复用控制文件

// 多路复用控制文件
SQL> alter system set control_files='/u01/app/oracle/oradata/orcl/control01.ctl','/u01/app/oracle/fast_recovery_area/orcl/control02.ctl','/u01/app/oracle/oradata/orcl/control03.ctl' scope=spfile;
SQL> shutdown immediate
[oracle@orcl ~]$ cp /u01/app/oracle/oradata/orcl/control01.ctl /u01/app/oracle/oradata/orcl/control03.ctl
SQL> startup

添加日志组成员

// 添加日志组成员(oracle建议每组多个成员,已防止成员丢失)
SQL> alter database add logfile member '/u01/app/oracle/oradata/orcl/redo01_2.log' to group 1;
SQL> alter database add logfile member '/u01/app/oracle/oradata/orcl/redo02_2.log' to group 2;
SQL> alter database add logfile member '/u01/app/oracle/oradata/orcl/redo03_2.log' to group 3;
// 删除日志组成员
SQL> alter database drop logfile member '/u01/app/oracle/oradata/orcl/redo02_2.log';
// 添加组
SQL> ALTER DATABASE ADD LOGFILE GROUP 4('/u01/app/oracle/oradata/orcl/redo04.log','/u01/app/oracle/oradata/orcl/redo04_2.log') SIZE 50M BLOCKSIZE 512;
// 删除组
SQL> ALTER DATABASE drop LOGFILE GROUP 4

将控制文件备份到跟踪文件

// 将控制文件备份到跟踪文件(数据库物理结构发生变化时手动执行)
SQL> alter database backup controlfile to trace;
SQL> select spid from v$process where addr=(select paddr from v$session where sid=(select distinct sid from v$mystat));
[oracle@orcl ~]$ cd /u01/app/oracle/diag/rdbms/orcl/orcl/trace/

你可能感兴趣的:(oracle)