-- Get
select sessiontimezone from dual;
--Db timezone
select dbtimezone from dual;
-- Set
set ora_sdtz=db_tz
or
alter session set time_zone=dbtimezone;
--change db time_zone
16:51:23 SQL> alter database set time_zone='+01:00';
Database altered.
16:55:11 SQL> create table t_lt (id timestamp with local time zone);
Table created.
Elapsed: 00:00:00.64
16:55:29 SQL> alter database set time_zone='+01:00';
Database altered.
Elapsed: 00:00:00.06
16:55:31 SQL> alter database set time_zone='+02:00';
Database altered.
16:56:16 SQL> insert into t_lt select systimestamp from dual;
1 row created.
Elapsed: 00:00:00.07
16:56:33 SQL> commit;
Commit complete.
Elapsed: 00:00:00.00
16:56:35 SQL> alter database set time_zone='+01:00';
alter database set time_zone='+01:00'
*
ERROR at line 1:
ORA-30079: cannot alter database timezone when database has TIMESTAMP WITH LOCAL TIME ZONE columns
This site contains information, scripts and instructions related to Oracle database and other technologies. Please use sqlplus and test my scripts on test environment before actual use on production. All relevant comments are welcome.
Страницы
- Main
- Veritas cluster
- AIX
- Solaris
- Linux
- Performance scripts
- RAC
- TNS
- Init parameters
- Dataguard
- ASM
- Unix tips
- VxVM
- Linux HA (hearbeat)
- Oracle internals
- Metalink (useful notes)
- Security
- OGG Oracle Golden Gate
- HTML/JavaScript in sqlplus
- Automatic TSPITR 11.2.0.3 (dropped user)
- 12.1
- SQL Performance Analyzer
- Backup/Recovery
- Alert log
вторник, 7 декабря 2010 г.
понедельник, 6 декабря 2010 г.
dbms_scheduler using as dbms_job.submit
exec dbms_scheduler.create_job(job_name => DBMS_SCHEDULER.GENERATE_JOB_NAME, job_type => 'plsql_block', job_action => 'begin raise_application_error(-20000, ''error_in_alert''); end;', start_date => sysdate, enabled => true);
ora-04031
orafaq
set lines 300
select to_char(to_number(v.KSPPSTVL), '999999999') min_to_go_to_reserved, to_char(s.request_failures, '99999999') ora04031
, to_char(s.last_failure_size, '999999999999') failure_size, trunc(s.free_space/1024/1024) free_reserved_m, max_free_size largest
, to_char(stat.bytes, '999999999') shs_pool_free
from x$ksppi n,
x$ksppsv v,
v$shared_pool_reserved s
, v$sgastat stat
where n.indx = v.indx
and n.ksppinm = '_shared_pool_reserved_min_alloc'
and stat.pool = 'shared pool'
and stat.name = 'free memory'
;
Issue if REQUEST_FAILURES > 0:
Shared pool - fragmentation? or low memory
if LAST_FAILURE_SIZE < SHARED_POOL_RESERVED_MIN_ALLOC
else Shared pool reserved -
fragmentation?
if max_free_size < failure_size and free_space > failure_size
or low memory
-- Free shared memory hist
select t.BEGIN_INTERVAL_TIME, s.bytes
from DBA_HIST_SGASTAT s,
dba_hist_snapshot t
where s.pool = 'shared pool' and s.name = 'free memory'
and t.snap_id = s.snap_id
order by 1;
set lines 300
select to_char(to_number(v.KSPPSTVL), '999999999') min_to_go_to_reserved, to_char(s.request_failures, '99999999') ora04031
, to_char(s.last_failure_size, '999999999999') failure_size, trunc(s.free_space/1024/1024) free_reserved_m, max_free_size largest
, to_char(stat.bytes, '999999999') shs_pool_free
from x$ksppi n,
x$ksppsv v,
v$shared_pool_reserved s
, v$sgastat stat
where n.indx = v.indx
and n.ksppinm = '_shared_pool_reserved_min_alloc'
and stat.pool = 'shared pool'
and stat.name = 'free memory'
;
Issue if REQUEST_FAILURES > 0:
Shared pool - fragmentation? or low memory
if LAST_FAILURE_SIZE < SHARED_POOL_RESERVED_MIN_ALLOC
else Shared pool reserved -
fragmentation?
if max_free_size < failure_size and free_space > failure_size
or low memory
-- Free shared memory hist
select t.BEGIN_INTERVAL_TIME, s.bytes
from DBA_HIST_SGASTAT s,
dba_hist_snapshot t
where s.pool = 'shared pool' and s.name = 'free memory'
and t.snap_id = s.snap_id
order by 1;
среда, 1 декабря 2010 г.
iot mapping table
-- create
ALTER TABLE countries move MAPPING TABLE;
-- drop
ALTER TABLE countries move noMAPPING;
ALTER TABLE countries move MAPPING TABLE;
-- drop
ALTER TABLE countries move noMAPPING;
вторник, 30 ноября 2010 г.
rman datafile offline
sql "alter database datafile ''C:\ORACLE\PRODUCT\10.2.0\DB_3\DATABASE\UNNAMED00004'' offline";
вторник, 23 ноября 2010 г.
Подписаться на:
Сообщения (Atom)
Update BLOB
set define off DECLARE vb1 CLOB := 'long text'; vb2 CLOB := 'long text'; vb3 CLOB := ...
-
0) Generate the diff plan report We have sql_id gu7rvn4s4rb0m, and 2 child cursors 0 and 2 variable v clob set serveroutput on set auto...
-
aus@linux-nn5t:~/Desktop> su - Password: linux-nn5t:~ # /etc/init.d/vboxdrv setup Stopping VirtualBox kernel modules ...
-
-- After media failure 03:03:25 150 4294967295 SYS@orcl> select * from t_t where object_name = 'test'; select * from t_t where ob...