SQL> select * from test ;
no rows selected
SQL> desc test ;
Name Null? Type
—————————————– ——– —————————-
TEST_ID NOT NULL NUMBER
TEST_NAME VARCHAR2(20)
SQL> truncate table test cascade ;
Table truncated.
More Features coming up 🙂
For the people who think differently Welcome aboard
SQL> select * from test ;
no rows selected
SQL> desc test ;
Name Null? Type
—————————————– ——– —————————-
TEST_ID NOT NULL NUMBER
TEST_NAME VARCHAR2(20)
SQL> truncate table test cascade ;
Table truncated.
More Features coming up 🙂
But with oracle database 12c this concept is changed new features add when you create table called generated as identity.
Check the Below Demonstration which explain this new features :
SQL> create table test (test_id number generated as identity , test_name varchar2(20));
SQL> desc test ;
Name Null? Type
—————————————– ——– ————–
TEST_ID NOT NULL NUMBER
TEST_NAME VARCHAR2(20)
SQL> insert into test values (1,’osama’);
insert into test values (1,’osama’)
*
ERROR at line 1:
ORA-32795: cannot insert into a generated always identity column
The TEST_ID Column will be inserting automatically no need to use in insert command.
SQL> insert into test (TEST_NAME) values ( ‘Jennifer’ );
1 row created.
SQL> select * from test ;
TEST_ID TEST_NAME
———- ——————–
1 Jennifer
SQL> create table test2 (TEST_ID NUMBER generated as identity (start with 1 increment by 1 cache 30 order), TEST_NAME varchar2(20));
Table created.
SQL> insert into test2 (test_name) values (‘JENNIFER’);
SQL> insert into test2 (test_name) values (‘STEVE’);
SQL> insert into test2 (test_name) values (‘USER’);
SQL> select * from test2 ;
TEST_ID TEST_NAME
———- ——————–
1 JENNIFER
2 STEVE
3 USER
Check the https://support.oracle.com note :
Oracle Database 12.1 : FAQ on Queryable Patch Inventory [ID 1530108.1]
from the name you can see it’s retrieve information using query, and to use query you have to get access to SQL Plus, this features allow you access to the OPatch information from within the database. This Package called DBMS_QOPATCH
Some of Attribute to use with this package :
SQL> select dbms_qopatch.get_opatch_lsinventory() from dual;
DBMS_QOPATCH.GET_OPATCH_LSINVENTORY()
——————————————————————————–
SQL> select dbms_qopatch.GET_PENDING_ACTIVITY() from dual;
DBMS_QOPATCH.GET_PENDING_ACTIVITY()
——————————————————————————–
For the first time in Oracle Database you can move objects online without offline or shutdown database which is very useful and helpful for any DBA’s
Check the example below :
SQL> select file_name from dba_data_files ;
FILE_NAME
——————————————————————————–
/u01/app/oracle/oradata/db12c/system01.dbf
/u01/app/oracle/oradata/db12c/sysaux01.dbf
/u01/app/oracle/oradata/db12c/users01.dbf
/u01/app/oracle/oradata/db12c/undotbs01.dbf
SQL> select File_name from dba_data_files ;
FILE_NAME
——————————————————————————–
/u01/system.dbf
/u01/app/oracle/oradata/db12c/sysaux01.dbf
/u01/app/oracle/oradata/db12c/users01.dbf
/u01/app/oracle/oradata/db12c/undotbs01.dbf
Thank you
Osama mustafa
SQL> create table test ( id number);
Table created.
SQL> create view test_vw as select * from test ;
View created.
SQL> create directory dump as ‘/u01/dump’;
Directory created.
SQL> grant read,write on directory dump to osama ;
Grant succeeded.
Hardware
you need to configure Swap Memory And make sure you RAM is enough to avoid Out Of memory during the installation.
Software
as i mention before check certified OS with database, in my case i will use Redhat 6 update 4.
install Packages :
binutils-2.20.51.0.2-5.11.el6 (x86_64)
glibc-2.12-1.7.el6 (x86_64)
libgcc-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6 (x86_64)
libaio-0.3.107-10.el6 (x86_64)
libXext-1.1 (x86_64)
libXtst-1.0.99.2 (x86_64)
libX11-1.3 (x86_64)
libXau-1.0.5 (x86_64)
libxcb-1.5 (x86_64)
libXi-1.3 (x86_64)
make-3.81-19.el6sysstat-9.0.4-11.el6 (x86_64)
compat-libcap1-1.10-1 (x86_64)
compat-libstdc++-33-3.2.3-69.el6 (x86_64)
gcc-4.4.4-13.el6 (x86_64)
gcc-c++-4.4.4-13.el6 (x86_64)
glibc-devel-2.12-1.7.el6 (x86_64)
ksh <== any version of ksh is acceptable
libstdc++-devel-4.4.4-13.el6 (x86_64)
libaio-devel-0.3.107-10.el6 (x86_64)
inside /etc/sysctl.conf
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
Use this command to restart kernel /sbin/sysctl -p
/etc/hosts
Serverip Hostname
/etc/security/limits.conf
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768
/etc/pam.d/login
session required pam_limits.so
after edit OS parameter you need to create Oracle user :
groupadd -g 101 oinstall
groupadd -g 102 dba
groupadd -g 103 oper
useradd -u 100 -g oinstall -G dba,oper oracle
passwd oracle
copy media to your Server , and do the following :
chown -R oracle:oinstall /u01/database
chmod -R 775 /u0/database
mkdir -p /u01/app/oracle/product/12.1.0/db_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01
now start installation by ./runInstaller
to Create Database you need to configure listener using netca and after finished successfully use dbca like below :
I Upload the article Here
Thank you
Osama mustafa
SQL > SELECT START_SCN,OPERATION,LOGON_USER,XID FROM FLASHBACK_TRANSACTION_QUERY WHERE TABLE_NAME=’TEST’;
The Output will be like this :
XID TABLE_OWNER TABLE_NAME OPERATION LOGON_USER UNDO_SQL
—————- ———– ———- ——————————– ———- —————
0600090064030000 TX UNKNOWN TEST
0600090064030000 TX UNKNOWN TEST
To avoid Unknown Status enable supplemental logging by
SQL> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA ;
Database altered.
Thank you
Osama mustafa
ORA-00600: internal error code, arguments: [4193], [4271], [4056], [], [], [], [], []
SQL> show parameter undo
NAME TYPE VALUE
———————————— ———– ——————————
undo_management string AUTO
undo_retention integer 900
undo_tablespace string UNDOTBS
SQL> alter system set undo_management=’MANUAL’ scope=spfile;
SQL > Shutdown immediate ;
SQL > Startup ;
SQL > create undo tablespace NEW_UNDOTBS datafile ‘/u01/app/oracle/oradata/SID/NEW_UNDOTBS01.DBF’ size 1G ;
SQL> alter system set undo_tablespace=’NEW_UNDOTBS’ scope=spfile;
System altered.
SQL> alter system set undo_management=’AUTO’ scope=spfile;
System altered.
SQL> drop tablespace UNDOTBS01 including contents;
ORA-01548: active rollback segment ‘_SYSSMU1_1255349037$’ found, terminate dropping tablespace
SQL> select * from v$rollname ;
USN NAME
———- —————–
0 SYSTEM
1 _SYSSMU1$
2 _SYSSMU2$
3 _SYSSMU3$
4 _SYSSMU4$
5 _SYSSMU5$
6 _SYSSMU6$
SQL > Create Pfile=’/u01/New.init’ from spfile
File Created
SQL > Shutdown immediate ;
*.undo_management=’MANUAL’
*.undo_retention=1800
*.undo_tablespace=’NEW_UNDOTBS’
*._offline_rollback_segments= (_SYSSMU1$,_SYSSMU2$,_SYSSMU3$,_SYSSMU4$,_SYSSMU5$,_SYSSMU6$ )
Database 11gr2
Rac 11gr2
When trying to expdp the below error appear :
expdp dumpfile=tdmp_test.dmp logfile=1.log directory=expdp_folder schemas=siebel parallel=4
ORA-31693: Table data object “CS_XM_TEMP”.”CS_XM_TEMP_CC” failed to load/unload and is being skipped due to error:
ORA-31617: unable to open dump file “/u01/expdp /dump_test.dmp” for write
ORA-19505: failed to identify file “/u01/expdp/dump_test.dmp”
ORA-27037: unable to obtain file status
You need to make sure of the below :
– Folder exdp_folder should be exists on the both nodes with same path.
even if you try to connect using tnsnames it will generate error so solution
-Remove parallel from your expdp command to be like this
expdp dumpfile=tdmp_test.dmp logfile=1.log directory=expdp_folder schemas=siebel
-Use Cluster Option in expdp
expdp dumpfile=tdmp_test.dmp logfile=1.log directory=expdp_folder schemas=siebel cluster=n
Thank you
Osama mustafa
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected.
SQL>
SQL>
SQL> startup ;
ORA-00000: normal, successful completion