zoukankan      html  css  js  c++  java
  • ORACLE基本用法及常用命令

    切换ORACLE用户 su - oracle
    ----------------------------
    重启数据库
    sqlplus sys / as sysdba
    shutdown immediate
    startup;
    ----------------------------
    导出单个表
    exp pls/yjt_pls2013@yjt file=/home/oracle/boz.dmp tables=EDU_VERSION_SET_AREA;
    导入单个表
    imp pls/yjt_pls2013@yjt file=RMS_RESOURCEBODY.dmp tables=EDU_VERSION_SET_AREA;
    exp tms/zzvcomTMS@youjt file=/home/oracle/boz.dmp tables=EDU_VERSION_SET_AREA;
     
     
    导出整个库
    su -oracle
    sqlplus / as sysdba
    create or replace directory DumpDir as '/home/oracle/pls';
    exit
     
    cd /home/oracle/pls
    expdp pls/yjt_pls DUMPFILE=zzpls2013.dmp DIRECTORY=DumpDir LOGFILE=zzpls2013.log SCHEMAS=pls
     
     
    导入整个库
    导入前先删除这个用户
    su - oracle
    sqlplus system/sys_98921
    drop user PLS cascade;
    commit;
    exit
    如果提示 无法删除当前连接的用户
    select username,sid,serial# from v$session where username like 'pls';
    alter system kill session 'sid,serial#';
     
    导入整个库
    cd /home/oracle/pls
    impdp system/sys_8968888 DUMPFILE=zzpls20130911.dmp DIRECTORY=DumpDir LOGFILE= zzpls20130911.log  SCHEMAS=pls
     
     
    约束表dba_constraints
    C (check constraint on a table) 
    P (primary key) 
    U (unique key) 
    R (referential integrity) 
    V (with check option, on a view) 
    O (with read only, on a view)
     
    oracle 查看某个表的约束
    select * from dba_constraints where owner='PLS' and table_name='SHARE_KNOWLEDG_STRUCTURE';
  • 相关阅读:
    概率论中几个入门公式
    记一道贝叶斯公式的裸题
    BZOJ3585: mex(主席树)
    利用MingW检验程序运行内存
    清北集训Day3T1(转换)
    万能pb_ds头文件—bits/extc++.h
    清北集训Day1T3 LYK loves jumping(期望DP)
    洛谷P1962 斐波那契数列(矩阵快速幂)
    namespace用法
    BZOJ4868: [Shoi2017]期末考试
  • 原文地址:https://www.cnblogs.com/blueskycc/p/4347848.html
Copyright © 2011-2022 走看看