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 user_password_limits; |
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
col COMPATIBILITY form a10 | |
col DATABASE_COMPATIBILITY form a10 | |
col NAME form a20 | |
select group_number, name, compatibility, database_compatibility from v$asm_diskgroup; |
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
-- Average DB Time over the past week | |
select instance_number, avg(dbtime_min) avg_dbtime_min | |
from ( | |
select a.instance_number, begin_interval_time, end_interval_time, | |
round((a.value-lag(a.value) over (order by a.instance_number, a.snap_id ))/1000000/60,2) dbtime_min | |
from dba_hist_sys_time_model a, dba_hist_snapshot b | |
where a.snap_id = b.snap_id and a.instance_number = b.instance_number | |
and a.stat_name = 'DB time' | |
) |
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
-- exécuter un snapshot sur les DEUX INSTANCES | |
EXEC perfstat.statspack.snap; | |
variable jobno NUMBER; | |
BEGIN | |
FOR inst IN (SELECT dbid, inst_id AS id FROM gv$database) LOOP | |
STATSPACK.MODIFY_STATSPACK_PARAMETER( | |
i_snap_level => 7, | |
i_dbid => inst.dbid, | |
i_instance_number => inst.id |
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
alter database add logfile ('+DATA', '+DATA') size 100m; | |
... | |
alter database drop logfile group 1; | |
... | |
alter system switch logfile; | |
alter system checkpoint; |
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
foreach($inputFile in get-childitem -recurse | Where-Object { @('.m4a','.aac') -contains $_.extension }) | |
{ | |
$outputFileName = [System.IO.Path]::GetFileNameWithoutExtension($inputFile.FullName) + ".mp3"; | |
$outputFileName = [System.IO.Path]::Combine($inputFile.DirectoryName, $outputFileName); | |
$programFiles = ${env:ProgramFiles(x86)}; | |
if($programFiles -eq $null) { $programFiles = $env:ProgramFiles; } | |
$processName = $programFiles + "\VideoLAN\VLC\vlc.exe" |
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 pid, state, | |
CASE WHEN wait_event is not null | |
THEN concat(wait_event, ' (', wait_event_type, ')') | |
ELSE NULL::text END AS lock_intel, | |
pg_blocking_pids(pid) AS blocked_by, | |
substr(query, 1, 20) | |
FROM pg_stat_activity | |
WHERE state IS NOT NULL; |
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
date -d "$(cut -f1 -d' ' /proc/uptime) seconds ago" |
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
CREATE INDEX &schema.&index_part | |
ON &schema.&table_name(TO_NUMBER(TO_CHAR(TO_DATE(TO_CHAR(&column),'YYYYMMDD'),'IYYYIW'))) | |
LOCAL UNUSABLE; |
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
-- ----------------------------------- | |
-- FUNCTION: easter_date | |
-- ----------------------------------- | |
CREATE OR REPLACE FUNCTION easter_date(year integer) | |
RETURNS timestamp as $$ | |
DECLARE | |
g integer := year % 19; | |
c integer := (year/100)::int; | |
h integer := ((c - (c/4)::int - ((8*c+13)/25)::int + 19*g + 15) % 30)::int; | |
i integer := h - (h/28)::int * (1 - (h/28)::int * (29/(h + 1))::int * ((21 - g)/11)::int); |