1.啟動/关闭/查看數據庫监听:lsnrctl start/stop/status;
2.启动/关闭数据库服务:net start/stop oracleServiceDBNAME
3.cmd 進入;sqlplus 或sqlplus/nolog;前者先登錄到實例數據庫;后者連上數據庫;
4.查看数据库版本:Select version FROM Product_component_version Where SUBSTR(PRODUCT,1,6)='Oracle';
5.查看表空间使用情况:select sum(bytes)/(1024*1024) as free_space,tablespace_name
from dba_free_space
group by tablespace_name;
6.查看表空间物理文件的名称及大小:
select tablespace_name, file_id, file_name,
round(bytes/(1024*1024),0) total_space
from dba_data_files
order by tablespace_name;
7.查看当前用户的角色
SQL>select * from user_role_privs;
查看当前用户的系统权限和表级权限
SQL>select * from user_sys_privs;
SQL>select * from user_tab_privs;
8.查看用户下所有的表
SQL>select * from user_tables;
查看名称包含log字符的表
SQL>select object_name,object_id from user_objects
where instr(object_name,'LOG')>0;
9.查看某表的创建时间
SQL>select object_name,created from user_objects where object_name=upper('&table_name');
10.查看某表的大小
SQL>select sum(bytes)/(1024*1024) as "size(M)" from user_segments
where segment_name=upper('&table_name');
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/15127599/viewspace-626570/
,如需转载,请注明出处,否则将追究法律责任。