• No results found

Using risunlod with the Interactive Interface

In document risutil (Page 143-149)

Setting Modes and Enabling Databases

12.1 Using risunlod with the Interactive Interface

Invoking risunlod without any command line arguments displays interactive prompts.

Accepting Default Values. Most prompts have default values indicated in square brackets([]). Press the ENTER key to select these default values.

Selecting Nondefault Values. To select a nondefault value, choose the character in parentheses corresponding to the option you want. Key in that character and press ENTER.

Specifying Other Information. Some prompts ask you to enter information, such as filenames. Key in the information requested and press ENTER.

12 - 8 risunlod

The following list discusses the interactive prompts in detail.

1. Preserve blanks? (y/n) :[n] >

This prompt lets you set the blankstrip mode. By default risunlod strips trailing blanks from character data.

Do one of the following:

Press ENTER to accept the default if you do not want to preserve trailing blanks.

Selectyif you want to preserve trailing blanks.

2. File mode of all output files?

overwrite(w) append(a) error out if exists(e) :[e] >

The file mode affects the main file and all the data files. By default risunlod returns an error if the specified main file or data files already exist.

Do one of the following:

Press ENTER to accept the default.

Selectwto overwrite the existing main file and data files.

Selectato append to the existing main file and data files.

3. Main file for unloading: [ris.dmp] >

This prompt lets you specify the name of the main file for unloading. The default name for the main file is ris.dmp.

Press ENTER to accept the default filename.

Enter another filename for the main file.

If you selectede(forerror out if exists)at theFile mode of all output files?prompt, and a main file already exists, risunlod prompts you to quit unloading or to key in another filename.

Quit risunlod(y/n) :[n] >

If you selectn, risunlod prompts you for a new name for the main file. Specify a new filename at this prompt or key inyand risunlod exits.

4. Enter schema name (<return> after last schema): >

This prompt lets you specify a schema for unloading.

If a secure schema name is entered, the user is prompted for the database username and database username password, and the osusername and osusername password, if appropriate. If the schema has a password, the user is prompted for the schema password.

Do not add the password at the end of the schema name. The schema and user passwords in a schema definition are not unloaded into the main file for security reasons. Instead, they are designated by a period immediately after the schema and user names. If the passwords are not added to the main file before loading, the user is prompted for them when loading the schema.

Do one of the following:

Enter the name of the schema to unload. risunlod displays additional prompts to gather schema information, then returns to this prompt to let you specify another schema.

You can unload multiple schemas during a risunlod session.

Within a schema, data are unloaded in the following order:

tables, indexes, views, and privilege definitions.

Press ENTER without entering another schema name when you have entered all the schema information you want to process. risunlod will process the entered schemas.

Press ENTER without entering any schema names, and risunlod terminates.

5. Which tables should be unloaded?

all(a) prompted(p) entered by user(e) none(n):[a] >

This prompt lets you specify which table(s) to unload from the specified schema.

Do one of the following:

Press ENTER to unload all the tables in the current schema.

Selectpand risunlod generates a list of tables and prompts you before unloading each table:

Unload table <table>(y/n): [y] >

Selectyto unload the specified table or selectnif you do not want to unload the table.

Selecteand risunlod prompts for a table name:

Enter table for unloading:[<return>]

Enter the name of a table to unload.

12 - 10 risunlod

Selectnand risunlod does not unload any tables for the schema.

If you selecteda,p, oreat theWhich tables should be unloaded?prompt, the following prompt appears:

Both definitions and data(b) definitions only(o): [b] >

This prompt lets you decide whether to unload both the table definitions and the data in the tables or only the table definitions.

Do one of the following:

Selectoto unload table definitions only.

Press ENTER to unload both table definitions and data and the following prompt appears:

Definitions and data in the same file(s) data in a different file(d):[s] >

Press ENTER to store both the definitions and data in the main file, or select dto store the definitions in the main file and the data in data files with one data file per table.

The name of a data file is composed of the first three characters (or fewer) of a schema name, followed by the first three characters (or fewer) of a table name, followed by a number signifying the number of data files generated so far in a risunlod session. The name of a data file is terminated by .dmp. For example, the 100th data file generated for storing the data in table, tab1, of schema, sch1, has the name schtab100.dmp. All these files are placed in the current directory. On the first line of a data file, risunlod specifies the table and schema from which the data comes.

