Problem Statement: User should be able to connect to database from a specific host
Following is the list of pre-defined factors
SQL> SELECT OBJECT_NAME, OBJECT_TYPE FROM DBA_OBJECTS WHERE OWNER=’DVF’ AND OBJECT_NAME LIKE ‘F$%’
17 rows selected.
We can also create a new factor, which will internally create a function F$. We’ll make use of pre-defined MACHINE factor, in the example.
Create a RULE SET
Now in the Rule section, create a rule based on a FACTOR
We want to force this restriction on all users connecting to the database. So in the command rules section, create a command rule CONNECT & assign the rule set.
Now to test the rule by logging from the different host mentioned in the FACTOR expression.
SQL*Plus: Release 126.96.36.199.0 – Production on Tue Apr 29 15:40:10 2008
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
ORA-47400: Command Rule violation for CONNECT on LOGON
To remove the objects, remove the command rule connect, then the rule set.