ORACLE ʹÓÃDBMS_METADATA.GET_DDL»ñÈ¡DDLÓï¾ä
Oracle ÔÚ9iÒԺ󣬿ÉÒÔÀûÓÃDBMS_METADATA.GET_DDL°üµÃµ½Êý¾Ý¿âµÄ¶ÔÏóµÄddl½Å±¾¡£ÈçÏ£¨SQLPLUSÖÐÖ´ÐУ©£º
1. »ñÈ¡µ¥¸öµÄ½¨±í¡¢ÊÓͼºÍ½¨Ë÷ÒýµÄÓï·¨
set pagesize 0
set long 90000
set feedback off
set echo off
spool DEPT.sql
select dbms_metadata.get_ddl('TABLE','TAB_NAME','SCOTT') from dual;
select dbms_metadata.get_ddl('VIEW','VIEW_NAME','SCOTT') from dual;
select dbms_metadata.get_ddl('INDEX','IDX_NAME','SCOTT') from dual;
spool off;
2. »ñÈ¡Ò»¸öSCHEMAϵÄËùÓн¨±í¡¢ÊÓͼºÍ½¨Ë÷ÒýµÄÓï·¨£¬ÒÔscottΪÀý£º
set pagesize 0
set long 90000
set feedback off
set echo off
spool schema.sql
connect scott/tiger;
SELECT DBMS_METADATA.GET_DDL('TABLE',u.table_name) from USER_TABLES u;
SELECT DBMS_METADATA.GET_DDL('VIEW',u.VIEW_name) from USER_VIEWS u;
SELECT DBMS_METADATA.GET_DDL('INDEX',u.index_name) from USER_INDEXES u;
spool off;
3. »ñȡij¸öSCHEMAµÄ½¨È«²¿´æ´¢¹ý³ÌµÄÓï·¨
set pagesize 0
set long 90000
set feedback off
set echo off
spool procedures.sql
select DBMS_METADATA.GET_DDL('PROCEDURE',u.object_name) from user_objects u where object_type = 'PROCEDURE';
spool off;
4. »ñȡij¸öSCHEMAµÄ½¨È«²¿º¯ÊýµÄÓï·¨
set pagesize 0
set long 90000
set feedback off
set echo off
spool function.sql
select DBMS_METADATA.GET_DDL('FUNCTION',u.object_name) from user_objects u where object_type = 'FUNCTION';
spool off;
Ïà¹ØÎĵµ£º
µÚÒ»¿Î£º¿Í»§¶Ë
1. Sql Plus(¿Í»§¶Ë£©£¬ÃüÁîÐÐÖ±½ÓÊäÈ룺sqlplus£¬È»ºó°´ÌáʾÊäÈëÓû§Ãû£¬ÃÜÂë¡£
2. ´Ó¿ªÊ¼³ÌÐòÔËÐÐ:sqlplus£¬ÊÇͼÐΰæµÄsqlplus.
3. http://localhost:5560/ ......
Èç¹ûÄã½Ó´¥¹ýmysqlµÄ»°Ò»¶¨¶ÔmysqlµÄtextºÍblob²»»áÄ°Éú£¬ÔÚmysqlÖÐÊÇÖ±½Ó²Ù×÷textºÍblobµÄ¡£µ«ÊÇÔÚoracleÖУ¬Ëü°Ñlob×öΪһÖÖÌØÊâµÄ×ֶΣ¬²»ÄÜÖ±½Ó½øÐвÙ×÷--±ÈÈç²»ÄÜÖ±½Ó²åÈëµ½lob×Ö¶ÎÖУ¬Ò²²»ÄÜÓÃlike²éѯµÈµÈ¡£
ÕâÀïÊÇÎÒ±£´æµÄһƪÕâ·½ÃæµÄÎÄÕ£¬ÔÎÄ°á¹ýÀ´£¬ÓÉÓÚ±£´æµÄʱºòÖ»ÊÇÈ¡ÁËÒ»²¿·Ö£ ......
Oracle ×°Åä¹£¸Å
Òª²é¿´¿ÉÓà RAM ºÍ»¥»»¿Õ¼ä´óС£¬ÔË×÷ÒÔ´ÎÏÂÁ
grep MemTotal /proc/meminfo
grep SwapTotal /proc/meminfo
±ÈÈ磺
# grep MemTotal /proc/meminfo
MemTotal:512236 kB
# grep SwapTotal /proc/meminfo
SwapTotal:1574360 kB
½ÓÏÂÀ´£¬´´ÔìÓÃÀ´×°ÅäºÍά»¤ Oracle Ê®g Èí¼þµÄ Linux ×éºÍÓû ......
Èç¹û½ö½öÊÇlock£¬ÒÔÏÂÓï¾ä¿ÉÒÔ·¢ÏÖËùÓÐÓû§Ëø :
SELECT s.username,
decode(l.type, 'TM', 'TABLE LOCK', 'TX', 'ROW LOCK', NULL) LOCK_LEVEL,
o.owner,
o.object_name,
&n ......