SQL>Create tablespace datafile ‘\osama.dbf’ size 1G;
Step Two : Check User On which Tablespace
sqlplus / as sysdba
spool osama.log
For the people who think differently Welcome aboard
SQL>Create tablespace datafile ‘\osama.dbf’ size 1G;
Step Two : Check User On which Tablespace
sqlplus / as sysdba
spool osama.log
connect / as sysdba
SQL> startup nomount;SQL> alter system dump datafile '/home/oracle/app/oracle/oradata/orcl/system01.dbf' block min 1 block max 2;
System altered.
tail -f /home/oracle/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_10680.trc
...
Start dump data block from file /home/oracle/app/oracle/oradata/orcl/system01.dbf minblk 1 maxblk 2
V10 STYLE FILE HEADER:
Compatibility Vsn = 186646528=0xb200000
Db ID=1229390655=0x4947033f, Db Name='ORCL'
...
SQL> alter system dump datafile '/home/oracle/app/oracle/oradata/orcl/undotbs01.dbf' block min 1 block max 2;
System altered.
tail -f /home/oracle/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_10680.trc
...
Start dump data block from file /home/oracle/app/oracle/oradata/orcl/undotbs01.dbf minblk 1 maxblk 2
V10 STYLE FILE HEADER:
Compatibility Vsn = 186646528=0xb200000
Db ID=1229390655=0x4947033f, Db Name='ORCL'
Thank you
Osama Mustafa
SELECT object_name, object_type, last_ddl_time
FROM dba_objects (or all_objects)
WHERE owner = <<owner of table>>
AND object_name = 'MY_TABLE'
Thank you
Osama mustafa
DDL_LOCK_TIMEOUT parameter indicates the number of seconds a DDL command should wait for the locks to become available before throwing the resource busy error message
For Example :
CREATE TABLE lock_tab (id NUMBER);INSERT INTO lock_tab VALUES (1);ALTER SESSION SET ddl_lock_timeout=30;ALTER TABLE lock_tab ADD (description VARCHAR2(50));ALTER TABLE lock_tab ADD (
*
ERROR at line 1:
ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
Ref :
Oracle_base
Thank you
Osama mustafa
run {
ALLOCATE CHANNEL disk1 DEVICE TYPE DISK FORMAT ‘/u01/Rman/%U’;
ALLOCATE CHANNEL disk2 DEVICE TYPE DISK FORMAT ‘/u02/Rman/%U’;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ‘u02/rman/%F’;
backup incremental level 0 database;
release channel disk1;
release channel disk2;
sql ‘alter system archive log current’;
ALLOCATE CHANNEL disk1 DEVICE TYPE DISK FORMAT ‘/u01/Rman/LOG_%t_%s_%p_%U’;
ALLOCATE CHANNEL disk2 DEVICE TYPE DISK FORMAT ‘/u02/Rman/LOG_%t_%s_%p_%U’;
backup archivelog all DELETE INPUT;
release channel disk1;
release channel disk2;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK CLEAR;
}
Thank you
Osama mustafa
The procedure kdswrt in dbms_system package allows us to write own messages in the alert log / trace files or both.It receives two parameters:
2. A text string (the message itself).
How to Use it :
exec dbms_system.ksdwrt(2, ‘ORA-10200: Error in Database.);
Sun Sep 29 10:00:57 2010
Thread 1 advanced to log sequence 7615 (LGWR switch)
Current log# 1 seq# 7615 mem# 0: u01/app/oracle/product/11.2.0/dbhome_1/REDO01.LOG
Sun Sep 29 11:10:15 2010
ORA-10200: Error in Database.
Sun Sep 29 11:10:15 2010
Thread 1 advanced to log sequence 7616 (LGWR switch)
Current log# 2 seq# 7616 mem# 0: u01/app/oracle/product/11.2.0/dbhome_1/REDO02.LOG
Sun Sep 29 10:00:57 2010
Thread 1 advanced to log sequence 7615 (LGWR switch)
Current log# 1 seq# 7615 mem# 0: u01/app/oracle/product/11.2.0/dbhome_1/REDO01.LOG
It is a very useful feature, as we can use it in our PL/SQL procedures inside the exception handling section or to indicate the procedure’s progression.
As i mention before my blog you can use X$DBGALERTEXT to check alert log via sqlplus (11g).
Thank you
Osama Mustafa
To check Datavase Backup
RMAN > Restore Validate Database ;
Check Two :
Check Spfile
RMAN > restore validate spfile to ‘c:\temp\spfile.ora’;
Check Three :
Test Control File
RMAN> restore validate controlfile to ‘c:\temp\control01.ctl’;
Check Four :
Test Archive log
RMAN> list backup of archivelog all;
or
RMAN> list backup of archivelog all completed after ‘sysdate -1’;
Then
RMAN> restore validate archivelog from sequence XXX until sequence XXX;
Thank you
Osama Mustafa
1) “With” clause can define PL/SQL functions
2) Improved defaults, including Default col to a sequence or “default if (on) null”. Or always use a generated as an identity (with optional sequence def info). Or Metadata-only defaults (default on an added column).
3) Bigger varchar2, nvarchar2, raw -up to 32K. But follows rules like LOB, if over 4K will be out of line. (max_SQL_String_Size init param)
4) TopN and Pagenation queries using the ‘OFFSET’ clause + optional ‘FETCH next N rows’ in SELECT. Eg: SELECT … FROM t ORDER BY y FETCH FIRST 5 ROWS
5) Row pattern matching using the “MATCH_RECOGNIZE” clause. Gonna take a while to get this one.
6) Partitioning improvements including ASYNC Global Index maintenance (includes new jobs to do work ‘later’), cascade truncate & exchange, multi ops in a single DDL, online partition moves (no RDBMS_REDEFINITION), “interval + reference” partitioning.
7) Adaptive execution plans, which sets thresholds and allows execution plans to switch if threshold is exceeded. (Also ‘gather_plan_statistics’ hint.) Shown by ‘Statistics Collector’ steps in trace/tkprof.
8) Enhanced statistics. Dynamic sampling goes to ‘eleven’, turning it persistent. New histograms: hybrid (for more than 254 distinct values, instead of height-balanced) and top. Stats gathered on data loads automatically. (By the way, don’t regather stats if not needed.) Session private statistics for GTTs.
9) UNDO for temporary objects, managed in TEMP, which eliminates REDO on the permanent UNDO. (ALTER SESSION/SYSTEM SET TEMP_UNDO_ENABLED=TRUE/FALSE)
10) Data optimization, or Information Lifecycle Management, which detects block use – hot, medium, dormant – and allows policies in table defintion (new ILM clause) to compress or archive data after time.
11) “transaction Guard’ to preserve commit state, which includes TAF r/w transfer and restart for some types of transactions.
12) pluggable databases! Implications too numerous to list right now. Suffice it to say, huge resource improvements, huge consolidation possibilities. Looking forward to reality.
Thank you
Osama mustafa
-bash-3.00$ emctl stop dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.1.0.7.0
Copyright (c) 1996, 2008 Oracle Corporation. All rights reserved.
https://rgpdb1.rg.com:1158/em/console/aboutApplication
Stopping Oracle Enterprise Manager 11g Database Control ...
... Stopped.
-bash-3.00$
-bash-3.00$
-bash-3.00$
-bash-3.00$ emctl start dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.1.0.7.0
Copyright (c) 1996, 2008 Oracle Corporation. All rights reserved.
https://rgpdb1.rg.com:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 11g Database Control ............................................................................................. failed.
------------------------------------------------------------------
Logs are generated in directory /pdb01/oraprod/db/tech_st/11.1.0/rgpdb1_rgprd1/sysman/log
Solution:
Check the following processes and kill them :
ps -ef | grep emagent
ps -ef | grep DEMS
-bash-3.00$ kill -9 PID
-bash-3.00$ kill -9 PID
Then
-bash-3.00$ emctl stop dbconsole-bash-3.00$ emctl start dbconsole
Thank you
Osama Mustafa
2. Oracle Flex ASM
Thank you Asif Momen .
Thank you
Osama Mustafa