oracle 基本语句

最近整理一下oralce的常用语句,借此记录一下,在网上都应该能搜到,这里主要是整理分享。

一、操作语句
建立表空间 MYDATE

CREATE TABLESPACE "MYDATE"   
DATAFILE 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\MYDATE'   
SIZE 1500M AUTOEXTEND   
ON NEXT 200M MAXSIZE   
UNLIMITED LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO 

 

 

建立用户highill,密码highill 并授权

-- Create the user highill  
  create user highill  
  identified by highill  
  default tablespace MYDATA  
  temporary tablespace TEMP  
  profile DEFAULT;  
-- Grant/Revoke role privileges   
  grant connect to highill;  
  grant dba to highill;  
  grant resource to highill;  
-- Grant/Revoke system privileges   
  grant unlimited tablespace to highill with admin option; 

 

 

--修改表空间大小

ALTER DATABASE DATAFILE 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\MYDATA' RESIZE 32000M 

 

 

数据库导入导出需要再cmd命令下进行
导出文件

cmd > exp highill/highill@ORCL file=d:/highill_2012.dmp  

 

 

导入文件(需要清空用户下所有函数、存储过程、表、视图、物化视图等)

cmd > imp highill/highill@ORCL file=d:/highill_2012.dmp full=y  

 

 

仅导入一个表MYTABLE

imp highill/highill@ORCL file=d:/highill_2012.dmp  tables=(MYTABLE)  

 

你可能感兴趣的:(oracle)