Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

Share this Page URL
Help

File placement policy > Create a policy and rules with CLI - Pg. 309

DAYOFYEAR(x) DAYS(x) DAYSINMONTH(x) DAYSINYEAR(x) HOUR(x) MINUTE(x) MONTH(x) QUARTER(x) SECOND(x) TIME(x) TIMESTAMP(x,y) WEEK(x) YEAR(x) Creates the day of the year out of date x, where x is a number from 1 to 366. Determines the number of days since 0000-00-00. Determines the number of days in the month from date x. Determines the day of the year from date x. Determines the hour of the day (a value from 0 to 23) of time or time stamp x. Determines the minutes from date x. Determines the month of the year from date x. Determines the quarter of year from date x, where x is a number from 1 to 4. Returns the seconds portion of time x. Displays x in a time format. Creates a time stamp (date and time) from a date x and, optionally, a time y. Determines the week of the year from date x. Determines the year from date x. 7.8.3 Create a policy and rules with CLI To create a policy with the CLI, log in to the master MDS, and use the text editor vi to create a file containing the rules, using the SQL syntax shown. When creating a rule file: Every policy file must start with the string "VERSION 1". The policy file may use MBCS or ASCII (7 or 8 bit) for file pattern matching strings or file names. All fileset names and storage pool names can only be specified using 8-bit ASCII, that is, no MBCS characters. SAN File System will not allow you to use MBCS when defining these types of administrative objects. A policy is not required to contain any rules, in which case it would be equivalent to the default policy (all files stored in the default storage pool). The maximum size of a policy is 32 KB. To add comments to the policy, use the delimiters /* and */ (for example, /* This is a comment */). Example 7-70 shows a very simple rule file, containing two rules. Example 7-70 Sample rule file VERSION 1 /* Do not remove or change this line! */ rule 'stgRule1' set stgpool 'mp3pool' where NAME like '%.mp3' rule 'stgRule2' set stgpool 'DBpool' where NAME like '%DB2.%' Save the file and note the name used. We saved our file with the name /home/admin/sample_policy.txt. Chapter 7. Basic operations and configuration 309