OracleÒÆ¶¯datafileµÄλÖÃ
Ëæ×Åʱ¼äµÄÍÆÒÆ£¬ÓпÉÄÜÔÀ´Ã»Óй滮ºÃµÄÊý¾ÝÎļþËùÔÚµÄÅ̿ռäÒѾ²»¹»ÁË£¬»òÕßÎÒÃÇÓÐÐèÒª°ÑÒ»¸ödatafileÒÆ¶¯ºÃÆäËûµÄµØ·½£¬ÕâʱºòÎÒÃǸÄÈçºÎ²Ù×÷ÄØ£¿
ÕâÀïÓÐ×î¼òµ¥µÄÒ»¸ö·½·¨
1. offlineÊý¾ÝÎļþËù±»°üº¬µÄtablespace£¬
alter tablespace testts offline;
2. rename ÔÓеÄdatafileÖ¸Ïòеķ¾¶
#cp /opt/oracle/oradata/orcl/testts01.dbf /opt/oracle/oradata/test/testts01.dbf
SQL>alter tablespace testts rename datafile ‘/opt/oracle/oradata/orcl/testts01.dbf’
to ‘/opt/oracle/oradata/test/testts01.dbf’;
»òÕßÓÃdatafile ÐòºÅ
alter tablespace testts rename datafile 3
to ‘/opt/oracle/oradata/test/testts01.dbf’;
3. onlineÒѾ¸ÄºÃµÄtablespace
SQL> alter tablespace testts online;
×Դ˲Ù×÷Íê³É¡£
Ïà¹ØÎĵµ£º
1. ²é¿´Oracle´´½¨¹ýÄÄЩÓû§
>select username from all_users;
2. ²é¿´Oracle´´½¨¹ýÄÄЩ±í¿Õ¼ä£¬±í¿Õ¼äµÄÃû×ֺʹóС
>select t.tablespace_name, round(sum(bytes/(1024*1024)),0) ts_size
from dba_tablespaces t, dba_data_files d
wher ......
select a.constraint_name, a.table_name, b.constraint_name
from user_constraints a, user_constraints b
where a.constraint_type = 'R'
and b.constraint_type = 'P'
and a.r_constraint_name = b.constraint_name
P ´ú±íÖ÷¼ü
R ´ú±íÍâ¼ü ......
select bid from t_branch c start with c.upbid ='11000000' connect by prior c.bid=c.upbid
˵Ã÷£º
1¡¢Í³¼ÆÄ³¸ö»ú¹¹ÏÂËùÓеÄ×ÓËï»ú¹¹¡£Èçͳ¼Æ±±¾©»ú¹¹ÏµÄ×ÓËï»ú¹¹£¬°üÀ¨£º³¯ÑôÇø»ú¹¹¡¢º£µíÓªÏú»ú¹¹¡¢¡¢¡¢ÇàÁúÇÅÏç»ú¹¹¡¢¡¢¡¢¡¢Ò»Ö±µ½×îµ×²ãµÄ»ú¹¹¡£
2¡¢upbidÊÇÖ¸Éϼ¶»ú¹¹µÄID¡£º£µíÇø»ú¹¹ID(bid)µÄÉϼ¶»ú ......
Ҫʹһ¸ö¿Í»§¶Ë»úÆ÷ÄÜÁ¬½Ó
oracle
Êý¾Ý¿â£¬ÐèÒªÔÚ¿Í»§¶Ë»úÆ÷Éϰ²×°
oracle
µÄ¿Í»§¶ËÈí¼þ£¬Î¨Ò»µÄÀýÍâ¾ÍÊÇ
java
Á¬½ÓÊý¾Ý¿âµÄʱºò£¬¿ÉÒÔÓÃ
jdbc thin
ģʽ£¬²»ÓÃ×°
oracle
µÄ¿Í»§¶ËÈí¼þ¡£¼ÓÈëÄãÔÚ»úÆ÷ÉÏ×°ÁË
oracle
Êý¾Ý¿â£¬¾Í²»ÐèÒªÔÚµ¥¶ÀÔڸûúÆ÷Éϰ²×°
oracle
¿Í»§¶ËÁË£¬ÒòΪװ
oracle
Êý¾Ý¿âµÄʱºò»á×Ô¶ ......
²éÕÒÊý¾Ý¿âÖÐËùÓÐ×Ö¶Î ÒÔ¶ÔÓ¦µÄ±í
select C.column_name,C.TABLE_NAME from dba_tab_columns C where owner=''
²éÿ¸ö¿ÆÄ¿class ·ÖÊýscroǰÈýÃû
select id, name, class, scro
from (select row_number() over(partition by class order by scro desc) cnt,
&n ......