2008-04-18

SQL(ORACLE)常用的SQL语句

关键字: 常用的sql语句
--创建用户--
Create User 'UserNam' Identified By 'PassWord' Profile Default Default Tablespace users Temporary Tablespace 'TableSpaceName' Account Unlock;
--查看表空间,分配大小--
Select t.tablespace_name,round(sum(bytes/(1024*1024)),0) ts_size From dba_tablespaces t,dba_data_files d where t.tablespace_name = d.tablespace_name group by t.tablespace_name;
--查看表空间使用情况--
Select sum(bytes)/(1024*1024) as free_space,tablespace_name from dba_free_space Group by tablespace_name;
--查看数据库创建时间--
Select Created,Log_Mode,Log_Mode From V$Database;
--查看数据库版本--
Select version FROM Product_component_version Where SUBSTR(PRODUCT,1,6)='Oracle';
--查看还没有提交的事务--
Select * from v$transaction;
--查看锁住的进程的操作系统进程--
select * from v$locked_object;
--导出数据表---
exp statuser/wonderstat@stat file=E:\060227_statuser_bak.dmp owner=statuser direct=y log=E:\exp.log
--导入数据表---
**不需要指定表**
imp statuser/wonderstat@WONDER_DEVLOP file=c:\temp\Macro_Indr(2008-04-14).dmp ignore=y fromuser=statuser touser=statuser
**需要指定表**
imp statuser/wonderstat@WONDER_DEVLOP touser=statuser ignore=y tables=(macro_data) file=f:\Macro_data_2008_02_25.dmp
评论
发表评论

您还没有登录,请登录后发表评论

wangyu336
搜索本博客
最近加入圈子
存档
最新评论