易截截图软件、单文件、免安装、纯绿色、仅160KB

玩转Oracle(5)

||-------  数据库管理  -------||
//显示初始化参数
show parameter;
//数据库表的逻辑备份与恢复
//导出
1.导出表
exp userid=scott/tiger@ORCL tables=(emp) file=d:\e1.dmp
2.导出其他方案的表,首先要确认自己是sysdba身份
exp userid=system@919959ORCL tables=(scott.emp) file=d:\e1.dmp
3.导出表结构
exp userid=scott/tiger@ORCL tables=(emp) file=d:\e3.dmp rows=n
4.使用直接导出方式(效率比普通导出方式快)
exp userid=scott/tiger@ORCL tables=(emp,dept) file=d:\e4.dmp direct=y
5.导出方案
exp userid=scott/tiger@ORCL owner=scott file=d:\e5.dmp
6.导出数据库,该用户必须是dba
exp userid=system/919959@ORCL full=y inctype=complete file=d:\e6.dmp
//导入
1.导入自己表
imp userid=scott/tiger@ORCL tables=(emp) file=d:\e1.dmp
2.导入表到其他用户
要求该用户具有dba权限,或是imp_full_database
imp userid=system/919959@ORCL tables(emp) file=d:\e2.dmp touser=scott
3.导入表的结构
imp userid=scott/tiger@ORCL tables=(emp) file=d:\e3.dmp rows=n
4.导入数据
imp userid=scott/tiger@ORCL tables=(emp) file=d:\e4.dmp ignore=y
||-------  表空间管理  -------||
建表空间需要dba用户权限
//建立表空间
create tablespace sp001 datafile 'd:\data01.dbf' size 20m uniform size 128k
//使用数据表空间
create table mypart(
deptno number(4),
dname varchar2(14),
loc varchar2(13)
) tablespace sp001;
//使表空间脱机
alter tablespace sp001 offline;
//使表空间联机
alter tablespace sp001 online;
//只读表空间
alter tablespace sp001 read only;
//修改表空间为可读可写
alter tablespace sp001 read write;
//显示表空间包括扩的所有表
select * from all_tables where tablespace_name='sp001';
//知道表明,查看该表属于哪个表空间
select tablespace_name ,table_name from user_tables where table_name='EMP';
//扩展表空间
1.增加数据文件
alter tablespace sp01 add datafile 'd:\sp01.dbf' size 20m;
2.增加数据文件大小(这里需要注意的是数据文件的大小不要超过500m)
alter database datafile 'd:\sp01.dbf' resize 20m;
3.设置文件的自动增长
alter tablespace datafile 'd:\sp


相关文档:

Oracle多行记录合并/连接/聚合字符串的几种方法

什么是合并多行字符串(连接字符串)呢,例如:
SQL> desc test;
Name     Type          Nullable Default Comments
------- ------------ -------- ------- --------
COUNTRY VARCHAR2(20) Y       &nb ......

Oracle审计功能

Oracle审计功能
一、    审计分类:
Oracle中审计总体上可分为“标准审计”和“细粒度审计”后者也称为“基于政策的审计”,在Oracle10G之后功能得到很大增强。其中标准审计可分为用户级审计和系统级审计。用户级审计是任何Oracle用户可设置的审计,主要是用户针对自己创建 ......

Oracle Trigger简单用法

1. trigger 是自动提交的,不用COMMIT,ROLLBACK
2. trigger最大为32K,如果有复杂的应用可以通过在TRIGGER里调用PROCEDURE或FUNCTION来实现。
3. 语法
CREATE OR REPLACE TRIGGER <trigger_name>
<BEFORE | AFTER> <ACTION>
ON <table_name>
DECLARE
 <variable definitions> ......

oracle EM

C:Documents and Settings>emca -repos create  
EMCA 开始于 2007-5-31 9:57:04  
EM Configuration Assistant 10.2.0.1.0 正式版  
版权所有 (c) 2003, 2005, Oracle。保留所有权利。  
输入以下信息:  
数据库 SID: ora10g  
监听程序端口号: 152 ......

Windows下的Oracle冷备份脚本,已经测试通过

共需要创建两个文件在同一个目录下:
一:
文件oracle_cool_backup.bat,内容如下:
Remark 定义时间日期变量
set date=%date:~0,10%
set h=%time:~0,2%
set m=%time:~3,2%
set s=%time:~6,2%
set tempvar=%date%-%h%-%m%-%s%
md "c:/temp/%tempvar%/"
echo %tempvar%
sqlplus /nolog @oracle_cool_backup.sql % ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号