玩转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
相关文档:
什么是合并多行字符串(连接字符串)呢,例如:
SQL> desc test;
Name Type Nullable Default Comments
------- ------------ -------- ------- --------
COUNTRY VARCHAR2(20) Y &nb ......
给团队内部做的一个Oracle 数据类型分享,主要是关于Oracle数据类型一些内部存储结构及性能介绍。
http://www.slideshare.net/yzsind/oracle-4317768
以下是PPT中unDumpNumber函数的全部代码:
create or replace function unDumpNumber(iDumpStr varchar2) return number is
TYPE ByteAr ......
一. 为表创建自增长自段有两种,一种是不同的表使用各自的Sequence,方法如下:
1、在Oracle sequence首先创建sequence create sequence seq_idminvalue 1start with 1increment by 1cache 20; 2.在你的hbm.xml中的配置 seq ......
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 ......