当前位置:网站首页>Oracle 常用SQL
Oracle 常用SQL
2022-07-02 03:27:00 【天天代码码天天】
1.查看服务器IP
select UTL_INADDR.get_host_address() from dual;
2.当前会话主机IP
select sys_context('USERENV', 'IP_ADDRESS') from dual
3.服务器主机名
SELECT host_name from v$instance;
4.当前会话主机名
select sys_context('USERENV', 'HOST') from dual;
5.查询服务器平台信息
SELECT * FROM DBA_REGISTRY_DATABASE;
6.查询服务器内存大小
SELECT value / 1024 / 1024 / 1024 G
FROM v$osstat
where stat_name = 'PHYSICAL_MEMORY_BYTES'
7.查看控制信息
select name from v$controlfile;
8.查看数据文件
select file_name from dba_data_files;
9.查看日志文件
select member from v$logfile;
10.查看临时文件
select file_name from Dba_temp_files;
11.查看archive log
select name from v$archived_log
12.查询当前用户
show user
13.查询当前用户所有表
select unique tname from col;
--或者
select * from user_tables;
--或者
select * from tab;
14.查看数据库创建时间
SELECT TO_CHAR(CREATED, 'YYYY-MM-DD,HH24:MI:SS'), LOG_MODE FROM V$DATABASE;
15.查看数据对象
select owner, object_type, status, count(*) count#
from all_objects
group by owner, object_type, status;
16.查看不同用户的连接数
select username, count(username)
from v$session
where username is not null
group by username;
边栏推荐
- C # joint Halcon's experience of breaking away from Halcon environment and various error reporting solutions
- UI (New ui:: MainWindow) troubleshooting
- Pycharm2021 delete the package warehouse list you added
- Kubernetes cluster storageclass persistent storage resource core concept and use
- verilog 并行块实现
- 命名块 verilog
- venn图取交集
- PHP array processing
- JS <2>
- Global and Chinese markets for ultrasonic probe disinfection systems 2022-2028: Research Report on technology, participants, trends, market size and share
猜你喜欢
随机推荐
Getting started with MQ
aaaaaaaaaaaaa
This article describes the step-by-step process of starting the NFT platform project
Global and Chinese markets for infant care equipment, 2022-2028: Research Report on technology, participants, trends, market size and share
The page in H5 shows hidden execution events
"Analysis of 43 cases of MATLAB neural network": Chapter 42 parallel operation and neural network - parallel neural network operation based on cpu/gpu
Unity脚本的基础语法(6)-特定文件夹
aaaaaaaaaaaaa
Form custom verification rules
/silicosis/geo/GSE184854_scRNA-seq_mouse_lung_ccr2/GSE184854_RAW/GSM5598265_matrix_inflection_demult
One of the future trends of SAP ui5: embrace typescript
Verilog 避免 Latch
Uniapp uses canvas to generate posters and save them locally
Gradle notes
Go execute shell command
Global and Chinese market of handheld ultrasonic scanners 2022-2028: Research Report on technology, participants, trends, market size and share
MySQL之账号管理
PHP array processing
Grpc快速实践
/silicosis/geo/GSE184854_ scRNA-seq_ mouse_ lung_ ccr2/GSE184854_ RAW/GSM5598265_ matrix_ inflection_ demult