CORBA 2.6.1 Programmer's Guide for C++

3. Run ns_browse to bind a new naming context with name TestCtx test (TestCtx is the name id and test is the name kind) in the root
naming context. This command returns a stringified IOR of the newly created context.
ns_browse bind_new_context TestCtx test
4. Run ns_browse to bind a new naming context with name TestCtx1 "" (no kind specified) in the naming context with name TestCtx test.
This action can be done in two ways: One way is to bind a new naming context,
Test Ctx junk TestCtx1 "", to the root naming
context. Note that the assumption here is that the
TestCtx test context is bound into the root naming context. For example:
ns_browse bind_new_context TestCtx test TestCtx1 ""
Another way is to bind a new context TextCtx1 "" into the TestCtx test context by using the -ior option to specify the TestCtx test
naming context as the base naming context for this operation. To do this action, you need the stringified IOR of the TestCtx test
context, which is returned by ns_browse when that context is created.
ns_browse -ior IOR:004532... bind_new_context TestCtx1 ""
5. Run ns_browse to list the contents of the naming context with name TestCtx test:
ns_browse list TestCtx test
6. Run ns_browse to remove a naming context with name TestCtx1 "" from the naming context with name TestCtx test. Again, assuming
that the TestCtx test context is bound to the root naming context, you can issue the following command:
ns_browse remove_context TestCtx test TestCtx1 ""
7. Run ns_browse to remove a naming context with name TestCtx1 test from the root naming context.
ns_browse remove_context TestCtx test
Using NamingDBCleanupTool
The naming database cleanup tool (NamingDBCleanupTool) allows interactive clean up or batch cleanup of orphaned contexts in the naming-
service database. In interactive mode, the tool presents information about each orphaned context. The user can choose to delete the orphaned
context or leave it.
In batch mode, the user first runs the tool to gather information about orphaned contexts. This information is written to the specified file. This file
can be modified using a text editor so the file contains only those contexts to be deleted. On a subsequent run of the tool, the modified file is
read and the indicated contexts are deleted. Prior to deleting a context, the tool confirms that the indicated context is valid, and that it is indeed
an orphaned context.
For either batch mode or interactive mode, the user must specify a "grace" period for contexts. No context younger than the specified number of
days will be deleted. The "grace" period avoids disturbing recent entries that could be being actively modified. Alternatively, the user can specify
a date range that limits the contexts that are candidates for deletion.
For either batch mode or interactive mode, the following identifying information is presented for each naming context that is a candidate
for deletion:
Creation timestamp for the context
Name and kind strings of the context (if available)
Path showing ancestor contexts (if available) [shows only path one if there is more than one possible path]
The number of objects and the number of contexts bound in this context
The tool cannot determine if an orphaned context is actually in use. The user must accept responsibility for inadvertently deleting an in- use
naming context. This tool does not have an undo option.
Usage:
NamingDBCleanupTool -p <db location> [ -i | -w <file> | -r <file> ] [ -t <number> | -d <date1> [<date2>] ]
Options:
-i
Interactively query user who indicates which orphaned contexts to delete
-w <file>
Write information about orphaned contexts to the indicated ascii file on OSS.
-r <file>
Read information about which context to delete from the indicated ascii file from OSS.
-t <number>