cancel
Showing results for 
Search instead for 
Did you mean: 

Unload just users (userids and grant user permissions)?

Former Member
1,924

Is there a way to just unload users (userids and grant user permissions)? Using dbunload 11.0.1.2044, many options will skip the section. The only way I've found is to do a full dbunload of both schema and data. If I export just the schema (-n), it also skips users. If I export just the data (-d), it also skips the users. Is there a way to just export the users?

Accepted Solutions (0)

Answers (1)

Answers (1)

Breck_Carter
Participant

No, there is no way to tell dbunload to unload just the user ids.

However, dbunload -n does not skip the user ids. Neither does dbunload -nl and -no.

Here is a test using SQL Anywhere Personal Server Version 11.0.1.2276 (note that dbunload -e is not specified):

GRANT CONNECT TO xyz IDENTIFIED BY 'sql';
GRANT RESOURCE TO xyz;
GRANT SELECT ON child TO xyz;

"%SQLANY11%\\Bin32\\dbunload.exe"^
  -c "ENG=ddd11;DBN=ddd11;UID=dba;PWD=sql"^
  -n^
  -o dbunload11_log.txt^
  -r reload11_n.sql^
  -v^
  -y

PAUSE

C:\\projects\\$SA_templates\\run\\dbunload>"C:\\Program Files\\SQL Anywhere 11\\Bin32\\d
bunload.exe"  -c "ENG=ddd11;DBN=ddd11;UID=dba;PWD=sql"  -n  -o dbunload11_log.tx
t  -r reload11_n.sql  -v  -y
SQL Anywhere Unload Utility Version 11.0.1.2276
Connecting and initializing
Unloading user and group definitions
Unloading table definitions
Unloading text configurations
Unloading materialized view definitions
Unloading index definitions
Unloading functions
Unloading view definitions
Unloading procedures
Unloading triggers
Unloading SQL Remote definitions
Unloading MobiLink definitions

C:\\projects\\$SA_templates\\run\\dbunload>PAUSE
Press any key to continue . . .

--
-- This command file reloads a database that was unloaded using "dbunload".
--
-- (Version:  11.0.1.2276)
--

...

-------------------------------------------------
--   Create users
-------------------------------------------------

...

GRANT CONNECT,RESOURCE TO "xyz" IDENTIFIED BY ENCRYPTED '\\x01\\x27\\x57\\x89\\xd9\\x7e\\x27\\x92\\xfa\\xb9\\x6b\\x41\\xbb\\x23\\x7a\\xcf\\xde\\x14\\x45\\xfa\\xba\\x0d\\x90\\x0d\\x77\\xb5\\x70\\x5d\\x11\\x04\\xfb\\x05\\xfd\\x3c\\xdf\\xac\\x46'
go

...

-------------------------------------------------
--   Create tables
-------------------------------------------------

...

CREATE TABLE "DBA"."child" (
    "pkey_child"                     integer NOT NULL
   ,"pkey_parent"                    integer NOT NULL
   ,"data01"                         integer NOT NULL
   ,"data02"                         integer NOT NULL
   ,CONSTRAINT "table_primary07" PRIMARY KEY ("pkey_child") 
)
go

GRANT SELECT ON "DBA"."child" TO "xyz" 
go

...
Former Member
0 Kudos

Thanks. I will verify that "-n" does not skip user ids early next week when back in the office.