標籤:通過建立database link實現Oracle跨資料庫查詢的方法在Oracle本機資料庫端執行賦權dbuser帳號SQL> grant create database link to dbuser; 配置本機資料庫伺服器的tnsnames.ora檔案 $ vi $ORACLE_HOME/network/admin/tnsnames.ora增加需要遠端連線伺服器的串連配置,如:ORCL_REMOTE =(DESCRIPTION =(ADDRESS =
標籤:異常處理create or replace procedure pr_test3(v_bh in varchar2,v_xx out t_hq_ryxx%rowtype) isbegin select * into v_xx from t_hq_ryxx where bianh = v_bh;if sql%found then dbms_output.put_line(‘尋找到資料了‘);else dbms_output.put_line(‘未尋找到資料‘);end
標籤:分支語句/迴圈語句v_case number(3) := 100;begin if 2 < 1 then dbms_output.put_line(‘條件成立‘); elsif 4 > 3 then if 7 < 6 then dbms_output.put_line(‘條件不成立1‘); end if; elsif 6 > 5 then dbms_output.put_line(‘條件不成立2‘)
標籤:create or replace procedure pr_test1 isv_case number(3) := 100;--定義變數begin-- /*判斷語句if 2>1 then dbms_output.put_line(‘條件成立‘); else dbms_output.put_line(‘條件不成立‘); end if; if 2<1 then dbms_output.put_line(‘條件成立‘);elsif 4>3 then
標籤:[[email protected] ~]$ lsnrctl status LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 06-OCT-2015 21:10:05 Copyright (c) 1991, 2009, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))
標籤:[[email protected] ~]$ vi .bash_profile # .bash_profile # Get the aliases and functionsif [ -f ~/.bashrc ]; then . ~/.bashrcfi # User specific environment and startup programs PATH=$PATH:$HOME/bin
標籤:以啟動DB12為例子 $ sqlplus ‘/as sysdba‘SQL*Plus: Release 12.1.0.2.0 Production on Sun Nov 1 15:48:15 2015Copyright (c) 1982, 2014, Oracle. All rights reserved.Connected to an idle instance.1.nomount階段SQL> startup nomount;