Các lệnh thường dùng

Create Table:

CREATE TABLE hr.admin_emp (
         empno      NUMBER(5) PRIMARY KEY,
         ename      VARCHAR2(15) NOT NULL,
         hiredate   DATE DEFAULT (sysdate),
         sal        NUMBER(7,2),
                     CONSTRAINT admin_dept_fkey REFERENCES hr.departments
                     (department_id));

COMMENT ON TABLE hr.admin_emp IS 'Enhanced employee table';

select sysdate from dual;

LINUX CRONTAB: crontab -l ; crontab -e; crontab -l | grep abc

Start MongoDB: "C:\Program Files\MongoDB\Server\4.0\bin\mongod.exe" --dbpath c:\data

RESET tomcat: service tomcat7 restart

  1. Navigate to tomcat_home/bin.
  2. Run the following command to stop Apache Tomcat:
    ./shutdown.sh
  3. Run the following command to restart Apache Tomcat:
    ./startup.sh 

Search text, colume on Procedure, Package, Table….

select * from dba_source where text like '%report_fpt%';
select * from  dba_tables where table_name like '%VN_CC_1%';
SELECT table_name, column_name, data_type, data_length
FROM USER_TAB_COLUMNS
WHERE column_name like '%CGRPDUREE%';

Crontab: crontab -l | grep pktuy

 *     *     *     *     *     command to be executed 
 -     -     -     -     - 
|      |     |     |     | 
|      |     |     |     +----- day of week (0 - 6) (Sunday=0) 
|      |     |     +------- month (1 - 12) 
|      |     +--------- day of month (1 - 31) 
|      +----------- hour (0 - 23) 
+------------- min (0 - 59) 

Chuyển chuỗi sang dạng cột để select

select regexp_substr('PRIM,SECO,THIRD,NORIGHT','[^,]+', 1, level) as code_id from dual
 connect by regexp_substr('PRIM,SECO,THIRD,NORIGHT', '[^,]+', 1, level) is not null;