Oracle, Web, Script, SQLserver, Tips & Trick

February 16, 2012

how to know create script of spesific table on oracle

Filed under: oracle — sikathabis @ 8:01 am
Tags: , ,

/** EXAMPLE SINGLE TABLE / INDEX **/

set heading off;
set echo off;
Set pages 999;
set long 90000;

spool ddl_list.sql

select dbms_metadata.get_ddl(‘TABLE’,'DEPT’,'SCOTT’) from dual;

select dbms_metadata.get_ddl(‘INDEX’,'DEPT_IDX’,'SCOTT’) from dual;

spool off;

/** EXAMPLE ALL TABLE / INDEX ON SPECIFIC SCHEMAS **/

set pagesize 0
set long 90000
set feedback off
set echo off

spool scott_schema.sql

connect scott/tiger;

SELECT DBMS_METADATA.GET_DDL(‘TABLE’,u.table_name)
FROM USER_TABLES u;

SELECT DBMS_METADATA.GET_DDL(‘INDEX’,u.index_name)
FROM USER_INDEXES u;

spool off;

links : http://www.dba-oracle.com/oracle_tips_dbms_metadata.htm

February 14, 2012

Google python class with Nick Parlante (text version)

Filed under: phyton — sikathabis @ 10:01 am
Tags:

www.youtube.com/watch?v=tKTZoB2Vjuk

www.youtube.com/watch?v=EPYupizJYQI

www.youtube.com/watch?v=haycL41dAhg

Day 1 part 1

C:\Python32>python hello.py asdasd vsdf dfdf
Hello
['hello.py', 'asdasd', 'vsdf', 'dfdf']
6
4
4
Hello hello.py!!!!

C:\Python32>python hello.py asdasd vsdf dfdf
File “hello.py”, line 5
def Hello(name) {
^
SyntaxError: invalid syntax

C:\Python32>python hello.py asdasd vsdf dfdf
File “hello.py”, line 8
}
^
SyntaxError: invalid syntax
(more…)

February 13, 2012

cx_oracle for python

Filed under: oracle,phyton — sikathabis @ 10:42 pm
Tags: ,

cx_Oracle is a Python extension module that allows access to Oracle databases and conforms to the Python database API specification. This module is currently built against Oracle 9.2, 10.2, 11.1 and 11.2. For more information on the database API specification, see here. Use the provided setup.py to build and install the module which makes use of the DistUtils module made available in Python 2.0 and up.

If you are looking for support with Tuxedo servers, go here.

Download 5.1.1 released October 10, 2011

February 8, 2012

Check constraint space value on oracle

Filed under: oracle — sikathabis @ 7:51 am
Tags: ,

1. EXAMPLE create constraint

CREATE TABLE DBADMIN.PARA_MISC_CODE
(
KAT_TAB    VARCHAR2(3 BYTE) ,
MISC_CODE  CHAR(10 BYTE),
KET_CODE   VARCHAR2(50 BYTE),
constraint check_spasi_kattab CHECK (instr(KAT_TAB,’ ‘)=0)
);

2. EXAMPLE alter constraint

ALTER TABLE PARA_MISC_CODE
add constraint check_spasi_kattab CHECK (instr(KAT_TAB,’ ‘)=0);

reference : http://www.techonthenet.com/oracle/check.php

February 2, 2012

How to change network / ip address on command / shell linux

Filed under: centos,linux,linux:centos — sikathabis @ 3:10 am
Tags: , ,

Using root user to change ip address

example

vi /etc/sysconfig/network-scripts/ifcfg-eth#  (change # with default number 0 for first ethernet )

edit eth0 with vi

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Press Insert on your keyboard and Changing your ipaddr

Press ESC on your keyboard and type :wq! to save

Type /etc/init.d/network restart to restart the network

Restart network adapter

 

 

 

 

 

references :

http://www.cyberciti.biz/faq/rhel-centos-fedoracore-linux-network-card-configuration/

http://www.cyberciti.biz/faq/linux-change-ip-address/

http://www.wallpaperama.com/forums/how-to-change-ip-address-in-linux-shell-command-t6092.html

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.