ALTER SYSTEM SET db_recovery_file_dest_size=4g scope=both;
show parameter asm;
select inst_id,count(*) from gv$session group by inst_id;#确认是否负载均衡?
SELECT MEMBER FROM v$logfile; 查看日志文件
select file_name,tablespace_name,bytes from dba_data_files;#查看表空间及相应文件所在路径
select * from v_selecst_systesdm_info t where t.w_time >= to_date('2020/05/22 10:00','yyyy/mm/dd hh24:mi')
and t.w_time<= to_date('2020/05/22 10:55','yyyy/mm/dd hh24:mi');
select status,instance_name from v$instance; #查看实例运行状态
select instance_name from v$instance; #查看当前实例
sqlplus /@实例名 as sysdba #切换实例
ps -aux |grep oracle #查看Oracle进程
ps -ef|grep smon #查看Oracle有多少实例
声明并启动实例和启动监听
export ORACLE_SID=实例名称 & startup
lsnrctl start
#################################
在Oracle中如何找出SQL loader创建的导入外部数据的程序??
###########################################
lsnrctl status #查看Oracle的监听端口
find /u01/ -type f -name "alert_appdb2.log" #查看告警日志文件
v$diag_info告警日志文件系统视图 #ADR自动诊断日志#select name from v$diag_info
select * from dual;
-------oracle 查看已经执行过的sql 这些是存在共享池中的 --------->
select * from v$sqlarea t order by t.LAST_ACTIVE_TIME desc
-----------查看oracle会话----------------------------》
select * from v$session t order by t.LAST_ACTIVE_TIME desc
获取错误信息: select * from user_errors;
通过命令查看错误日志目录:show parameter background_dump_dest
select name,value from v$diag_info;
查询警告日志全称:find -name "alert*.log"
select value from v$parameter where name like 'proc%'; --查看最大会话数
select count(*) from v$process;--显示数据库当前的连接数
select value from v$parameter where name ='processes' --显示数据库最大连接数
select count(*) from v$session
alter tablespace system add datafile '/opt/oracle/oradata/ora11g/system2.dbf' size 10G autoextend off;#增大SYSTEM表空间
select file_name,autoextensible,increment_by from dba_data_files where tablespace_name = 'ANALYSE'; #查看表空间是否为自动扩展
select username,default_tablespace from user_users;#查看当前用户所在的表空间
select tablespace_name, sum(bytes)/1024/1024 from dba_free_space group by tablespace_name;#空闲表空间大小
诊断:select * from v$flash_recovery_area_usage;
select * from v$recovery_file_dest;
select * from v$logfile;
select group#,sequence#,bytes,members,archived,status from v$log;
archive log list;
col XXXX for a50;
dba_data_files:数据库数据文件信息表。可以统计表空间大小(总空间大小)。
dba_free_space:可以统计剩余表空间大小。
select TABLESPACE_NAME,BYTES from dba_free_space where TABLESPACE_NAME='ANALYSE';
SQL> set linesize 180;
SQL> set pages 999;
SQL> set long 90000;
select dbms_metadata.get_ddl('TABLESPACE','ANALYSE') from dual;
select dbms_metadata.get_ddl('TABLE','TABLENAME','USERNAME') from dual;