grep -w string
See it in use here
Minimalistic Oracle contains a collection of practical examples from my encounters with Oracle technologies. When relevant, I also write about other technologies, like Linux or PostgreSQL. Many of the posts starts with "how to" since they derive directly from my own personal experience. My goal is to provide simple examples, so that they can be easily adapted to other situations.
_b_tree_bitmap_plans _fast_full_scan_enabled _grant_secure_role _like_with_bind_as_equality _projection_pushdown
for a in $(cat removal_list.txt ); do echo now testing $a sleep 1 curr_param=`grep -w $a init${ORACLE_SID}.ora | awk -F '[=]' '{ print $1 }'` if [ $curr_param ]; then echo removing $curr_param sed -i "/${curr_param}/d" init${ORACLE_SID}.ora sleep 1 else echo $a not found in parameter file. Skipping... sleep 1 fi; done exit 0
chmod 755 remove_params.sh
./remove_params.sh
now testing _b_tree_bitmap_plans removing _b_tree_bitmap_plans now testing _fast_full_scan_enabled removing _fast_full_scan_enabled now testing _grant_secure_role _grant_secure_role not found in parameter file. Skipping... now testing _like_with_bind_as_equality removing _like_with_bind_as_equality now testing _projection_pushdown _projection_pushdown not found in parameter file. Skipping...
Basic Compression |
---|
CREATE TABLE SCOTT.test ( id NUMBER, fname VARCHAR2(32), ename VARCHAR2(32), added_date DATE ) TABLESPACE USERS COMPRESS; |
ROW STORE COMPRESSor
ROW STORE COMPRESS BASICBasic compression does not apply compression to DML operations after the initial load.
Advanced Compression |
---|
CREATE TABLE SCOTT.test ( id NUMBER, fname VARCHAR2(32), ename VARCHAR2(32), added_date DATE ) TABLESPACE USERS ROW STORE COMPRESS ADVANCED; |
HCC Compression - non-dormant data |
---|
CREATE TABLE SCOTT.test ( id NUMBER, fname VARCHAR2(32), ename VARCHAR2(32), added_date DATE ) TABLESPACE USERS COLUMN STORE COMPRESS FOR QUERY HIGH | LOW; |
HCC Compression - dormant data |
---|
CREATE TABLE SCOTT.test ( id NUMBER, fname VARCHAR2(32), ename VARCHAR2(32), added_date DATE ) TABLESPACE USERS COLUMN STORE COMPRESS FOR ARCHIVE HIGH | LOW; |
ORA-64307: Exadata Hybrid Columnar Compression is not supported for tablespaces on this storage type
SELECT O.OBJECT_NAME,O.OWNER, SUM(S.TABLE_SCANS_TOTAL) "# of FTS",(SELECT NUM_ROWS FROM DBA_TABLES T WHERE T.TABLE_NAME = O.OBJECT_NAME) "num rows total" FROM DBA_HIST_SEG_STAT S JOIN DBA_OBJECTS O ON (S.OBJ# = O.DATA_OBJECT_ID) WHERE O.OWNER NOT IN ( 'SYS','DBSNMP','XDB') AND O.OBJECT_TYPE = 'TABLE' GROUP BY S.OBJ#,O.OBJECT_NAME,O.OWNER ORDER BY 4 DESC;
OBJECT_NAME | OWNER | # of FTS | num rows total |
---|---|---|---|
TABLE1 | USER1 | 5702 |
1583895743 |
TABLE2 | USER1 | 11 |
588921781 |
TABLE3 | USER1 | 6195 |
241550246 |
sqlplus / as sysdba purge dba_recyclebin; --> purges all recyclebin objects, globally purge tablespace user_data user scott; --> purge only scott's Objects from the user_data tablespace purge tablespace user_data; --> purge all recyclebin Objects from the user_data tablespace conn scott/tiger purge recyclebin; --> purges scott's recycle bin only
purge table "BIN$W/n28BqBgRbgU64JAQoz3A==$0"; purge table emp;
SELECT CLIENT_NAME, STATUS FROM DBA_AUTOTASK_CLIENT WHERE CLIENT_NAME = 'sql tuning advisor';
SELECT OWNER,TASK_ID, TASK_NAME,DESCRIPTION,ADVISOR_NAME,EXECUTION_TYPE,STATUS,RECOMMENDATION_COUNT "num rec",EXECUTION_START,EXECUTION_END,LAST_EXECUTION,HOW_CREATED FROM DBA_ADVISOR_TASKS WHERE TASK_NAME = 'SYS_AUTO_SPM_EVOLVE_TASK';
OWNER | TASK_ID | TASK_NAME | DESCRIPTION | ADVISOR_NAME | EXECUTION_TYPE | STATUS | num rec | EXECUTION_START | EXECUTION_END | LAST_EXECUTION | HOW_CREATED |
---|---|---|---|---|---|---|---|---|---|---|---|
SYS | 2 |
SYS_AUTO_SPM_EVOLVE_TASK | Automatic SPM Evolve Task | SPM Evolve Advisor | SPM EVOLVE | COMPLETED | 0 |
13.11.2017 23:00:06 | 13.11.2017 23:00:07 | EXEC_20606 | AUTO |
SELECT PARAMETER_NAME,PARAMETER_VALUE FROM DBA_ADVISOR_PARAMETERS WHERE TASK_NAME LIKE 'SYS_AUTO_SPM_EVOLVE_TASK' AND PARAMETER_NAME='ACCEPT_PLANS';
PARAMETER_NAME | PARAMETER_VALUE |
---|---|
ACCEPT_PLANS | TRUE |
# who -b system boot 2017-11-10 01:23