Append text to the end of each line, globally:
:%s/$/text/g
Add text to the beginning of each line, globally:
:%s/^/text/g
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.
:%s/$/text/g
:%s/^/text/g
connect / as sysdba drop user MDSYS cascade;To remove Multimedia:
connect / as sysdba @?/rdbms/admin/catcmprm.sql ORDIMYou can reinstall both of these components later if needed by running the following scripts. Note, Multimedia must be installed first.
connect / as sysdba @?/ord/admin/ordinst.sql SYSAUX SYSAUX @?/ord/im/admin/catim.sql execute sys.validate_ordim;To install Spatial:
connect / as sysdba @?/md/admin/mdinst.sql
connect / as sysdba set pagesize 10000 col owner format a12 col table_name format a35 col column_name format a25 col index_name format a25 -- Is Spatial being used? select owner, index_name from dba_indexes where ityp_name = 'SPATIAL_INDEX'; select owner, table_name, column_name from dba_tab_columns where data_type= 'SDO_GEOMETRY' and owner != 'MDSYS';If both of these queries return no rows, Spatial is not being used.
-- Is Multimedia being used? set serveroutput on; @?/ord/im/admin/imremchk.sqlIf you're not using this component, you will get the message returned "Oracle Multimedia is not being used".
select logins from v$instance;Output here will be either ALLOWED or RESTRICTED
select a.INSTANCE_NAME, a.ACTIVE_STATE,a.logins, b.open_mode from v$instance a inner join v$database b on UPPER(a.instance_name) = b.name;
INSTANCE_NAME ACTIVE_ST LOGINS OPEN_MODE ---------------- --------- ---------- -------------------- mydb01 NORMAL RESTRICTED MOUNTED
INSTANCE_NAME ACTIVE_ST LOGINS OPEN_MODE ---------------- --------- ---------- -------------------- mydb01 NORMAL ALLOWED READ WRITE
sqlplus system/*** @ausy1120.sql SQL*Plus: Release 11.2.0.4.0 Production on Mon Nov 2 14:19:31 2015 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning option PL/SQL procedure successfully completed. declare * ERROR at line 1: ORA-01722: invalid number ORA-06512: at line 5
select to_number(substr(version,1,instr(version,'.'))) into :dbver from v$instance where rownum=1;to
select to_number(substr(version,1,instr(version,'.')-1)) into :dbver from v$instance where rownum=1;
PL/SQL procedure successfully completed. PL/SQL procedure successfully completed. -------------------------------------------------------------------------------- --- ausy1120 started at 02-NOV-2015 14:40:04 --- '---AUSY1120COMPLETEDAT'||TO_CHAR(SYSDATE,'DD-MON-YYYYHH24:MI:SS')||'----' -------------------------------------------------------------------------------- --- ausy1120 completed at 02-NOV-2015 14:40:04 ---- Commit complete.
alter system set "_system_trig_enabled"=TRUE scope=both;
ALTER SYSTEM SET undo_tablespace='APPS_UNDOTS1' SCOPE=BOTH;