Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

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?

asked 17 Mar '10, 20:09

Cameron%20Taggart's gravatar image

Cameron Taggart
1076610
accept rate: 0%


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

...
permanent link

answered 18 Mar '10, 08:52

Breck%20Carter's gravatar image

Breck Carter
32.5k5417261050
accept rate: 20%

edited 18 Mar '10, 09:54

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

(19 Mar '10, 18:46) Cameron Taggart
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×52

question asked: 17 Mar '10, 20:09

question was seen: 1,775 times

last updated: 18 Mar '10, 09:54