If you selecteda,p, oreat the promptWhich tables should be unloaded?and selectedbto unload both definitions and data, risunlod prompts you for a fixed or variable data format for unloading table data.

Data in fixed (f) or variable (v) format: [f]>

Do one of the following:

— Press ENTER to unload the table data in fixed format and data that does not fill the entire column is padded with spaces.

— Selectvand variable length data will be delimited by single quotation marks (’). This saves disk space, and lets you easily edit the data.

If you selectedporeat the promptWhich tables should be unloaded?, you are also prompted for risunlod’s extended whereclause for each table to unload partial data.

Enter where clause :[return] >

Do one of the following:

— Press ENTER to ignore the whereclause prompt.

— Enter a whereclause.

This whereclause is risunlod’s extended whereclause. It lets you join across more than one table for powerful selection criteria.

Examples of the where clause:

Enter where clause: [return] >

c1 = 100 and c2 not like ’john’ENTER Enter where clause: [return] >

join t2 where t1.c1 = 100

and t2.c2 not like ’john’ and t1.c1 = t2.c1ENTER The joinclause permits additional tables to be specified for better

selection criteria. In the previous example, the current table is joined with t2 using the joinclause.

Partial data can be unloaded only from the current table, even when a joinclause is specified.

Use single quotation marks (’) for character strings.

6. Which indexes should be unloaded for a table?

all(a) prompted(p) entered by user(e) none(n):[a]>

If you selectedporeat the promptWhich tables should be unloaded?, you should key innat the promptWhich indexes should be unloaded for a table?unless indexes on additional tables are required.

risunlod automatically unloads indexes created on the tables selected asporeat theWhich tables should be unloaded?prompt.

Do one of the following:

Press ENTER to unload all the indexes created in the current schema.

Selectpand risunlod prompts for each table that has indexes:

Unload index on table <table>(y/n):[y] >

Press ENTER to unload the indexes of that table or key innif you do not want to unload indexes.

Selecteand risunlod prompts you to enter the table:

12 - 12 risunlod

Enter table for unloading index:[<return>] >

Enter a table name and press ENTER.

Selectn, and risunlod will not unload any indexes.

7. Which views should be unloaded?

all(a) prompted(p) entered by user(e) none(n):[a] >

The prompt for unloading views in a schema comes after the prompt(s) for unloading the indexes.

Do one of the following:

Press ENTER to unload all the views created in the current schema.

Selectp, and risunlod prompts for each view:

Unload view <view>(y/n):[y] >

Press ENTERto unload the view or key innif you do not want to unload the view.

Selecteand risunlod prompts you to enter a view name:

Enter view for unloading:[<return>] >

Enter a view name and press ENTER.

Selectn, and risunlod will not unload any views.

8. Which privileges should be unloaded?

all(a) prompted(p) entered by user(e) none(n):[a] >

The prompt for unloading privilege definitions comes after the prompt(s) for unloading views.

As is the case with unloading indexes, risunlod automatically unloads privilege definitions granted on tables and/or views that wereporeselections to theWhich tables should be unloaded?and/or Which views should be unloaded? prompts.

Do one of the following:

Press ENTER to unload all the privileges created in the current schema.

Selectp, and risunlod prompts for each table or view on which one or more privileges are defined:

Unload access privilege on <relation>(y/n):[y] >

Press ENTER to unload the access privileges or key innif you do not want to unload the privileges.

Selecteand risunlod prompts you to enter a table to unload all the privileges defined:

Enter table or view for unloading access privilege:[<return>] >

Enter a table or view name and press ENTER.

Selectn, and risunlod will not unload any privileges.

In a schema, privileges may be granted on a table or view owned by the schema or by another schema. Privileges granted on a table or view owned by another schema are illustrated in the following example.

Schema sch1 grants select privilege on its table tab1 to another schema sch2 with grant option. Schema sch2 can then grant the select privilege on sch1.tab1 to yet another schema sch3. Thus in schema sch2, a privilege on the table (tab1) belonging to another schema (sch1) is defined. The following command line option illustrates the previous example:

risunlod -s sch2 grant sch1.tab1

When specifying a table or view on which privileges have been granted, only the name of the relation is needed if it is owned by the current schema. Otherwise, the relation name must be preceded by a schema name in the form of <schema>.<relation>.

In document risutil (Page 143-149)

Related documents