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
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
发表评论
- 浏览: 1776 次
- 性别:

- 来自: 上海

- 详细资料
搜索本博客
最近加入圈子
链接
最新评论
-
System.getProperty()学习
-- by wangyu336 -
Log4j详细解
LZ费心了. 多学会整理整理是程序员的良好习惯.
-- by Fly_m -
Log4j详细解
很好,比较全,多谢。基本涵盖了所有常用到的点。正好需要
-- by moogle -
websphere,weblogic,tomca ...
不错!
-- by wangyu336






评论排行榜