• 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;

  • 相关阅读:
    Redis使用小结
    MongoDB中的变更通知
    发布一个从迅雷下载字幕的小工具
    在Windows下通过netsh命令实现端口映射
    .net core在Linux ARM板上运行
    通过WinAPI播放PCM声音
    spring中scope作用域(转)
    Spring <context:annotation-config/> 解说(转)
    Jenkins+Maven+SVN快速搭建持续集成环境(转)
    maven中跳过单元测试(转)
  • 原文地址:https://www.cnblogs.com/xxwtfw/p/7289825.html
Copyright © 2020-2023  润新知