zoukankan      html  css  js  c++  java
  • Oracle实用命令大全

    查询所有表空间名称
    select tablespace_name from dba_tablespaces;


    查看表空间的名称和状态
    select tablespace_name,status from dba_tablespaces;


    查询当前表空间属性
    select * from dba_tablespaces where tablespace_name='mtgyd'

    删除表空间与表空间文件(注意:如果在创建表空间的时候带有双引号,则删除的时候也要带上)
    DROP TABLESPACE "mtgyd" INCLUDING CONTENTS AND DATAFILES;

    删除当前表空间的用户
    drop user mtgyd cascade;

    修改当前用户的密码(一般开发版本,有密码过期,所以在过期后,修改密码)
    alter user system identified by manager;


    查询所有用户
    select username from dba_users;

    查询当前所有用户的session sid值
    select username,sid,serial# from v$session
    select saddr,sid,serial#,paddr,username,status from v$session where username is not null-------------------此项待定。

    通过查询当前连接用户的session sid值,删除其连接状态,则可以正常删除该用户。
    alter system kill session '115,348';
    -----------------USERNAME SID SERIAL# 此项暂时不需要用到。---------------------


    创建表空间
    create tablespace mtgyd_DB datafile 'D:\MyTools\oracle\oradata\sino\mtgyd_DB.dbf' size 100m autoextend on next 32m EXTENT management local;


    创建用户并指定对应表空间
    create user mtgyd identified by mtgyd default tablespace mtgyddb;


    给用户授权dba权限
    grant dba to mtgyd;


    导出exp  导入imp


    alter system kill session '115,348';
    USERNAME SID SERIAL#

    --------------------------------------ORACLE启动切换实例命令------------------------------------

    ---> sqlplus /nolog

    ---> conn / as sysdba

    ---> select name from v$database; // 查询当前实例名

    ---> select instance_name, status from v$instance; // // 查看实例状态

    ---> !lsnrctl status;查看实例监听器 

    ---> startup 
  • 相关阅读:
    .net core webapi发布到linux中
    封装EF,使用仓储模式所遇到的问题
    oracle取分组的前N条数据
    20141124
    搭建discuz论坛(2)
    安装apache mysql 论坛(一)
    L13 DNS
    L10 PUtty+SSH 访问vncviewer
    L12 samba服务器搭建
    L10 数据入站、转发、出站流程
  • 原文地址:https://www.cnblogs.com/cnzz84/p/4098827.html
Copyright © 2011-2022 走看看