This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare | |
v_string varchar2(4000) := ''; | |
begin | |
if v_string = '' then | |
raise_application_error(-20000, 'It''s not working!'); | |
else | |
raise_application_error(-20000, 'Hey, this is empty string!'); | |
end if; | |
end; | |
/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare | |
v_owner varchar2(4000) := '?'; | |
type t_varchar2_tab is table of varchar2(4000); | |
v_tables t_varchar2_tab := t_varchar2_tab( | |
'?', | |
'?' | |
); | |
begin | |
for i in 1..v_tables.count loop | |
dbms_stats.gather_table_stats( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select * | |
from table( | |
dbms_xplan.display_cursor( | |
( SELECT max(sql_id) keep (dense_rank first order by last_active_time desc) | |
FROM V$SQL | |
WHERE lower(sql_text) LIKE 'select /*+ gather_plan_statistics %'), | |
'', | |
'ALLSTATS ADVANCED LAST +PEEKED_BINDS' | |
) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set serveroutput on; | |
DECLARE | |
v_cursor_id number; | |
v_last_scale_division_idx number; | |
v_column_int number; | |
v_column_str varchar2(4000); | |
v_fetched_cnt number; | |
BEGIN | |
select max(column_id) | |
into v_last_scale_division_idx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare | |
v_error_message varchar2(4000); | |
function is_empty_field(p_field_name in varchar2, p_field_value in varchar2, p_error_message out varchar2) | |
return boolean is | |
begin | |
IF p_field_value is not null then | |
p_error_message := 'заполнено поле "'||p_field_name||'"'; | |
return true; | |
end if; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT s.username, | |
sl.sid, | |
sq.executions, | |
sl.last_update_time, | |
sl.sql_id, | |
sl.sql_hash_value, | |
opname, | |
target, | |
elapsed_seconds, | |
time_remaining, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select s.sql_id, t.sql_text | |
from V$SESSION s, v$sqltext_with_newlines t | |
where | |
s.status = 'ACTIVE' | |
and s.username = :p_schema | |
and s.machine = :p_machine | |
and t.address =s.sql_address | |
and t.hash_value = s.sql_hash_value | |
and s.sid = :p_sid | |
and s.type <>'BACKGROUND' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
semanage fcontext -a -t samba_share_t /root/downloads | |
chcon -R -t samba_share_t /root/downloads |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# description: Starts and stops the Oracle database and listeners | |
# processname: oracle | |
# chkconfig: 2345 20 80 | |
export ORACLE_BASE=/opt/oracle/app/oracle | |
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1 | |
export ORACLE_SID=vo2 | |
export PATH=$ORACLE_HOME/bin:$PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Description: /opt/tomcat7 Start Stop Restart | |
# processname: tomcat7 | |
# chkconfig: 2345 20 80 | |
export JDK_HOME=/usr/java/jdk1.6.0_37 | |
export JRE_HOME=/usr/java/jdk1.6.0_37/jre | |
CATALINA_HOME=/opt/tomcat7 | |
CATALINA_OPTS="-Xms512M -Xmx1024M" |
NewerOlder