Time of Update: 2015-07-29
標籤:原文出處(這是來自“百度文庫”中的文章寫得很不錯) PHP操作Oracle資料庫(OCI資料抽象層)OCI(Oracle 8 Call-Interface)是PHP中內建的資料庫抽象層函數。下面針對串連Oracle資料庫操作資料庫的常見任務舉例說明:=======================基本查詢:無條件查詢===================1、資料庫連接:函數:oci_connect()函數:resource oci_connect (
Time of Update: 2015-07-29
標籤:--函數的建立create function func1(dno number)return NUMBER--必須帶有傳回值is v_max number;--定義傳回值 begin select max(sal) into v_max--賦值 from emp where deptno= dno; RETURN v_max;--返回 end;--函數的調用,只能是運算式的一部分,不能單獨調用 select * from emp where sal= func1
Time of Update: 2015-07-29
標籤:1、先下載pl/sql,安裝、破解;這裡提供一個自己製作的plsql11本版的綠色漢化破解版:http://down.51cto.com/data/2075386http://download.csdn.net/detail/abc2536465230/8939917這兩個都是一樣的。2、下載oracle的instanct
Time of Update: 2015-07-29
標籤:一、問題描述 有時在“相互關聯的子查詢中”需要查詢某個實體類對應的某個欄位有多個值,如果不做行專列查詢,會提示返回多個列的錯誤。例如: 如所示,一個組合包,可能對應多個產品,需要你將所對應的多個產品都放到前台顯示。二、解決方案 表結構設計 首先,我們這裡採用相互關聯的子查詢的方式來擷取結果: 組合包和產品是一對多的關係,故一個組合包可以對應多個產品:select (select listagg(pp.product_name,‘,‘) within
Time of Update: 2015-07-29
標籤: create or replace trigger TRI_PrintTest before delete or insert or update on TEST_EXAM --觸發事件 for each row -- 每修改一行都需要調用此過程 begin dbms_output.put_line(:new.IDNEW); --IDNEW欄位更新後的值 dbms_output.put_line(:old.
Time of Update: 2015-07-29
標籤:oracle 資料庫 資料表空間 大小要查看Oracle資料庫資料表空間大小,是否需要增加資料表空間的資料檔案,在資料庫管理中,磁碟空間不足是DBA都會遇到的問題,問題比較常見。--1、查看錶空間已經使用的百分比Sql代碼
Time of Update: 2015-07-29
標籤:備份策略RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 2;RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 14 DAYS;啟用控制檔案自動備份及備份存放位置配置RMAN> configure controlfile autobackup on;查看配置資訊RMAN> show all;-------------------------
Time of Update: 2015-07-29
標籤:資料同步方案:--用DBLINK 建立與所需同步表的連結--------------------------------------------------------------------------------------------------參數 --dblink1 名稱 --csys使用者名稱稱 --**** 使用者密碼 --HOST 伺服器位址 --CONNECT_DATA 執行個體--------------
Time of Update: 2015-07-29
標籤:1.連結資料庫 引用System.Data.OracleClient; //資料庫連結字串 Data Source如:192.168.5.153:1521/orcl string linkStr = "User ID=" + name + "; Password=" + password + "; Data Source=" + oraLink; OracleConnection oraCon = new
Time of Update: 2015-07-29
標籤:-----解析ip 地址SQL> select utl_inaddr.get_host_address(‘google.com‘) from dual;UTL_INADDR.GET_HOST_ADDRESS(‘GOOGLE.COM‘)--------------------------------------------------------------------------------122.229.30.202-----擷取本機IP地址SQL> select
Time of Update: 2015-07-29
標籤://備份資料庫前的sqlplus命令建立資料庫dmp存入目錄sqlplus /nologconn /as sysdbaSQL> create or replace directory expdir as ‘E:/Kxdb‘;目錄已建立。cmd:// 匯出資料庫expdp EMMS/EMMS123 directory=expdir dumpfile=EMMS2.dmp logfile=EMMS2.log// 匯入dmpimpdp EMMS/EMMS123
Time of Update: 2015-07-29
標籤:注意last_call_et的值,select s.status,s.last_call_et,s.* from v$session s where username=‘DDD‘;在本例中,開了個sqlplus,然後對一張大表進行select * from
Time of Update: 2015-07-29
標籤:今兒個重裝了個系統,win8
Time of Update: 2015-07-28
標籤:SELECT * | { [ DISTINCT ] column | expression [ alias ] , ... }FROM table;?SELECT 標識
Time of Update: 2015-07-28
標籤:LessonAimWhile retrieving data from the database, you may need to restrict the rows of data that are displayed or specify the order in which the rows are displayed. This lesson explains the SQL statements that youuse to perform these actions.
Time of Update: 2015-07-28
標籤:寫了一個複雜的select語句,突然oracle就報了:ora-25153 暫存資料表空間為空白,這個錯誤,於是網上查了下,發現了如下解決方案:建立一個新的暫存資料表空間。首先要有system許可權,登入進去後,第一步,建立一個資料表空間,如下,引號中的d是盤符,oracleoradatatestdbtemp01是檔案名稱,100m是大小,temp01是臨時空間名稱,可修改。create temporary tablespace temp01 tempfile
Time of Update: 2015-07-28
標籤:轉自:http://jingyan.baidu.com/article/8275fc868ce57946a03cf692.html 一條sql突然執行變慢,耗時9秒,應用是不能改的,只能從資料庫方面下手解決步驟思路:1:查看sql是否走索引2:查看索引是否失效3:hint
Time of Update: 2015-07-28
標籤:轉自:http://blog.sina.com.cn/s/blog_682841ba0101bncp.html 1.analyze table t1 compute statistics for table; -->user_tables(只對錶的總體資訊進行統計,比如行數多少等,不涉及到表欄位) 2.analyze table t2 compute statistics for all columns;
Time of Update: 2015-07-28
標籤:命令: imp 資料庫使用者名稱/密碼@127.0.0.1:1521/orcl file=D:\txpt20150424.dmp full=y 若上面命令出現以下錯誤資訊 IMP-00058: 遇到 ORACLE 錯誤 12514ORA-12514: TNS: 監聽程式當前無法識別串連描述符中請求的服務IMP-00000: 未成功終止匯入 則使用下面語句匯入
Time of Update: 2015-07-28
標籤:一、初始情況描述: 登入sqlplus,無法登入。換pl/sql developer,提示:ORA-12514: TNS: 監聽程式當前無法識別串連描述符中請求的服務。二、我的應對: 1、首先我把在服務中把監聽服務和oracle服務重啟。(這時,感覺oracle服務在啟動的時候,比平時要快一點,也沒太在意,回頭來看,這是一個訊號...),然後繼續pl/sql developer登入,提示一樣。 2、在oracle網路設定助手中,把監聽程式重新設定,不成;建立一個,