Skip Navigation Links | |
Exit Print View | |
System Administration Guide: Naming and Directory Services (NIS+) |
Part I About Naming and Directory Services
Part II NIS+ Setup and Configuration
4. Configuring NIS+ With Scripts
5. Setting Up the NIS+ Root Domain
8. Configuring an NIS+ Non-Root Domain
10. NIS+ Tables and Information
12. Administering NIS+ Credentials
14. Administering Enhanced NIS+ Security Credentials
15. Administering NIS+ Access Rights
16. Administering NIS+ Passwords
18. Administering NIS+ Directories
Using the nistbladm Command With NIS+ Tables
nistbladm and NIS+ Column Values
nistbladm, Searchable NIS+ Columns, Keys, and Column Values
nistbladm and Indexed NIS+ Names
Creating Additional NIS+ Automount Tables
Editing an NIS+ Table Entry With the -e Option
Editing an NIS+ Table Entry With the -E Option
Removing NIS+ Single Table Entries
Removing Multiple Entries From an NIS+ Table
Displaying the Contents of an NIS+ Table
Displaying the Object Properties of an NIS+ Table or Entry
About Regular Expressions in NIS+
nismatch and nisgrep Command Syntax
Searching the First Column in NIS+
Searching a Particular Column in NIS+
Searching Multiple Columns in NIS+
Expanding a Directory Into an NIS+ Domain
Expanding a Directory Into an NIS-Compatible Domain
Loading Information Into NIS+ From a File
Loading Data From an NIS Map Into NIS+
Dumping the Contents of an NIS+ Table to a File
20. NIS+ Server Use Customization
23. Information in NIS+ Tables
Common NIS+ Namespace Error Messages
To add new entries (rows) to a table, use nistbladm with either the -a or -A options followed by either one or more column=value pairs and the table name or an indexed name as described in nistbladm and Indexed NIS+ Names.
nistbladm [-a | -A] indexedname nistbladm [-a | -A] column="value" \ column="value" \ ... tablename
When adding new entry rows to a table with either -a or -A:
Always enclose the value element in quotes. For example, to add an entry where the value of the cname column is deneb, the column=value pair would look like: cname="deneb".
You must specify a value for every column in the table.
To specify that a column in the entry row you are adding is empty use column=" ". In other words, for the value, enclose a space between the quote marks.
Note - NIS+ is a naming service and its tables are designed to store references to objects, not the objects themselves. NIS+ is optimized to support 10,000 objects with a combined total size of all tables not more than 10M bytes. NIS+ does not support individual tables where the sum of field sizes in a single column are greater than approximately 7k. If a table is too large, rpc.nisd may fail.
The -a option adds an entry to a table unless the entry already exists, in which case it returns an error. An entry is defined as existing if its values in the searchable columns exactly match the values in the new entry's searchable columns. (The values in non-searchable columns are not taken into account.)
To use the -a option, you must specify a value for every column in the table:
nistbladm -a column="value" \ column="value" \ ... tablename nistbladm -a indexedname
(To list the names and characteristics of table columns, use the niscat -o tablename command.)
For example, to add a new row to a table named depts using column=value pairs, you would enter:
rootmaster% nistbladm -a Name='R&D' Site='SanFran' \ Name='vattel' depts.doc.com.
To add the same entry using an indexed name, you would enter:
rootmaster% nistbladm -a [Name='R&D',Site='SanFran',\ Name='vattel'],depts.doc.com.
Both examples would produce a table row that looked like this:
|
C-shell users should also use quotes to set off expressions using square brackets.
You can only add one entry with each instance of the nistbladm command. You must run nistbladm once for each entry row you want to add.
If a table row already exists with values in each column that are identical to the entry you are trying to create, nistbladm -a will return an error. You cannot have two identical entry rows in a table. In this context, rows are considered identical if the values in the searchable columns are identical, the values in none search able columns are not considered.
For example, if the Dept and Site columns are searchable, and the Name column is not searchable, nistbladm considers the following two rows to be identical:
|
In this example, nistbladm -a would not allow you to create the Sales Vancouver Lincoln row.
However if just some of the searchable columns have values identical to the entry you are trying to create, nistbladm -a will create a new entry as specified. For example, you could run the following commands to create two similar, but not identical, rows in a depts table:
rootmaster% nistbladm -a Dept='Sales' \ Site='Vancouver' Name='hosteen' staff.doc.com. rootmaster% nistbladm -a Dept='Sales' \ Site='SanFran' Name='lincoln' staff.doc.com.
Which would produce rows that had some, but not all identical values in the searchable columns:
|
The -A option is designed for applications where you need to force nistbladm to overwrite an existing entry. Like the -a option, -A adds a new entry to a table. However, if the entry already exists, instead of exiting with an error, it overwrites the existing entry row.
When using the -A option, you must specify all columns in the entry.
For example, suppose the following table exists and the Dept and Site columns are searchable:
|
Now you run the following command:
rootmaster% nistbladm -A Name=Sales Site=SanFran \ Name=Tsosulu depts.doc.com.
The -a option would have returned an error, since the entry specified by Name=Sales Site=SanFran already exists. But the -A option allows you to overwrite the existing row.
|