oracleÊý¾Ý¿âÎļþÔÚ´ÅÅÌÖеÄÒƶ¯
1¡¢¹Ø±ÕÊý¾Ý¿â >>shutdown immediate;
2¡¢¿½±´Îļþ£¨*.dbf)µ½Ä¿µÄÎļþ¼Ð;
3¡¢Æô¶¯Êý¾Ý¿â >>startup mount;
4¡¢¸ü¸Ä·¾¶
>>alter database rename file 'C:\oracle\oradata\global\USERS01.DBF' to 'D:\oracle\USERS01.DBF';
>>alter database rename file 'C:\oracle\oradata\global\UNDOTBS01.DBF' to 'D:\oracle\UNDOTBS01.DBF';
5¡¢´ò¿ªÊý¾Ý¿â >>alter database open;
ÁíÍ⣬¿Éͨ¹ýÒÔÏÂÖ¸Áî²é¿´ËùÓбí¿Õ¼äÊý¾ÝÎļþλÖãº
select file_name from sys.dba_data_files;
Ïà¹ØÎĵµ£º
ÎÒÔÚ¹¤×÷ÖÐÔÚOracleÖжà±í²éѯÔÙ°´Ê±¼äµ¹Ðòʱ£¬ÓÃorder by ±íÃû.datatime desc ×ÜÊÇʵÏÖ²»ÁË¡£
²»¹ý×îºóÎÊÑî¾é×îºóºÍÎÒ˵¿ÉÒÔ°ÑÎÒÃDzéѯµÄ×ܸösqlÓï¾ä×öΪһ¸ö±íÀ´ÅÅÐò£º
select rownum,aa.* from (.... order by ±íÃû.datatime desc ) aa ......
INTERVAL YEAR TO MONTHÊý¾ÝÀàÐÍ
OracleÓï·¨:
INTERVAL 'integer [- integer]' {YEAR | MONTH} [(precision)][TO {YEAR | MONTH}]
¸ÃÊý¾ÝÀàÐͳ£ÓÃÀ´±íʾһ¶Îʱ¼ä²î, ×¢Òâʱ¼ä²îÖ»¾«È·µ½ÄêºÍÔÂ. precisionΪÄê»òÔµľ«È·Óò, ÓÐЧ·¶Î§ÊÇ0µ½9, ĬÈÏֵΪ2.
eg:
INTERVAL '123-2' YEAR(3) TO MONTH & ......
Àí½âoracleÖÐÁ¬½ÓºÍ»á»° 1. ¸ÅÄͬ£º¸ÅÄͬ£º
Á¬½ÓÊÇÖ¸ÎïÀíµÄÍøÂçÁ¬½Ó¡£
ÔÚÒѽ¨Á¢µÄÁ¬½ÓÉÏ£¬½¨Á¢¿Í»§¶ËÓëoracleµÄ»á»°£¬ÒÔºó¿Í»§¶ËÓëoracleµÄ½»»¥¶¼ÔÚÒ»¸ö»á»°»·¾³ÖнøÐС£
2. ¹ØϵÊǶà¶Ô¶à£º
Ò»¸öÁ¬½ÓÉÏ¿ÉÒÔ½¨Á¢0¸ö£¬1¸ö£¬2¸ö£¬¶à¸ö»á»°¡£
OracleÔÊÐí´æÔÚÕâÑùµÄ»á»°£¬¾ÍÊÇʧȥÁËÎïÀíÁ¬½ÓµÄ»á»°¡£
3. ¸ÅÄîÓ¦Ó㺸 ......
OracleÊý¾Ýµ¼Èëµ¼³öimp/exp¾ÍÏ൱ÓÚoracleÊý¾Ý»¹ÔÓ뱸·Ý¡£expÃüÁî¿ÉÒÔ°ÑÊý¾Ý´ÓÔ¶³ÌÊý¾Ý¿â·þÎñÆ÷µ¼³öµ½±¾µØµÄdmpÎļþ£¬impÃüÁî¿ÉÒÔ°ÑdmpÎļþ´Ó±¾µØµ¼Èëµ½Ô¶´¦µÄÊý¾Ý¿â·þÎñÆ÷ÖС£ÀûÓÃÕâ¸ö¹¦ÄÜ¿ÉÒÔ¹¹½¨Á½¸öÏàͬµÄÊý¾Ý¿â£¬Ò»¸öÓÃÀ´²âÊÔ£¬Ò»¸öÓÃÀ´ÕýʽʹÓá£
Ö´Ðл·¾³£º¿ÉÒÔÔÚSQLPLUS.EXE»òÕßDOS£¨ÃüÁîÐУ ......
-- ɾ³ýÖظ´¼Ç¼
DELETE from mytable t1 WHERE ROWID > (SELECT MIN (ROWID) from mytable t2 WHERE t1. key = t2.key);
-- µ±Ç°ÈÕÆÚ
SELECT TO_CHAR(SYSDATE, 'yyyy-MM-dd') from DUAL;
-- ÉÏÔµ±Ç°ÈÕÆÚ
SELECT TO_CHAR(ADD_MONTHS(SYSDATE,
-1), 'yyyy-MM-dd') from DUAL;
-- ÏÂÔµ±Ç°ÈÕÆÚ
SELECT
TO_C ......