Common SET commands in ORACLE and common SET commands in ORACLE
Zookeeper
1 SET TIMING ON
Description: displays the SQL statement running time. The default value is OFF.
It is used in SQLPLUS and the time is accurate to 0.01 seconds. That is, 10 ms.
In PL/SQL DEVELOPER, the time is accurate to 0.001 seconds:
2 SET AUTOTRACE ON
Description: allows you to analyze executed SQL statements. The default value is OFF.
Set autotrace off: No AUTOTRACE report is generated. This is the default mode.
Set autotrace on explain: AUTOTRACE only displays the optimizer execution path report
Set autotrace on statistics: Only execution STATISTICS are displayed.
Set autotrace on: contains the execution plan and statistics
Set autotrace traceonly: Same as set autotrace on, but no query output is displayed.
3 SET TRIMOUT ON
Removes trailing spaces of each standard output line. The default value is OFF.
4 SET TRIMSPOOL ON
Remove the trailing space of the redirection (SPOOL) output line. The default value is OFF.
5 SET ECHO ON
Displays each SQL command in the START script. The default value is ON.
6 SET FEEDBACK ON
Set to display "XX rows selected"
Displays the number of records processed by this SQL command. The default value is ON.
7 set colsep''
Delimiter between output columns.
8 SET HEADING OFF
Output domain title, on by default
9 set pagesize 0
The number of output lines per page. The default value is 24. To avoid paging, you can set the value to 0.
10 set linesize 80
Output the number of characters in a row. The default value is 80.
11 set numwidth 12
Length of the output NUMBER field. The default value is 10.
12 SET TERMOUT OFF
Displays the execution results of commands in the script. The default value is ON.
13 SET SERVEROUTPUT ON
Set to allow display of output similar to DBMS_OUTPUT
Size 10000000
14 SET VERIFY OFF
You can disable or enable the display of the message "old 1" and "new 1.
Common oracle commands
Baike.baidu.com/view/1239908.htm
SQL Plus commands are almost all on the above page.
Mysql> show databases;
+ -------------------- +
| Database |
+ -------------------- +
| Information_schema |
| Mysql |
| Sqldoc |
| Test |
+ -------------------- +
4 rows in set (0.00 sec)
An Oracle instance is a database, so there is no corresponding show databases statement
Mysql> show tables
->;
+ ---------------- +
| Tables_in_test |
+ ---------------- +
| Sale_report |
| Test_dysql |
| Union_tab_1 |
| Union_tab_2 |
| V_sale_report |
+ ---------------- +
5 rows in set (0.00 sec)
Oracle uses the following statement to implement
SQL> SELECT
2 table_name
3 FROM
4 all_tables
5 WHERE
6 ROWNUM <10;
TABLE_NAME
------------------------------------------------------------
ICOL $
CON $
UNDO $
PROXY_ROLE_DATA $
FILE $
UET $
IND $
SEG $
COL $
9 rows selected.
Mysql> desc sale_report;
+ ------------ + --------------- + ------ + ----- + --------- + ------- +
| Field | Type | Null | Key | Default | Extra |
+ ------------ + --------------- + ------ + ----- + --------- + ------- +
| SALE_DATE | datetime | NO | NULL |
| SALE_ITEM | varchar (2) | NO | NULL |
| SALE_MONEY | decimal (10, 2) | NO | NULL |
+ ------------ + --------------- + ------ + ----- + --------- + ------- +
3 rows in set (0.00 sec)
Oracle
SQL> desc all_tab_columns
Name ...... remaining full text>
Common Oracle commands
There are too many common oracle commands (my notes)
Common commands in oracle Chapter 1: log Management 1. forcing log switches
SQL> alter system switch logfile;
2. forcing checkpoints
SQL> alter system checkpoint;
3. adding online redo log groups
SQL> alter database add logfile [group 4]
SQL> ('/disk3/log4a. rdo', '/disk4/log4b. rdo') size 1 m;
4. adding online redo log members
SQL> alter database add logfile member
SQL> '/disk3/log1b. rdo' to group 1,
SQL> '/disk4/log2b. rdo' to group 2;
5. changes the name of the online redo logfile
SQL> alter database rename file 'C:/oracle/oradata/oradb/redo01.log'
SQL> to 'C:/oracle/oradata/redo01.log ';
6. drop online redo log groups
SQL> alter database drop logfile group 3;
7. drop online redo log members
SQL> alter database drop logfile member 'C:/oracle/oradata/redo01.log ';
8. clearing online redo log files
SQL> alter database clear [unarchived] logfile 'C:/oracle/log2a. rdo ';
9. using logminer analyzing redo logfiles
A. in the init. ora specify utl_file_dir =''
B. SQL> execute dbms_logmnr_d.build ('oradb. ora ', 'c: \ oracle \ oradb \ log ');
C. SQL> execute dbms_logmnr_add_logfile ('C: \ oracle \ oradata \ oradb \ redo01.log ',
SQL> dbms_logmnr.new );
D. SQL> execute dbms_logmnr.add_logfile ('C: \ oracle \ oradata \ oradb \ redo02.log & #3 ...... the remaining full text>