添加表空间:
CREATE TABLESPACE OIS
DATAFILE 'C:appHuiMu06oradataorclOIS.dbf'
SIZE 200M
AUTOEXTEND ON;
添加用户:
CREATE USER pacs
IDENTIFIED BY pacs
DEFAULT TABLESPACE PACS
TEMPORARY TABLESPACE temp;
添加权限:
GRANT CREATE SESSION,CREATE TABLE,CREATE VIEW,CREATE SEQUENCE,UNLIMITED TABLESPACE TO pacs;
GRANT CONNECT TO pacs;
GRANT RESOURCE TO pacs;
GRANT DBA TO pacs;
导出数据库:
exp ois_eb/ois_eb@c1.njhuimu.com:1521/orcl file=E:ois_eb.dmp 需要全部信息的时候加上full=y 需要特定用户的时候加上owner=ois
导入数据库:
imp sys/oracle@testxxxx as sysdba file=G:sx20190325.dmp full=y ignore=y ignore=y 代表着忽略错误继续运行
删除非空表空间:
drop tablespace tablespace_name including contents and datafiles;
查找表被应用在哪些视图中:
select * from dba_dependencies where REFERENCED_NAME='表名' and TYPE='VIEW';
创建视图或存储过程调用其他用户表提示权限不足:
GRANT SELECT ANY TABLE TO USER_A WITH ADMIN OPTION; USER_A是指创建视图或存储过程的用户,语句由表的拥有者运行
查询表的字段及其对应的注释:
select a.column_name column_name,a.comments comments from user_col_comments a where a.table_name = 'tab_name';