Skip to content

Commit d85d39d

Browse files
authored
Remove scott and hard-coded passwords for test users (oracle-samples#109)
* security update * security update * security update
1 parent 3466913 commit d85d39d

File tree

13 files changed

+25
-18
lines changed

13 files changed

+25
-18
lines changed

optimizer/faster_stats/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11

22

3-
First, create a user called STEST by adapting the the user.sql script to use an appropriate tablespace (which needs to have about 1.5GB free).
3+
First, create a user called STEST.
4+
5+
EDIT user.sql script to use an appropriate tablespace and password (which needs to have about 1.5GB free).
6+
EDIT cusr.sql to set the password/connect string
47

58
Two 'connect' scripts are available:
69
cadm.sql <-- Connects to SYSDBA account
7-
cusr.sql <-- Connects to the STEST user account
10+
cusr.sql <-- Connects to the STEST user account - EDIT THIS TO SET YOUR PASSWORD
811
You can edit these to suit you system, particularly if you are using a multitenant environment.
912

1013
Create tables:

optimizer/faster_stats/cusr.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
connect stest/stest
1+
connect stest/<put_your_password_here>

optimizer/faster_stats/user.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
create user stest identified by stest;
1+
create user stest identified by <put_your_password_here>;
22
grant dba to stest;
33
grant sysdba to stest;
44
alter user stest default tablespace big;

optimizer/spm_plan_control/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<h2>Using SQL Plan Management to Control SQL Execution Plans</h2>
22

3+
Note that some scripts will DROP AND CREATE a new user called SPM_TESTU.
4+
5+
EDIT the following scripts to set the SPM_TESTU password and connect strings:
6+
7+
- example.sql, example2.sql, connect_user.sql ./SE/example_outln.sql ./SE/example_se.sql ./SE/connect_user.sql
8+
39
Based on <a href="https://blogs.oracle.com/optimizer/using-sql-plan-management-to-control-sql-execution-plans">this blog article.</a>
410

511
The example.sql script demonstrates how to control SQL execution plans using SQL plan management.
@@ -12,8 +18,6 @@ Scripts create utility procedures called "set_my_plan" and "add_my_plan" (see pr
1218

1319
Example output is shown in example.lst and example2.lst.
1420

15-
Note that example.sql example2.sql scripts will DROP AND CREATE a new user called SPM_TESTU.
16-
1721
Scripts tested in Oracle Database 11g Release 2, Oracle Database 12c Release 2 and Oracle Database 18c. The only caveat is that in Oracle Database 11g DBMS_XPLAN sometimes returns ORA-01403, but the example still works.
1822

1923
Now included: SPM example for Oracle Database 18c Standard Edition (see SE directory)
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
connect spm_testu/spm_testu
1+
--##### EDIT HERE TO SET PASSWORD/CONNECT STRING #####
2+
connect spm_testu/<your_password_here>
23

optimizer/spm_plan_control/SE/example_outln.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ set echo on
88
pause p...
99
drop user spm_testu cascade;
1010

11-
create user spm_testu identified by spm_testu;
11+
--##### EDIT HERE TO SET PASSWORD #####
12+
create user spm_testu identified by <your_password_here>;
1213
grant connect,resource to spm_testu;
1314
grant unlimited tablespace to spm_testu;
1415
grant select on v_$sqlarea to spm_testu;

optimizer/spm_plan_control/SE/example_se.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ set echo on
88
pause p...
99
drop user spm_testu cascade;
1010

11-
create user spm_testu identified by spm_testu;
11+
--##### EDIT HERE TO SET PASSWORD #####
12+
create user spm_testu identified by <your_password_here>;
1213
grant connect,resource to spm_testu;
1314
grant unlimited tablespace to spm_testu;
1415
grant select on v_$sqlarea to spm_testu;
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
connect spm_testu/spm_testu
1+
--##### EDIT HERE TO SET PASSWORD/CONNECT STRING #####
2+
connect spm_testu/<your_password_here>
23

optimizer/spm_plan_control/example.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ set echo on
88
pause p...
99
drop user spm_testu cascade;
1010

11-
create user spm_testu identified by spm_testu;
11+
--##### EDIT HERE TO SET PASSWORD #####
12+
create user spm_testu identified by <your_password_here>;
1213
grant connect,resource to spm_testu;
1314
grant unlimited tablespace to spm_testu;
1415
grant select on v_$sqlarea to spm_testu;

optimizer/spm_plan_control/example2.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ set echo on
88
pause p...
99
drop user spm_testu cascade;
1010

11-
create user spm_testu identified by spm_testu;
11+
--##### EDIT HERE TO SET PASSWORD #####
12+
create user spm_testu identified by <your_password_here>;
1213
grant connect,resource to spm_testu;
1314
grant unlimited tablespace to spm_testu;
1415
grant select on v_$sqlarea to spm_testu;

0 commit comments

Comments
 (0)