在ORACLE和sql server中简单备份table的方法
如果temp_t1不存在,
oracle:
create table temp_t1
as
select * from t1
sql server:
select * into temp_t1 from t1
如果temp_t1存在,
oracle:
insert into table temp_t1
select * from t1
sql server:
insert into table temp_t1
select * from t1
相关文档:
v$database 数据库信息
v$datafile 数据文件信息
v$controlfile 控制文件信息
v$logfile 重做日志信息
v$instance 数据库实例信息
v$log 日志组信息
v$loghist 日志历史信息
v$sga 数据库SGA信息
v$parameter 初始化参数信息
v$process 数据库服务器进程信息
v$bgprocess 数据库后台进程信息
v$controlfil ......
AU
ASM的最小分配单元,默认是1M,可以在创建diskgroup时指定。在diskgroup中的每个盘都被切分为很多个AU,可以是1, 2, 4, 8, 16, 32, or 64MB。
File Extent
由一个或多个AU组成,一个file extent总是在一块磁盘上(不跨磁盘分配AU),这里的file extent和数据库中的extent是不同的,我们可以这样理解,这里的file ex ......
查询:select语句,多表查询,group by 分组,having 对分组后的每一个组进行过滤,order by 排序。(select语句多表查询这个最重要)
DML语句:insert into emp() values(),insert into emp (select * from emp2),
delete from emp where...
update emp set sal =.. where ..
rollback;恢复 ......
直接restore或附加应该是不行的, 用脚本+导数据肯定没有问题。
2005转到2000的步骤
1. 生成for 2000版本的数据库脚本
2005 的manger studio
-- 打开"对象资源管理器"(没有的话按F8), 连接到你的实例
-- 右键要转到2000的库
-- 任务
-- 生成脚本
-- 在"脚本向导"的"选择数据库"中, ......
这里介绍sql server2005里面的一个使用实例:
CREATE TABLE tb(province nvarchar(10),city nvarchar(10),score int)
INSERT tb SELECT '陕西','西安',3
UNION ALL SELECT '陕西','安康',4
UNION ALL SELECT '陕西','汉中',2
UNION ALL SELECT '广东','广州',5
UNION ALL SELECT '广东','珠海',2
UNION ......