123456789101112131415161718192021222324252627282930313233343536373839404142
set verify offcol value format a20column file_name format a50 word_wrappedcolumn smallest format 999,990 heading "Smallest|Size|Poss."column currsize format 999,990 heading "Current|Size"column savings format 999,990 heading "Poss.|Savings"break on reportcompute sum of savings on report column value new_val blksizeselect value from v$parameter where name ...
Recovery Writer (RVWR) is stuck until more space
is available in the recovery area.
Unable to write Flashback database log data because the
recovery area is full, presence of a guaranteed
restore point and no reusable flashback logs.
1. 查看闪回日志目录
1
show parameter recover
2. 查看闪回目录的使用状态
1
select * from v$flash_recovery_area_usage;
...
racle 出现未释放锁 查询出 sid 与 serial 杀死进程事务 1185
123
SELECT T2.USERNAME,T2.SID,T2.SERIAL#,T2.LOGON_TIMEFROM V$LOCKED_OBJECT T1,V$SESSION T2WHERE T1.SESSION_ID=T2.SID ORDER BY T2.LOGON_TIME
根据 sid 查询出sql sql 不重要 这步可跳过
123
SELECT SQL_TEXT FROM V$SESSION A,V$SQLTEXT_WITH_NEWLINES BWHERE DECODE(A.SQL_HASH_VALUE, 0, PREV_HASH_VALUE, SQ...
DG 环境重启过程
DataGuard环境的重启原则是:先关主库再关备库,先开备库再开主库
1、关闭DG
1> 关闭主库
SQL>shutdown immediate
$ lsnrctl start
2> 关闭备库
SQL>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
SQL>SHUTDOWN IMMEDIATE;
$lsnrctl stop
2、启动DG
1>启动备库
SQL>STARTUP MOUNT/OPEN;
SQL>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM
SESSION;
$ lsnrctl start
2>启动主库
SQL> STARTUP;
SQL> exit
$ lsnrctl start
(2)启动DataGuard后的检查...
1. system密码在主库修改后,可以通过日志传输到备库应用,保证主备同步。
2. sys的密码只写在密码文件中,不会通过日志同步,要通过密码文件覆盖的方式同步到备库。
3. dataguard同步,只会验证密码文件。
4. 主库如果修改sys和system的密码, 和备库不一致后,不会立刻报错。当前如果有session连接着就不
会报错,如果session重连后发起验证密码,就会开始报错。所以要马上覆盖密码文件,不要等待报错。
5. 备库不打开,所以修改sys和system密码的操作都不成功
oralce 用户下发现 SYS_EXPORT_SCHEMA_01、SYS_EXPORT_SCHEMA_02 表,这些表是 expdp 的时候生成,一般导入导出任务完成后会自动删除这些表,可以手动删除这些表。
通过查询任务状态,当任务是 NOT RUNNING 就可以删除,这些任务可能是意外终止导致。
12345
SELECT owner_name, job_name, rtrim(operation) "OPERATION", rtrim(job_mode) "JOB_MODE", state, attached_sessions FROM dba_datapump_jobs WHERE job_name NOT LIKE 'BIN$%' ORDER BY 1, 2;
...
数据泵impdp导入慢,查看alert.log发现relog频繁切换,查看发现默认大小是3个50M的日志组,这里介绍如何扩展为1G
1.检查日志文件大小
12345678910
SQL> column group# format 99999;SQL> column status format a10;SQL> column mb format 99999;SQL> select group#, status, bytes/1024/1024 mb from v$log; GROUP# STATUS MB------ ---------- ------ 1 CURRENT &n...
最近在巡检数据库时,发现一套线上数据库服务器的redo log和standby log设置不符合最佳实践,所以需要联机修改主备库的 redo log和standby log,修改的具体步骤进行了如下的总结。
(1)在主库上切换日志,查看主备同步状态,查看主备同步是否正常,参考此篇文章(https://blog.csdn.net/weixin_41561862/article/details/104185660)。
alter system switch logfile;
alter system switch logfile;
alter system switch logfile;
alter system checkpoint;
(2)如果主备日志同步正常,先取消备库的实时应用,设置主库和备库的standby...
收集数据库信息时候报ORA-01652错 如下
1234567891011
SQL> EXEC DBMS_STATS.gather_database_stats; BEGIN DBMS_STATS.gather_database_stats; END;*ERROR at line 1:ORA-01652: unable to extend temp segment by 128 in tablespace TEMP01ORA-06512: at "SYS.DBMS_STATS", line 13210ORA-06512: at "SYS.DBMS_STATS", line 13556ORA-06512: at "SYS.DBMS_STATS", line 13700ORA-06512: at "SYS.DBMS_STATS", line 13664ORA-06512: at line 1
...
1、查看每个oracle帐户的连接总数
1
select username,count(username) from v$session where username is not null group by username
2、缺省从 v$session 中不能直接获得客户端 IP,可以在数据库中创建一个追踪客户端IP地址的触发器:
12345
create or replace trigger on_logon_trigger after logon on database begin &nb...