Oracle

Duplicate User Oracle

Ambil dari metadata Sintaks Dasar :

parameter = ''; # USER, DEFAULT_ROLE, SYSTEM_GRANT, OBJECT_GRANT, ROLE_GRANT, TABLESPACE_QUOTA
username = 'HANIF';
select dbms_metadata.get_ddl(parameter,username) from dual;

SQLloader

root@localhost$ sqlldr userid=user/password control=file.ctl log=file.log
File Control (file.ctl)
LOAD DATA
INFILE 'file.csv'
BADFILE 'file.bad'
DISCARDFILE 'file.dsc'
INSERT|APPEND|REPLACE|TRUNCATE
Keterangan  :
  # Insert  : Load data to table if table empty
  # Append  : Load data to table if table is not empty
  # Replace : Replace existing data then load them. (DELETE)
  # Truncate then load
FIELDS TERMINATED BY "|"
TRAILING NULLCOLS #last column is null

Backup Restore Oracle

root@localhost$ imp SYSTEM/SYSTEM_password FROMUSER=usersource TOUSER=userdest file=file.dmp IGNORE=Y

ERROR ORA-00904: DBMS_JAVA.LONGNAME invalid identifier

Error ketika export. Karena Export Utility pada Oracle menggunakan DBMS_JAVA.LONGNAME

  1. Cek JServer Java Virtual Machine
    sqlplus> select comp_name,version,status from dba_registry;
    
  2. Jika kosong, execute initdbj.sql
    sqlplus> @$ORACLE_HOME/javavm/install/initdbj.sql
    

ERROR OEXP-00091 Exporting Questionable Statistics

OS charset berbeda dengan Oracle Charset Solusi: Sebelum export, lakukan berikut

root@localhost$ EXPORT NLS_LANG=.SERVER_CHARSET

EXP/IMP on remote host

root@localhost$ imp/exp USER/PASSWORD@HOST:PORT/SID_OR_SERVICENAME file=file.dmp log=file.log

Zombie Process

is a process that has terminated but has not been cleaned up yet. Find Them!

root@localhost$ top
Tasks: x total, x running, x sleeping, x stopped, x zombie
root@localhost$ ps aux | grep z | more
look at the STAT column with z-word
root@localhost$ ps -ef | grep defunct

Find Parent Process ID (PPid)

root@localhost$ cat /proc/PID/status | grep PPid
isi PID dengan langkah diatas
root@localhost$ kill -9 PPid

results matching ""

    No results matching ""