日期:2014-05-16  浏览次数:20430 次

oracle命令记录本
oracle 控制台链接:sqlplus /nolog;conn fydsb/oracle@sid_ip
本机连oracle:sqlplus ”/as sysdba“

控制台cmd下导出oralcle数据

表:exp username/password@sid_ip file= d:\table.dmp tables=(tablename1,tablename2)
数据库:exp username/password@SID file=d:\example.dmp full=y
将某用户的表导出:exp username/password@SID file=d:\example.dmp owner=(system,sys)
导出表中固定字段数据:exp username/password@TEST file=d:\example.dmp tables=(table1) query=" where filed1 like '00%'"

控制台cmd下导入oralcle数据

imp system/manager@TEST  file=d:\example.dmp
imp aichannel/aichannel@TEST  full=y  file=d:\example.dmp ignore=y
imp system/manager@TEST  file=d:\example.dmp  tables=(table1)

oracle:ORA-28000错误解决方法:alter user username account unlock;
快速删除数据:TRUNCATE TABLE name


创建数据库过程

1.创建表空间:
create  tablespace nsf
datafile 'F:\oracle\oradata\orcl\nsf.dbf'
size 50m
autoextend on
next 50m maxsize 20480m
extent management local;

2.创建按用户:
create user nsf identified by orcl
default tablespace nsf
temporary tablespace temp;

3.授权:
GRANT CREATE USER,DROP USER,ALTER USER ,CREATE ANY VIEW ,select any  dictionary,
     DROP ANY VIEW,EXP_FULL_DATABASE,IMP_FULL_DATABASE,
      DBA,CONNECT,RESOURCE,CREATE SESSION  TO nsf;