zoukankan      html  css  js  c++  java
  • Oracle 操作

    select tablespace_name,sum(bytes)/1024/1024 from dba_data_files group by tablespace_name;
    select tablespace_name,sum(bytes)/1024/1024 from dba_free_space group by tablespace_name;
    select df.tablespace_name,SUM(df.bytes)/1024/1024 total,SUM(fs.bytes)/1024/1024 free,SUM(df.bytes-fs.bytes)/1024/1024 used from dba_data_files df,dba_free_space fs
    where df.tablespace_name = fs.tablespace_name
    group by df.tablespace_name

    select table_name,tablespace_name from user_tables where table_name='fwfinfo';
    select username,default_tablespace from dba_users where username='FWSK';

    select username,default_tablespace from dba_users;

    select
    b.file_id 文件ID号,
    b.tablespace_name 表空间名,
    b.bytes/1024/1024||'M'字节数,
    (b.bytes-sum(nvl(a.bytes,0)))/1024/1024||'M' 已使用,
    sum(nvl(a.bytes,0))/1024/1024||'M' 剩余空间,
    100 - sum(nvl(a.bytes,0))/(b.bytes)*100 占用百分比
    from dba_free_space a,dba_data_files b
    where a.file_id=b.file_id
    group by b.tablespace_name,b.file_id,b.bytes
    order by b.file_id;

    select tablespace_name,file_name,autoextensible from dba_data_files where autoextensible='YES';

    SELECT FILE_NAME, TABLESPACE_NAME, AUTOEXTENSIBLE FROM DBA_DATA_FILES

    select tablespace_name,
    file_id,
    file_name,
    round(bytes / (1024 * 1024), 0) total_space
    from sys.dba_data_files
    order by tablespace_name


    alter database datafile 'D:MYORACLEORACLEORADATAORCLFWSKKZ_DATA.DBF' resize 4000m

    CREATE OR REPLACE PROCEDURE getDeptCount(deptCount out int)
    AS
    BEGIN
    SELECT COUNT(*) INTO deptCount FROM jc_applyfor;
    END;

    CREATE OR REPLACE PROCEDURE AddNewUser
    (
    n_id test_user_info.id%TYPE,
    n_name test_user_info.name%TYPE,
    n_pwd test_user_info.pwd%TYPE,
    n_address test_user_info.address%TYPE
    )
    AS
    BEGIN
    --向表中插入数据
    INSERT INTO test_user_info(id,name,pwd,address)
    VALUES(n_id,n_name,n_pwd,n_address);
    END AddNewUser;

  • 相关阅读:
    express框架总结
    http协议和file协议的区别
    苹果和安卓机的兼容问题
    nodejs搭建服务器
    VsCode编辑器
    编辑器统一 快捷键
    前后端分离 方案
    资源
    commonJs的运行时加载和es6的编译时加载
    mock 数据 解决方案
  • 原文地址:https://www.cnblogs.com/xxwtfw/p/7289825.html
Copyright © 2011-2022 走看看