ORACLEÏÂɾ³ýµ±Ç°Óû§ÏÂËùÓжÔÏóµÄSQL
ORACLEÏÂɾ³ýµ±Ç°Óû§ÏÂËùÓжÔÏóµÄSQL
Sql´úÂë
--ɾ³ýij¸öÓû§ÏµĶÔÏó
set heading off;
set feedback off;
spool c:\dropobj.sql;
prompt --Drop constraint
select 'alter table '||table_name||' drop constraint '||constraint_name||' ;' from user_constraints where constraint_type='R';
prompt --Drop tables
select 'drop table '||table_name ||';' from user_tables;
prompt --Drop view
select 'drop view ' ||view_name||';' from user_views;
prompt --Drop sequence
select 'drop sequence ' ||sequence_name||';' from user_sequences;
prompt --Drop function
select 'drop function ' ||object_name||';' from user_objects where object_type='FUNCTION';
prompt --Drop procedure
select 'drop procedure '||object_name||';' from user_objects where object_type='PROCEDURE';
prompt --Drop package
prompt --Drop package body
select 'drop package '|| object_name||';' from user_objects where object_type='PACKAGE';
prompt --Drop database link
select 'drop database link '|| object_name||';' from user_objects where object_type='DATABASE LINK'; &
Ïà¹ØÎĵµ£º
Mysql£¬SqlServer£¬OracleÖ÷¼ü×Ô¶¯Ôö³¤µÄÉèÖÃ
1¡¢°ÑÖ÷¼ü¶¨ÒåΪ×Ô¶¯Ôö³¤±êʶ·ûÀàÐÍ
ÔÚmysqlÖУ¬Èç¹û°Ñ±íµÄÖ÷¼üÉèΪauto_incrementÀàÐÍ£¬Êý¾Ý¿â¾Í»á×Ô¶¯ÎªÖ÷¼ü¸³Öµ¡£ÀýÈ磺
create table customers(id int auto_increment primary key not null, name varchar(15));
insert into customers(name) values("name1"),("nam ......
create table test1 as select 1 id,'create table test2(id number,name varchar2(200));insert into test2 values(1,''a'');' sqltext from dual
2 union all select 2,'truncate table test2;' from dual
3 union all select 3,'insert into test2 select rownum,dbms_random.string(''l'', ......
oracleÈÃid×Ô¶¯Ôö³¤£¨insertʱ²»ÓÃÊÖ¶¯²åÈëid£©µÄ°ì·¨£¬ÏñMysqlÖеÄauto_incrementÄÇÑù
´´½¨ÐòÁÐ
create sequence emp_seq
increment by 1
start with 1
nomaxvalue
nocycle
......
Êý¾ÝÀàÐÍ
²ÎÊý
ÃèÊö
char(n)
n=1 to 2000×Ö½Ú
¶¨³¤×Ö·û´®£¬n×Ö½Ú³¤£¬Èç¹û²»Ö¸¶¨³¤¶È£¬È±Ê¡Îª1¸ö×Ö½Ú³¤£¨Ò»¸öºº×ÖΪ2×Ö½Ú£©
varchar2(n)
n=1 to 4000×Ö½Ú
¿É±ä³¤µÄ×Ö·û´®£¬¾ßÌ嶨ÒåʱָÃ÷×î´ó³¤¶Èn£¬
ÕâÖÖÊý¾ÝÀàÐÍ¿ÉÒÔ·ÅÊý×Ö¡¢×ÖĸÒÔ¼°ASCIIÂë×Ö·û¼¯(»òÕßEBCDICµÈÊý¾Ý¿âϵͳ½ÓÊܵÄ×Ö·û¼¯±ê×¼)ÖеÄËùÓзûºÅ¡£
Èç¹ ......
ÁÙʱ±íµÄ¸ÅÄ
ÔÚOracleÊý¾Ý¿âÖл¹ÓÐÒ»ÖÖÀàÐÍµÄ±í£¬½Ð×öÁÙʱ±í¡£Õâ¸öÁÙʱ±í¸úÓÀ¾Ã±í×î´óµÄÇø±ð¾ÍÊDZíÖеÄÊý¾Ý²»»áÓÀÔ¶µÄ´æÔÚ¡£µ±Ò»¸ö»á»°½áÊø»òÕßÊÂÎñ½áÊøµÄʱºò£¬Õâ¸öÁÙʱ±íÖеÄÊý¾Ý£¬²»ÓÃÓû§×Ô¼ºÉ¾³ý£¬Êý¾Ý¿â×Ô¼º»á×Ô¶¯Çå³ý¡££¨±íÊÇÈ«¾Ö£¬Ö»ÊÇÊý¾ÝÏûʧ£©
O ......